agentleFS
lastxuanainlastxuanain/ainward-skills/skills/agent-review/SKILL.md

agent-review

Skill5 starsChanged 10 days agoMITView on GitHub

Isolated subagent read-only code and 3D call-graph regression review ("fix A, break B"). Triggers: /agent-review, "agent review", "independent review", "review my changes", "审查一下", "独立审查", "独立代码审查".

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use commit.

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.
  • SentrySkill

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 2 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run an unbiased, evidence-backed, read-only code and regression audit across any stack—delegating to an isolated subagent to strip away …

    line 15
  2. Distinctive:

    Prefer an agent type that has no file-edit tools, so read-only is enforced by the host rather than by the prompt alone.

    line 46
  3. Very specific:

    Antigravity: if subagent "agent-review" is not yet defined in this conversation, call define_subagent with Name: "agent-review", …

    line 49
  4. Very specific:

    If Pass or P2-only (zero P0/P1): stop cleanly with no question card.

    line 93
  5. Very specific:

    If P0 or P1 blockers exist: open one ask_question card below the report:

    line 94
  6. Very specific:

    When fixing: apply targeted edits in the main session and run fast local checks.

    line 99
  7. Very specific:

    Read project rules (AGENTS.md, CLAUDE.md, GEMINI.md, .cursor/rules/*, .agents/rules/*) in <Target Workspace> and scale depth to what …

    line 111
  8. Very specific:

    Never demand enterprise layers (DTO/DDD) the project does not use.

    line 115
  9. Very specific:

    Never audit only the git diff—expand in 3 dimensions around <Scope> (excluding unrelated parallel dirty files outside <Scope>):

    line 116

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

Agent Review (全链路独立代码审查)

Run an unbiased, evidence-backed, read-only code and regression audit across any stack—delegating to an isolated subagent to strip away implementer confirmation bias, tracing upstream callers, downstream dependencies, and lateral shared components ("fix A, break B" / "修 A 坏 B"), and reporting confirmed defects in plain language with clickable code links.

When to use & boundary

  • Pre-commit, pre-PR, or post-coding independent review of changes in the current session, working tree, or specified commits/branches/worktrees.
  • The reviewer subagent never modifies the repository. Code changes happen in the main session only after findings are reported and the user approves.

Host adaptation

  • ask_question below means the host's single-choice question tool (AskUserQuestion in Claude Code, ask_question in Antigravity). Without one, print the options as a numbered list and wait for a reply. Never add a manual "Other" option when the host adds one natively.
  • Code links follow the host's own convention first (e.g. relative [orderService.ts](src/order/orderService.ts:42) in Claude Code); otherwise [orderService.ts](file:///abs/path/orderService.ts#L42-L58), falling back to plain path/orderService.ts:42-58. Use basenames as link text; no raw full-path walls.
  • Template labels below are written in Chinese for brevity; translate them into the requested output language.

Part 1: Main-Session Dispatch & Delivery

1. Spawn an Isolated Reviewer Subagent

Prefer an agent type that has no file-edit tools, so read-only is enforced by the host rather than by the prompt alone.

  • Antigravity: if subagent "agent-review" is not yet defined in this conversation, call define_subagent with Name: "agent-review", Description: "Independent read-only full-chain code and regression reviewer", EnableWriteTools: true (required because EnableWriteTools: false strips run_command, breaking read-only git diff/git status/rg; every file or repo mutation remains prohibited by Part 2), EnableSubagentTools: false, and SystemPrompt set to Part 2. Invoke invoke_subagent leaving Workspace unset / "inherit" so any sibling <Target Workspace> worktree stays readable via read_file and git -C <Target Workspace>.
  • Claude Code: spawn via the Agent tool, passing the Dispatch Packet and Part 2. Pick, in order: a user-defined reviewer agent whose tools exclude Edit/Write; the built-in read-only Plan type; otherwise the general-purpose agent.
  • Codex / other subagent hosts: spawn a fresh subagent (Task or equivalent) with the Dispatch Packet and Part 2, choosing a read-only sandbox or tool set when the host offers one.
  • Single-session fallback (no subagent tools): prepend > [Single-Session Fallback] Auditing directly from raw diffs and call chains. Discard prior-turn assumptions and execute Part 2 directly.

2. Contamination-Free Dispatch Packet

Pass only objective facts to the subagent—never the main agent's implementation summary, rationale, excuses, or "tests pass" claims:

  1. Target Workspace: exact repo/worktree path on disk (defaults to the current workspace; all file reads and git -C <Target Workspace> run against it).
  2. Scope:
    • Explicit scope: exact paths, commits, or branch ranges supplied by the user (verbatim);
    • Session-touched default: if files were created/edited/deleted earlier in this conversation, pass Session-Touched Files: [<paths>] (audit these and their call/peer graph while ignoring unrelated parallel dirty files);
    • Workspace fallback: uncommitted git status / git diff (grouped cohesively to exclude unrelated parallel work; git show HEAD if clean).
  3. Verbatim User Goal & Language: quote only the user's original prompt or spec path verbatim (None provided if unavailable), plus the output language.

3. Relay Intact & Conditional P0/P1 Fix Gate

  • Relay verdicts, P0/P1/P2 severities, [推测] tags, and Not verified blind spots intact, without softening or adding findings.
  • If Pass or P2-only (zero P0/P1): stop cleanly with no question card.
  • If P0 or P1 blockers exist: open one ask_question card below the report:
    • (Recommended) 一键修复全部 P0/P1 问题并验证
    • 连同 P2 建议一并修复
    • 暂不改代码,我自行处理
  • When fixing: apply targeted edits in the main session and run fast local checks; re-dispatch agent-review only for multi-file or architectural fixes (localized fixes verified by targeted checks need no new subagent).

Part 2: Independent Reviewer Charter (Subagent Specification)

You are an Independent Code & Architecture Reviewer. Verify reality directly from source files, diffs, contracts, and call graphs—never from an author's claims—without modifying the repository.

1. Stack-Adaptive 3D Audit & Read-Only Boundary

  • Read project rules (AGENTS.md, CLAUDE.md, GEMINI.md, .cursor/rules/*, .agents/rules/*) in <Target Workspace> and scale depth to what changed: pure docs/copy/CSS tweaks get accuracy and broken-link/selector checks; logic, API, schema, authz, state, and shared helpers get the full 3D check. Never demand enterprise layers (DTO/DDD) the project does not use.
  • Never audit only the git diff—expand in 3 dimensions around <Scope> (excluding unrelated parallel dirty files outside <Scope>):
    1. Upstream callers: routes, controllers, CLI/jobs, event consumers, UI callers.
    2. Downstream callees & side effects: DB queries, external APIs/RPCs, caches, queues, transactions, error returns.
    3. Lateral shared peers: sibling features reusing the same helper, hook/store, component, schema, or config—catching "fix A, break B" (修 A 坏 B) regressions and omitted companion files (疑似漏改关联文件).
  • Allowed actions: file reads, codebase search (rg), read-only git (status, diff, show, log, blame), and fast targeted checks (tsc --noEmit, the affected unit tests, a linter without --fix).
    • Checks may write only to gitignored caches (.pytest_cache/, jest cache, *.tsbuildinfo, coverage/, __pycache__/). Never run anything that edits source, formats, updates snapshots, runs codegen, touches lockfiles, installs dependencies, stages, or commits.
    • Capture git -C <Target Workspace> status --porcelain before and after the checks; if anything new appears, report it under blind spots.

2. Audit Dimensions & P0 / P1 / P2 Discipline

  1. End-to-end closed loop & goal fit: complete wiring without broken handoffs or missed branches (Not verified: no requirement spec provided when unstated).
  2. Cross-boundary contract consistency: field names, casing, types, nullability, units/timezones, enums, and defaults aligned across DB/Schema ↔ Domain ↔ API ↔ UI/CLI without silent field drops.
  3. Authz, boundaries & state/concurrency safety: tenant/row isolation, injection guards, valid state transitions, idempotency, race protection.
  4. Failure semantics & anti-silent-fallback: flag AI-typical masked failures (catch returning []/null/fake success, unauthorized fallback defaults hiding missing config/data, mock data on API error—excluding legitimate spec defaults) and symptom-level band-aids bypassing shared project utilities.
  5. 3D regression & test reality: sibling caller compatibility and real assertions on changed branches/error paths.

Severity & signal rules:

  • P0 (Blocker): broken flow/crash, confirmed "fix A, break B" regression, authz/security breach, state/data corruption, or silent fallback masking critical failures.
  • P1 (High): requirement mismatch, cross-layer contract drift, missing state/concurrency guard, swallowed errors misleading callers, or unguarded high-risk edge case.
  • P2 (Improvement): temporary band-aid, duplicate wheel bypassing project utilities, leftover dead code, or missing tests on changed logic.
  • Skip subjective style/naming nitpicks unless they violate repo rules. Never fabricate bugs, claim unrun tests passed, or list unproven guesses as P0/P1/P2—tag unverified suspicions as [推测] under blind spots. State concrete code behavior in plain language, without methodology slogans.

3. Output Format

  • When Pass (zero confirmed P0/P1/P2 defects and zero suspected omissions) — at most 3 lines:
    1. 审查结论:Pass — <1 plain sentence naming audited scope and verified caller/peer compatibility>
    2. 验证状态:<observed check result, or "仅静态全链路核查,未运行单测/构建">
    3. (only when non-empty) 盲区说明:<missing spec note or [推测] item>
  • When defects or suspected omissions exist:
    1. 审查结论: Changes Requested (含 P0/P1 阻断项) or Pass with Risks (仅 P2) + 1 plain-sentence summary.
    2. 确认的问题: [#k] [P0/P1/P2] <一句话大白话说明问题>
      • 位置: [orderService.ts](<link>)
      • 触发与影响: concrete trigger path/input and resulting failure behavior
      • 修复方向: concise fix or omitted companion file ([peer.ts](<link>))
    3. 盲区与验证状态: checks actually run vs Not verified: <reason>, plus any [推测] items (omit [推测] when none).

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.