Collect every failing signal up front, then review the diff in full anyway:
Signal
How to read it
Merge conflict with base
gh pr view --json mergeable,mergeStateStatus or git merge-tree
Failing CI checks
gh pr checks or the platform equivalent
Lint / typecheck failure
the project's own commands
Each failing signal becomes a blocker finding. None of them ends the run.
A review that aborts on the first red signal spends the whole cycle repeating what
the tracker already displayed, while the finding that would have told the author
something new never gets written. One invocation produces the most complete picture
of the change that it can.
Automated Diff Analysis
Before starting manual review, run the diff analyzer script to get a structured risk assessment:
python3 ${CLAUDE_SKILL_DIR}/scripts/diff-analyzer.py [base_branch]
# Default base branch: main
# Example: python3 ${CLAUDE_SKILL_DIR}/scripts/diff-analyzer.py develop
The script outputs JSON with:
files: each changed file with additions, deletions, category (security/test/config/migration/infra/docs/logic), and risk level
risk_score: overall assessment (high/medium/low)
hotspots: top 5 files by additions
secrets_scan: potential secret leaks detected in added lines
test_coverage_estimate: whether test files accompany logic changes (good/partial/none)
parallel_review_recommended: boolean flag
If the script reports parallel_review_recommended: true, use the Parallel Review (Agent Teams) mode below.
Parallel Review (Agent Teams)
For significant PRs or large changesets, create a parallel review team:
Create an agent team to review [target]:
- Teammate 1 (security-auditor): "Review for security vulnerabilities, auth issues,
injection risks, secret leaks. Report with severity ratings." Use Opus.
- Teammate 2 (performance-optimizer): "Check for N+1 queries, memory leaks,
unnecessary allocations, caching opportunities. Report with impact ratings." Use Opus.
- Teammate 3 (test-engineer): "Validate test coverage, edge cases, mock quality,
missing assertions. Report coverage gaps." Use Opus.
Each reviewer should report findings independently. Do NOT modify files.
After all reviewers complete:
Synthesize findings into unified Code Review Report
Prioritize by severity (blocker > major > minor > nit)
Issue verdict per the verdict rule below — not by impression
When to use: PRs with >5 files changed, cross-module changes, security-sensitive code.
READ-ONLY: No teammate should modify files during review.
Cross-scope replay: can an identifier from one tenant/user/org be replayed in another?
Fails closed wherever the path affects security, money, or data retention
API / Contract Changes
Backward compatibility preserved (no silent breaking changes)
API versioning updated if contract changed
Schema validation on request/response
Client validation uses the authoritative input contract, including operation groups/defaults, finite bounds, nested paths and documented Unicode units; read reference/input-validation.md from the security-patterns skill located through the current client's installed catalog
Shared backend/client fixtures and generation drift checks cover changed rules; unsupported/server-only checks are explicit, and local refusals do not masquerade as HTTP responses
Error responses follow project convention
Statuses and messages distinguish input/state refusals from infrastructure failures; original causes remain available in authorized diagnostics
Error filtering preserves machine codes, field paths, JSON object/list types, locale and recovery headers; background-job error fields are covered too
Retry advice reflects known persisted/provider state and does not invite blind replay of an uncertain mutation
Wire-level contracts checked, not just code signatures: HTTP routes, webhook payloads, event/queue schemas
Concurrency / Async
Shared mutable state protected (locks, atomics, channels)
No fire-and-forget promises without error handling
Database transactions scoped correctly (no long-held locks)
Race condition risk assessed for concurrent access paths
Migrations / Schema Changes
Migration is reversible (has rollback path)
No table locks on large tables during peak hours
Data backfill handles NULL/missing values
Indexes added for new query patterns
Performance
No N+1 queries
Appropriate caching
No memory leaks
Optimized loops
Frontend & UI Craft (Anti-Slop Gates)
No gradient text headlines (background-clip: text) or saturated purple/blue hero washes
No cliché 3-column card grids with icon-above-title tiles, card-in-card nesting, or side-stripe cards
Interactive elements implement all 8 states (default, hover, focus-visible, active, disabled, loading, error, success)
Input fields maintain constant 1px border-width across all states (zero layout shift) and reserve 2px transparent outline
Mobile responsive: overflow-x: clip on html and body; no buttons/links wrapping to 2 lines; image grid tracks use minmax(0, 1fr)
Typography: headings are roman (font-style: normal, no italic emphasis in headers); max 3 font families (2+1 rule)
Content honesty: no invented metrics ("+47% conversion"), fake testimonials, or placeholder stock logos
No fake re-drawn browser/OS chrome; no emoji used as load-bearing icons
Testing
Tests for new code
Edge cases covered
Mocks appropriate
Severity & Verdict
Tier
Meaning
Merge impact
blocker
Causes damage: data loss, security hole, money, corruption
Blocks merge, no exceptions
major
Real defect that will bite in production
Blocks merge unless waived in writing
minor
Should be fixed, not worth blocking on
Does not block
nit
Polish, taste, style
Does not block
Verdict rule — apply it mechanically, do not negotiate with yourself:
any blocker → REQUEST_CHANGES
any major without a documented waiver (who waived it, why, what the follow-up is) → REQUEST_CHANGES
only minor / nit → APPROVE
the change cannot be classified from the diff → NEEDS_DISCUSSION, and state what would resolve it
Severity describes impact, confidence describes certainty — they are independent
axes. A finding with confidence < 6 is reported at the tier its evidence supports
and is never promoted to blocker on suspicion alone.
Output Format
## Code Review Report
### Summary
- **Files Changed**: [count]
- **Lines Added**: [+count]
- **Lines Removed**: [-count]
- **Issues Found**: [count]
- **Overall Confidence**: [1-10] — how confident the reviewer is in the assessment
### Findings
#### Blocker
- **[file:line]**: [issue]
- Severity: blocker | Confidence: [1-10]
- Evidence: [specific code reference and reasoning]
- Suggested fix: [code]
#### Major
- **[file:line]**: [issue]
- Severity: major | Confidence: [1-10]
- Evidence: [specific code reference and reasoning]
- Suggested fix: [code]
#### Minor
- **[file:line]**: [issue]
- Severity: minor | Confidence: [1-10]
- Evidence: [line number + reasoning]
#### Nit
- **[file:line]**: [suggestion]
- Severity: nit | Confidence: [1-10]
### Confidence Guide
| Score | Meaning |
|-------|---------|
| 9-10 | Certain — verified via code, tests, or documentation |
| 7-8 | High — strong evidence, minor assumptions |
| 5-6 | Medium — plausible issue, needs author confirmation |
| 3-4 | Low — speculative, based on patterns not proof |
| 1-2 | Guess — flag for discussion, don't block on this |
### Positive Notes
- [What's good about the code]
### Verdict
[APPROVE / REQUEST_CHANGES / NEEDS_DISCUSSION]
State which clause of the verdict rule produced it, e.g.
"REQUEST_CHANGES — 1 blocker (auth.ts:88)" or
"APPROVE — 2 minor, 1 nit, no blocker or major".
Waived majors must name the waiver and the follow-up.
Common Rationalizations
Excuse
Why It's Wrong
"Small change, quick scan is enough"
Small changes introduce subtle bugs — apply consistent review regardless of size
"Tests pass, so the code is correct"
Tests validate specific scenarios, not all behaviors — verify missing coverage
"It's just a refactor, no need for deep review"
Refactors change invariants — verify behavior preservation, not just compilation
"The author is senior, they know what they're doing"
Seniority doesn't prevent mistakes — review the code, not the person
"We're in a hurry, ship it"
Rushed reviews create tech debt that costs 10x more to fix later
Self-Evaluation (LLM-as-Judge)
After completing the review, perform a self-evaluation pass:
Check for Blind Spots
Did I verify, or assume? — For each finding, confirm you read the actual code (not inferred from context)
Did I miss the inverse? — If you flagged X as a problem, did you check if NOT doing X is also a problem elsewhere?
Did I anchor on the first issue? — Review whether early findings biased you toward similar patterns, missing different issue classes
Did I check the unhappy path? — Error handling, edge cases, failure modes — not just the golden path
Did I flag uncertainty? — Findings with confidence < 6 should be clearly marked as "needs author input"
Calibrate Confidence
If all findings are confidence 7+, you may be overconfident — re-examine the weakest finding
If any finding lacks a file:line reference, downgrade it or remove it
If you found zero issues, state what you specifically checked (not "looks good")
READ-ONLY
This skill only analyzes. It does NOT modify any files.
Related Skills
Issues found? → /debug to trace root causes
Missing tests? → /tdd to add test-first coverage
Security findings? → /cve-scan for dependency vulnerabilities
Architecture concerns? → /analyze for deeper code quality metrics
1---2name: review3description: "Reviews code for quality, security, correctness. Triggers: code review, quality review, security review, review PR, review branch."4user-invocable: true5effort: high6argument-hint: "[target: branch, pr, file path, or staged changes]"7agent: code-reviewer8context: fork9allowed-tools: Read, Grep, Glob, Bash10---1112# Code Review1314$ARGUMENTS1516Reviews code changes for quality and issues.1718## Changed files context1920- Changes: !`git diff --stat main...HEAD 2>/dev/null || git diff --cached --stat 2>/dev/null || echo "no changes detected"`2122## Signal Collection (never stop at the first red)2324Collect every failing signal up front, then review the diff in full **anyway**:2526| Signal | How to read it |27|--------|----------------|28| Merge conflict with base | `gh pr view --json mergeable,mergeStateStatus` or `git merge-tree` |29| Failing CI checks | `gh pr checks` or the platform equivalent |30| Lint / typecheck failure | the project's own commands |3132Each failing signal becomes a `blocker` finding. **None of them ends the run.**3334A review that aborts on the first red signal spends the whole cycle repeating what35the tracker already displayed, while the finding that would have told the author36something new never gets written. One invocation produces the most complete picture37of the change that it can.3839## Automated Diff Analysis4041Before starting manual review, run the diff analyzer script to get a structured risk assessment:4243```bash44python3 ${CLAUDE_SKILL_DIR}/scripts/diff-analyzer.py [base_branch]45# Default base branch: main46# Example: python3 ${CLAUDE_SKILL_DIR}/scripts/diff-analyzer.py develop47```4849The script outputs JSON with:50- **files**: each changed file with additions, deletions, category (security/test/config/migration/infra/docs/logic), and risk level51- **risk_score**: overall assessment (high/medium/low)52- **hotspots**: top 5 files by additions53- **secrets_scan**: potential secret leaks detected in added lines54- **test_coverage_estimate**: whether test files accompany logic changes (good/partial/none)55- **parallel_review_recommended**: boolean flag5657If the script reports `parallel_review_recommended: true`, use the Parallel Review (Agent Teams) mode below.5859---6061## Parallel Review (Agent Teams)6263For significant PRs or large changesets, create a parallel review team:6465```66Create an agent team to review [target]:67- Teammate 1 (security-auditor): "Review for security vulnerabilities, auth issues,68 injection risks, secret leaks. Report with severity ratings." Use Opus.69- Teammate 2 (performance-optimizer): "Check for N+1 queries, memory leaks,70 unnecessary allocations, caching opportunities. Report with impact ratings." Use Opus.71- Teammate 3 (test-engineer): "Validate test coverage, edge cases, mock quality,72 missing assertions. Report coverage gaps." Use Opus.73Each reviewer should report findings independently. Do NOT modify files.74```7576After all reviewers complete:771. Synthesize findings into unified Code Review Report782. Prioritize by severity (blocker > major > minor > nit)793. Issue verdict per the verdict rule below — not by impression8081> **When to use**: PRs with >5 files changed, cross-module changes, security-sensitive code.82> **READ-ONLY**: No teammate should modify files during review.8384---8586## Sequential Review (Default)87881. **Reads** changed files892. **Analyzes** for issues903. **Checks** best practices914. **Reports** findings9293## Review Scope9495| Target | What's Reviewed |96|--------|-----------------|97| (none) | Staged changes |98| `branch` | Branch vs main |99| `pr` | Pull request changes |100| `file.ts` | Specific file |101102## Review Checklist103104### Code Quality105- [ ] Clear naming106- [ ] Proper error handling107- [ ] No code duplication108- [ ] Appropriate abstractions109110### Security (OWASP Top 10)111- [ ] A01: Proper auth/authorization on all endpoints112- [ ] A02: No weak crypto, HTTPS for external comms113- [ ] A03: Input validation, parameterized queries, output encoding (XSS)114- [ ] A04: Threat model assumptions documented for new features115- [ ] A05: No debug mode, default credentials, or verbose errors in prod config116- [ ] A06: Dependencies checked for known CVEs117- [ ] A07: No hardcoded secrets, session management correct118- [ ] A08: Integrity checks on deserialized data, CI/CD pipeline safety119- [ ] A09: Security-relevant events logged (without PII)120- [ ] A10: External URL handling validates scheme/host (SSRF prevention)121- [ ] Cross-scope replay: can an identifier from one tenant/user/org be replayed in another?122- [ ] Fails closed wherever the path affects security, money, or data retention123124### API / Contract Changes125- [ ] Backward compatibility preserved (no silent breaking changes)126- [ ] API versioning updated if contract changed127- [ ] Schema validation on request/response128- [ ] Client validation uses the authoritative input contract, including operation groups/defaults, finite bounds, nested paths and documented Unicode units; read `reference/input-validation.md` from the `security-patterns` skill located through the current client's installed catalog129- [ ] Shared backend/client fixtures and generation drift checks cover changed rules; unsupported/server-only checks are explicit, and local refusals do not masquerade as HTTP responses130- [ ] Error responses follow project convention131- [ ] Statuses and messages distinguish input/state refusals from infrastructure failures; original causes remain available in authorized diagnostics132- [ ] Error filtering preserves machine codes, field paths, JSON object/list types, locale and recovery headers; background-job error fields are covered too133- [ ] Retry advice reflects known persisted/provider state and does not invite blind replay of an uncertain mutation134- [ ] Wire-level contracts checked, not just code signatures: HTTP routes, webhook payloads, event/queue schemas135136### Concurrency / Async137- [ ] Shared mutable state protected (locks, atomics, channels)138- [ ] No fire-and-forget promises without error handling139- [ ] Database transactions scoped correctly (no long-held locks)140- [ ] Race condition risk assessed for concurrent access paths141142### Migrations / Schema Changes143- [ ] Migration is reversible (has rollback path)144- [ ] No table locks on large tables during peak hours145- [ ] Data backfill handles NULL/missing values146- [ ] Indexes added for new query patterns147148### Performance149- [ ] No N+1 queries150- [ ] Appropriate caching151- [ ] No memory leaks152- [ ] Optimized loops153154### Frontend & UI Craft (Anti-Slop Gates)155- [ ] No gradient text headlines (`background-clip: text`) or saturated purple/blue hero washes156- [ ] No cliché 3-column card grids with icon-above-title tiles, card-in-card nesting, or side-stripe cards157- [ ] Interactive elements implement all 8 states (default, hover, focus-visible, active, disabled, loading, error, success)158- [ ] Input fields maintain constant 1px `border-width` across all states (zero layout shift) and reserve 2px transparent outline159- [ ] Mobile responsive: `overflow-x: clip` on `html` and `body`; no buttons/links wrapping to 2 lines; image grid tracks use `minmax(0, 1fr)`160- [ ] Typography: headings are roman (`font-style: normal`, no italic emphasis in headers); max 3 font families (2+1 rule)161- [ ] Content honesty: no invented metrics ("+47% conversion"), fake testimonials, or placeholder stock logos162- [ ] No fake re-drawn browser/OS chrome; no emoji used as load-bearing icons163164### Testing165- [ ] Tests for new code166- [ ] Edge cases covered167- [ ] Mocks appropriate168169## Severity & Verdict170171| Tier | Meaning | Merge impact |172|------|---------|--------------|173| `blocker` | Causes damage: data loss, security hole, money, corruption | Blocks merge, no exceptions |174| `major` | Real defect that will bite in production | Blocks merge unless waived in writing |175| `minor` | Should be fixed, not worth blocking on | Does not block |176| `nit` | Polish, taste, style | Does not block |177178**Verdict rule** — apply it mechanically, do not negotiate with yourself:179180- any `blocker` → `REQUEST_CHANGES`181- any `major` without a documented waiver (who waived it, why, what the follow-up is) → `REQUEST_CHANGES`182- only `minor` / `nit` → `APPROVE`183- the change cannot be classified from the diff → `NEEDS_DISCUSSION`, and state what would resolve it184185Severity describes impact, confidence describes certainty — they are independent186axes. A finding with confidence < 6 is reported at the tier its evidence supports187and is never promoted to `blocker` on suspicion alone.188189## Output Format190191```markdown192## Code Review Report193194### Summary195- **Files Changed**: [count]196- **Lines Added**: [+count]197- **Lines Removed**: [-count]198- **Issues Found**: [count]199- **Overall Confidence**: [1-10] — how confident the reviewer is in the assessment200201### Findings202203#### Blocker204- **[file:line]**: [issue]205 - Severity: blocker | Confidence: [1-10]206 - Evidence: [specific code reference and reasoning]207 - Suggested fix: [code]208209#### Major210- **[file:line]**: [issue]211 - Severity: major | Confidence: [1-10]212 - Evidence: [specific code reference and reasoning]213 - Suggested fix: [code]214215#### Minor216- **[file:line]**: [issue]217 - Severity: minor | Confidence: [1-10]218 - Evidence: [line number + reasoning]219220#### Nit221- **[file:line]**: [suggestion]222 - Severity: nit | Confidence: [1-10]223224### Confidence Guide225226| Score | Meaning |227|-------|---------|228| 9-10 | Certain — verified via code, tests, or documentation |229| 7-8 | High — strong evidence, minor assumptions |230| 5-6 | Medium — plausible issue, needs author confirmation |231| 3-4 | Low — speculative, based on patterns not proof |232| 1-2 | Guess — flag for discussion, don't block on this |233234### Positive Notes235- [What's good about the code]236237### Verdict238[APPROVE / REQUEST_CHANGES / NEEDS_DISCUSSION]239240State which clause of the verdict rule produced it, e.g.241"REQUEST_CHANGES — 1 blocker (auth.ts:88)" or242"APPROVE — 2 minor, 1 nit, no blocker or major".243Waived majors must name the waiver and the follow-up.244```245246## Common Rationalizations247248| Excuse | Why It's Wrong |249|--------|----------------|250| "Small change, quick scan is enough" | Small changes introduce subtle bugs — apply consistent review regardless of size |251| "Tests pass, so the code is correct" | Tests validate specific scenarios, not all behaviors — verify missing coverage |252| "It's just a refactor, no need for deep review" | Refactors change invariants — verify behavior preservation, not just compilation |253| "The author is senior, they know what they're doing" | Seniority doesn't prevent mistakes — review the code, not the person |254| "We're in a hurry, ship it" | Rushed reviews create tech debt that costs 10x more to fix later |255256## Self-Evaluation (LLM-as-Judge)257258After completing the review, perform a self-evaluation pass:259260### Check for Blind Spots2611. **Did I verify, or assume?** — For each finding, confirm you read the actual code (not inferred from context)2622. **Did I miss the inverse?** — If you flagged X as a problem, did you check if NOT doing X is also a problem elsewhere?2633. **Did I anchor on the first issue?** — Review whether early findings biased you toward similar patterns, missing different issue classes2644. **Did I check the unhappy path?** — Error handling, edge cases, failure modes — not just the golden path2655. **Did I flag uncertainty?** — Findings with confidence < 6 should be clearly marked as "needs author input"266267### Calibrate Confidence268- If all findings are confidence 7+, you may be overconfident — re-examine the weakest finding269- If any finding lacks a file:line reference, downgrade it or remove it270- If you found zero issues, state what you specifically checked (not "looks good")271272## READ-ONLY273274This skill only analyzes. It does NOT modify any files.275276## Related Skills277- Issues found? → `/debug` to trace root causes278- Missing tests? → `/tdd` to add test-first coverage279- Security findings? → `/cve-scan` for dependency vulnerabilities280- Architecture concerns? → `/analyze` for deeper code quality metrics
Run npx skillmds@latest add softspark/review in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Reviews code for quality, security, correctness. Triggers: code review, quality review, security review, review PR, review branch. It is listed under Security on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: executes scripts, reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
softspark (@softspark) published this skill. Their other Agent Skills are listed on their SkillMD profile.