agentleFS
helloternhellotern/Sextant/skills/review-code/SKILL.md

review-code

Skill15 starsChanged 8 months agoMITView on GitHub

You MUST use this skill before evaluating, commenting on, or giving feedback on any code. Use when the primary request is to assess existing code — quality, correctness, style, or readiness to merge. Stronger signals: "review", "PR", "pull request", "code review", "check this code", "is this correct", "review this file", "give me feedback on", "look at this diff". Takes highest priority when the primary request is to evaluate code rather than write or fix it. Use sextant:security instead when the review focus is specifically on security vulnerabilities.

41 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use review-deps, review-security and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • cjohnhansonSkill

    review-deps

    Judge dependencies, advisories, and licences. Use as a required review, or as /review-deps. Not for how a dependency is called: review-code covers that.

    Also in 3 projects that use this

  • PydanticSkill

    review-security

    Security review of the current branch against its merge base — sandbox escapes, memory errors, panics and resource-limit bypasses. Use when reviewing changes for security risk, or before merging anything touching the heap/ module, path_security.rs, the wire protocol or the pool.

    Also in 5 projects that use this

  • dirkkok101Skill

    review-design

    Use before /plan, after /technical-design, when user says "review design", "check the design", or when design quality is uncertain.

    Also in 4 projects that use this

  • JetBrainsSkill

    review-plan

    Manually re-run the autonomous plan review (Phase 2 — consistency + structural). The same review runs automatically as the first phase of /execute-tracks; this command is for re-runs after inline replanning or whenever the plan needs explicit re-validation. TRIGGER when: user asks to re-validate the plan after inline replanning; user requests explicit plan review outside /execute-tracks. SKIP: /execute-tracks already running State 0 in this session (autonomous Phase 2 path will fire) — do not double-run.

    Also in 5 projects that use this

  • Microsoft AzureSkill

    review-pr

    Review a pull request for functional issues, coding guideline adherence, and best practices. Use this when asked to review, inspect, or provide feedback on a pull request (Azure DevOps or GitHub). Proposes comments for user approval before posting.

    Also in 4 projects that use this

  • Microsoft AzureSkill

    test

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 34 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do NOT call any Edit/Write/file-modification tool during this session.

    line 47
  2. Distinctive:

    If you feel compelled to fix something, add it to [Must Fix] with a suggestion instead.

    line 48
  3. Distinctive:

    Before reviewing any line of code, first clarify three questions:

    line 98
  4. Distinctive:

    If the above information is incomplete, first confirm intent with the author before starting the review.

    line 106
  5. Distinctive:

    After understanding the change intent, establish the surrounding context — don't just look at the diff.

    line 110
  6. Distinctive:

    DRY check: Look for logic blocks appearing 2+ times.

    line 150
  7. Distinctive:

    Idempotency: If an operation might be executed multiple times (retry, duplicate consumption), are results consistent?

    line 158
  8. Distinctive:

    Give specific suggestions: Don't just say "this is bad" — say "suggest changing to X, because…"

    line 204
  9. Distinctive:

    Acknowledge uncertainty: Put uncertain items in "Confirm Items," don't pretend to be certain

    line 206

“Common” is measured: kept by at least 6 in 10 of the 34 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

!../principles/SKILL_BODY.md

!../tool-gitnexus/SKILL_BODY.md


Code Review Workflow

Core Principle

The goal of code review is not to find fault, but to discover design flaws, logic vulnerabilities, and architecture risks before code is merged. Review quality depends on the reviewer's depth of understanding of the change context — the deeper the understanding, the more fundamental the issues found.


Before You Start

Operating Mode — Declare Before Starting

Before reading a single line of code, output this declaration as the first line of your response:

Mode: Review-only  — reason: <one phrase>

or

Mode: Review+patch — reason: <one phrase>

Mode selection rules:

SignalMode
"review this PR/code", user submitted code for evaluationReview-only
"review and fix", "find and fix issues", you wrote the codeReview+patch
AmbiguousReview-only — declare it and ask at the end if fixes are wanted

