agentleFS
VerusKVerusK/claude-skills/skills/plan-review/SKILL.md

plan-review

Skill0 starsChanged 2 months agoMITView on GitHub

External engineering review of an implementation plan before any code is written. Launches Codex in an Orca terminal beside the session (codex exec only as the launcher's last resort, then a fallback reviewer agent), routes confidence-7+ findings through the TypeSafe judge, revises the plan, and runs exactly one re-review round. Use after writing-plans, when asked to "review the plan", or before subagent-driven-development.

27 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use design-review, security-audit 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.
  • AICreator-WindSkill

    design-review

    编码设计师工具。设计审计和修复。

    Also in 3 projects that use this

  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 4 projects that use this

  • AWSSkill

    retro

    Conduct a retrospective on a coding session.

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 9 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 5 projects that use this

  • BlockSkill

    plan

    Draft a TDD, PRD, or lightweight plan in the conversation without committing it.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 25 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Create a temp file outside the repo (under $TMPDIR) containing, in order:

    line 20
  2. Very specific:

    Run the judge exactly as judge.md says.

    line 80
  3. Distinctive:

    Never start implementation from this skill.

    line 120
  4. Very specific:

    Never edit REPORT; it is the reviewer's artifact.

    line 121

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

Plan Review

Announce at start: "Using plan-review on <plan path>."

0. Inputs

  • PLAN: the argument, or the newest file in docs/plans/. Stop with a message if none.
  • REPORT: <directory of PLAN>/<plan basename without .md>.review.md — beside the plan, always repo-relative; reviewer.sh rejects an absolute path. It is relative to the repo reviewer.sh works in, so run from the repo containing PLAN, or pass --repo <that repo> to reviewer.sh.
  • ROUND: 1.
  • Locate the repo and the judge protocol: read judge.md from the kickoff skill directory (same repo, skills/kickoff/judge.md; locate the repo with the snippet in that file, replacing kickoff with plan-review). Every fenced block below is one shell call, so a block that uses $SKILLS_REPO must run the locator itself.

1. Build the prompt

Create a temp file outside the repo (under $TMPDIR) containing, in order:

  1. The full text of reviewer.md from this skill's directory.
  2. THE PLAN: followed by the plan file verbatim inside a fence longer than any backtick run in the plan — use seven backticks unless the plan contains a run of seven or more, then go longer still.
  3. Referenced source files: followed by the repo-relative paths mentioned in the plan that are real files: grep the plan for path-like tokens containing /, keep those that pass test -f, drop anything under .claude/, .codex/, agents/ or node_modules/, deduplicate and sort, and keep at most 40 entries.
  4. On round 2 only: Previous report: followed by the previous report verbatim (from <REPORT>.round1.md), then Only report findings that are still present after the plan changes; mark fixed ones as resolved.
  5. Write the report to <REPORT> on its own line — the last line of the file, in round 1 and round 2 alike. Self-check before launching: [ "$(tail -1 "$PROMPT")" = "Write the report to $REPORT" ] || echo "prompt malformed". If it prints prompt malformed, rebuild the prompt in this order and re-check; do not launch the reviewer.

Say nothing about models or reasoning effort in the prompt — the launcher pins those.

2. Launch the external reviewer

The reviewer is Codex in an Orca terminal opened beside this session — a visible tab the user can watch. codex exec is only the launcher's last resort: reviewer.sh itself falls back to it when Orca cannot start a Codex terminal, and says why on stderr. So launch only by running the block below as written: never run codex, codex exec or orca terminal … yourself, never write your own launcher, never skip the block because Orca "looks unavailable". In Claude Code run the block with dangerouslyDisableSandbox: true (the sandbox can cut Orca's local socket and Codex's network, which silently turns the review into codex exec) and run_in_background: true (the review outlives the Bash timeout; you are notified when it exits).

Substitute the real values for the four placeholders before running:

SKILLS_REPO=""
for c in "$(cat "$HOME/.verus-skills/root" 2>/dev/null)" \
         "$HOME/.claude/skills/plan-review/../.." \
         "$HOME/.codex/skills/plan-review/../.."; do
  [ -n "$c" ] && [ -f "$c/scripts/typesafe-judge.mjs" ] && SKILLS_REPO="$(cd -P "$c" && pwd -P)" && break
done
[ -f "$SKILLS_REPO/scripts/reviewer.sh" ] || echo "reviewer not found: SKILLS_REPO=$SKILLS_REPO"

PROMPT="<the temp prompt file from section 1>"
REPORT="<REPORT, repo-relative>"
ROUND="<1 or 2>"
ROUND1_REPORT="<the round-1 REPORT; in round 2 the same value as in round 1>"
SESSION="$(git rev-parse --show-toplevel)/.context/plan-review-$(basename "$ROUND1_REPORT" .md)-session"
echo "SESSION=$SESSION"
# Round 1 starts fresh: close an orphan left by an interrupted earlier review of this plan.
[ "$ROUND" = 1 ] && bash "$SKILLS_REPO/scripts/reviewer.sh" --close-session "$SESSION"
bash "$SKILLS_REPO/scripts/reviewer.sh" --prompt-file "$PROMPT" --output "$REPORT" --title plan-review --timeout-min 15 --session-file "$SESSION"
echo "reviewer_exit=$?"
  • 0: report is at REPORT; note which path ran (reviewer: orca / reviewer: codex-exec). On reviewer: codex-exec, copy the orca: … stderr line into the section-6 summary as the reason the Orca terminal was not used; do not relaunch by hand.
  • 3: dispatch the fallback reviewer with the same prompt file content as its prompt and the instruction to write REPORT, and wait for it. Claude Code: subagent_type = verus-reviewer (verus-skills:verus-reviewer when installed as a plugin), unnamed, in the background, no model parameter. In a Codex session: dispatch the same prompt with spawn_agent, unnamed, in the background; pass no model. On a host with no subagent tool at all, do not stop: perform the review yourself in this session following reviewer.md exactly, write REPORT, and state in the report header that it was produced by the fallback reviewer, not an independent second voice.
  • 1: fix the invocation; do not proceed. An Orca terminal that could not be closed is left recorded in the session file, and the section-6 close retries it.
  • any other exit code (e.g. 127): the launcher was not found or could not run — treat as 1: fix the invocation, do not proceed.

3. Triage findings

Parse ## Findings (confidence 7+). For each finding, in order of severity:

First decide whether the finding is a real choice.

One reasonable fix — for example a reproduced bug with an obvious remedy, or a factual error in a document: do not call the judge. Accept it and print, in place of a decision block:

accepted without the judge: <finding one-liner> — <the evidence: reproduction, file:line, command output>

Record that line with the decisions (section 4).

Otherwise build a judge question about how to fix it:

  • question: "How should <the finding, in a few words> be fixed?"
  • options: 2–4 concrete ways to fix it, each one a reasonable engineer could pick, each with its concrete consequence in description. The reviewer's proposal may be one of them. A "leave it as is" option is allowed only when its description states the strongest argument for leaving it; never add a bare "reject". Map each option to the judge's JSON fields: label is a short name, description the consequence.
  • context: a structured object — goal (what the plan delivers, one sentence), decisions (findings already triaged in this round), facts (the plan's Goal and Architecture lines, the spec's relevant constraint, the finding verbatim, and the relevant plan excerpt), constraints (the user's rules and the plan's hard limits), consequences (one entry per option id, each naming what concretely happens or breaks — file, behaviour, test — if that option is chosen; equal specificity and length for every id, no comparative or preference language). Facts only — a stranger reading facts alone must be able to pick.
  • recommended: your pick. It is shown to the user and never sent to the judge.

Run the judge exactly as judge.md says. Accepted → apply the decision; unaccepted or any non-zero judge exit → ask the user with the decision block. Print every decision block in chat as it happens.

Findings in the Appendix are not acted on; leave them in the report.

4. Revise the plan

Apply to PLAN directly (edit tasks, add tests, add steps) the chosen action of every judged finding, whatever its option letter and whether the judge accepted it or the user chose it, and every finding accepted without the judge. A "leave it as is" choice is recorded with the decisions but changes nothing in the plan. Append to the plan a section:

## Plan review decisions (round N)
<one decision block per judged finding, one "accepted without the judge: …" line per finding decided without it, and a "Left as is: <finding> — <argument>" line for each finding the judge or the user chose to leave>

Commit: git commit -am "docs(plan): apply plan-review round N".

5. Second round

Skip round 2 if the round-1 report has no P0/P1 at confidence 7+. Otherwise, if ROUND is 1 and at least one finding changed the plan: copy the round-1 report to <REPORT>.round1.md first (reviewer.sh deletes REPORT at startup, so the only copy would be lost), then set ROUND to 2, rebuild the prompt (section 1, reading the previous report from <REPORT>.round1.md), relaunch (section 2; pass the same SESSION as round 1 — in Orca that reuses round 1's terminal, so the reviewer sees its own earlier context), triage and revise again.

Stop after round 2.

6. Hand off

First close this review's reviewer session:

SKILLS_REPO=""
for c in "$(cat "$HOME/.verus-skills/root" 2>/dev/null)" \
         "$HOME/.claude/skills/plan-review/../.." \
         "$HOME/.codex/skills/plan-review/../.."; do
  [ -n "$c" ] && [ -f "$c/scripts/typesafe-judge.mjs" ] && SKILLS_REPO="$(cd -P "$c" && pwd -P)" && break
done
SESSION="<the SESSION printed by section 2>"
bash "$SKILLS_REPO/scripts/reviewer.sh" --close-session "$SESSION"

Report to the user: rounds run, reviewer path used, findings accepted/rejected/asked, path of the final report, and — when round 2 ran — the path of the kept round-1 report (<REPORT>.round1.md). Then say: "Plan review done. Next: subagent-driven-development on <PLAN>." and invoke subagent-driven-development (verus-skills:subagent-driven-development when installed as a plugin).

Rules

  • Never start implementation from this skill.
  • Never edit REPORT; it is the reviewer's artifact. Decisions go into the plan.
  • One re-review round maximum. Residual P2/P3 go to the plan's Plan review decisions (round N) section as "deferred" — a separate heading from the Review decisions (round N) section the review skill appends after the code exists, so the two never collide in one plan.
  • Whenever this skill stops — hand-off, a stop after round 1 or 2, report-only mode, a red suite — first run reviewer.sh --close-session "$SESSION" (section 6), so review terminals never pile up.

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.