Skills elixir-code-review
Reviews Elixir code for idiomatic patterns, OTP basics, and documentation. Use when reviewing .ex/.exs files, checking pattern matching, GenServer usage, or module documentation.
install
source · Clone the upstream repo
git clone https://github.com/openclaw/skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/anderskev/elixir-code-review" ~/.claude/skills/openclaw-skills-elixir-code-review && rm -rf "$T"
OpenClaw · Install into ~/.openclaw/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/anderskev/elixir-code-review" ~/.openclaw/skills/openclaw-skills-elixir-code-review && rm -rf "$T"
manifest:
skills/anderskev/elixir-code-review/SKILL.mdsource content
Elixir Code Review
Quick Reference
| Issue Type | Reference |
|---|---|
| Naming, formatting, module structure | references/code-style.md |
| With clauses, guards, destructuring | references/pattern-matching.md |
| GenServer, Supervisor, Application | references/otp-basics.md |
| @moduledoc, @doc, @spec, doctests | references/documentation.md |
Review Checklist
Code Style
- Module names are CamelCase, function names are snake_case
- Pipe chains start with raw data, not function calls
- Private functions grouped after public functions
- No unnecessary parentheses in function calls without arguments
Pattern Matching
- Functions use pattern matching over conditionals where appropriate
- With clauses have else handling for error cases
- Guards used instead of runtime checks where possible
- Destructuring used in function heads, not body
OTP Basics
- GenServers use handle_continue for expensive init work
- Supervisors use appropriate restart strategies
- No blocking calls in GenServer callbacks
- Proper use of call vs cast (sync vs async)
Documentation
- All public functions have @doc and @spec
- Modules have @moduledoc describing purpose
- Doctests for pure functions where appropriate
- No @doc false on genuinely public functions
Security
- No
on user input (useString.to_atom/1
)to_existing_atom/1 - No
on untrusted inputCode.eval_string/1 - No
without:erlang.binary_to_term/1
option:safe
Valid Patterns (Do NOT Flag)
- Empty function clause for pattern match -
is valid guarddef foo(nil), do: nil - Using
with single transformation - Readability choice, not wrong|>
on callback implementations - Callbacks documented at behaviour level@doc false- Private functions without @spec - @spec optional for internals
- Using
- Valid for dynamic dispatch with known module/functionKernel.apply/3
Context-Sensitive Rules
| Issue | Flag ONLY IF |
|---|---|
| Missing @spec | Function is public AND exported |
| Generic rescue | Specific exception types available |
| Nested case/cond | More than 2 levels deep |
When to Load References
- Reviewing module/function naming → code-style.md
- Reviewing with/case/cond statements → pattern-matching.md
- Reviewing GenServer/Supervisor code → otp-basics.md
- Reviewing @doc/@moduledoc → documentation.md
Before Submitting Findings
Load and follow review-verification-protocol before reporting any issue.