Claude-elixir-phoenix phx:review
Review code with parallel agents — tests, security, Ecto, LiveView, Oban. Use after implementation to catch bugs and anti-patterns before committing.
git clone https://github.com/oliver-kriska/claude-elixir-phoenix
T=$(mktemp -d) && git clone --depth=1 https://github.com/oliver-kriska/claude-elixir-phoenix "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/elixir-phoenix/skills/review" ~/.claude/skills/oliver-kriska-claude-elixir-phoenix-phx-review && rm -rf "$T"
plugins/elixir-phoenix/skills/review/SKILL.mdReview Elixir/Phoenix Code
Review code by spawning parallel specialist agents. Find and explain issues — do NOT create tasks or fix anything.
Usage
/phx:review # Review all changed files /phx:review test # Review test files only /phx:review security # Run security audit only /phx:review oban # Review Oban workers only /phx:review deploy # Validate deployment config /phx:review iron-laws # Check Iron Law violations only /phx:review .claude/plans/auth/plan.md # Review implementation of plan
Arguments
$ARGUMENTS = Focus area or path to plan file.
Workflow
Step 1: Identify Changed Files and Prepare Directories
CRITICAL: Create output dirs BEFORE spawning agents — agents cannot create directories and writes will fail.
- Determine SLUG via Glob on
(default:.claude/plans/*/
)"review" - Run
mkdir -p ".claude/plans/${SLUG}/reviews" ".claude/plans/${SLUG}/summaries" .claude/reviews - Run
andgit diff --name-only HEAD~5git diff --name-only main - Save the diff base for pre-existing detection in Step 3b
Step 1b: Load Plan Context and Prior Reviews
- Read
for planning decisions and rationale.claude/plans/${SLUG}/scratchpad.md - Pass relevant decisions to agents as WHY-context (eliminates session archaeology)
- Check
for prior output; if present, include a consolidated summary as "PRIOR FINDINGS" with: "Focus on NEW issues. Mark still-present issues as PERSISTENT.".claude/plans/${SLUG}/reviews/
Step 2: Spawn Review Agents (MANDATORY)
NEVER spawn the same agent role twice per review. One pass per role. NEVER analyze code yourself — use the Agent tool only. Zero agents = failure.
- Create a Claude Code task per agent via
andTaskCreate
toTaskUpdatein_progress - For
or/phx:review
: select agents dynamically per the selection table in/phx:review all${CLAUDE_SKILL_DIR}/references/agent-spawning.md - For focused reviews (
): spawn only the matching specialist from the focused mode table in the same referencetest|security|oban|deploy|iron-laws - Spawn in ONE message with
andmode: "bypassPermissions"run_in_background: true - MANDATORY: pass explicit
per-agent (mapping in the reference)output_file - Include the CRITICAL prompt block: write by turn ~12, chat body ≤300 words
- Scope every agent to the diff: pass
output with "Focus on NEW code. Pre-existing: one-linegit diff --name-only
. Do NOT deep-analyze unchanged files."{file}:{line} — {brief}
Step 3: Collect and Compress Findings
Wait for ALL agents to complete. Do NOT report status until every agent completes. Mark each task
completed via TaskUpdate as it finishes.
Missing file fallback — after each agent finishes, verify its expected
output_file exists. If missing (turn exhaustion, error):
- Append to
:.claude/plans/{slug}/scratchpad.md[HH:MM] WARN: {agent} did not write {expected_path} — extracting from message - Parse findings from the agent's return message as fallback
- Mark the section in the final review with
— never silent⚠️ EXTRACTED FROM AGENT MESSAGE (see scratchpad)
Verification-runner fallback — if it times out, run directly:
mix compile --warnings-as-errors && mix format --check-formatted $(git diff --name-only HEAD~5 | grep '\.exs\?$' | tr '\n' ' ') && mix credo --strict && mix test
Context supervision — for 4+ agents, spawn
elixir-phoenix:context-supervisor:
Prompt: "Compress review agent output. input_dir: .claude/plans/{slug}/reviews output_dir: .claude/plans/{slug}/summaries output_file: review-consolidated.md priority_instructions: BLOCKERs and WARNINGs: KEEP ALL. SUGGESTIONs: COMPRESS similar ones into groups. Deconfliction: when iron-law-judge and elixir-reviewer flag same code, keep iron-law-judge finding."
Skip the supervisor for focused (1-agent) reviews — read output directly.
Step 3b: Filter Findings (Anti-Noise)
Before writing the review, apply these overriding filters to each finding:
- Would a senior Elixir dev dismiss this as noise?
- Does the finding add complexity exceeding the problem's complexity?
- Are any findings duplicates reworded by different agents?
- Does the finding affect code actually changed in this diff?
- Is the finding on unchanged code (not in diff)? → Mark PRE-EXISTING
Demote or remove findings that fail filters 1-4. Mark pre-existing per filter 5.
Step 4: Generate Review Summary
Read consolidated/agent output. Write to
.claude/plans/{slug}/reviews/{feature}-review.md
with verdict: PASS | PASS WITH WARNINGS | REQUIRES CHANGES | BLOCKED.
Step 5: Present Findings and Ask User
STOP and present the review. Do NOT create tasks or fix anything.
On BLOCKED or REQUIRES CHANGES: Show finding count by severity, then offer via
AskUserQuestion: /phx:triage (recommended), /phx:plan,
fix directly, or "I'll handle it myself".
On PASS / PASS WITH WARNINGS: Suggest
/phx:compound, /phx:learn-from-fix.
Convention extraction: After presenting findings, offer: "Any findings to suppress or enforce as conventions?" See
${CLAUDE_SKILL_DIR}/references/conventions.md.
Iron Laws
- Review is READ-ONLY — Find and explain, never fix
- NEVER auto-fix after review — Always ask the user first
- Always offer both paths:
and/phx:plan/phx:work - Research before claiming — Agents MUST research before making claims about CI/CD or external services
Integration
/phx:plan → /phx:work → /phx:review (YOU ARE HERE) → Blocked? /phx:triage or /phx:plan | Pass? /phx:compound
See:
${CLAUDE_SKILL_DIR}/references/review-template.md, ${CLAUDE_SKILL_DIR}/references/example-review.md, ${CLAUDE_SKILL_DIR}/references/blocker-handling.md