write-review-elixir
Review Elixir code. ALWAYS use this skill before or after you added code written in elixir to ensure high code quality. Also use use this when asked to review existing elixir code.
- License 许可
- MIT
- 最近更新
- 2026-03-19
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- write-review-elixir
- description
- Review Elixir code. ALWAYS use this skill before or after you added code written in elixir to ensure high code quality. Also use use this when asked to review existing elixir code.
02 资源文件 1
- 参考文档REFERENCE.md17.0 KB
03 SKILL.md 正文
Review Elixir code and make sure it does not violate these anti patterns.
Elixir Anti-Patterns Reference
Quick reference guide for Elixir anti-patterns with practical do/don't examples.
Quick Reference Checklist
Code Quality
- [ ] Avoid redundant comments; use clear names and module attributes
- [ ] Keep
withelse clauses simple; normalize errors in helpers - [ ] Extract pattern/guard vars in signatures, body vars in body
- [ ] Never create atoms dynamically from user input
- [ ] Group related parameters; keep parameter lists short
- [ ] Use your package namespace, not others'
- [ ] Use static access (
.) for required fields, dynamic ([]) for optional - [ ] Fail fast with pattern matching; avoid defensive nil propagation
- [ ] Use strict boolean operators (
and/or/not) for booleans - [ ] Keep structs under 32 fields
Design
- [ ] Create separate functions instead of options changing return types
- [ ] Use atoms for state instead of multiple booleans
- [ ] Use case/pattern matching, not try/rescue for control flow
- [ ] Use structs/maps for domain concepts, not primitives
- [ ] Separate unrelated functionality into distinct functions
- [ ] Use function parameters, not application config for libraries
Processes
- [ ] Use processes for concurrency/state, not code organization
- [ ] Centralize all process interaction in one module
- [ ] Extract data before sending to processes
- [ ] Always start processes within supervision trees
Macros
- [ ] Use
Macro.expand_literals/2to reduce compile-time deps - [ ] Delegate bulk validation to functions, not expanded code
- [ ] Only use macros when truly necessary
- [ ] Prefer explicit
importoveruse - [ ] Use module literals, not dynamic construction
- [ ] Debug with
mix xref trace
More concreate DO's and DONT's are available in ./REFERENCE.md Make sure to read that.
Resources
Additional Instructions
Use mix xref trace path/to/file.ex to verify tracking.
Use mix credo to get more quality issues.
First Create a list of all the issues you find. Store them in PATTERN-VIOLATIONS.md
Then group all issues by complexity and similarity and create a bundled plan to tackle the issues you found. Store the plan in PATTERN-PLAN.md in the root.
Suggest which fixes could be easily done by an LLM like claude code. Ask the user whether to fix the issues, if the users aggrees:
Group Tasks into groups that are related/dependent of each other and dispatch parallel agents for each group.
04 同仓库更多 Skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
writing good code
use this skill whenever you write code. it provides a process for creating good, composable apis.
whats-next
Answers what to do next, what to work on next, where we're at
verification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
using-superpowers
Use when starting any conversation - establishes how to find and use skills, requiring Skill tool invocation before ANY response including clarifying questions