Review-only constraints (hard rules, not guidelines):

  • Do NOT call any Edit/Write/file-modification tool during this session.
  • If you feel compelled to fix something, add it to [Must Fix] with a suggestion instead.
  • Exception: user explicitly upgrades to Review+patch mid-session ("go ahead and fix it") — before making any changes, output: Mode upgrade: Review-only → Review+patch and then proceed.

Review+patch constraints:

  • Complete the full review output first. Do not patch silently.
  • Apply only Must Fix items after the review block is complete.
  • Suggested Improvements and Confirm Items remain output-only — no unilateral patch.

Reviewer Role

  • You are a gatekeeper, not a rewriter — point out problems and risks; don't rewrite the author's code (Review-only mode)
  • You are a second pair of eyes, not a style police — focus on logic correctness and architecture compliance; leave style to the linter
  • You are a collaborator, not a judge — give specific improvement suggestions, not abstract negations

Tailoring Review Scope

Change ScaleReview Depth
< 50 lines, within a single fileQuick review: baseline rules + logic correctness
50–300 lines, cross-file but not cross-moduleStandard review: complete workflow
> 300 lines, or cross-module / involves public interfacesDeep review: complete workflow + full architecture compliance check

Complete Execution Workflow

Progress tracking: Output the progress block twice per step:

  1. Before starting the step — mark it → — in progress, then immediately do the work.
  2. After completing the step — output the block again with that step marked ✓ — <one-line finding>.

Do NOT batch all updates into a single block at the end. Each step must print its own start and completion block.

For Quick reviews show only Steps 1, 5, 7; for Standard reviews show Steps 1–2, 4–7; for Deep reviews show all steps.

Example mid-review (just finished Step 2, about to start Step 3):

Code Review Progress
✓ Step 1: Understand Change Intent   — <one-line finding>
✓ Step 2: Establish Change Context   — <one-line finding>
→ Step 3: Architecture Compliance    — in progress
○ Step 4: Code Quality
○ Step 5: Logic Correctness
○ Step 6: Impact Scope
○ Step 7: Review Conclusion

Step 1: Understand the Change Intent

Before reviewing any line of code, first clarify three questions:

  • What problem does this change aim to solve? (Requirement/Bug/Optimization/Refactor)
  • What is the expected behavior after the change?
  • Why was this approach chosen? (Are there rejected alternative solutions?)

Information sources: PR description, commit message, associated issue/ticket, communication with the author.

If the above information is incomplete, first confirm intent with the author before starting the review.

Step 2: Establish Change Context

After understanding the change intent, establish the surrounding context — don't just look at the diff; understand the environment where the diff lives.

What to understand:

  • What was the modified function/class originally doing? How has the behavior changed?
  • Which callers does the modified code have? Do they depend on the behavior that is about to change?
  • Have the dependencies of the modified code also been synchronously modified?
  • Does the change involve public interfaces? If so, is it backward compatible?

🔗 When GitNexus is available, use context / impact MCP tools to map change context.

Step 3: Architecture Compliance Review

─── Architecture Compliance Checklist ───────────────
[ ] Is the layering correct? Any layer-crossing calls in the change?
    (Entry Layer → Logic Layer → Data Layer → Infrastructure Layer, no reversal)
