skills/code-review-mastery/SKILL.md
Complete code review lifecycle - WHAT to check + HOW to interact + verification gates. ALWAYS use when the user says "code review", "review this PR", "check my code", "audit this", "revue de code", "vérifier le code", "analyser ce PR", "revoir mon code", or when reviewing PRs, receiving feedback, requesting reviews, conducting code audits, or before making completion claims. Covers security (OWASP), clean code (SOLID), metrics, feedback patterns, and verification gates.
npx skillsauth add devattom/.claude code-review-masteryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete code review lifecycle: WHAT to check, HOW to interact, and WHEN to verify.
Code review is a three-part discipline:
Priority order: Security > Correctness > Maintainability > Performance
1. SECURITY: Input validation, auth checks, secrets exposure
2. LOGIC: Edge cases, error handling, null checks
3. ARCHITECTURE: Single responsibility, proper abstractions
4. TESTS: Coverage for new functionality
Skip (automate instead): Formatting, naming conventions, linting violations
READ → UNDERSTAND → VERIFY → EVALUATE → RESPOND → IMPLEMENT
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
Run the command. Read the output. THEN claim the result.
Must check in every review:
password.*=.*['"], api[_-]?key.*=)eval(), exec(), dangerous functionsReference: references/security-checklist.md
Verify correctness:
Check for code smells:
Reference: references/clean-code-principles.md
Targets: | Metric | Target | Warning | Critical | |--------|--------|---------|----------| | Cognitive complexity | <15/fn | 15-25 | >25 | | Function size | <20 lines | 30-50 | >50 | | Parameters | ≤3 | 4 | >5 | | Nesting depth | ≤2 | 3 | >3 |
Reference: references/code-quality-metrics.md
Structure: What + Why + How
✓ "[BLOCKING] SQL injection at line 34. Query uses string concatenation
with user input. Fix: Use parameterized query:
db.query('SELECT * FROM users WHERE id = ?', [userId])"
✗ "This query looks unsafe."
Priority Labels:
| Label | Meaning | Blocks Merge? |
|-------|---------|---------------|
| [BLOCKING] | Must fix - security, bugs | Yes |
| [CRITICAL] | Strongly recommended | Discuss |
| [SUGGESTION] | Would improve code | No |
| [NIT] | Minor preference | No |
Reference: references/feedback-patterns.md
The Response Pattern:
1. READ: Complete feedback without reacting
2. UNDERSTAND: Restate requirement in own words
3. VERIFY: Check against codebase reality
4. EVALUATE: Technically sound for THIS codebase?
5. RESPOND: Technical acknowledgment or reasoned pushback
6. IMPLEMENT: One item at a time, test each
Forbidden responses:
When feedback is unclear:
STOP - do not implement anything yet
ASK for clarification on ALL unclear items
When feedback is wrong: Push back with technical reasoning, not defensiveness.
Reference: references/code-review-reception.md
When to request:
How:
BASE_SHA=$(git rev-parse HEAD~1)
HEAD_SHA=$(git rev-parse HEAD)
Then dispatch code-reviewer subagent via Task tool.
Reference: references/requesting-code-review.md
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
1. IDENTIFY: What command proves this claim?
2. RUN: Execute the FULL command (fresh, complete)
3. READ: Full output, check exit code, count failures
4. VERIFY: Does output confirm the claim?
5. ONLY THEN: Make the claim
| Claim | Requires | Not Sufficient | |-------|----------|----------------| | Tests pass | Test output: 0 failures | Previous run, "should pass" | | Build succeeds | Build exit 0 | Linter passing | | Bug fixed | Original symptom passes | Code changed | | Requirements met | Line-by-line checklist | Tests passing |
Reference: references/verification-before-completion.md
Problem: Excessive minor comments bury critical issues Solution: Automate style with linters; focus humans on logic/security
Problem: "This is wrong" without explanation Solution: Always include What + Why + How
Problem: Blocking merge for subjective style Solution: Reserve blocking for security/correctness only
Problem: "You're absolutely right!" without verification Solution: Verify first, then implement
SITUATION?
│
├─ Reviewing someone's code
│ ├─ Security issue? → [BLOCKING] with fix
│ ├─ Logic bug? → [BLOCKING] with test case
│ ├─ Code smell? → [SUGGESTION] with explanation
│ └─ Style preference? → Skip or automate
│
├─ Received feedback
│ ├─ Unclear items? → STOP, ask for clarification first
│ ├─ From trusted source? → Understand, then implement
│ └─ From external reviewer? → Verify technically before implementing
│
├─ Completed work
│ └─ Major feature/task? → Request code-reviewer subagent review
│
└─ About to claim status
├─ Have fresh verification? → State claim WITH evidence
└─ No fresh verification? → RUN command first
A good code review:
development
Use when you want to audit a project wiki for quality issues — stale version claims, contradictions between pages, orphan pages, broken wiki links, missing cross-references, or misalignment between wiki content and the actual codebase state.
development
Systematic error debugging with analysis, solution discovery, and verification
development
Structured adversarial debate between AI councillors using Agent Teams to evaluate ideas, plans, or decisions. ALWAYS use when the user says "council", "debate this", "evaluate this idea", "challenge my plan", "stress-test", "devil's advocate", "multiple perspectives", "évaluer cette idée", "débattre", "challenger mon plan", "tester cette décision", or when the user wants rigorous multi-perspective analysis of a proposal, architecture decision, or strategic choice. Each councillor (visionary, critic, pragmatist, innovator, ethicist, domain expert) represents a distinct perspective and they challenge each other through cross-examination and peer exchange, producing a nuanced verdict (PROCEED / PROCEED WITH CONDITIONS / RECONSIDER / DO NOT PROCEED). Do NOT use for divergent brainstorming or idea generation — use workflow-brainstorm instead.
testing
Automated CI/CD pipeline fixer - watches CI, fixes errors locally, commits, and loops until green. Use when CI is failing and you want to automatically fix and verify changes.