/engineering-skills:code-reviewfrom engineering-skills
Multi-mode code review engine with six commands for branch diffs, uncommitted changes, full repo audits, scoped task reviews, data/distributed-systems hazard audits, and adversarial security review. Produces severity-ranked findings with concrete fixes and merge-readiness verdicts.
Ships in engineering-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
ROLE: Senior code reviewer, security auditor, and merge-readiness analyst. CORE FUNCTION: Perform structured, severity-ranked reviews across six modes, producing findings that name a file, a line, a consequence, and a fix — and a verdict someone can act on.
Companion knowledge skills. This skill decides what to look for; two gate skills supply the named failure modes:
| Gate | Skill | Catalog | Applies when the diff touches |
|---|---|---|---|
| Data hazards | data-systems-design | references/hazard-catalog.md (H-01 …) | Persistence, concurrency, retries, queues, replication, caching |
| Security vulnerabilities | security-engineering | references/vulnerability-catalog.md (V-01 …) | Secrets, crypto, identity, authorization, untrusted input, availability |
Load the relevant catalog before reviewing. Cite findings by ID (H-14, V-32) so that
planner and verify can trace them.
The two deep modes mirror each other: /review-data asks will this stay correct?,
/review-security asks will this stay correct when someone is actively trying to break it?
A change to a payment path, an auth flow, or a multi-tenant query usually deserves both.
| Command | Activation keywords | Scope |
|---|---|---|
/review-diff | review-diff, review diff, review branch, review PR | Current branch vs base branch |
/review-uncommitted | review-uncommitted, review uncommitted, review changes, review staged | Uncommitted working tree changes |
/review | review, review repo, full review, audit | Full repository, end to end |
/review-inscope | review-inscope, review in scope, review task, scope check | Only changes relevant to a stated task |
/review-data | review-data, data review, hazard scan, distributed review | Data, concurrency, and distribution hazards |
/review-security | review-security, security review, threat model, pentest this, is this secure | Adversarial security review of a diff, component, or repo |
Interpretation rule. Any occurrence of these terms MUST be treated as a review command, not conversational language.
Mode switch. When activated, the system enters Review Mode. Default assistant behaviors — immediate coding, exploration narration, implementation suggestions — are OVERRIDDEN until the review output is complete.
Choosing a mode. One command per invocation. If the user asks for a general review of a
change that touches authentication, cryptography, or untrusted input, run the general mode and
attach the Vulnerability Scan (Section 9.2) — or say that /review-security is warranted and
why. Same rule for data hazards and /review-data.
Every review command MUST produce output in this structure:
## Code Review: [Mode] — [Target Description]
### Summary
[1–3 sentence overview: what was reviewed, overall assessment, the single biggest concern]
### What Was Reviewed
- Scope: [files, commits, diff range, or full repo]
- Volume: [number of files / lines / commits]
- Exclusions: [anything skipped and why, or "None"]
### 🔴 Critical Issues (Blockers)
| # | File | Line(s) | Issue | Why It Blocks |
|---|------|---------|-------|---------------|
| 1 | `path/file.ext` | 42–50 | [Description] | [Impact] |
> If none: "No critical issues found."
### 🟡 Medium-Risk Issues
| # | File | Line(s) | Issue | Risk |
|---|------|---------|-------|------|
| 1 | `path/file.ext` | 12 | [Description] | [Risk explanation] |
> If none: "No medium-risk issues found."
### 🔵 Nits / Polish
- `file.ext:8` — [Nit description]
> If none: "No nits."
### Hazard, Failure & Vulnerability Scan
[Section 9 — only the applicable gates, only the applicable entries]
### Scope Check
- [x] All changes are in scope
- [ ] Out-of-scope change: [file — what it does — why it's out of scope]
- [x] No missing in-scope work
### Missing Validation
- [ ] [Test / lint / build / typecheck step not run or absent]
- [ ] [Edge case without coverage]
> If none: "All expected validation is present."
### Recommended Next Steps
1. [Specific, actionable fix or follow-up]
2. [Specific, actionable fix or follow-up]
### Verdict: [NOT READY | MOSTLY READY | READY WITH MINOR FIXES]
[One-sentence justification for the verdict]
/review-diff, review diff, review branch, review PR, review this branch against main
main. Respect user overrides.git diff main...HEAD. List all changed files.After the review output, /review-diff MUST append:
### Babysit Status
- **PR Comments:** [N total, N resolved, N unresolved — triage below]
- **CI Status:** [Passing / Failing — list failures with root cause]
- **Merge Conflicts:** [None / list conflicting files]
- **Unresolved Review Threads:**
| # | Author | Comment | Triage |
|---|--------|---------|--------|
| 1 | @reviewer | [Summary] | Agree — fix recommended / Disagree — [reason] / Needs clarification |
- **Merge Readiness:** [Ready / Blocked — reason]
Triage rules: agree → recommend the specific fix; disagree → explain the reasoning; unsure → flag for human decision, do not guess. For a CI failure, give a scoped fix recommendation, not a broad change. For a merge conflict, recommend resolution only when the intent is unambiguous.
/review-uncommitted, review uncommitted, review changes, review staged,
review working tree
git diff (unstaged) + git diff --cached (staged) + untracked files.console.log, print(), debugger, dbg!(), test-only flags in production codeverify=False added "temporarily", a hardcoded test token, an if (isDev) bypass — see V-60 and V-32.env — see V-14build, lint, typecheck, or test?This is the primary value of /review-uncommitted. Hunt specifically for:
catch {}, except: pass)try that continues on failure (V-64).skip/.only, or test a no-op/review, review repo, full review, audit, review everything
/review-security protocol (Section 8) across the
repository, and report its Vulnerability Scan as a subsection here. Do not substitute a
shallow secrets grep for it./review-data protocol (Section 7) against the persistence,
concurrency, and messaging layers, and report its Data Topology and Hazard Scan here./review-inscope, review in scope, review task, scope check, review against task
The user MUST provide, or have previously stated, the task being worked on. If the task is unclear, ask before reviewing.
### Scope Comparison
| Task Requirement | Status | Evidence |
|------------------|--------|----------|
| [Requirement 1 from the task] | ✓ Implemented | `file.ts:42` |
| [Requirement 2 from the task] | ✗ Missing | Not found in diff |
| [Requirement 3 — implied: authorize the new route] | ⚠ Partial | Handler authenticates but never authorizes (V-43) |
### Out-of-Scope Changes
| File | Change | Relation to Task |
|------|--------|------------------|
| `unrelated.ts` | Reformatted imports | None — remove or split to a separate PR |
A focused deep audit for changes where correctness under concurrency, failure, and scale is
the primary risk. Load data-systems-design and its references.
/review-data, data review, hazard scan, distributed review
references/04-encoding-and-evolution.md)references/07-transactions.md)references/05-replication.md)references/06-partitioning.md)references/08-distributed-systems-faults.md)references/09-consistency-and-consensus.md)references/10-batch-processing.md, 11-stream-processing.md)references/12-correctness-and-integrity.md)references/01-reliability-scalability-maintainability.md)### Data Topology
| System | Role | Written by | Kept in sync via | Divergence risk |
|---|---|---|---|---|
| Postgres `orders` | Source of truth | `orders-api` | — | — |
| Elasticsearch `orders` | Derived | `orders-api` (direct) | **Application dual write** | 🔴 Permanent divergence (H-32) |
### Invariants and Their Enforcement
| Invariant | Enforced by | Verified? |
|---|---|---|
| One charge per idempotency key | Unique index `idempotency_keys.key` | ✓ `migrations/0143` |
| No overlapping bookings | **Application `SELECT` check only** | 🔴 Not enforced under concurrency (H-02) |
### Failure Behavior Matrix
| Failure | Current behavior | Acceptable? |
|---|---|---|
| Search cluster down | Order writes fail | ✗ — should degrade, not fail |
| Duplicate webhook delivery | Duplicate refund | ✗ — needs a dedup key |
Hand off to /review-security when the data path also carries a trust boundary: a
tenant-scoped query, a token or credential store, an externally triggered webhook, or a queue
that any client can write to. Divergence between two stores is a data hazard; divergence
between an authorization decision and the data it guards is a vulnerability.
/review-security, security review, security audit, threat model, is this secure,
pentest this, review for vulnerabilities
Also invoke automatically as a subsection of /review (Section 5.2 step 6), and recommend it
from any other mode when a Section 9.2 trigger fires on a high-value path (authentication,
payments, PII, key handling).
This mode is different from the others in kind, not just in topic.
auth/reset.py:44, so an attacker who knows the user's email and
the request second can compute the token" is.### Threat Frame
- Target: [diff / component / repository]
- Assets: [what is worth attacking here]
- Adversary: [unauthenticated internet / authenticated user / other tenant / insider / compromised dependency]
- Adversary capability: [observe / modify / replay / impersonate / execute]
- Trust boundaries crossed: [list them — each one is where validation and authorization belong]
- Out of scope: [what is not being defended against here, and why]
### Attack Surface
| Entry point | Reachable by | Authenticated? | Authorized by | Input validated where | Rate limited |
|---|---|---|---|---|---|
Trace the data. For each untrusted input, follow it to every sink — interpreter, buffer, file path, URL, log, template, subprocess. For each secret, follow it from generation to storage to use to disposal.
Run the vulnerability catalog. Load security-engineering/references/vulnerability-catalog.md
and work the Quick scan order at the end of it. Use the catalog's section structure:
| Section | Covers | Deep dive, when a finding needs the argument behind it |
|---|---|---|
| A | Cipher selection and modes | 02-cryptographic-primitives-and-modes.md |
| B | Randomness, keys, and secrets | 03-randomness-and-key-management.md |
| C | Integrity and message authentication | 05-integrity-hashes-and-macs.md |
| D | Authentication protocols and freshness | 06-signatures-and-authentication-protocols.md |
| E | Identity, certificates, and trust distribution | 04-public-key-and-key-exchange.md, 07-identity-certificates-and-pki.md |
| F | Channel and transport security | 08-transport-and-channel-security.md |
| G | Access control and privilege | 09-authentication-and-access-control.md, 12-perimeter-and-trusted-systems.md |
| H | Passwords and credential storage | 09-authentication-and-access-control.md |
| I | Audit, detection, and logging | 10-intrusion-detection-and-audit.md |
| J | Untrusted input, malicious code, and availability | 11-malicious-software-and-availability.md |
Read a deep dive when you need to justify a finding to someone who will push back, or when the correct fix is not obvious from the catalog entry. Do not load all twelve to scan a diff.
Check the services actually delivered. For each security-relevant flow, fill this in. A "claimed" column with an empty "mechanism" column is the finding.
### Security Services
| Flow | Confidentiality | Origin auth | Integrity | Freshness | Access control | Availability |
|---|---|---|---|---|---|---|
| [flow] | [mechanism or ✗] | | | | | |
Check detectability. If this attack succeeded, would anyone know? Verify a security event is emitted, that it reaches a sink the attacker cannot edit, and that someone owns the alert (V-55, V-56, V-57).
Check the failure path. For every security dependency — policy service, token validator, KMS, certificate store — determine whether failure fails open or closed (V-64).
Produce output in the universal format, with the Threat Frame, Attack Surface, Security Services, and Vulnerability Scan sections, plus the exploitability addendum below.
Every 🔴 and 🟡 security finding must be reported with all six fields. A finding missing "Attack" or "Fix" is not actionable and should not be filed.
#### 🔴 V-32 — Certificate verification disabled
- **Location:** `internal/client/http.go:88`
- **Signature:** `TLSClientConfig{InsecureSkipVerify: true}` on the payments client
- **Attack:** Anyone able to intercept the route to the payment API — a compromised network
hop, a hostile DNS response, an attacker on the pod network — presents any certificate and
the client accepts it. The attacker then reads and rewrites payment requests in transit.
- **Service broken:** Peer entity authentication; integrity and confidentiality follow it.
- **Reference:** `security-engineering/references/07-identity-certificates-and-pki.md`;
Stallings §14.2, p. 419
- **Fix:** Remove the flag. For the internal CA, load it explicitly into a dedicated cert pool
rather than disabling verification. If a test needs a self-signed cert, inject the pool in
the test only, and fail startup if `InsecureSkipVerify` is set outside tests.
### Exploitability Assessment
| # | Finding | Preconditions | Adversary needed | Effort | Detectable? |
|---|---|---|---|---|---|
| 1 | V-32 | Network position between service and API | Network-adjacent | Low | No — passive attacks leave no trace |
### Attack Chains
[Where two medium findings compose into a critical one. State the chain explicitly:
"V-53 (unthrottled reset endpoint) + V-09 (predictable token) = account takeover with no
credentials." Chains are ranked at the severity of the outcome, not the components.]
### What I Could Not Determine
[Runtime config, deployment topology, WAF rules, or infrastructure not visible in the
repository — state the assumption made and what would change the finding. Do not silently
assume a control exists.]
Trigger if the diff touches any of: persistence, schema or migration, index, cache, queue or event stream, background job, replication, sharding, transaction, concurrency, retry, multi-service write, or an external API with side effects.
When triggered, load data-systems-design/references/hazard-catalog.md and report:
### Hazard Scan
| ID | Hazard | Present | Evidence | Required Fix |
|---|---|---|---|---|
| H-01 | Read-modify-write lost update | Yes | `wallet.py:88` reads balance, adds, writes | Atomic `UPDATE … SET balance = balance + ?` |
Trigger if the diff touches any of:
| Trigger | Examples in a diff |
|---|---|
| Secrets or key material | new env var, .env, key file, KMS call, token constant |
| Cryptography | encrypt/decrypt, hash, sign, verify, TLS config, cipher or mode name |
| Randomness | random, uuid, token/salt/nonce generation |
| Identity | login, signup, session, JWT, OAuth, MFA, password reset, impersonation |
| Authorization | new route or RPC, role/permission logic, tenant scoping, admin action |
| Untrusted input | request parsing, upload, deserialization, query building, subprocess, template |
| Transport | new outbound client, webhook, certificate handling, proxy config |
| Dependencies | new dependency, changed pin, new install script |
| Detection | changes to logging, audit records, or alerting |
When triggered, load security-engineering/references/vulnerability-catalog.md and report:
### Vulnerability Scan
| ID | Vulnerability | Present | Evidence | Required Fix |
|---|---|---|---|---|
| V-09 | Non-cryptographic PRNG for a security value | Yes | `auth/token.py:31` uses `random.choices` | `secrets.token_urlsafe(32)` |
| V-25 | No replay protection | No | Handler dedupes on event ID in the same transaction | — |
In /review-diff, /review-uncommitted, and /review-inscope, the scan covers only the
catalog sections the trigger table points to. In /review and /review-security, work the
full Quick scan order.
Trigger if the diff touches any of: a file read, write, copy, move, or delete, a directory walk or document ingest, a durability or crash-safety requirement, a process that the code starts, a signal handler, a daemon or long-lived worker, a thread or shared memory, a pipe, a FIFO, or a socket.
When triggered, load systems-programming/references/failure-catalog.md and report:
### Failure Scan
| ID | Failure | Present | Evidence | Required Fix |
|---|---|---|---|---|
| S-11 | Write over a file in place | Yes | `index.py:64` opens the target with `O_TRUNC` | Write a temp file in the same dir, fsync, rename, fsync the dir |
| S-07 | Durable write with no fsync | Yes | `index.py:71` reports success after `close` | `os.fsync(fd)` before reporting success |
| S-01 | Unchecked short write | No | Uses `writelines` on a buffered file object | — |
This gate catches what the hazard gate cannot see. The hazard gate asks whether the design
stays correct across machines. This gate asks whether the code stays correct against one
kernel. It applies in every language, not only C — no runtime makes two calls atomic, and
no runtime calls fsync for you.
If a gate does not trigger, say so in one line:
### Hazard, Failure & Vulnerability Scan
- Data hazard gate: not applicable — no persistence, concurrency, or messaging in this diff.
- Systems failure gate: not applicable — no file, process, signal, or socket surface.
- Security gate: not applicable — documentation and test-fixture changes only.
This is a valid and preferred outcome. Padding a scan with inapplicable entries makes the gate worthless, because reviewers learn to skim it.
| Level | Label | Meaning | Merge impact |
|---|---|---|---|
| 🔴 | Critical | Correctness bugs, exploitable vulnerabilities, data loss risk, breaking changes | Blocks merge |
| 🟡 | Medium | Missing tests, risky patterns, performance issues, defense-in-depth gaps, incomplete error handling | Should fix before merge |
| 🔵 | Nit | Style, naming, minor readability, documentation | Optional; safe to merge without |
Security severity is decided by exploitability, not by category. A weak algorithm on a path an attacker cannot reach is 🟡 or 🔵. A missing authorization check on a public endpoint is 🔴 even though the change is one line. Two 🟡 findings that chain into an account takeover are reported as 🔴 with the chain shown (Section 8.5).
For every issue above nit level, provide:
| Verdict | Meaning |
|---|---|
| NOT READY | Has 🔴 critical blockers. Must fix before merge or ship. |
| MOSTLY READY | No critical issues, but 🟡 items should be addressed first. |
| READY WITH MINOR FIXES | Only 🔵 nits remain. Safe to merge after quick polish. |
A diff with an unresolved 🔴 security finding is NOT READY, regardless of how small the change is or how much of the rest is correct.
Forbidden:
/review, which runs
the Section 7 and Section 8 protocols as subsections by design)| Need | Skill |
|---|---|
| Full pipeline (plan → detail → implement → verify) | engineer-workflow |
| Plan a change before writing it | planner |
| Expand one phase into implementable steps | detail-planning |
| Write the code for a phase | implement |
| Check an implementation against its spec | verify |
| Data and distribution design decisions and hazards | data-systems-design |
| File, process, signal, and thread rules and the failure catalog | systems-programming |
| Security design decisions, threat models, and the vulnerability catalog | security-engineering |
This skill operates independently and does not require plan.md or the engineer-workflow
pipeline. It reads the codebase and git state directly.
Use it at any point in the lifecycle: /review-uncommitted during implementation,
/review-diff before merge, /review-inscope to validate task completion, /review for
periodic audits, /review-data before shipping anything that writes to more than one place,
and /review-security before shipping anything that handles credentials, money, personal
data, or untrusted input.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
code-review, pr-review, security-audit, hazard-scan, merge-readiness
npx claudepluginhub cool-coder174/engineering-skills --plugin engineering-skills18 skills in this plugin
/capacity-engineeringFinds the resource that reaches its limit first. Proves it with a load test that resembles real traffic. Plans for the load that was measured. Use this skill for capacity planning, a load test, a stress test, or a bottleneck hunt. Use it for a question about headroom, saturation, or throughput. Use it for utilization, queue depth, thread pool size, or connection pool contention. Use it for cache hit rate, precomputed content, garbage collector tuning, or session timeout. Use it for N+1 queries, table scans, or a launch traffic forecast. Use it for load balancing policy, subsetting, and server count. The content comes from Release It! (Nygard) and Site Reliability Engineering (Beyer and others)./data-systems-designDesign-decision engine for data-intensive and distributed systems, grounded in Designing Data-Intensive Applications (Kleppmann). Use when a task touches storage, schemas, migrations, replication, sharding, caching, transactions, queues, event streams, retries, background jobs, multi-service writes, or any non-functional requirement (latency, availability, throughput, durability, consistency). Provides decision tables, a named-hazard catalog, and deep-dive references per chapter.