agentleFS
NYTC69NYTC69/review-loop/skills/review-pr/SKILL.md

review-pr

Skill3 starsChanged 7 months agoApache-2.0View on GitHub

Comprehensive code review using specialized agents. Each agent focuses on a different quality aspect (code, errors, comments, types, tests, simplify). Runs sequentially by default or in parallel on request.

96 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use build-graph, review-delta and 10 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.
  • n24q02mSkill

    build-graph

    Build or update the code review knowledge graph. Run this first to initialize, or let hooks keep it updated automatically.

    Also in 3 projects that use this

  • n24q02mSkill

    review-delta

    Review only changes since last commit using impact analysis. Token-efficient delta review with automatic blast-radius detection.

    Also in 3 projects that use this

  • jasoncrawfordSkill

    work-on

    Use to kick off work on a feature, bug, or task

    Also in 3 projects that use this

  • DockerSkill

    fix-issue

    Fix a single GitHub issue end-to-end: triage, research, write the fix, review, and create a PR. Use when asked to fix an issue: "fix issue 1234", "resolve #500", "create a PR for issue 200".

    Also in 6 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

  • SentrySkill

    create-pr

    Create pull requests following Sentry conventions. Use when opening PRs, writing PR descriptions, or preparing changes for review. Follows Sentry's code review guidelines.

    Also in 21 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. 0 are common, 8 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 91 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

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

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

    Run a comprehensive code review using multiple specialized agents, each focusing on a different aspect of code quality.

    line 9
  2. Distinctive:

    Run git diff --name-only to identify unstaged changed files (this is the default scope).

    line 23
  3. Distinctive:

    If no changes are found at all, tell the user and stop.

    line 26
  4. Distinctive:

    Run git diff (or git diff --cached) to capture the full diff content — this is what agents will review.

    line 32
  5. Very specific:

    Read .review-loop/config.md if it exists.

    line 47
  6. Very specific:

    When all is selected, determine applicable aspects based on the changed files:

    line 71
  7. Very specific:

    simplify runs last: when selected — it applies changes, so it goes after all read-only reviews complete.

    line 75
  8. Distinctive:

    Keep cwd in the task workspace and resolve the launcher against the support repository:

    line 90
  9. Very specific:

    Keep the existing judgment/cheap tier rules in the dispatch inventory.

    line 97
  10. Distinctive:

    If zero tool uses are confirmed, discard the report and retry once with a new slot.

    line 158
  11. Very specific:

    CRITICAL — single spawning path: Do NOT use subagent_type: review-loop:code-simplifier.

    line 165
  12. Distinctive:

    Run agents one at a time in this order:

    line 196
  13. Distinctive:

    After each agent completes, display its findings to the user before proceeding to the next.

    line 204
  14. Very specific:

    Run simplify last if selected (never in parallel — it modifies files)

    line 212
  15. Distinctive:

    After all agents complete, compile a unified summary:

    line 218
  16. Very specific:

    If simplify was run, also note:

    line 245

“Common” is measured: kept by at least 6 in 10 of the 91 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

Comprehensive Code Review

Run a comprehensive code review using multiple specialized agents, each focusing on a different aspect of code quality. Report-only reviewers use fresh isolated native CLI processes; code-simplifier remains a writer via the Agent tool.

At entry, read the reviewer runtime contract. Its launcher, permission, completion, and accounting requirements apply to every report-only dispatch below. A general-purpose Agent is not a read-only boundary.

Review Aspects (optional): "$ARGUMENTS"


Step 1 — Determine Review Scope

  1. Run git diff --name-only to identify unstaged changed files (this is the default scope). If there are no unstaged changes, fall back to git diff --cached --name-only (staged changes).
  2. If no changes are found at all, tell the user and stop.
  3. Parse $ARGUMENTS to detect:
    • Aspect selection: one or more of code, errors, comments, types, tests, simplify, all. Default: all.
    • Execution mode: parallel keyword triggers parallel mode. Default: sequential.
  4. Run git diff (or git diff --cached) to capture the full diff content — this is what agents will review.

Display to the user:

── review-pr ──────────────────────────────────────
Scope: git diff (unstaged changes)
Files: {N} changed
Aspects: {selected aspects or "all"}
Mode: {sequential | parallel}
────────────────────────────────────────────────────

