/skillbook-skills:code-review-loopfrom skillbook-skills
Software-factory chain stage: two-axis code review of the integration branch against the merge-base with origin/main, written to an untracked local report, then routed — normal findings to dev-flow, a clean review to create-pr, decision-forcing findings to grill-with-spec, which pauses the chain on the maintainer. Use for /code-review-loop or any independent review that must pick the next stage.
Ships in skillbook-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
In helper commands, replace <skill-dir> with the absolute directory containing
this loaded SKILL.md; keep the shared worktree as the working directory.
Independent review of the integration branch, then route to the next stage. You did not write this code. Read durable artifacts only; do not reconstruct the implementer's reasoning from the handoff doc.
Model pin: opencode-go/mimo-v2.6-pro, --thinking high — the model's
highest available effort (max clamps to it). It runs headless as a pi
session that the pack helper launches into a visible Kepler terminal from the
shared worktree, started at the end of the implement-spec session or
standalone with /code-review-loop.
Standalone entry: /code-review-loop without a task or a spec asks the
user which one — the spec issue, or the tracker issue at hand — before it
pins the fixed point. The answer names the run's subject, and the ids resolve
from the answer's context: the standalone session's own Kepler metadata
(GET /agent/sessions, filtered by the worktree) is the source when the
harness registers it, and a live worktree entry (GET /terminal/list,
chain-labeled preferred) is the fallback. All three ids ride the helper's
explicit --repo-id/--worktree-id/--task-id flags on every route's launch —
the dev-flow or create-pr stage, and the pause's grill session; the helper's
no-anchor-no-flags hard error stands as the standalone path — standalone
invocations are outside the chain's contract — so a run that resolves no ids
stops instead of guessing.
Read the handoff doc; it points at the spec issue, the tickets, the PR (when
one exists) and the worktree. The fixed point is the merge-base with
origin/main:
git fetch origin
git merge-base origin/main HEAD
When a PR exists, its base ref names the base branch. Read it with
gh pr view --json baseRefName; the fixed point is the merge-base with it:
git merge-base origin/<baseRefName> HEAD.
Confirm the ref resolves and git diff <fixed-point>...HEAD is non-empty
before spawning reviewers.
Call the Skill tool for code-review with the fixed point. It runs the
Standards and Spec axes as parallel sub-agents and reports them side by side.
Keep the axes separate: do not merge or rerank their findings.
Write the aggregated report to an untracked local markdown file in the shared
worktree, for example .scratch/software-factory/review-<spec>-<short-sha>.md
(create the parent directory; never git add the file and never commit it).
The report is the durable artifact every later stage reads. Include the fixed
point, the diff command, and every finding labelled Standards or Spec.
Classify the findings, then take exactly one route:
Normal findings — the fix is obvious and derivable from the code, the
task or the spec. Route to dev-flow, which publishes them as fix tickets
and hands off to implement-spec.
Clean review — no findings on either axis. Route to create-pr, which
ships the verified branch.
Decision-forcing findings — the fix is not obvious, or the needed
decision cannot be derived from the code, the task or the spec. Route to
grill-with-spec, which opens the grilling session on the task and pauses
the chain on the maintainer. Classify conservatively: if the resolution
would overturn a decision the user already made, it is decision-forcing.
A finding is decision-forcing also when the fix would change one of the
project's commitments — what the project is or promises — instead of
satisfying them:
A fix that satisfies these commitments is normal — classify conservatively as before.
Always call the Skill tool for handoff first, tailored to the chosen stage.
It points at the review report, the spec issue, the tickets and the PR.
dev-flow — launch a new pi session:
node "<skill-dir>/scripts/launch-stage.mjs" dev-flow <spec> 'Run the dev-flow skill for spec #<n>: load the dev-flow skill and follow it. Read the handoff doc at <path> and the review report at <path>. Publish the findings as fix tickets.'
create-pr — launch a new pi session:
node "<skill-dir>/scripts/launch-stage.mjs" create-pr <spec> 'Run the create-pr skill for spec #<n>: load the create-pr skill and follow it. Read the handoff doc at <path> and the review report at <path>.'
grill-with-spec — actuate the pause instead of waiting to be noticed. Run:
node "<skill-dir>/scripts/open-grill-session.mjs" <spec> '<re-entry prompt>'
The helper creates the opencode session on the task, labels it chain #<spec>: grill-with-spec, pins its model and effort, and sends the re-entry
prompt — so a fresh grilling session lands unread on the maintainer's
task. The re-entry prompt carries the pointers: the handoff doc path,
the review report path, the spec issue and the decision-forcing finding.
When the helper reports a connection-level failure it prints the pause — the
manual re-entry route — with those pointers in the prompt; the maintainer
re-enters with /grill-with-spec in Kepler. The pause ends when
grill-with-spec hands off to dev-flow.
Every route but the last starts the next stage as a new session. The route to
grill-with-spec opens the pause itself: the grilling session is created on the
task, and the durable report plus the handoff doc are the state it resumes
from. Only when the helper cannot reach the API does the pause fall back to a
printed notice waiting on a manual /grill-with-spec re-entry.
The chain's rules apply at this stage and every later one:
handoff skill writes the compacted doc to the OS temp directory; the
next session reads it by pointer.GLOSSARY.md, the review report — never as conversation.node "<skill-dir>/scripts/launch-stage.mjs" <stage> <spec> '<pointers>'.
The helper starts a visible chain #<spec>: <stage> Kepler terminal, injects
the stage's pinned command under a retry wrapper and prints the terminal id.
The wrapper is harness-agnostic — whatever the harness, pi is not
load-bearing — and gives the pinned command 5 attempts with exponential
backoff (a ~10-minute window). On exhaustion it leaves a loud FAILED marker
in the terminal buffer (stage, spec, the exact resume command) and actuates a
wake — an unread session on the task carrying that resume command. A launch
that never executes is caught by the helper's post-injection check, which
confirms the wrapper started after injection and recovers. The detached
nohup pi fallback fires only on a connection-level failure to the terminal
API and never after
POST /terminal/start succeeded — a reachable API never silently degrades —
and it preserves error.message while reporting which path it took.pi command — the stage launch and each sub-agent — carries
an explicit --provider, --model and --thinking; never rely on pi's
ambient default (the kimi-k3 incident: three un-pinned spawns burned the
most expensive model in the account — the ambient default is an environment
fact, not a chain decision).ADR-0006 is the canonical record of the shared chain rules and the pins they carry; this copy stays for self-containment.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
52 skills in this plugin
/architectSketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for "architect this", "design this", or non-trivial work where jumping to code would lock in the wrong shape./arenaSpawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for "arena this", "throw it in the arena", or when one attempt at a non-trivial artifact would lock in the wrong shape./automate-meUse for "automate me", "create/update/refresh my -mode skill", "turn/capture my preferences or working style into a skill", or wanting agents to follow how the user works. Drafts or revises a personal -mode skill via create-skill + unslop, optionally pulling fresh evidence from recent transcripts.npx claudepluginhub dyegolara/skillbook --plugin skillbook-skills