Skip to content

Add /plan-review command and plan-reviewer subagent - #9

Draft
kubiknyc wants to merge 2 commits into
mainfrom
claude/self-review-code-planning-cfs6zl
Draft

Add /plan-review command and plan-reviewer subagent#9
kubiknyc wants to merge 2 commits into
mainfrom
claude/self-review-code-planning-cfs6zl

Conversation

@kubiknyc

Copy link
Copy Markdown
Owner

What

Adds tooling to review an implementation plan from fresh context before it gets built. A plan reviewed inside the context that produced it is rationalization — the model is anchored on its own reasoning. Two new files: a plan-reviewer subagent and a /plan-review slash command that fans it out.

plan-reviewer (.claude/agents/plan-reviewer.md) is read-only (Read, Grep, Glob, Bash). It takes a lens — factual-grounding, adversarial, or invariants — and returns a JSON verdict. It is told to default to refuted, to treat "I could not verify this" as a valid finding, and to check claims about existing code by opening the file rather than trusting the plan's description of it. It complements worklog-reviewer, which reviews diffs; this one runs while throwing the plan away is still cheap. The invariants lens carries the plan-stage version of this repo's hard rules — OTA safety, SELECT-only report tables, schema parity, platform split, sync purity, the mutationQueue.ts coverage pin, tests never under app/, testID coverage, and open decisions in docs/architecture/00-README.md.

/plan-review (.claude/commands/plan-review.md) writes the plan and the original request to .plan-review/, spawns the three lenses in parallel with only those two file paths — deliberately withholding the author's reasoning — then merges: drops findings with neither a file nor a concrete failure scenario, settles reviewer disagreements by reading the code rather than averaging, and reports surviving assumptions before the user approves.

.plan-review/ is gitignored. It also gives a future PreToolUse hook on ExitPlanMode a findings file to gate on, if the advisory version turns out not to be enough.

Milestone / plan task

None — tooling, not a milestone task.

Gates

  • npm run verify green locally — not run: node_modules is absent in this container and npm run typecheck fails at expo/tsconfig.base, which is environmental, not caused by this diff. The change is outside everything verify covers: no TS, no tests, and .prettierignore excludes both .claude/ and *.md, so format:check does not read either new file. CI will confirm.
  • Backend schema changed? → no
  • New native dependency? → no
  • New screen or element an E2E flow will drive? → no
  • Touches an open decision in docs/architecture/00-README.md? → no
  • New user-facing copy? → no UI copy; the agent and command prose is agent-facing
  • Changes SQLite schema or mutation payload shape? → no

Open decisions touched

None.

Adversarial review

Not run — worklog-reviewer checks app/, src/, scripts/, and .maestro/, and this diff touches none of them. Two agent-configuration markdown files and one .gitignore line.

One judgement call worth flagging for review: the three lenses are fixed in the command rather than being chosen per plan. That is deliberate — letting the author pick the lenses reintroduces the bias the fan-out exists to remove — but it means a plan whose real risk sits outside all three gets a clean verdict. The unverifiable field is the partial mitigation, and the merge step is instructed to treat it as amber rather than green.


Generated by Claude Code

Reviewing a plan in the context that produced it is rationalization, not
review — the model is anchored on its own reasoning and rationalizes. This
adds the machinery to review a plan from fresh context instead, before any
of it gets built.

`plan-reviewer` is a read-only subagent that takes a lens (factual
grounding, adversarial, or invariants) and returns a JSON verdict. It is
told to default to refuted and to verify claims about existing code by
opening the file rather than trusting the plan's description of it — a
false premise about what already exists is the most common way a plan
fails. It complements worklog-reviewer, which reviews diffs; this one runs
while throwing the plan away is still cheap.

`/plan-review` orchestrates: writes the plan and the original request to
`.plan-review/`, fans out three reviewers in parallel with only those two
files, then merges — dropping findings with no file and no failure
scenario, and settling reviewer disagreements by reading the code rather
than averaging.

`.plan-review/` is gitignored; it also gives a later PreToolUse hook on
ExitPlanMode a findings file to gate on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7xXZbGTUPQGST1F3UUUkB
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ffcff689-54f7-4be3-bc3e-f2d2232d8b61

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Step 1 wrote the plan to `.plan-review/plan.md`, but plan mode is
read-only — the command failed on its first action in the exact situation
it exists for. The files were only ever a convenience; the reviewers just
need the plan text. Fall back to passing plan and request inline when
writes are blocked, and say explicitly not to leave plan mode to get
around it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M7xXZbGTUPQGST1F3UUUkB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants