<< All versions

Skill v1.0.2

currentAutomated scan100/100
romiluz13/cc10x/code-review

5 files

──Details
PublishedNovember 14, 2026 at 09:23 PM
Content Hashsha256:42bc7228d9d13d1f...
Git SHA36c7b06a7c84
Bump Typepatch
Compare with v1.0.1
──Files
Files (1 file, 13.9 KB)
SKILL.md13.9 KBactive
SKILL.md · 195 lines · 13.9 KB

name: code-review description: | Two-mode skill: (1) adversarial review — spec compliance + code quality + security, confidence-scored findings with file:line evidence; (2) receiving review — verify-before- agreeing discipline for acting on external/human review feedback. allowed-tools: Read Grep Glob LSP Bash user-invocable: false metadata: version: "1.0.2"


Code Review (Adversarial + Receiving)

Reference Files

Read only what's needed:

  • references/review-order-and-checkpoints.md — review order, checkpoint discipline; load when starting a review that spans multiple files or needs a checkpointed pass
  • references/code-review-heuristics.md — heuristics, pattern recognition, false-positive prevention; load when the diff is non-trivial or before reporting zero findings (Zero-Finding Halt re-scan)
  • references/security-review-checklist.md — security review checklist; load whenever the diff touches auth, input handling, network, secrets, or data access

Run ADVERSARIAL when producing findings on a diff; run RECEIVING when acting on findings someone else produced. The Code Smells catalog, AI-Generated Anti-Patterns, Metric Honesty Rule, and Deferred Findings handling below apply in both modes.

Mode: ADVERSARIAL REVIEW

Only report issues with confidence ≥80 — below that, a finding is more likely noise than signal, and noise burns the fix loop's time and trust. Do not inflate a score to smuggle a hunch through; a genuine security hunch goes to the Summary as an open question (see the Security exception under Confidence Scoring). Every finding states category, impact, and why it matters. Present a recommendation, not a menu. Be opinionated.

Signal quality rule: One finding with file:line evidence and a fix is worth more than ten generic observations. Never report a pattern without showing where it lives.

Two-Stage Review

Stage 1: Spec Compliance — Does the code do what the plan/spec asked? Check: phase exit criteria met, interfaces match plan's Consumes/Produces, no scope drift, no missing scenarios.

Stage 2: Code Quality — Is the code well-built? Check: correctness, performance, security, clarity, test coverage.

One-fact rule: On a consequential change, find the one fact the change is safe because of — a caller invariant, a lifecycle assumption, a data-shape contract at a boundary — and spend the review proving that fact instead of enumerating maybes. The fact is usually one a breakage grep will not surface. If you cannot prove it, the change is unreviewed; the maybes you listed do not change that.

Review Order

Top-down (spec → architecture → module → function → line) for first pass. Bottom-up (line → function → module) for detail pass. See references/review-order-and-checkpoints.md.

Severity Classification

SeverityCriteria
CRITICALData loss, security breach, silent data corruption
HIGHUser-visible broken behavior
MEDIUMSuboptimal but functional
LOWCode smell, style

Confidence Scoring

ConfidenceMeaning
90-100Verified: read the code, confirmed the issue, can cite file:line
80-89Strong: read surrounding context, pattern is clear
<80Do not report — insufficient evidence

Security exception: a security-category finding below 80 confidence is NOT silently dropped. Surface it as an explicit open question in the review Summary (e.g., "Possible auth bypass at file:line — could not confirm exploit path"), not as a finding. The <80 floor drops everything else.

Parallel Review + Router Merge

When code-reviewer and failure-hunter run in parallel (BUILD workflow):

  • code-reviewer (Assessment A): correctness, performance, spec compliance. Forms opinion WITHOUT seeing the hunter's scan.
  • failure-hunter (Assessment B): silent failure scan using red-flags table. Does NOT see the reviewer's findings.
  • Router-owned merge: after both complete, the router writes a merged findings summary into the workflow artifact before verifier handoff. Where both agree → high confidence. Where the hunter caught what the reviewer missed → keep. Where the hunter finding is a false positive → drop with reason. Contradictory verdicts: the blocking verdict is authoritative (CHANGES_REQUESTED over APPROVE, FAIL over PASS) and is logged in status_history, except that a re-raised finding whose dispute the verifier upheld (DISPUTE_UPHELD) is dropped by the router and one whose dispute is still in flight continues to the verifier.

