Find bugs that actually break things. Not style, not slop - correctness, reliability, and logic errors that will bite in production.
This skill complements anti-slop (code quality/style) and security-audit (vulnerabilities/OWASP). Those catch "is the code clean?" and "is the code safe?" - this one catches "does the code actually work?"
Reviewing recent changes for bugs, regressions, edge cases, or fragile assumptions
Sanity-checking code before merge or release
Looking for logic errors that static tooling may miss
Doing a focused correctness review where style and security are secondary
The Three Questions
Every finding answers one of:
Will it crash? - null derefs, unhandled errors, resource exhaustion, missing imports
Will it do the wrong thing? - logic errors, off-by-ones, wrong comparisons, missing cases
Will it break later? - race conditions, implicit ordering, fragile assumptions, API contract drift
When NOT to use
Style, verbosity, or machine-generated code quality issues - use anti-slop
Exploitable vulnerabilities, auth flaws, or secret scanning - use security-audit
Pipeline architecture design - use ci-cd
End-of-session doc hygiene or instruction-file cleanup - use update-docs
AI Self-Check
Before reporting any finding at >= 80% confidence, verify:
Read full context: read the entire function/file, not just the flagged line
Check for tests: is there a test covering this case? Is the test correct?
Check git blame: is this new code or battle-tested? Pre-existing issues belong out of scope
Check for explaining comments: a comment explaining the pattern means someone already considered it
Cite the evidence: exact file, line, and code that proves the issue. No citation = no finding
Adversarial self-check: argue against each finding. If the counter-argument is convincing, drop it
Construct a failing case: for P0 findings, describe the specific input or sequence that triggers the bug
Verify API/stdlib claims: AI code review suggestions frequently contain factual errors about framework behavior. If unsure, look it up
Boundary values on numeric inputs flagged: zero, negative, and overflow values on page numbers, sizes, counts, and indices are high-confidence findings - do not suppress with the 80% threshold
Current source checked: dated versions, CLI flags, API names, and support windows are verified against primary docs before repeating them
Hidden state identified: local config, credentials, caches, contexts, branches, cluster targets, or previous runs are made explicit before acting
Verification is real: final checks exercise the actual runtime, parser, service, or integration point instead of only linting prose or happy paths
Routing overlap checked: overlapping skills, trigger terms, and "When NOT to use" boundaries are checked before returning guidance
Spec claims verified: claims about tool behavior, output contracts, or repo conventions are checked against current docs, scripts, or skill files
Line references verified: every finding points to code that exists in the reviewed diff
Behavioral claim proven: findings describe a plausible failing input, race, leak, or regression
Performance
Start with changed public interfaces, shared utilities, migrations, and concurrency boundaries.
Use tests and static analysis to validate suspected issues instead of reading the entire repo linearly.
Merge duplicate findings into one high-signal comment with affected locations.
Best Practices
Lead with bugs and risks, not style preferences.
Do not request rewrites unless the current structure blocks correctness or maintainability.
Call out missing tests only when a specific behavior or risk needs coverage.
Workflow
Step 1: Scope the review
Default scope based on context:
If invoked right after writing code in this session -> self-check (review what you just wrote)
If there are uncommitted changes (git diff --name-only) -> recent changes
If the user specifies files/dirs/commits -> targeted review
Otherwise -> ask the user
Available scopes:
Full codebase review - scan everything, report by category
Recent changes - check git diff or specific commits
Specific files/dirs - targeted review
Self-check - review code you just wrote in this session
Large diffs (> 500 lines): Chunk by file. Review each file with its surrounding context, then do a cross-file pass looking for integration issues (mismatched types across boundaries, inconsistent error handling, broken call chains). Large diffs are also a code smell worth noting in Observations.
Step 2: Gather project context
Before reviewing any code, build context:
Read project instruction files (AGENTS.md or equivalent) if present - project conventions, patterns, known gotchas
Check the project's language/framework versions (package.json, pyproject.toml, go.mod, etc.)
Understand the architecture - monolith, microservices, CLI tool, library?
Note any custom error handling patterns, logging conventions, or testing requirements
This context prevents false positives. A pattern that's wrong in a React app might be correct in a Node CLI tool.
Step 3: Run mechanical checks first (if available and practical)
Before manual review, run standard tooling to clear obvious issues - but only when it makes sense:
TypeScript: tsc --noEmit / eslint (skip if no tsconfig.json / .eslintrc*, or if the project has 500+ TS files - too slow)
Python: ruff check / mypy (skip if no pyproject.toml / ruff.toml / mypy.ini)
Shell: shellcheck (fast, always worth running if installed)
Terraform: terraform validate (skip if terraform init hasn't been run - validate requires initialized providers)
Ansible: ansible-lint (skip if no .ansible-lint config and the project isn't primarily Ansible)
When to skip a tool:
No config file for it in the project (no tsconfig.json, no pyproject.toml, etc.)
Reviewing a small diff (< 5 files) - linting the whole project for a 3-file change is wasted effort
The user just wants a quick review, not a full audit
When a tool isn't installed: Don't silently skip it. Tell the user which tools are missing so they can install them. Example: "shellcheck isn't installed - consider pacman -S shellcheck for shell script linting." This is a one-time heads-up, not a blocker - continue the review without it.
Linters catch syntax, imports, and known anti-patterns mechanically. This skill focuses on what automated tools miss: logic errors, edge cases, incorrect assumptions, and subtle bugs that require understanding intent. Don't burn time and tokens on linter output - move to the actual review.
Step 4: Review with four focus areas
Review the code through four lenses. These aren't sequential passes - they're dimensions to evaluate as you read. The order reflects priority: understanding intent comes first because everything else depends on it.
Focus 1: Understand Intent
Read the code to understand what it's supposed to do. If reviewing a diff, read the surrounding context too. Check commit messages, PR descriptions, or comments for stated intent. You can't find bugs if you don't know what "correct" looks like.
Focus 2: Trace Logic Paths
Follow every code path. For each branch, loop, or condition:
What happens on the happy path?
What happens on each error path?
What happens at boundaries (empty, zero, max, null, negative)?
Are all cases handled? (switch/match exhaustiveness, if/else completeness)
Boundary value analysis deserves special attention: when a function accepts numeric inputs (page numbers, sizes, counts, indices), zero, negative, and overflow values are inherently high-confidence findings. Don't suppress these with the 80% threshold - if the function doesn't guard against page=0, perPage=0 (division by zero in callers), offset > total, or offset + limit > total (last page returns a short slice or the caller over-reads), that's a real bug on a realistic path. For paginated APIs, walk the arithmetic for page=1, page=0, page=-1, and the final page where (page-1)*perPage lands at or past total.
If no go.mod is available (inline snippet, paste, interview question), flag version-dependent issues at reduced confidence and note the version dependency.
Focus 3: Check Contracts & Boundaries
Examine every interface between components:
Function signatures: are callers passing the right types/shapes?
API boundaries: is input validated before use?
State transitions: are preconditions checked?
Error propagation: do errors carry enough context?
Resource lifecycle: is everything acquired/released symmetrically?
Downstream impact: when reviewing changes to exported functions, interfaces, or API endpoints, grep for all callers/consumers. For config/env var changes, check all files that reference the changed key. A boolean toggle in one file can break feature-flag logic across twelve modules.
Focus 4: Convention Compliance
Check against project-specific correctness rules - not style (that's anti-slop), but rules that affect whether the code works:
Project instruction-file rules about error handling, transactions, API patterns
Consistency with surrounding code's error handling and state management
Framework idioms that affect correctness (not just style)
Required test coverage for critical paths
Step 5: Score each finding
Rate every potential issue on a confidence scale of 0-100:
Score
Meaning
Action
0
False positive. Doesn't hold up under scrutiny or is pre-existing.
Discard
25
Might be real. Could also be intentional or context-dependent.
Discard
50
Real issue, but minor. Nitpick territory. Won't cause production incidents.
Discard
75
Very likely real. Will impact functionality or violates explicit project rules.
Borderline
80+
Confirmed real. Verified by reading surrounding code. High impact.
Report
100
Dead certain. The code is definitively wrong. Evidence is unambiguous.
Report
Only report findings scored >= 80. Quality over quantity. A report with 3 real bugs beats one with 20 maybes.
Self-review mode exception: When reviewing code you just wrote in this session, lower the threshold to >= 70%. The cost of fixing is near-zero right now, and you can skip the git blame step (everything is new). Focus harder on logic paths and contracts - that's where fresh code has the most bugs.
Finding cap: If you have more than 8-10 reportable findings, something is wrong - either the code is catastrophically bad (say so in the summary) or your threshold is too low. Prioritize ruthlessly. Wall-of-text reviews get ignored.
For each significant code change, ask: What are the three most likely failure modes? This question catches architecture-level bugs that line-by-line review misses - especially in AI-generated code where individual lines look fine but the overall design has gaps.
Before assigning a score, verify:
Read the full function/file, not just the flagged line
Check if there's a test covering this case (and whether the test is correct)
Check git blame - is this new code or battle-tested?
Look for comments explaining why something looks odd (if a comment explains the pattern, it's not a bug)
Cite the evidence. Every >= 80% finding must reference the exact file, line, and code that proves the issue. If you can't cite it, go find it. If you can't find evidence, downgrade the score.
Adversarial self-check. Before finalizing each finding, argue against it. Try to explain why the code is actually correct. If the counter-argument is convincing, drop the finding.
Construct a failing case. For P0 findings, describe the specific input or sequence that triggers the bug. If you can't construct one, it's not P0.
Never claim API/stdlib behavior without verifying. 18% of "high-confidence" AI code review suggestions contain factual errors about framework behavior. If unsure whether a function is stable-sorted, returns a view, or handles null - look it up first.
Step 6: Report
Present findings grouped by severity, with concrete fixes. See Output Format below.
Universal Patterns (All Languages)
Read references/universal-patterns.md for the full cross-language bug catalog.
Always check these ten buckets before calling a review complete:
logic errors
null or absent-value hazards
error-handling gaps
race conditions and shared-state issues
resource leaks and lifecycle mismatches
boundary or edge-case breakage
API and data-contract mismatches
real performance traps
correctness-relevant convention violations
tests that pass without proving the behavior
The standard is simple: if it can return the wrong result, crash on a realistic path, or silently
rot over time, it belongs in the review.
Prioritizing in Large Codebases
For full codebase reviews on repos with 100+ files, you can't read everything. Prioritize:
Recently changed files (git log --since='2 weeks ago' --name-only) - fresh code has more bugs
Critical paths - auth, payments, data mutations, API handlers, middleware
Files without tests - git ls-files '*.ts' | while read f; do test -f "${f%.ts}.test.ts" || echo "$f"; done
Complex files - long functions, high cyclomatic complexity, many branches
Shared utilities - bugs here multiply across the codebase
Skip: vendored code, generated files, test fixtures/snapshots, documentation, static assets.
For targeted reviews (diff/specific files), read the full files being changed plus their immediate callers/callees. Context matters - a function that looks fine in isolation might be called incorrectly.
Language: TypeScript / JavaScript
Read references/typescript.md for the full TS/JS bug pattern catalog. Key highlights:
Import side effects: circular imports, module-level code that runs on import
Async pitfalls: mixing sync and async, blocking the event loop, missing await
Dataclass/pydantic bugs: mutable default fields without default_factory, validator side effects, model_validate() coercion on untrusted input
Attribute typos: self.nmae = name silently creates a new attribute on regular classes - use __slots__ or dataclasses
Language: Bash / Shell
Read references/shell.md for the full Shell bug pattern catalog. Key highlights:
Word splitting: unquoted variables breaking on spaces, glob expansion in unexpected places
Exit code masking: pipes hiding failures (cmd1 | cmd2 only checks cmd2), $(...) in assignments
Signal handling: missing trap for cleanup, backgrounded processes not cleaned up
Portability: bashisms in #!/bin/sh scripts, GNU vs BSD tool differences
Language: Java
Read references/java.md for the full Java bug pattern catalog. Key highlights:
Quarkus: CDI scope thread safety (@ApplicationScoped + mutable state), @RequestScoped lost in reactive pipelines, Uni/Multi never subscribed, native image reflection, dev services config drift (drop-and-create in prod)
Spring Boot: @Transactional proxy traps (self-invocation, non-public, final, checked exceptions), SecurityFilterChain ordering, WebFlux blocking calls, Reactor context/MDC loss
General Java: Optional.of() on nullable, stream reuse, lazy eval escaping try-catch, ConcurrentHashMap check-then-act, equals/hashCode contract, checked exceptions swallowed in lambdas
Modern Java 17+: virtual thread pinning on synchronized, ThreadLocal memory explosion with Loom, sealed class IncompatibleClassChangeError, StructuredTaskScope leak
Read references/iac.md for the full IaC bug pattern catalog. Key highlights:
Terraform: resource dependencies wrong or missing, lifecycle issues with create_before_destroy, state drift from manual changes, data source race conditions
Ansible: handlers not notified, variable precedence surprises, when conditions with undefined vars, idempotency violations
Helm: template rendering errors only visible at deploy time, value type mismatches, missing required values
Kubernetes: liveness probe killing healthy pods, resource limits causing OOMKills, missing PDB for HA
ArgoCD: auto-sync with prune on production, sync wave ordering, health check misconfiguration, app-of-apps cluster targeting
Docker: ENTRYPOINT shell vs exec form, multi-stage COPY from wrong stage, ARG scoping across FROM, missing .dockerignore
Compose: depends_on without condition: service_healthy (race condition on startup ordering), restart: always without healthcheck (infinite crash loop), version field still present (deprecated since Compose v2)
Proxmox/LXC: API token permissions too broad, LXC nesting=1 without keyctl=1 (Docker fails inside), Terraform telmate/proxmox provider unpinned (breaking changes), cloud-init network config mismatch between Proxmox and guest, full_clone when linked clone would work
CI/CD Pipelines
Read references/cicd-pipelines.md for the full CI/CD bug pattern catalog. Key highlights:
GitLab CI/CD: rules: vs only:/except: mixing (silently rejected), missing when: never causing fallthrough, workflow:rules absent causing duplicate pipelines, dotenv variables used in rules: (don't exist yet), protected variable silently empty on non-protected branches
GitHub Actions: expression injection via ${{ }} with user-controlled input, GITHUB_TOKEN permission scope too broad, reusable workflow input type mismatches, concurrency group bugs canceling wrong runs
MCP vulnerabilities: command injection (43% of servers), tool poisoning (5% of open-source servers), path traversal, SSRF, cross-tenant data exposure
Databases
Read references/databases.md for the full database bug pattern catalog. Key highlights:
General SQL: transaction misuse (partial writes, missing rollback), NULL handling (NOT IN with NULLs returns 0 rows), migration bugs (NOT NULL without DEFAULT on existing tables)
PostgreSQL: timestamp vs timestamptz confusion, connection pool exhaustion, jsonb operator mixups (-> vs ->>), idle-in-transaction blocking autovacuum
MongoDB: missing $set in updates (replaces entire document), field name typos silently match nothing, write concern w:0 data loss, schema-less type inconsistency
MySQL/MariaDB: silent data truncation in non-strict mode, utf8 is not real UTF-8 (use utf8mb4), GROUP BY returning arbitrary values
MSSQL: @@IDENTITY vs SCOPE_IDENTITY(), VARCHAR can't store Unicode (use NVARCHAR), TOP without ORDER BY
ORM pitfalls: N+1 queries, stale entity caches, enum stored as ordinal (reorder breaks data), auto-DDL in production
Language: Go
Read references/go.md for the full Go bug pattern catalog. Key highlights:
Goroutine leaks: goroutines blocked on channels with no receiver, missing context/done signal, no WaitGroup
Nil interface traps: interface holding a typed nil pointer is not nil - error returned as (*MyError)(nil) fails nil checks
Defer ordering: LIFO execution, closure capture by reference, defer in loops exhausting file descriptors
Channel deadlocks: unbuffered channel send/receive in same goroutine, double close panic, time.After in for-select loop leaking timers
Error wrapping: %s vs %w in fmt.Errorf, sentinel comparison with == instead of errors.Is(), custom errors missing Unwrap()
Context leaks: context.WithCancel/WithTimeout without defer cancel(), ignoring request-scoped contexts
Data races: concurrent map writes (fatal panic), shared slice append, read-modify-write without sync, missing -race in CI
Loop variable capture: pre-Go 1.22 closure capture bug. Check go.mod first: go 1.22 or higher means per-iteration semantics (safe); below 1.22 means the loop variable is shared across all goroutines/closures (classic capture bug). This check is version-gated - read go.mod before flagging.
Other Languages
For Rust and other languages without dedicated reference files: apply the universal patterns (sections 1-10) only. Note in the report that language-specific checks were limited to universal patterns.
Previously reviewed code - if invoked multiple times in a session, focus on changes since the last review.
Severity Classification
Each reported finding (confidence >= 80) uses the shared severity scale:
P0 - must fix: will crash, corrupt data, or produce wrong results in normal usage. Includes null derefs on common paths, data loss, race conditions that affect correctness, broken error propagation that hides failures, and security-adjacent logic errors such as auth bypass through a logic bug.
P1 - should fix: will cause problems under specific realistic conditions or degrade reliability over time. Includes edge case crashes, resource leaks, performance traps that will eventually hit, missing error handling on external operations, and convention violations that cause bugs in this codebase.
P2 - nice to fix: lower-urgency correctness risk, missing focused regression coverage for a confirmed bug, or maintainability issue with a plausible future failure mode.
P3 - backlog: real but non-urgent follow-up that should not block the reviewed change.
info - informational: verified observation with no immediate action.
Rule of thumb: if you'd wake someone up at 2am over it, it's P0. If it can wait for the next sprint, it's P1. If it belongs in a backlog but still has a plausible failure mode, it's P2/P3.
Output Format
When issues are found:
## Code Review: [scope]
### Findings
#### P0 - Must Fix ([count] issues)
🔴 **[confidence]%** `path/to/file:line` - [description]
[Why this is wrong and what will happen if it isn't fixed]
**Triggers when:** [specific input, sequence, or condition that causes the bug]
```[language]
// before
[code snippet]
// after
[fixed code snippet]
```
#### P1 - Should Fix ([count] issues)
🟡 **[confidence]%** `path/to/file:line` - [description]
[Explanation]
```[language]
// before
[code snippet]
// after
[fixed code snippet]
```
#### P2 - Nice to Fix ([count] issues)
🟡 **[confidence]%** `path/to/file:line` - [description]
[Explanation]
#### P3 - Backlog ([count] issues)
🔵 **[confidence]%** `path/to/file:line` - [description]
[Explanation]
#### Info ([count] notes)
🔵 **[confidence]%** `path/to/file:line` - [description]
[Non-actionable observation]
### Observations
[Patterns noticed below the 80% threshold but worth mentioning as a group. This is where higher-level insights go - "error handling is inconsistent across the API handlers", "no input validation on any of the CLI commands", "the test suite mocks the database everywhere so nothing tests actual queries." These aggregate observations are often more valuable than individual findings.]
### Summary
- X findings across Y files (P0: Z, P1: W, P2: V, P3: U, info: T)
- [1-2 sentences on overall code health as it relates to correctness]
When no issues are found:
## Code Review: [scope]
No issues found above the confidence threshold.
**Checked:** [list what was reviewed - e.g., "14 files, focused on API handlers and auth middleware"]
**Linters:** [what ran, what was missing - e.g., "eslint clean, shellcheck not installed (`pacman -S shellcheck`)"]
[Optional: 1-2 sentences noting anything positive - well-structured error handling, good test coverage, etc.]
Keep it tight. Show the bug, show the fix, move on. Long explanations only when the bug is subtle and the reader needs to understand why it's wrong.
Reference Files
references/universal-patterns.md - cross-language bug patterns and failure modes
references/typescript.md - TypeScript and JavaScript bug patterns
See skills/_shared/output-contract.md for the full contract.
Skill name: CODE-REVIEW
Deliverable bucket:audits
Mode: always-on. Every invocation emits the full contract - boxed inline header, body summary inline plus per-finding detail in the deliverable file, boxed conclusion, conclusion table.
Severity scale:P0 | P1 | P2 | P3 | info (see shared contract).
Related Skills
anti-slop - handles style, quality, and machine-generated code patterns. If the finding
is "ugly but correct," route to anti-slop. If it would cause incorrect behavior, keep it here.
full-review - orchestrates code-review, anti-slop, security-audit, and update-docs in
parallel. Code-review is one of the four passes.
databases - references/databases.md in this skill covers application-level DB bug
patterns. The databases skill covers engine configuration and operations.
git - for PR/MR creation and git operations. Code-review evaluates the code in PRs;
git handles creating and managing them.
Rules
Read before flagging. Never flag code you haven't read in full context. Read the function, the file, and the callers if needed. A pattern that looks wrong in isolation might be correct in context.
Don't duplicate other skills. Style issues belong to anti-slop. Security vulnerabilities belong to security-audit. If you're unsure whether a finding is a bug or a style issue, ask: "would this cause incorrect behavior?" If no, skip it.
One finding per bug, not per occurrence. If the same pattern appears in 5 files, report it once with a note about scope. Don't pad the report.
Show the fix. Every finding must include a concrete code fix, not just a description of the problem. If you can't show a fix, the finding isn't specific enough.
Verify before scoring. Before assigning 80+, check: is there a test covering this? Does git blame show this is new or old? Is there a comment explaining why?
Report missing tools. When a linter or checker isn't installed, tell the user the package name and install command so they can set it up.
Don't repeat dismissed findings. If the user acknowledged or dismissed a finding in this session, don't re-report it on subsequent invocations. They heard you the first time.
1---2name: code-review-33description: · Review code for correctness: bugs, edge cases, races, leaks, regressions. Triggers: 'review', 'code review', 'find bugs', 'check this', 'spot check', 'sanity check'. Not for style/slop (anti-slop) or vulnerabilities (security-audit).4license: MIT5---67# Code Review: Deep Correctness Audit
89Find bugs that actually break things. Not style, not slop - correctness, reliability, and logic errors that will bite in production.
1011This skill complements **anti-slop** (code quality/style) and **security-audit** (vulnerabilities/OWASP). Those catch "is the code clean?" and "is the code safe?" - this one catches "does the code actually work?"
1213Covers: **TypeScript/JavaScript**, **Python**, **Go**, **Java**, **Bash/Shell**, and **Infrastructure as Code** (Terraform, Ansible, Helm, Kubernetes, Docker/Compose, Proxmox/LXC). Universal patterns apply everywhere; language-specific sections add targeted checks.
1415## When to use
1617- Reviewing recent changes for bugs, regressions, edge cases, or fragile assumptions
18- Sanity-checking code before merge or release
19- Looking for logic errors that static tooling may miss
20- Doing a focused correctness review where style and security are secondary
2122### The Three Questions
2324Every finding answers one of:
25261. **Will it crash?** - null derefs, unhandled errors, resource exhaustion, missing imports
272. **Will it do the wrong thing?** - logic errors, off-by-ones, wrong comparisons, missing cases
283. **Will it break later?** - race conditions, implicit ordering, fragile assumptions, API contract drift
2930## When NOT to use
3132- Style, verbosity, or machine-generated code quality issues - use **anti-slop**
33- Exploitable vulnerabilities, auth flaws, or secret scanning - use **security-audit**
34- Pipeline architecture design - use **ci-cd**
35- End-of-session doc hygiene or instruction-file cleanup - use **update-docs**
3637## AI Self-Check
3839Before reporting any finding at >= 80% confidence, verify:
4041- [ ] **Read full context**: read the entire function/file, not just the flagged line
42- [ ] **Check for tests**: is there a test covering this case? Is the test correct?
43- [ ] **Check git blame**: is this new code or battle-tested? Pre-existing issues belong out of scope
44- [ ] **Check for explaining comments**: a comment explaining the pattern means someone already considered it
45- [ ] **Cite the evidence**: exact file, line, and code that proves the issue. No citation = no finding
46- [ ] **Adversarial self-check**: argue against each finding. If the counter-argument is convincing, drop it
47- [ ] **Construct a failing case**: for P0 findings, describe the specific input or sequence that triggers the bug
48- [ ] **Verify API/stdlib claims**: AI code review suggestions frequently contain factual errors about framework behavior. If unsure, look it up
49- [ ] **Boundary values on numeric inputs flagged**: zero, negative, and overflow values on page numbers, sizes, counts, and indices are high-confidence findings - do not suppress with the 80% threshold
50- [ ] **Current source checked**: dated versions, CLI flags, API names, and support windows are verified against primary docs before repeating them
51- [ ] **Hidden state identified**: local config, credentials, caches, contexts, branches, cluster targets, or previous runs are made explicit before acting
52- [ ] **Verification is real**: final checks exercise the actual runtime, parser, service, or integration point instead of only linting prose or happy paths
53- [ ] **Routing overlap checked**: overlapping skills, trigger terms, and "When NOT to use" boundaries are checked before returning guidance
54- [ ] **Spec claims verified**: claims about tool behavior, output contracts, or repo conventions are checked against current docs, scripts, or skill files
55- [ ] **Line references verified**: every finding points to code that exists in the reviewed diff
56- [ ] **Behavioral claim proven**: findings describe a plausible failing input, race, leak, or regression
5758---
5960## Performance
6162- Start with changed public interfaces, shared utilities, migrations, and concurrency boundaries.
63- Use tests and static analysis to validate suspected issues instead of reading the entire repo linearly.
64- Merge duplicate findings into one high-signal comment with affected locations.
6566---
6768## Best Practices
6970- Lead with bugs and risks, not style preferences.
71- Do not request rewrites unless the current structure blocks correctness or maintainability.
72- Call out missing tests only when a specific behavior or risk needs coverage.
7374## Workflow
7576### Step 1: Scope the review
7778Default scope based on context:
79- If invoked right after writing code in this session -> **self-check** (review what you just wrote)
80- If there are uncommitted changes (`git diff --name-only`) -> **recent changes**
81- If the user specifies files/dirs/commits -> **targeted review**
82- Otherwise -> ask the user
8384Available scopes:
85- **Full codebase review** - scan everything, report by category
86- **Recent changes** - check git diff or specific commits
87- **Specific files/dirs** - targeted review
88- **Self-check** - review code you just wrote in this session
8990**Large diffs (> 500 lines):** Chunk by file. Review each file with its surrounding context, then do a cross-file pass looking for integration issues (mismatched types across boundaries, inconsistent error handling, broken call chains). Large diffs are also a code smell worth noting in Observations.
9192### Step 2: Gather project context
9394Before reviewing any code, build context:
951. Read project instruction files (`AGENTS.md` or equivalent) if present - project conventions, patterns, known gotchas
962. Check the project's language/framework versions (package.json, pyproject.toml, go.mod, etc.)
973. Understand the architecture - monolith, microservices, CLI tool, library?
984. Note any custom error handling patterns, logging conventions, or testing requirements
99100This context prevents false positives. A pattern that's wrong in a React app might be correct in a Node CLI tool.
101102### Step 3: Run mechanical checks first (if available and practical)
103104Before manual review, run standard tooling to clear obvious issues - but only when it makes sense:
105- **TypeScript**: `tsc --noEmit` / `eslint` (skip if no `tsconfig.json` / `.eslintrc*`, or if the project has 500+ TS files - too slow)
106- **Python**: `ruff check` / `mypy` (skip if no `pyproject.toml` / `ruff.toml` / `mypy.ini`)
107- **Shell**: `shellcheck` (fast, always worth running if installed)
108- **Terraform**: `terraform validate` (skip if `terraform init` hasn't been run - validate requires initialized providers)
109- **Ansible**: `ansible-lint` (skip if no `.ansible-lint` config and the project isn't primarily Ansible)
110111**When to skip a tool:**
112- No config file for it in the project (no `tsconfig.json`, no `pyproject.toml`, etc.)
113- Reviewing a small diff (< 5 files) - linting the whole project for a 3-file change is wasted effort
114- The user just wants a quick review, not a full audit
115116**When a tool isn't installed:** Don't silently skip it. Tell the user which tools are missing so they can install them. Example: "shellcheck isn't installed - consider `pacman -S shellcheck` for shell script linting." This is a one-time heads-up, not a blocker - continue the review without it.
117118Linters catch syntax, imports, and known anti-patterns mechanically. This skill focuses on what automated tools miss: logic errors, edge cases, incorrect assumptions, and subtle bugs that require understanding intent. Don't burn time and tokens on linter output - move to the actual review.
119120### Step 4: Review with four focus areas
121122Review the code through four lenses. These aren't sequential passes - they're dimensions to evaluate as you read. The order reflects priority: understanding intent comes first because everything else depends on it.
123124**Focus 1: Understand Intent**
125Read the code to understand what it's supposed to do. If reviewing a diff, read the surrounding context too. Check commit messages, PR descriptions, or comments for stated intent. You can't find bugs if you don't know what "correct" looks like.
126127**Focus 2: Trace Logic Paths**
128Follow every code path. For each branch, loop, or condition:
129- What happens on the happy path?
130- What happens on each error path?
131- What happens at boundaries (empty, zero, max, null, negative)?
132- Are all cases handled? (switch/match exhaustiveness, if/else completeness)
133134**Boundary value analysis** deserves special attention: when a function accepts numeric inputs (page numbers, sizes, counts, indices), zero, negative, and overflow values are inherently high-confidence findings. Don't suppress these with the 80% threshold - if the function doesn't guard against `page=0`, `perPage=0` (division by zero in callers), `offset > total`, or `offset + limit > total` (last page returns a short slice or the caller over-reads), that's a real bug on a realistic path. For paginated APIs, walk the arithmetic for page=1, page=0, page=-1, and the final page where `(page-1)*perPage` lands at or past `total`.
135136If no `go.mod` is available (inline snippet, paste, interview question), flag version-dependent issues at reduced confidence and note the version dependency.
137138**Focus 3: Check Contracts & Boundaries**
139Examine every interface between components:
140- Function signatures: are callers passing the right types/shapes?
141- API boundaries: is input validated before use?
142- State transitions: are preconditions checked?
143- Error propagation: do errors carry enough context?
144- Resource lifecycle: is everything acquired/released symmetrically?
145- **Downstream impact**: when reviewing changes to exported functions, interfaces, or API endpoints, grep for all callers/consumers. For config/env var changes, check all files that reference the changed key. A boolean toggle in one file can break feature-flag logic across twelve modules.
146147**Focus 4: Convention Compliance**
148Check against project-specific correctness rules - not style (that's anti-slop), but rules that affect whether the code works:
149- Project instruction-file rules about error handling, transactions, API patterns
150- Consistency with surrounding code's error handling and state management
151- Framework idioms that affect correctness (not just style)
152- Required test coverage for critical paths
153154### Step 5: Score each finding
155156Rate every potential issue on a confidence scale of 0-100:
157158| Score | Meaning | Action |
159|-------|---------|--------|
160| 0 | False positive. Doesn't hold up under scrutiny or is pre-existing. | Discard |
161| 25 | Might be real. Could also be intentional or context-dependent. | Discard |
162| 50 | Real issue, but minor. Nitpick territory. Won't cause production incidents. | Discard |
163| 75 | Very likely real. Will impact functionality or violates explicit project rules. | Borderline |
164| 80+ | Confirmed real. Verified by reading surrounding code. High impact. | **Report** |
165| 100 | Dead certain. The code is definitively wrong. Evidence is unambiguous. | **Report** |
166167**Only report findings scored >= 80.** Quality over quantity. A report with 3 real bugs beats one with 20 maybes.
168169**Self-review mode exception:** When reviewing code you just wrote in this session, lower the threshold to >= 70%. The cost of fixing is near-zero right now, and you can skip the git blame step (everything is new). Focus harder on logic paths and contracts - that's where fresh code has the most bugs.
170171**Finding cap:** If you have more than 8-10 reportable findings, something is wrong - either the code is catastrophically bad (say so in the summary) or your threshold is too low. Prioritize ruthlessly. Wall-of-text reviews get ignored.
172173For each significant code change, ask: **What are the three most likely failure modes?** This question catches architecture-level bugs that line-by-line review misses - especially in AI-generated code where individual lines look fine but the overall design has gaps.
174175Before assigning a score, verify:
176- Read the full function/file, not just the flagged line
177- Check if there's a test covering this case (and whether the test is correct)
178- Check git blame - is this new code or battle-tested?
179- Look for comments explaining why something looks odd (if a comment explains the pattern, it's not a bug)
180- **Cite the evidence.** Every >= 80% finding must reference the exact file, line, and code that proves the issue. If you can't cite it, go find it. If you can't find evidence, downgrade the score.
181- **Adversarial self-check.** Before finalizing each finding, argue *against* it. Try to explain why the code is actually correct. If the counter-argument is convincing, drop the finding.
182- **Construct a failing case.** For P0 findings, describe the specific input or sequence that triggers the bug. If you can't construct one, it's not P0.
183- **Never claim API/stdlib behavior without verifying.** 18% of "high-confidence" AI code review suggestions contain factual errors about framework behavior. If unsure whether a function is stable-sorted, returns a view, or handles null - look it up first.
184185### Step 6: Report
186187Present findings grouped by severity, with concrete fixes. See Output Format below.
188189---
190191## Universal Patterns (All Languages)
192193Read `references/universal-patterns.md` for the full cross-language bug catalog.
194195Always check these ten buckets before calling a review complete:
196- logic errors
197- null or absent-value hazards
198- error-handling gaps
199- race conditions and shared-state issues
200- resource leaks and lifecycle mismatches
201- boundary or edge-case breakage
202- API and data-contract mismatches
203- real performance traps
204- correctness-relevant convention violations
205- tests that pass without proving the behavior
206207The standard is simple: if it can return the wrong result, crash on a realistic path, or silently
208rot over time, it belongs in the review.
209210---
211212## Prioritizing in Large Codebases
213214For full codebase reviews on repos with 100+ files, you can't read everything. Prioritize:
2152161. **Recently changed files** (`git log --since='2 weeks ago' --name-only`) - fresh code has more bugs
2172. **Critical paths** - auth, payments, data mutations, API handlers, middleware
2183. **Entry points** - main files, route definitions, CLI commands, event handlers
2194. **Files without tests** - `git ls-files '*.ts' | while read f; do test -f "${f%.ts}.test.ts" || echo "$f"; done`
2205. **Complex files** - long functions, high cyclomatic complexity, many branches
2216. **Shared utilities** - bugs here multiply across the codebase
222223Skip: vendored code, generated files, test fixtures/snapshots, documentation, static assets.
224225For targeted reviews (diff/specific files), read the full files being changed plus their immediate callers/callees. Context matters - a function that looks fine in isolation might be called incorrectly.
226227---
228229## Language: TypeScript / JavaScript
230231Read `references/typescript.md` for the full TS/JS bug pattern catalog. Key highlights:
232233- **Promise pitfalls**: missing `await`, unhandled rejections, `Promise.all` partial failure, `async void`
234- **Type narrowing gaps**: type assertions (`as`) bypassing runtime checks, discriminated union exhaustiveness
235- **Closure traps**: stale closures in loops/effects, captured mutable variables in async callbacks
236- **React-specific**: missing dependency arrays, state updates during render, memory leaks in effects
237- **Node-specific**: unhandled stream errors, missing `error` event handlers on EventEmitters
238239## Language: Python
240241Read `references/python.md` for the full Python bug pattern catalog. Key highlights:
242243- **Mutable default arguments**: `def foo(items=[])` - the list is shared across calls
244- **Exception handling**: bare `except:` catching KeyboardInterrupt/SystemExit, context loss in exception chains
245- **Iterator exhaustion**: generators consumed twice silently, `map()`/`filter()` returning iterators not lists
246- **Import side effects**: circular imports, module-level code that runs on import
247- **Async pitfalls**: mixing sync and async, blocking the event loop, missing `await`
248- **Dataclass/pydantic bugs**: mutable default fields without `default_factory`, validator side effects, `model_validate()` coercion on untrusted input
249- **Attribute typos**: `self.nmae = name` silently creates a new attribute on regular classes - use `__slots__` or dataclasses
250251## Language: Bash / Shell
252253Read `references/shell.md` for the full Shell bug pattern catalog. Key highlights:
254255- **Word splitting**: unquoted variables breaking on spaces, glob expansion in unexpected places
256- **Exit code masking**: pipes hiding failures (`cmd1 | cmd2` only checks cmd2), `$(...)` in assignments
257- **Signal handling**: missing trap for cleanup, backgrounded processes not cleaned up
258- **Portability**: bashisms in `#!/bin/sh` scripts, GNU vs BSD tool differences
259260## Language: Java
261262Read `references/java.md` for the full Java bug pattern catalog. Key highlights:
263264- **Quarkus**: CDI scope thread safety (`@ApplicationScoped` + mutable state), `@RequestScoped` lost in reactive pipelines, `Uni`/`Multi` never subscribed, native image reflection, dev services config drift (`drop-and-create` in prod)
265- **Spring Boot**: `@Transactional` proxy traps (self-invocation, non-public, final, checked exceptions), `SecurityFilterChain` ordering, WebFlux blocking calls, Reactor context/MDC loss
266- **General Java**: `Optional.of()` on nullable, stream reuse, lazy eval escaping try-catch, `ConcurrentHashMap` check-then-act, equals/hashCode contract, checked exceptions swallowed in lambdas
267- **Modern Java 17+**: virtual thread pinning on `synchronized`, `ThreadLocal` memory explosion with Loom, sealed class `IncompatibleClassChangeError`, `StructuredTaskScope` leak
268- **AI-generated Java**: framework confusion (`@Autowired` in CDI), overcomplicated generics, concurrency blindness (2x rate), security shortcuts (1.5-2x rate)
269270## Language: Infrastructure as Code
271272Read `references/iac.md` for the full IaC bug pattern catalog. Key highlights:
273274- **Terraform**: resource dependencies wrong or missing, lifecycle issues with `create_before_destroy`, state drift from manual changes, data source race conditions
275- **Ansible**: handlers not notified, variable precedence surprises, `when` conditions with undefined vars, idempotency violations
276- **Helm**: template rendering errors only visible at deploy time, value type mismatches, missing required values
277- **Kubernetes**: liveness probe killing healthy pods, resource limits causing OOMKills, missing PDB for HA
278- **ArgoCD**: auto-sync with prune on production, sync wave ordering, health check misconfiguration, app-of-apps cluster targeting
279- **Docker**: ENTRYPOINT shell vs exec form, multi-stage COPY from wrong stage, ARG scoping across FROM, missing .dockerignore
280- **Compose**: `depends_on` without `condition: service_healthy` (race condition on startup ordering), `restart: always` without healthcheck (infinite crash loop), version field still present (deprecated since Compose v2)
281- **Proxmox/LXC**: API token permissions too broad, LXC `nesting=1` without `keyctl=1` (Docker fails inside), Terraform `telmate/proxmox` provider unpinned (breaking changes), cloud-init network config mismatch between Proxmox and guest, `full_clone` when linked clone would work
282283## CI/CD Pipelines
284285Read `references/cicd-pipelines.md` for the full CI/CD bug pattern catalog. Key highlights:
286287- **GitLab CI/CD**: `rules:` vs `only:/except:` mixing (silently rejected), missing `when: never` causing fallthrough, `workflow:rules` absent causing duplicate pipelines, dotenv variables used in `rules:` (don't exist yet), protected variable silently empty on non-protected branches
288- **GitHub Actions**: expression injection via `${{ }}` with user-controlled input, `GITHUB_TOKEN` permission scope too broad, reusable workflow input type mismatches, concurrency group bugs canceling wrong runs
289- **Forgejo Actions**: GitHub Actions compatibility gaps (missing features, different runner behavior, secrets handling differences)
290- **ArgoCD advanced**: ApplicationSet generator collisions, multi-source Application gotchas, annotation-based sync options silently changing behavior, progressive delivery rollback ordering
291- **Terraform advanced**: state locking race conditions, workspace isolation failures, provider alias confusion, `moved` blocks breaking plans, `import` block limitations
292293## AI-Age Patterns
294295Read `references/ai-age-patterns.md` for the full AI-age bug pattern catalog. Key highlights:
296297- **AI-generated code smells**: hallucinated APIs/dependencies (1 in 5 samples), deprecated patterns from stale training data, over-defensive error handling, unnecessary abstractions, insecure defaults
298- **Agentic AI patterns**: prompt injection (#1 OWASP LLM 2025), missing rate limiting on LLM API calls, context window overflow, streaming edge cases, tool/function calling validation gaps
299- **LLM SDK bugs**: provider SDK streaming + tool-calling interaction, reasoning block preservation where applicable, structured output gotchas, missing token limits or defaults
300- **MCP vulnerabilities**: command injection (43% of servers), tool poisoning (5% of open-source servers), path traversal, SSRF, cross-tenant data exposure
301302## Databases
303304Read `references/databases.md` for the full database bug pattern catalog. Key highlights:
305306- **General SQL**: transaction misuse (partial writes, missing rollback), NULL handling (`NOT IN` with NULLs returns 0 rows), migration bugs (NOT NULL without DEFAULT on existing tables)
307- **PostgreSQL**: `timestamp` vs `timestamptz` confusion, connection pool exhaustion, `jsonb` operator mixups (`->` vs `->>`), idle-in-transaction blocking autovacuum
308- **MongoDB**: missing `$set` in updates (replaces entire document), field name typos silently match nothing, write concern `w:0` data loss, schema-less type inconsistency
309- **MySQL/MariaDB**: silent data truncation in non-strict mode, `utf8` is not real UTF-8 (use `utf8mb4`), `GROUP BY` returning arbitrary values
310- **MSSQL**: `@@IDENTITY` vs `SCOPE_IDENTITY()`, VARCHAR can't store Unicode (use NVARCHAR), `TOP` without `ORDER BY`
311- **ORM pitfalls**: N+1 queries, stale entity caches, enum stored as ordinal (reorder breaks data), auto-DDL in production
312313## Language: Go
314315Read `references/go.md` for the full Go bug pattern catalog. Key highlights:
316317- **Goroutine leaks**: goroutines blocked on channels with no receiver, missing context/done signal, no WaitGroup
318- **Nil interface traps**: interface holding a typed nil pointer is not nil - `error` returned as `(*MyError)(nil)` fails nil checks
319- **Defer ordering**: LIFO execution, closure capture by reference, defer in loops exhausting file descriptors
320- **Channel deadlocks**: unbuffered channel send/receive in same goroutine, double close panic, `time.After` in for-select loop leaking timers
321- **Error wrapping**: `%s` vs `%w` in `fmt.Errorf`, sentinel comparison with `==` instead of `errors.Is()`, custom errors missing `Unwrap()`
322- **Context leaks**: `context.WithCancel`/`WithTimeout` without `defer cancel()`, ignoring request-scoped contexts
323- **Data races**: concurrent map writes (fatal panic), shared slice append, read-modify-write without sync, missing `-race` in CI
324- **Loop variable capture**: pre-Go 1.22 closure capture bug. Check `go.mod` first: `go 1.22` or higher means per-iteration semantics (safe); below 1.22 means the loop variable is shared across all goroutines/closures (classic capture bug). This check is version-gated - read `go.mod` before flagging.
325326## Other Languages
327328For Rust and other languages without dedicated reference files: apply the universal patterns (sections 1-10) only. Note in the report that language-specific checks were limited to universal patterns.
329330---
331332## What NOT to Flag
333334- **Style/quality issues** - that's anti-slop's job.
335- **Security vulnerabilities** - that's security-audit's job.
336- **Pre-existing bugs** - issues on lines not touched by the current changes (when reviewing a diff).
337- **Linter/compiler catches** - missing imports, type errors, formatting. The toolchain handles these.
338- **Intentional trade-offs** - code comments explaining "we do X because Y" signal the author already considered it.
339- **Test-only code** - relaxed error handling in test fixtures/helpers is often fine.
340- **Defensive code at boundaries** - input validation on external data is correct, not a bug.
341- **Known framework quirks** - patterns that look wrong but are idiomatic for the framework.
342- **TODOs with issue references** - `// TODO(#1234)` shows awareness, not negligence.
343- **Generated / vendored code** - lock files, compiled output, auto-generated types, vendored deps, ORM migrations.
344- **Previously reviewed code** - if invoked multiple times in a session, focus on changes since the last review.
345346---
347348## Severity Classification
349350Each reported finding (confidence >= 80) uses the shared severity scale:
351352- **P0** - must fix: will crash, corrupt data, or produce wrong results in normal usage. Includes null derefs on common paths, data loss, race conditions that affect correctness, broken error propagation that hides failures, and security-adjacent logic errors such as auth bypass through a logic bug.
353- **P1** - should fix: will cause problems under specific realistic conditions or degrade reliability over time. Includes edge case crashes, resource leaks, performance traps that will eventually hit, missing error handling on external operations, and convention violations that cause bugs in this codebase.
354- **P2** - nice to fix: lower-urgency correctness risk, missing focused regression coverage for a confirmed bug, or maintainability issue with a plausible future failure mode.
355- **P3** - backlog: real but non-urgent follow-up that should not block the reviewed change.
356- **info** - informational: verified observation with no immediate action.
357358Rule of thumb: if you'd wake someone up at 2am over it, it's P0. If it can wait for the next sprint, it's P1. If it belongs in a backlog but still has a plausible failure mode, it's P2/P3.
359360---
361362## Output Format
363364### When issues are found:
365366````markdown
367## Code Review: [scope]
368369### Findings
370371#### P0 - Must Fix ([count] issues)
372373🔴 **[confidence]%** `path/to/file:line` - [description]
374375[Why this is wrong and what will happen if it isn't fixed]
376**Triggers when:** [specific input, sequence, or condition that causes the bug]
377378```[language]
379// before
380[code snippet]
381382// after
383[fixed code snippet]
384```
385386#### P1 - Should Fix ([count] issues)
387388🟡 **[confidence]%** `path/to/file:line` - [description]
389390[Explanation]
391392```[language]
393// before
394[code snippet]
395396// after
397[fixed code snippet]
398```
399400#### P2 - Nice to Fix ([count] issues)
401🟡 **[confidence]%** `path/to/file:line` - [description]
402403[Explanation]
404405#### P3 - Backlog ([count] issues)
406🔵 **[confidence]%** `path/to/file:line` - [description]
407408[Explanation]
409410#### Info ([count] notes)
411🔵 **[confidence]%** `path/to/file:line` - [description]
412413[Non-actionable observation]
414415### Observations
416417[Patterns noticed below the 80% threshold but worth mentioning as a group. This is where higher-level insights go - "error handling is inconsistent across the API handlers", "no input validation on any of the CLI commands", "the test suite mocks the database everywhere so nothing tests actual queries." These aggregate observations are often more valuable than individual findings.]
418419### Summary
420- X findings across Y files (P0: Z, P1: W, P2: V, P3: U, info: T)
421- [1-2 sentences on overall code health as it relates to correctness]
422````
423424### When no issues are found:
425426````markdown
427## Code Review: [scope]
428429No issues found above the confidence threshold.
430431**Checked:** [list what was reviewed - e.g., "14 files, focused on API handlers and auth middleware"]
432**Linters:** [what ran, what was missing - e.g., "eslint clean, shellcheck not installed (`pacman -S shellcheck`)"]
433434[Optional: 1-2 sentences noting anything positive - well-structured error handling, good test coverage, etc.]
435````
436437Keep it tight. Show the bug, show the fix, move on. Long explanations only when the bug is subtle and the reader needs to understand *why* it's wrong.
438439---
440441## Reference Files
442443- `references/universal-patterns.md` - cross-language bug patterns and failure modes
444- `references/typescript.md` - TypeScript and JavaScript bug patterns
445- `references/python.md` - Python bug patterns
446- `references/shell.md` - shell bug patterns
447- `references/java.md` - Java bug patterns
448- `references/go.md` - Go bug patterns
449- `references/iac.md` - infrastructure-as-code bug patterns
450- `references/cicd-pipelines.md` - CI/CD bug patterns
451- `references/ai-age-patterns.md` - AI-age correctness patterns and hallucination-driven bugs
452- `references/databases.md` - application-level database bug patterns
453454---
455456## Output Contract
457458See `skills/_shared/output-contract.md` for the full contract.
459460- **Skill name:** CODE-REVIEW
461- **Deliverable bucket:** `audits`
462- **Mode:** always-on. Every invocation emits the full contract - boxed inline header, body summary inline plus per-finding detail in the deliverable file, boxed conclusion, conclusion table.
463- **Deliverable path:** `docs/local/audits/code-review/<YYYY-MM-DD>-<slug>.md`
464- **Severity scale:** `P0 | P1 | P2 | P3 | info` (see shared contract).
465466## Related Skills
467468- **anti-slop** - handles style, quality, and machine-generated code patterns. If the finding
469 is "ugly but correct," route to anti-slop. If it would cause incorrect behavior, keep it here.
470- **security-audit** - handles vulnerability detection (injection, auth bypass, credential
471 exposure). Code-review catches logic bugs; security-audit catches exploitable flaws.
472- **full-review** - orchestrates code-review, anti-slop, security-audit, and update-docs in
473 parallel. Code-review is one of the four passes.
474- **databases** - `references/databases.md` in this skill covers application-level DB bug
475 patterns. The databases skill covers engine configuration and operations.
476- **git** - for PR/MR creation and git operations. Code-review evaluates the code in PRs;
477 git handles creating and managing them.
478479---
480481## Rules
482483- **Read before flagging.** Never flag code you haven't read in full context. Read the function, the file, and the callers if needed. A pattern that looks wrong in isolation might be correct in context.
484- **Don't duplicate other skills.** Style issues belong to anti-slop. Security vulnerabilities belong to security-audit. If you're unsure whether a finding is a bug or a style issue, ask: "would this cause incorrect behavior?" If no, skip it.
485- **One finding per bug, not per occurrence.** If the same pattern appears in 5 files, report it once with a note about scope. Don't pad the report.
486- **Show the fix.** Every finding must include a concrete code fix, not just a description of the problem. If you can't show a fix, the finding isn't specific enough.
487- **Verify before scoring.** Before assigning 80+, check: is there a test covering this? Does git blame show this is new or old? Is there a comment explaining why?
488- **Report missing tools.** When a linter or checker isn't installed, tell the user the package name and install command so they can set it up.
489- **Don't repeat dismissed findings.** If the user acknowledged or dismissed a finding in this session, don't re-report it on subsequent invocations. They heard you the first time.
Run npx skillmds add majiayu000/code-review-3 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.
· Review code for correctness: bugs, edge cases, races, leaks, regressions. Triggers: 'review', 'code review', 'find bugs', 'check this', 'spot check', 'sanity check'. Not for style/slop (anti-slop) or vulnerabilities (security-audit). It is listed under Security on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: 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. This skill is licensed under MIT.
majiayu000 (@majiayu000) published this skill. Their other Agent Skills are listed on their SkillMD profile.