Step 1.5 — Load shared tier config

Read .review-loop/config.md if it exists. Extract:

  • judgment_model: shared tier override for judgment-tier review agents
  • cheap_model: shared tier override for cheap-tier review agents; if absent, cheap-tier dispatches backstop to claude-opus-5-5
  • review_style: optional review tone / cross-cutting rules

Missing agent tier defaults to judgment.


Step 2 — Available Review Aspects

Each aspect maps to a specialized agent in the agents/ directory:

AspectAgentWhen applicable
codecode-reviewerAlways (general code quality)
errorssilent-failure-hunterAlways (error handling analysis)
commentscomment-analyzerIf comments/docs added or changed
typestype-design-analyzerIf types added or modified
testspr-test-analyzerAlways (checks if changes lack tests too)
simplifycode-simplifierAfter other reviews pass (polish)

When all is selected, determine applicable aspects based on the changed files:

  • Always run: code, errors, tests (catches missing tests for new code too)
  • If comments or docs changed: comments
  • If type definitions added/modified (interfaces, type aliases, classes): types
  • simplify runs last when selected — it applies changes, so it goes after all read-only reviews complete.

Step 3 — Launch Review Agents

For each applicable report-only aspect, use the isolated native launcher below. The simplify writer has its own Agent invocation after these reviews.

Report-only agents (code, errors, comments, types, tests)

Inline the selected role body into the raw report prompt below and save that same prompt to .review-loop/tmp/{invocation_slot}-reviewer-prompt.txt. Include the absolute target repository path. Give each aspect/attempt a unique slot. Keep cwd in the task workspace and resolve the launcher against the support repository:

python3 <support-root>/scripts/run_claude_reviewer.py --session-id <invocation_slot> --parent-session-id <session_id> --model <resolved-model> --stage polish --role <agent-name> --timeout-seconds 570

Keep the existing judgment/cheap tier rules in the dispatch inventory. Its else omit means no judgment-tier override: omit --model and use the Claude CLI runtime default. Record the actual model only when the CLI reports it. Do not silently select a different tier or launch a writable Agent.

Reviewers only read/search. The caller materializes the diff and runs any required static analysis or tests, then supplies artifact paths, commands, exit statuses, and relevant output. The runtime boundary takes precedence over any role-body instruction to use Bash, install tools, or modify files. Preserve the aspect's raw report format; do not wrap it in a planning-review schema.