[ ] Has any new circular dependency been introduced?
[ ] Has any existing module's boundary been violated?
    (No direct references to another module's internal implementation)
[ ] Is the dependency direction compliant? Any reverse dependencies?
[ ] Does it follow the Hollywood Principle?
    (Dependencies obtained through injection, not self-constructed/pulled)
[ ] Are shared data structures (DTO / Event) placed in the shared layer?
─────────────────────────────────────────────────────

Step 4: Code Quality Review

Baseline rules (§0 above — must check regardless of change scale).

SOLID principles (add for medium and above changes):

PrincipleReview Points
SRPDoes the new/modified function do only one thing? Can its responsibility be described in one sentence (without "and")?
OCPIs new behavior added through extension or by modifying existing stable code?
LSPIf subclasses are involved, can they transparently replace the base class? Any empty implementations?
ISPIf interfaces are involved, are implementors forced to implement unused methods?
DIPDo higher-layer modules directly depend on concrete implementations? Are dependencies obtained through injection?

DRY check: Look for logic blocks appearing 2+ times. Flag cross-file duplication only when function signatures are identical AND the logic body exceeds 10 lines.

Step 5: Logic Correctness Review

Review points:

  • Boundary conditions: Are null values, zero values, negatives, empty collections, over-long strings, and concurrency scenarios handled?
  • Error paths: Is the behavior under exceptional conditions as expected? Are error messages meaningful?
  • State consistency: Is there rollback or compensation when operations fail?
  • Idempotency: If an operation might be executed multiple times (retry, duplicate consumption), are results consistent?
  • Security: Any injection risks? Are permission checks in place? Is sensitive data masked?

Logic review mental framework:

For each branch path in the change, ask three questions:
1. Under what conditions will this branch be entered? (Trigger condition)
2. What happens when it's entered? (Side effects, state changes)
3. If something goes wrong in this branch, what happens? (Error propagation path)

Step 6: Impact Scope Confirmation

─── Impact Completeness Checklist ───────────────────
[ ] Have all callers been adapted to the change? Any missed callers?
[ ] If a public interface was modified, is it backward compatible? If not, is there an explanation?
[ ] Have related type definitions / DTOs / Events been updated synchronously?
[ ] Have related unit tests been updated synchronously? Do they cover new/changed behavior?
[ ] Have related documentation / comments / CHANGELOG been updated synchronously?
[ ] Have related configs / routing / registries been updated synchronously?
─────────────────────────────────────────────────────

Step 7: Output Review Conclusion

─── Review Conclusion ───────────────────────────────
Change summary: <one sentence describing the change content and purpose>
Review result: ✅ Approved / ⚠️ Approved with changes / ❌ Needs redesign

[Must Fix] (must resolve before merge)
  1. <issue description> — <specific location> — <fix suggestion>

[Suggested Improvements] (doesn't block merge, but recommended)
  1. <issue description> — <improvement direction>

[Confirm Items] (questions requiring author confirmation)
  1. <question description>

Impact assessment: <actual impact scope; is it consistent with expectations>
─────────────────────────────────────────────────────

Output discipline:

  • Classify issues: Distinguish "must fix" from "suggested improvement"
  • Give specific suggestions: Don't just say "this is bad" — say "suggest changing to X, because…"
  • Point to the location: Precise to file name and line range
  • Acknowledge uncertainty: Put uncertain items in "Confirm Items," don't pretend to be certain

Forbidden Actions

  • Style-first: Nitpicking personal style preferences on logically correct, architecturally compliant code
  • Vague negation: "This code feels wrong" but can't identify specific problems
  • Overstepping rewrite (Review-only): Providing large blocks of replacement code — the reviewer provides direction
  • Silent patch (Review+patch): Fixing issues without first producing the review output — always document findings before patching
  • Context-free review: Starting line-by-line review without reading PR description or understanding change intent
  • All or nothing: Rejecting an entire PR because of one minor issue

Common Review Blind Spots

Blind SpotTypical OmissionReview Method
Indirect callersOnly checked direct callers, missed code that depends indirectly via interfaces/eventsTrace event bus and interface implementations
Error propagationOnly reviewed the happy path, ignored behavior under exception pathsReview each catch/except block
Data racesOnly reviewed single-threaded logic, ignored shared state under concurrencyIdentify all readers/writers of shared state
Backward compatibilityOnly reviewed new behavior, ignored whether old callers still workCheck usage patterns of all callers
Ghost dependenciesOnly reviewed code dependencies, ignored config/env vars/database schemaCheck config and external dependencies
Duplicate implementationNewly added code duplicates functionality of existing codeSearch for similar implementations

Reply Format

Review Summary:

#ItemDetail
[1]Conclusion<one sentence: change summary + overall verdict (Approved / Changes needed / Redesign)>
[2]Findings<Must Fix items + Suggested Improvements, each with location and fix suggestion>
[3]Risks / Assumptions<impact scope; assumptions about change intent or caller behavior>
[4]Verification<Steps 3–6 checklist coverage: which checks passed, which were skipped and why>
[5]Needs your input<Confirm Items — questions requiring author clarification before re-review>

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.