skills/agentic-review-handoff/SKILL.md
Cross-agent code review handoff and review-fix-re-review loop with persistent packet artifacts. Requires a git repo because packet addressing uses git rev-parse --show-toplevel. Use when the user asks for an independent, read-only second pair of eyes on a diff/branch/PR another agent or teammate implemented; asks to verify reviewer feedback before fixing; says a fix is done and wants scoped re-review; asks to continue the latest review packet; or asks for first-principles, DDD, high-cohesion/low-coupling review. Persists each loop under $repo_root/.review-handoff/active/ so agents can resume without copy-paste. Do NOT use for ordinary implementation, generic staged-change review, review-comment copy editing, non-git folders/zips/tarballs/temp dirs, or when the user names a different review skill.
npx skillsauth add adonis0123/adonis-skills agentic-review-handoffInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Persistent packet protocol that lets two agents (typically Claude Code as reviewer + Codex as implementer/fixer) hand a review loop back and forth via a file artifact instead of manual copy-paste. Each review→fix→re-review loop is one append-only markdown file under $repo_root/.review-handoff/active/.
For ordinary review / fix / re-review turns, use this SKILL.md only. Do not preload all references. Open a reference only when the current turn needs its details:
references/packet-anatomy.mdreferences/packet-addressing.mdreferences/review-contract.mdreferences/example-packet.mdThis skill historically said "review/re-review are read-only by default; do not edit files." That rule still holds for the subject of review (source / docs / product / tests / configs being reviewed) but is explicitly overridden for one path: writing to the packet artifact itself.
mv-ing files under $repo_root/.review-handoff/** is exactly what makes the cross-agent loop work. Treat these writes the same way you treat printing findings to the terminal.$repo_root/.git/info/exclude already contains a line /.review-handoff/ (leading slash anchors to repo root, the canonical form). If neither /.review-handoff/ nor the unanchored .review-handoff/ is already present, append the canonical form. See references/packet-addressing.md § ".git/info/exclude bootstrapping" for the exact idempotent snippet. This isolates the artifact per-repo without modifying anyone's .gitignore (important when reviewing in a repo that isn't yours).Stage is one of: review, feedback validation, fix handoff, fix, re-review. Scope is one of: staged diff / working-tree diff / full branch diff / generated artifacts / docs only / specific files. If the user did not name a stage, infer from the Stage Defaults table below. If scope is missing, reconstruct the minimum scope from the diff / file paths / prior findings the user gave you and label your assumptions explicitly. Asking a clarifying question is a last resort.
Before writing any output, run packet addressing exactly in this order. These steps define the packet identity and resume contract.
0. repo_root=$(git rev-parse --show-toplevel)
- Not in a git repo → fail loudly. The packet protocol requires a repo identity.
- All read / write / mv must use $repo_root/.review-handoff/... absolute paths.
Do not use cwd-relative paths — agents are often invoked from monorepo subdirectories
like apps/web/, and a relative path would create a second inbox or miss the root one.
1. branch=$(git rev-parse --abbrev-ref HEAD)
branch_slug = lowercase(branch with "/" and "\" replaced by "-")
2. List $repo_root/.review-handoff/active/${branch_slug}/*.md, sort ascending by filename.
File names use local minute time plus scope: `YYYY-MM-DD_HH-mm-<scope_slug>.md`.
The fixed-width local minute prefix guarantees lexical sort = chronological sort within the branch folder.
3. Take the last (newest) one:
- Exists → read the whole file; the last H1 anchor + frontmatter tells you which
section to append next (see Stage transitions below).
Special case: if lifecycle_state = awaiting_user_decision and the user said
"fix it" / "修一下" / "改吧", start a new round (append # Fix Completion (round N+1)).
- Does not exist → enter creation path, branched by who triggered:
· implementer-initiated (the user/agent just finished writing code and is asking
for review) → start with # Review Handoff (implementer fills Goal /
Implementation Summary / Open Questions etc.)
· reviewer-initiated (the user is directly asking the reviewer to look at a
staged/working-tree diff with no implementer handoff in hand) → start with
# Review Intake (reviewer records only what it can verify itself: scope,
verification, inferred goal labelled inferred from diff), then # Review
Findings. **Whether to write # Fix Handoff after # Review Findings depends
on the Verdict**: if Verdict is PASS / NO_FINDINGS, skip # Fix Handoff and
immediately archive (see "Lifecycle and Archive" Trigger 1 below). If
Verdict is BLOCKED / PASS_WITH_CONCERNS, append # Fix Handoff with the
validated findings to fix. Do NOT fabricate # Review Handoff — that
section is implementer-only and writing it without implementer context
breaks the evidence-first trust boundary.
4. If the user explicitly passed --packet=<path> or named a packet file, prefer that,
but still verify it lives under $repo_root/.review-handoff/.
Before writing the first packet for a branch, create $repo_root/.review-handoff/active/${branch_slug}/ and $repo_root/.review-handoff/archive/${branch_slug}/ if needed. Also ensure the .git/info/exclude line described above is in place.
Two write rules govern every packet edit:
# Anchor section has been written, never modify, delete, or reorder it. New writes only append to the end of the file.# Review Intake (or # Review Handoff for implementer-initiated) → # Review Findings → (conditional) # Fix Handoff. The Fix Handoff is appended only when Verdict is BLOCKED or PASS_WITH_CONCERNS; on PASS / NO_FINDINGS the group ends after # Review Findings and the packet is archived.# Fix Completion (or # Fix Completion (round N)).# Re-review (or # Re-review (round N)).
Do not stop after a single H1 if the stage requires more — partial groups break the auto-resume chain (e.g. reviewer stopping after # Review Intake leaves the fixer nothing to act on).updated, last_anchor (= the last H1 you just wrote), lifecycle_state, and (when entering a new round) round. Rewriting frontmatter is not a violation of append-only.Use the Fast Path map above. Loading references is optional and should be tied to a concrete uncertainty; routine turns should not read all reference files.
# Fix Handoff section per references/packet-anatomy.md.# Fix Completion; do not replace it with a prose-only summary. If the user asks for "fix conclusion" / "修改结论" / "修复结论" / "给出结论", satisfy that request inside the packet's Fix Conclusion subsection (the first subsection of # Fix Completion).Original Findings Snapshot, not the fixer's Claimed status).After writing # Re-review, look at the Verdict and apply the lifecycle / archive action from the table below.
There are two archive triggers depending on which review section the Verdict was written in:
# Review Findings with no fix needed (golden path)When the very first review finds nothing or only Preference-level items, the reviewer writes the Verdict in # Review Findings itself, does not write a # Fix Handoff (there's nothing to hand off), and acts on the verdict immediately:
| Verdict in # Review Findings | Action | last_anchor | lifecycle_state | File location |
|---|---|---|---|---|
| PASS / NO_FINDINGS | mv $repo_root/.review-handoff/active/<branch_slug>/<file> $repo_root/.review-handoff/archive/<branch_slug>/<file> | review_findings | archived | archive/ |
| PASS_WITH_CONCERNS / BLOCKED | Continue to # Fix Handoff — there are findings to fix. | review_findings | in_progress | active/ |
# Re-review (or # Re-review (round N))| Re-review Verdict | Action | last_anchor | lifecycle_state | File location |
|---|---|---|---|---|
| PASS / NO_FINDINGS | mv $repo_root/.review-handoff/active/<branch_slug>/<file> $repo_root/.review-handoff/archive/<branch_slug>/<file> | re_review | archived | archive/ |
| PASS_WITH_CONCERNS | Do not archive. Stay in active/. Tell the user the packet is parked and any "fix it" / "修一下" / "改吧" will auto-continue to round N+1; manual mv to archive only on the user's explicit "drop the concerns" decision. | re_review | awaiting_user_decision | active/ |
| BLOCKED | Do not archive. Wait for fixer to start the next round. | re_review | blocked | active/ |
Only the reviewer ever auto-archives; fixers never archive. Users may manually mv either direction; the agent should respect that.
Infer the stage from the user's signal:
| User signal | Stage | Required output |
|---|---|---|
| "review", "second pair of eyes", "audit this diff", or pasted team feedback | review / feedback validation | Findings or feedback validation, optionally followed by # Fix Handoff in the same packet |
| "give this back to the implementer", "send context to the fixing AI", or asks for a repair brief | fix handoff | Append # Fix Handoff |
| "fix according to this packet", "apply only these validated findings", "fix it", "apply the valid feedback", "修改吧", "改吧", "修一下", "按这个改", "按 review 意见修", "修改之后给出结论", "修完给结论", or "改完给我结论" | fix | Code/doc changes plus appended # Fix Completion whose first subsection is Fix Conclusion |
| "fixed, review again", "改好了再看", or the latest section in the packet is # Fix Completion | re-review | Append # Re-review (Prior findings reassessment, new fix-induced findings, regression surface, verdict) |
When one user message combines review/validation with a fix request (e.g. "review this then fix it", "validate this feedback and apply the valid parts"), execute stages sequentially in this order:
# Review Findings with verdict. Then branch:
BLOCKED / PASS_WITH_CONCERNS → append # Fix Handoff with validated findings, then proceed to step 2.PASS / NO_FINDINGS → do not write # Fix Handoff (nothing to fix). Archive immediately per Lifecycle Trigger 1 and skip step 2 — the user's "fix it" request becomes a no-op because there are no findings to fix. Say so explicitly in the terminal output.# Fix Handoff. Apply only the validated findings, then append # Fix Completion.Do not merge review evidence and fix changes into one unstructured response. Merging stages destroys the portability the packet design depends on — a later re-reviewer cannot independently re-attest findings if there is no # Fix Handoff section to anchor them. If the user pushes back on the sequencing, name the cost ("merging stages means a later re-reviewer can't independently re-attest findings") and let them decide. Free-form "rewrite this function" requests not tied to a validated finding are not a stage switch — defer them as a separate implementation task.
references/review-contract.md for the full rubric only when these details are needed.Preference or omitted — never reported as bugs.pwd, git rev-parse --show-toplevel, branch, and git status before quoting them.# Review Handoff section unless you are the implementer with implementation context. Reviewers without implementer handoff use # Review Intake instead.(round N) if the same kind of section needs to recur.last_anchor / lifecycle_state stale.tools
Use when the user's pain is "adding/removing one more X means editing N files" and X is a recurring variant kind: popup, banner, modal, ad slot, payment method, AI model/tool, form field type, connector, sub-site, command, menu item, agent, extension point, or data source. Use when they want to design, refactor, review, name, or explain a pluggable mechanism using registry, interface/trait contract, runtime core, and convention folders; mention pluginize, pluggable, plugin architecture, extension point, registry pattern, or extensibility. Use when explaining the first-principles rationale, DDD/SOLID/OCP mapping, or industry analogies behind that structure. Use for cross-stack mapping to VSCode contributes, Webpack/Vite plugins, Rust/Tauri connectors, Python entry_points, or cargo features. Skip one variant's internals/styles/hooks/copy/bugs, and skip register/registry meaning DI container, user signup, or package registry.
development
Use BEFORE heavier workflow skills when route choice matters. Route creative work without a design doc/spec to Brainstorm; destructive or hard-to-reverse work to Discuss; unresolved decisions, Plan/Full fan-out, ship checks, unclear bugs, and fresh-eyes fix-then-re-review need this gate. Skip single-line read-only lookups, pure typo/formatting edits, trivial safe one-line fixes, and clearly safe named-skill requests. Outputs Route, Runtime skill, Fallback alias, and Execution path.
testing
Enforces 'decide then plan' discipline - the pre-planning decision gate. Use when the user asks for a plan or starts a change while key decisions are unresolved: architecture tradeoffs, data flow, public interfaces, unclear requirements, multi-module scope, or roughly 5+ files affected. Also triggers when the user explicitly wants to discuss, compare options, or review architecture before committing. Core job: reduce incorrect-execution cost by confirming decisions before producing executable plans.
development
Scaffold class-based Zustand stores with flattenActions: web (component-level store + Context + Provider) and core (slice-based store with immer). Class-based actions provide Go-to-Definition DX, #private field encapsulation, and prototype-safe slice composition.