/fw:reviewfrom fw
Run structured code review. Use before PRs or merges to find bugs, regressions, missing tests, and readiness gaps.
Ships in fw. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
$fw:review reviews code changes with a risk-first, structured workflow.
It selects reviewers from diff evidence, dispatches them in parallel when the
host supports it, keeps synthesis centralized, and keeps mutation bounded.
Use this skill before merge, after meaningful implementation work, or inside a larger Flywheel loop when code has changed and the next job is to find risk.
When directly invoked, always review. Do not downgrade a direct invocation into a casual summary or diff explanation. If the scope is unclear, establish it and continue the review workflow.
Follow ../references/host-interaction-contract.md.
Call the exact host question tool named in
../references/host-interaction-contract.md when that tool is available. Do
not ask for raw 1/2/3 replies when the host already offers a choice surface.
When the workflow spans multiple material steps, use the host task-tracking
tool named in ../references/host-interaction-contract.md to create and
maintain a short task list.
Ask one question at a time. In mode:autofix, mode:report-only, or
mode:headless, skip interactive questions unless the mode contract explicitly
requires a failure message instead.
Parse $ARGUMENTS for the following optional tokens. Strip each recognized
token before interpreting the remainder as the PR number, GitHub URL, or branch
name.
| Token | Example | Effect |
|---|---|---|
mode:autofix | mode:autofix | Select autofix mode |
mode:report-only | mode:report-only | Select report-only mode |
mode:headless | mode:headless | Select headless mode for programmatic callers |
base:<sha-or-ref> | base:abc1234 or base:origin/main | Skip scope detection and use this as the diff base |
plan:<path> | plan:docs/plans/2026-03-25-001-feat-foo-plan.md | Load this plan for requirements verification |
All tokens are optional. Each one present means one less thing to infer.
Conflicting mode flags: If multiple mode tokens appear, stop and do not
dispatch reviewers. If mode:headless is one of the conflicting tokens, emit:
Review failed (headless mode). Reason: conflicting mode flags — <mode_a> and <mode_b> cannot be combined.
Otherwise emit:
Review failed. Reason: conflicting mode flags — <mode_a> and <mode_b> cannot be combined.
Do not preload every reference. Load only what the current phase needs:
references/resolve-base.sh only during Stage 1 when branch or
standalone scope detection needs a base branch.references/reviewer-registry.yaml and
references/persona-loading.md first when Stage 3 begins.references/stack-packs/index.yaml only when Stage 3 determines stack
packs should be considered for this diff.../observability/references/service-readiness-matrix.md only when the
diff changes runtime behavior, contracts, state, rollout posture, retries,
queues, migrations, or other service-readiness-sensitive boundaries.references/personas/ after the
registry and loading guide identify them.references/diff-scope.md and references/findings-schema.json
immediately before reviewer dispatch or serial reviewer execution.references/subagent-template.md immediately before parallel reviewer
dispatch.../references/research/activation-heuristics.md and
../references/research/source-ranking-and-synthesis.md only when judging
the diff depends on current published guidance, external API or framework
behavior, standards, security guidance, or other facts not settled by repo
truth alone.../commit/references/evidence-bundle.md only when an existing shared
evidence bundle is present or the review artifact should feed $fw:commit.references/review-output-template.md during synthesis and
presentation.../references/workflow-gates.md during synthesis when turning review
verdict, blocking status, and evidence into the next handoff.This skill is optimized for Codex and Claude Code style hosts:
<intent>, <files>, <diff>,
<pr-context>, and <standards-paths> when building reviewer context| Mode | When | Behavior |
|---|---|---|
| Interactive | No mode token present | Review, apply safe_auto fixes automatically, present findings, ask for policy decisions on gated or manual work, and optionally continue into fix, push, or PR next steps |
| Autofix | mode:autofix | No user interaction. Review, apply only policy-allowed safe_auto fixes, re-review in bounded rounds, write a run artifact, and emit residual downstream work |
| Report-only | mode:report-only | Strictly read-only. Review and report only, then stop with no edits, artifacts, todos, commits, pushes, or PR actions |
| Headless | mode:headless | Programmatic mode for skill-to-skill invocation. Apply safe_auto fixes silently in a single pass, return all other findings as structured text output, write run artifacts, skip todos, and end with Review complete |
Autofix
safe_auto -> review-fixer findings..context/flywheel/review/<run-id>/.downstream-resolver.Report-only
.context/flywheel/review/<run-id>/.Headless
Skip all user questions and infer intent conservatively when needed.
Require a determinable diff scope. If headless mode cannot determine one, emit:
Review failed (headless mode). Reason: no diff scope detected. Re-invoke with a branch name, PR number, or base:<ref>.
Apply only safe_auto -> review-fixer findings in a single pass.
Return all non-auto findings as structured text output.
Write a run artifact under .context/flywheel/review/<run-id>/.
Do not create todo files.
Do not switch the shared checkout. If a caller passes an explicit PR or branch target in headless mode on a shared checkout, emit:
Review failed (headless mode). Reason: cannot switch shared checkout. Re-invoke with base:<ref> to review the current checkout, or run from an isolated worktree.
End with Review complete as the terminal signal.
All reviewers use P0-P3:
| Level | Meaning | Action |
|---|---|---|
| P0 | Critical breakage, exploitable vulnerability, data loss or corruption | Must fix before merge |
| P1 | High-impact defect likely hit in normal usage, breaking contract | Should fix |
| P2 | Moderate issue with meaningful downside | Fix if straightforward |
| P3 | Low-impact, narrow scope, minor improvement | User's discretion |
Severity answers urgency. Routing answers who acts next and whether this skill may mutate the checkout.
autofix_class | Default owner | Meaning |
|---|---|---|
safe_auto | review-fixer | Local, deterministic fix suitable for in-skill fixing when the mode allows mutation |
gated_auto | downstream-resolver or human | Concrete fix exists, but it changes behavior, contracts, permissions, or another sensitive boundary |
manual | downstream-resolver or human | Actionable work that should be handed off rather than fixed in-skill |
advisory | human or release | Report-only output such as learnings, rollout notes, or residual risk |
Routing rules:
safe_auto -> review-fixer enters the in-skill fixer queue
automatically.requires_verification: true means the fix is incomplete without targeted
tests, focused re-review, or operational validation.The initial Flywheel reviewer catalog is intentionally cross-cutting and
language-agnostic. The core workflow does not depend on stack- or
platform-specific reviewers being hardcoded into SKILL.md.
Every review starts with a bounded default budget:
Read references/reviewer-registry.yaml and
references/persona-loading.md before reviewer selection. Do not invent new
reviewer categories during synthesis. Add them through the registry and persona
files instead.
The registry plus persona files are the extension surface. Keep SKILL.md
generic, append new reviewers in the registry, and use stack packs only when a
specialist truly depends on repo, stack, or platform evidence.
This deterministic loading order is mandatory. Do not skip straight to persona files or hardcode reviewer choices in the orchestrator body.
The following paths are Flywheel pipeline artifacts and must never be flagged for deletion, removal, or gitignore:
docs/brainstorms/*docs/plans/*.mddocs/solutions/*.mdDiscard any cleanup finding that targets those directories.
Compute the diff range, file list, and diff.
If base: is provided
Use the provided value directly and skip base-branch detection:
BASE_ARG="{base_arg}"
BASE=$(git merge-base HEAD "$BASE_ARG" 2>/dev/null) || BASE="$BASE_ARG"
echo "BASE:$BASE" && echo "FILES:" && git diff --name-only "$BASE" && echo "DIFF:" && git diff -U10 "$BASE" && echo "UNTRACKED:" && git ls-files --others --exclude-standard
Do not combine base: with a PR number, GitHub URL, or explicit branch target.
If both are present, stop with:
Cannot use `base:` with a PR number or branch target — `base:` implies the current checkout is already the correct branch. Pass `base:` alone, or pass the target alone and let scope detection resolve the base.
If a PR number or GitHub URL is provided
Preflight gate: if mode:report-only or mode:headless is running on the
shared checkout, stop here before any checkout logic. Do not continue to the
remaining steps in this section.
Only continue to gh pr checkout when the run is interactive or autofix, or
when the review is already running in an isolated checkout or worktree.
Verify the worktree is clean with git status --porcelain before switching.
If it is dirty, stop and ask the user to stash or commit first.
Check out the PR branch with:
gh pr checkout <number-or-url>
Fetch PR metadata:
gh pr view <number-or-url> --json title,body,baseRefName,headRefName,url
Resolve the base ref from the PR's actual base repository and compute the merge-base. Review against the local diff from that base so re-reviews include local fix commits and uncommitted edits.
If the base ref cannot be resolved, stop rather than falling back to
git diff HEAD.
If a branch name is provided
Preflight gate: if mode:report-only or mode:headless is running on the
shared checkout, stop here before any checkout logic. Do not continue to the
remaining steps in this section.
Only continue to git checkout <branch> when the run is interactive or
autofix, or when the review is already running in an isolated checkout or
worktree.
Verify the worktree is clean before switching.
Check out the named branch with:
git checkout <branch>
Run bash references/resolve-base.sh. If it outputs an error, stop rather
than falling back to git diff HEAD.
On success, produce:
echo "BASE:$BASE" && echo "FILES:" && git diff --name-only "$BASE" && echo "DIFF:" && git diff -U10 "$BASE" && echo "UNTRACKED:" && git ls-files --others --exclude-standard
If no argument is provided
Run bash references/resolve-base.sh.
If it fails, stop instead of silently reviewing only working-copy changes.
On success, review:
echo "BASE:$BASE" && echo "FILES:" && git diff --name-only "$BASE" && echo "DIFF:" && git diff -U10 "$BASE" && echo "UNTRACKED:" && git ls-files --others --exclude-standard
Using git diff "$BASE" against the working tree includes committed, staged,
and unstaged changes together.
Untracked file handling
Always inspect the UNTRACKED: list even when FILES: and DIFF: are
non-empty.
git add those files first.Understand what the change is trying to accomplish.
PR mode: use the PR title, body, linked issues, and commit messages when needed.
Branch mode: inspect git log --oneline ${BASE}..<branch>.
Standalone mode: inspect:
echo "BRANCH:" && git rev-parse --abbrev-ref HEAD && echo "COMMITS:" && git log --oneline "${BASE}..HEAD"
Write a 2-3 line intent summary and pass it to every reviewer.
If intent is ambiguous:
Locate the plan document so requirements completeness can be checked later. Check these sources in order:
plan: argumentdocs/plans/*.mddocs/plans/*Confidence tagging:
plan_source: explicitplan_source: inferredIf a plan is found, read its Requirements Trace and Implementation Units.
Do not block the review if no plan is found.
When implementation units include Test posture: tdd, extract the unit labels,
changed files, Red signal, and Green signal. Use that expectation later to
check whether the diff or evidence bundle shows a red-green-refactor path. A
missing TDD proof is review evidence, not just a process nit, unless the plan
or diff clearly records a valid exception.
If the diff is runtime-risky, read
../observability/references/service-readiness-matrix.md and build a concise
readiness frame from the dimensions that apply.
Use that frame to sharpen:
$fw:rollout or $fw:commitIf the active repo has docs/solutions/ and the diff touches an area that may
already be documented:
files_touched, module, tags,
problem_type, component, and titledoc_status: activesuperseded_by, follow that path first and treat the
older doc as historical context onlyUse these local prior learnings to:
If .flywheel/config.local.yaml exists, read only the local policy keys that
materially affect review-to-commit handoff, such as:
review.require_review_before_commitruntime.require_operational_validation_for_runtime_changesUse these local policy gates to sharpen:
$fw:commitAbsent config is not a policy violation. Treat local policy as an explicit overlay, not a universal Flywheel default.
If .context/flywheel/evidence/ exists, inspect only the newest summary.md
that clearly matches the current branch, task, or plan.
Use that bundle to:
$fw:commitIf review correctness depends on current external knowledge that the repo does not authoritatively answer, gather only the smallest targeted context needed.
Typical triggers:
Before broad browsing, look for a matching docs/research/ brief if one is
likely to exist. If no strong local brief exists, use a narrow research pass:
review into a standalone research report or route away from
review just because lookup was neededUse this context to sharpen reviewer selection, severity, and final reasoning.
Read the diff and file list from Stage 1, then read
references/reviewer-registry.yaml and references/persona-loading.md.
Always include the baseline reviewers from the registry.
Add scale-up structured reviewers and Flywheel agents only when the diff, standards paths, local learnings, or agent-workflow surface actually warrant them.
For each cross-cutting conditional reviewer, decide whether the diff warrants it. This is agent judgment, not keyword matching.
More reviewers is not automatically better. Prefer the smallest set that gives clear coverage of the actual risks in the diff.
If the repo and diff suggest stack- or platform-specific review would be useful:
references/stack-packs/index.yamlWhen multiple stack packs match, combine them additively into one selected reviewer set. Typical combinations include:
typescript + react for typed React surfacespostgres when app code and PostgreSQL behavior both changekafka or redis only when the diff clearly touches those
integrationsotel or datadog when the diff changes telemetry,
correlation, monitors, or runtime validation surfacesDo not split synthesis by pack. Pack selection determines who reviews; the selected reviewers still flow through one shared dispatch, merge, and verdict pipeline.
Only after the selected reviewer IDs are known, load the corresponding persona
files from references/personas/.
Selection rules:
previous-comments is PR-only. Skip it when no PR metadata exists.Announce the team before spawning. Include one-line justifications for conditional reviewers.
Before spawning reviewers, locate relevant AGENTS.md and CLAUDE.md files:
**/AGENTS.md and **/CLAUDE.md.If project-standards was selected, pass the resulting path list to that
reviewer inside a <standards-paths> block. The reviewer reads the files
itself.
This workflow uses model-tiered review orchestration when the host supports it:
If the platform has no model override mechanism, let reviewers inherit the default model rather than breaking dispatch.
When overrides are available, use frontier capability tiers. Prefer capability labels over provider branding, then bind them to the latest available GPT or Opus model family at dispatch time:
frontier_orchestrator for synthesis, policy decisions, and complex merge
workfrontier_review_worker for narrow reviewer passesMap those tiers to host-native model names only at dispatch time.
In interactive, autofix, and headless modes, generate a run ID before dispatching reviewers:
RUN_ID=$(date +%Y%m%d-%H%M%S)-$(head -c4 /dev/urandom | od -An -tx1 | tr -d ' ')
mkdir -p ".context/flywheel/review/$RUN_ID"
Report-only mode skips run-id generation and file writes.
Read:
references/diff-scope.mdreferences/findings-schema.jsonreferences/subagent-template.mdIf the platform supports subagents or tasks and the active host policy permits delegated review work, dispatch the selected reviewers in parallel. When the host requires explicit delegation approval, only delegate after that approval is already present. Otherwise run the same reviewer passes serially yourself while preserving persona boundaries.
Parallelism is by reviewer, not by pack. Once the selected reviewer set is known, dispatch the baseline reviewers plus any selected scale-up, cross- cutting, and stack-pack reviewers in the same parallel review batch when the host allows it.
Keep each reviewer prompt compact:
Each structured reviewer receives:
project-standards onlyReviewer passes are read-only with respect to project code. The one permitted write is the reviewer artifact file under:
.context/flywheel/review/{run_id}/{reviewer_name}.json
Each reviewer writes full JSON to disk when a run ID exists and returns compact JSON with merge-tier fields only.
When delegated reviewer execution is permitted, dispatch only the selected Flywheel agents in parallel with the structured reviewers. Otherwise produce the equivalent advisory analysis inline and preserve those outputs for synthesis even though they do not use the structured findings schema.
Convert multiple reviewer returns into one deduplicated, confidence-gated finding set. This is the coalescing step for the whole review, including any parallel stack-pack reviewers.
Validate compact returns against the compact-return field set:
top-level reviewer, findings, residual_risks, and testing_gaps, plus
per-finding merge-tier fields only. Do not apply artifact-only requirements
such as why_it_matters or evidence at this stage. Drop malformed returns
or findings and record the drop count.
Confidence gate findings below 0.60. Exception: P0 findings at 0.50+
survive.
Deduplicate using:
normalize(file) + line_bucket(line, +/-3) + normalize(title)
Cross-reviewer agreement boosts merged confidence by 0.10, capped at
1.0.
Separate pre-existing findings into their own list.
Resolve disagreements by keeping the most conservative severity and route, while preserving reviewer disagreement notes.
Normalize routing so synthesis owns final autofix_class, owner, and
requires_verification.
Partition the work into:
safe_auto -> review-fixergated_auto or manual findings
owned by downstream-resolveradvisory findings and anything owned by human or
releaseSort by severity, then confidence descending, then file path, then line.
Collect coverage data by unioning residual risks and testing gaps.
Track internal quality dimensions across merged findings for simplicity, maintainability, architecture fit, and pattern justification. Use this metadata to sharpen synthesis only. Do not turn it into a user-facing scorecard.
Preserve Flywheel agent artifacts alongside the merged findings.
Read references/review-output-template.md.
Read ../references/workflow-gates.md and apply the Review-Ready gate before
declaring the next stage.
Use pipe-delimited markdown tables for interactive findings output. Do not present findings as prose blocks.
Keep any internal quality-dimension tracking out of the interactive score surface unless the user explicitly asks for it.
Interactive output should contain:
Requirements completeness
When a plan was found:
explicit plan source: unaddressed requirements become P1 manual -> downstream-resolver findingsinferred plan source: unaddressed requirements become P3 advisory -> human findingstdd becomes a
testing or requirements-completeness finding unless an explicit exception was
recordedOmit the section entirely when no plan was found.
Format verification
Before delivering the interactive report, verify the findings sections use
pipe-delimited table rows (| # | File | Issue | ... |).
In mode:headless, replace the interactive report with this structured text
envelope:
Code review complete (headless mode).
Scope: <scope-line>
Intent: <intent-summary>
Reviewers: <reviewer-list with conditional justifications>
Verdict: <Ready to merge | Ready with fixes | Not ready>
Artifact: .context/flywheel/review/<run-id>/
Applied N safe_auto fixes.
Gated-auto findings (concrete fix, changes behavior/contracts):
[P1][gated_auto -> downstream-resolver][needs-verification] File: <file:line> -- <title> (<reviewer>, confidence <N>)
Why: <why_it_matters>
Suggested fix: <suggested_fix or "none">
Evidence: <evidence[0]>
Evidence: <evidence[1]>
Manual findings (actionable, needs handoff):
[P1][manual -> downstream-resolver] File: <file:line> -- <title> (<reviewer>, confidence <N>)
Why: <why_it_matters>
Evidence: <evidence[0]>
Advisory findings (report-only):
[P2][advisory -> human] File: <file:line> -- <title> (<reviewer>, confidence <N>)
Why: <why_it_matters>
Pre-existing issues:
[P2][gated_auto -> downstream-resolver] File: <file:line> -- <title> (<reviewer>, confidence <N>)
Why: <why_it_matters>
Residual risks:
- <risk>
Learnings & Past Solutions:
- <learning>
Agent-Native Gaps:
- <gap description>
Service Readiness Notes:
- <readiness note>
Schema Drift Check:
- <drift status>
Deployment Notes:
- <deployment note>
Testing gaps:
- <gap>
Coverage:
- Suppressed: <N> findings below 0.60 confidence (P0 at 0.50+ retained)
- Untracked files excluded: <file1>, <file2>
- Failed reviewers: <reviewer>
Review complete
Headless detail enrichment rules:
Why: and Evidence: come from reviewer artifact files on disk.Suggested fix: comes from the compact reviewer return.file + line_bucket(line, +/-3) and then by
normalized title as a tiebreaker.Why: and Evidence: for that finding and
note the gap in Coverage.Before delivering the review, verify:
safe_auto -> review-fixergated_auto or manual findings owned
by downstream-resolveradvisory findings and anything owned by human or
releaseInteractive
safe_auto -> review-fixer findings automatically.gated_auto or
manual findings remain.manual findings remain, offer residual-work vs report-only choices.gated_auto findings remain, offer approval, residual-work, or
report-only choices.Autofix
safe_auto -> review-fixer.Report-only
Headless
safe_auto -> review-fixer in a single pass.max_rounds: 2.requires_verification: true, the round is not
complete until the targeted verification runs.In interactive, autofix, and headless modes, write a per-run artifact under:
.context/flywheel/review/<run-id>/
Include:
Also write metadata.json with at least:
{
"run_id": "<run-id>",
"branch": "<git branch --show-current at dispatch time>",
"head_sha": "<git rev-parse HEAD at dispatch time>",
"verdict": "<Ready to merge | Ready with fixes | Not ready>",
"completed_at": "<ISO 8601 UTC timestamp>"
}
In autofix mode, create durable todo files only for unresolved actionable
findings whose final owner is downstream-resolver.
If a shared evidence bundle already exists, or if this review is clearly
feeding $fw:commit, read ../commit/references/evidence-bundle.md and append
one short review entry to:
.context/flywheel/evidence/<bundle-id>/summary.md
Record only what later stages need:
Keep full reviewer detail in .context/flywheel/review/<run-id>/ and link
to it from the shared bundle instead of duplicating large findings payloads.
Interactive mode only:
$fw:commit to push and refresh the PR, or Exit$fw:commit, Continue without finishing the branch, or ExitContinue or Exit$fw:browser-test before $fw:commit.$fw:rollout before $fw:commit.$fw:optimize as the next handoff.Autofix, report-only, and headless modes stop after report, artifact emission, and residual-work handoff.
If the platform does not support parallel subagents, run reviewers sequentially. Keep the same stages, merge pipeline, and output format.
@./references/reviewer-registry.yaml
@./references/persona-loading.md
@./references/stack-packs/index.yaml
@./references/subagent-template.md
@./references/diff-scope.md
@./references/findings-schema.json
@./references/review-output-template.md
@../commit/references/evidence-bundle.md
agents/openai.yaml (opens in a new tab)references/diff-scope.md (opens in a new tab)references/findings-schema.json (opens in a new tab)references/persona-loading.md (opens in a new tab)references/personas/adversarial.md (opens in a new tab)references/personas/agent-native.md (opens in a new tab)references/personas/api-contract.md (opens in a new tab)references/personas/architecture.md (opens in a new tab)references/personas/cli-readiness.md (opens in a new tab)references/personas/correctness.md (opens in a new tab)references/personas/data-access.md (opens in a new tab)references/personas/data-migrations.md (opens in a new tab)references/personas/datadog-reviewer.md (opens in a new tab)references/personas/deployment-verification.md (opens in a new tab)references/personas/go-reviewer.md (opens in a new tab)references/personas/java-reviewer.md (opens in a new tab)references/personas/kafka-reviewer.md (opens in a new tab)references/personas/learnings-researcher.md (opens in a new tab)references/personas/maintainability.md (opens in a new tab)references/personas/observability.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mopeyjellyfish/flywheel --plugin flywheel32 skills in this plugin
/architecture-strategyAssess repo-grounded architecture choices and improvements. Use for boundaries, service splits, dependency direction, or distributed posture./brainstormExplore requirements and approaches. Use for a fuzzy idea, open scope, or one direction that needs sharper behavior before planning./browser-testRun browser acceptance checks with playwright-cli. Use when browser-visible behavior needs fresh proof before review or commit./commitFinish a branch cleanly. Use to verify readiness, make logical commits, push, and create or refresh a PR with evidence.