Zero-Finding Halt

Zero findings on a non-trivial change → insufficient depth, not perfect code. Re-scan against heuristics and security checklist before reporting zero findings: APPROVE for code-reviewer, CLEAN for failure-hunter. A zero-finding APPROVE also needs at least three positive assertions with file:line evidence, the router's validity check, which triggers fallback inline verification when they are missing.

Code Smells (Fowler Catalog)

Scan for these 16 named smells during review. Each is actionable — not a style preference. "Messy" is not actionable; "Mysterious Name" is. Each smell is a labelled heuristic and always a judgement call ("possible Feature Envy"), never a hard violation:

SmellSignalFix
Mysterious NameFunction/variable name doesn't reveal intentRename to describe what it does
Long MethodMethod > 20 lines doing multiple thingsExtract sub-methods
Long Parameter List> 4 parameters — consider parameter objectExtract into an object
Large ClassClass with too many responsibilitiesSplit by responsibility
Data ClassHolds data, no behavior — anemic domain modelMove behavior in, or inline the class
Duplicated CodeSame logic in 3+ placesExtract shared function
Feature EnvyMethod reads more from another class than its ownMove method to the class it envies
Shotgun SurgeryOne change requires touching many filesConsolidate responsibility
Divergent ChangeOne class changes for different reasonsSplit into separate classes
Primitive ObsessionUsing primitives where a small value object would add meaningCreate a value object
Repeated SwitchesSame switch/if-else on a type across filesReplace with polymorphism
Speculative GeneralityAbstraction for future use that never comesDelete it (YAGNI)
Message Chainsa.b().c().d() — client knows the object graphHide the chain behind a method
Middle ManClass just delegates to another — adds no logicRemove the middleman, use the real object
Refused BequestSubclass doesn't use parent's methodsReplace inheritance with composition
Data Clumps3+ values always passed togetherExtract into an object

Repo standards override baseline: if the repo's documented conventions endorse something this baseline would flag, suppress the smell.

AI-Generated Anti-Patterns

Patterns commonly produced by AI code generation — flag with elevated priority:

  • Over-eager memoization — useMemo/useCallback/React.memo wrapping everything without profiling evidence
  • State duplication — same state stored in 2+ places, kept in sync manually (source of truth unclear)
  • Sequential awaits — independent async calls awaited sequentially instead of Promise.all (latency multiplier)
  • Over-fetching — fetching full objects (or more than the current view needs) when only one field is needed
  • Premature abstraction / speculative generality — interface with single implementation "for future flexibility"
  • Configurable when it should be constant — adding options/flags for flexibility nobody asked for
  • Defensive coding for impossible states — null checks / over-engineered error handling for scenarios that can't happen (values typed non-nullable, internal code boundaries)
  • Test mirrors implementation — test recomputes expected value using the same logic as the code (tautological test)
  • Factory overkill — factory pattern for objects with no polymorphism
  • Type assertions instead of type guards — as any/as Type instead of narrowing with a runtime check

Metric Honesty Rule

Never fabricate metrics. An LLM reading static source code cannot measure real-world LCP, INP, CLS, memory usage, or runtime performance.

  • Can assess from code: algorithmic complexity (O(n) vs O(n²)), N+1 query patterns, obvious hot loops, missing indices
  • Cannot assess from code: real-world latency, actual memory pressure, real INP/LCP/CLS values

State what you CAN verify from code. Tag anything else as "potential impact, not measured" — never invent numbers. Recommend specific tools (Lighthouse, profiler, benchmark suite) when runtime measurement is the real answer.

Deferred Findings (Not "Residual" — Already Wired)