Native reviewer prompt:
  prompt: |
    {contents of agents/<agent-name>.md body}

    Review the following code changes. Focus on your area of expertise.
    Report only; do not modify files.
    Use read/search tools only; inspect the caller-provided verification
    evidence and request missing checks instead of executing commands yourself.

    ## Target Repository
    {absolute task repository path}

    ## Changed Files
    {list of changed file paths}

    ## Diff
    {git diff output}

    ## Caller Verification Evidence
    {artifact paths, commands, exit statuses, relevant output, or no checks run}

    Provide your findings as a structured report with:
    - **Critical Issues** (must fix)
    - **Important Issues** (should fix)
    - **Suggestions** (nice to have)
    - **Positive Observations** (what's done well)

    Reference specific files and line numbers where possible.

Role mapping (inline each role body into the native launcher prompt):

  • code → inline agents/code-reviewer.md body
  • errors → inline agents/silent-failure-hunter.md body
  • comments → inline agents/comment-analyzer.md body
  • types → inline agents/type-design-analyzer.md body
  • tests → inline agents/pr-test-analyzer.md body

Concrete dispatch inventory:

  • review_pr_code_reviewer_dispatch -> code-reviewer; tier: judgment; model: {judgment_model if set; else omit}
  • review_pr_silent_failure_hunter_dispatch -> silent-failure-hunter; tier: judgment; model: {judgment_model if set; else omit}
  • review_pr_comment_analyzer_dispatch -> comment-analyzer; tier: cheap; model: {cheap_model if set; else claude-opus-5-5}
  • review_pr_type_design_analyzer_dispatch -> type-design-analyzer; tier: judgment; model: {judgment_model if set; else omit}
  • review_pr_pr_test_analyzer_dispatch -> pr-test-analyzer; tier: cheap; model: {cheap_model if set; else claude-opus-5-5}

Completion and inspection evidence: Accept a report only when launcher exit is 0 and returned status is ok; read its returned result_file and validate the aspect's report. Retain invocation_id, tool_uses, stream_file, stderr_file, and usage_file from the native return metadata. Use the launcher’s tool_uses count; do not read the raw stream into context. A missing or null count is unverified and fails closed. If zero tool uses are confirmed, discard the report and retry once with a new slot; if still zero, skip this aspect and report the failure. Never reuse a previous result as fresh.

The simplify aspect

The code-simplifier agent modifies files to apply simplifications.

CRITICAL — single spawning path: Do NOT use subagent_type: review-loop:code-simplifier. This writer uses general-purpose; report-only reviewers use the native launcher above. Use subagent_type: general-purpose with the agent's full body inlined in the prompt:

Agent tool parameters:
  subagent_type: general-purpose
  prompt: |
    {full body of agents/code-simplifier.md — everything below the frontmatter}

    ## Changed Files to Simplify
    {list of changed file paths}

    ## Diff
    {git diff output}

    Review the changed code and apply simplifications directly.
    After making changes, summarize what you simplified and why.

Concrete dispatch anchor: review_pr_code_simplifier_dispatch. code-simplifier is a cheap-tier dispatch and resolves model as cheap_model if set, else claude-opus-5-5.

Important: simplify always runs last (after all read-only reviews), because it modifies files. Skip simplify if any prior review returned CRITICAL issues — fix those first, then re-run with simplify.

Sequential mode (default)

Run agents one at a time in this order:

  1. code (general quality first — sets the baseline)
  2. errors (error handling)
  3. comments (if applicable)
  4. types (if applicable)
  5. tests (if applicable)
  6. simplify (if selected — always last)

After each agent completes, display its findings to the user before proceeding to the next.

Parallel mode

Launch all report-only reviewers simultaneously through the same isolated native launcher, using distinct prompt/artifact slots. Wait for all to complete, then:

  1. Display all findings together
  2. Run simplify last if selected (never in parallel — it modifies files)

Step 4 — Aggregate Results

After all agents complete, compile a unified summary:

# Code Review Summary

## Critical Issues ({count} found)
- [{agent-name}] Issue description [file:line]
- ...

## Important Issues ({count} found)
- [{agent-name}] Issue description [file:line]
- ...

## Suggestions ({count} found)
- [{agent-name}] Suggestion [file:line]
- ...

## Strengths
- What's done well (from agent observations)

## Recommended Actions
1. Fix critical issues first
2. Address important issues
3. Consider suggestions
4. Re-run `/review-loop:review-pr` after fixes to verify

If simplify was run, also note:

## Simplifications Applied
- {file}: {what was simplified}

Usage Examples

Full review (all applicable aspects, sequential):

/review-loop:review-pr

Specific aspects:

/review-loop:review-pr tests errors
# Reviews only test coverage and error handling

/review-loop:review-pr comments
# Reviews only code comments

/review-loop:review-pr simplify
# Simplifies changed code

Parallel review:

/review-loop:review-pr all parallel
# Runs report-only aspects in parallel, then simplify last

Combine:

/review-loop:review-pr code errors parallel
# Reviews code quality and error handling in parallel

Agent Descriptions

code-reviewer:

  • Checks CLAUDE.md / project guideline compliance
  • Detects bugs, logic errors, and anti-patterns
  • Reviews general code quality and style

silent-failure-hunter:

  • Finds silent failures and swallowed errors
  • Reviews catch blocks and error propagation
  • Checks error logging adequacy

comment-analyzer:

  • Verifies comment accuracy vs actual code
  • Identifies comment rot and stale docs
  • Checks documentation completeness

type-design-analyzer:

  • Analyzes type encapsulation and invariants
  • Reviews type design quality
  • Rates invariant expression strength

pr-test-analyzer:

  • Reviews behavioral test coverage
  • Identifies critical test gaps
  • Evaluates test quality and assertions

code-simplifier (has write access):

  • Simplifies complex or verbose code
  • Improves clarity and readability
  • Applies project standards
  • Preserves all existing functionality

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.