Findings of any severity that do not block and that you don't fix in this pass (the router's non-blocking "Minor" class) are NOT dropped, but you do NOT need a separate file or a separate CONTRACT field for them. Just report them normally with severity and file:line in your output. The router already handles persistence: it reads your findings, appends every non-blocking item to the workflow artifact's deferred_findings array (source, phase, finding, severity), and surfaces the accumulated list for explicit user triage at BUILD-DONE finishing. Nothing is silently discarded — this is automatic on the router side, not something you need to engineer in your response.

False Positive Prevention

Do NOT flag:

  • Code that matches an explicit project convention (check patterns.md)
  • Intentional simplification documented in the plan
  • Test-only code using test patterns (mocks, fixtures, stubs)
  • Performance "issues" without a measured bottleneck
  • Style preferences that don't match project conventions

Mode: RECEIVING REVIEW

Discipline for acting on external/human review feedback (pasted PR comments, review notes, "can you change X"). This governs the MAIN session, not the internal reviewer→router→fix loop.

The 6-Step Loop

  1. Read all feedback before responding to any item
  2. Categorize each item: CRITICAL (must fix), IMPORTANT (should fix), MINOR (optional), REJECT (with reason) — triage labels for received feedback, not the review severities above
  3. Verify before agreeing — don't blindly accept. Check if the feedback is correct against the code.
  4. Fix accepted items — CRITICAL first, then IMPORTANT
  5. Push back on rejected items — with evidence, not opinion
  6. Report — what was fixed, what was rejected and why

Verify Before Agreeing

Before implementing a suggestion, check:

  • Does the issue actually exist in the code? (read the file:line)
  • Is the suggested fix correct? (would it actually fix the issue?)
  • Does the fix introduce new problems? (side effects, breaking changes)
  • Is the suggestion based on a correct understanding of the code?

YAGNI-Grep Before Implementing

Before implementing a suggestion, grep the codebase for the pattern the reviewer claims is wrong. If the pattern is project convention (appears in many places, is in patterns.md), push back. If it's genuinely isolated, fix it.

When To Push Back

SituationResponse
Reviewer misunderstood the codeExplain with file:line evidence
Suggestion contradicts project conventionCite the convention, push back
Suggestion adds unnecessary complexityYAGNI — state why the simpler approach is better
Suggestion is correct but out of scopeAcknowledge, defer to a follow-up
Suggestion is a style preferenceAcknowledge, apply only if it matches project conventions

Known misbehaviors (external review surfaces)

Feedback arrives through gh or pasted text; both misbehave in known ways. Symptom → detection → fallback. Do not burn the fix loop retrying a misbehaving surface.

SymptomDetectionFallback
Comments predate your latest push (stale review state)Compare comment updated_at, not created_at — an edited comment keeps its old creation time. gh pr view --json does not expose updatedAt; use gh api repos/{owner}/{repo}/issues/<n>/comments --jq '.[].updated_at' for issue comments and gh api repos/{owner}/{repo}/pulls/<n>/comments --jq '.[].updated_at' for inline comments, and gh pr view --json reviews --jq '.reviews[].submittedAt' for review bodies (reviews expose submission time only), all vs the latest pushTreat pre-push comments as already-addressed candidates; verify each against current HEAD before acting
gh returns 401 / "To get started with GitHub CLI"gh auth statusReport BLOCKED on auth and ask the user; never retry the call in a loop
"API rate limit exceeded"gh api rate_limit --jq .rateWait until the reset time once, or ask the user to fetch; never tight-loop retries
Pasted line numbers no longer match (rebased/squashed diff)Compare the comment's referenced hunk against the current fileMap by content, not line number; if ambiguous, ask the reviewer — never guess which line was meant

When the user explicitly requests repeated review cycles, name the iteration cap before the first cycle; at the cap, stop and report, resolving each remaining finding by fixing it or rebutting it with stated grounds. A single requested review starts no score loop.

Precedence

Pushing back ≠ refusing. You must either fix the issue or provide evidence why it's not an issue. "I prefer my way" is not a valid push-back. "This is project convention, see patterns.md line X" is valid.

Never perform agreement. "You're absolutely right!" commits you to unverified feedback. Verify before implementing: restate the technical requirement, push back with reasoning, or just do the work and show the fix.

← v1.0.1All versions