Plan, Build, Review
Coordinate scoped work without mixing planning, implementation, and review.
The main agent owns scope, sequencing, global coherence, user communication,
and approval gates. It must not outsource product, architecture, or complexity
judgment to role verdicts.
Spawn every named role with a fresh, isolated context and a minimal,
authoritative task packet. Self-contained does not mean copying the full plan
or parent conversation.
- In Codex, always call
spawn_agent with fork_turns="none" — the default
is fork_turns="all", which inherits the entire parent conversation.
- In Claude Code, use a normal non-fork custom subagent invocation.
Do not rely on or inherit parent conversation history. Give each role a short
decision summary: project purpose, target user and deployment model, owner
decisions, superseded requirements, explicit exclusions, relevant roadmap
delta, and the current approval or release state. Add only the plan slice and
evidence needed for the role's assigned judgment. If this summary conflicts
with the source plan or repository evidence, stop and escalate.
1. Preflight
- Read applicable repository instructions and status documents.
- Inspect the base branch, working tree, relevant code, tests, and public
contracts.
- Preserve unrelated changes. Stop if they prevent safe work.
- Identify a lowercase hyphenated scope slug. Record a version only when the
work is a versioned milestone or release.
2. Plan and Review
- Spawn
pbr-explorer only for a bounded investigation that materially
improves planning.
- Spawn
pbr-planner with the request, decision summary, repository
instructions, preflight evidence, and explorer findings. Require a
decision-complete plan with ordered, reviewable tasks. The plan must state
which material requirements come from the owner and which are inferred;
compare its scope with the roadmap; and explicitly flag any new public
contract, compatibility promise, deployment model, or security posture for
owner decision before the plan can pass. Choose validation by actual
consumer. Review human-consumed artifacts against owner intent and
change-specific claims without generic structural or semantic policy. Give
machine-consumed artifacts proportionate structural and behavioral checks.
When work includes asynchronous, concurrent, polling, or other time-sensitive
coordination, state its temporal invariants and consumer-observable behavior.
Give local, PR, main, release, and scheduled validation distinct purposes;
justify equivalent coverage.
- Reconcile the draft with repository evidence in the main thread.
- Before hashing or freezing the draft, verify expected encoding and line
endings, a final newline, no trailing whitespace, and diff hygiene. Hash
only after all checks pass.
- Spawn a fresh
pbr-reviewer with the decision summary, relevant
evidence, and draft. Require one leading verdict: PASS,
CHANGES_REQUIRED, or BLOCKED. The reviewer must make two separate
judgments: a premise review (purpose, user, architecture, deployment,
compatibility, security, and roadmap delta) and a specification review
(scope, dependencies, actionability, acceptance, and validation). PASS
requires both judgments to pass.
- Return accepted blocking findings to the same planner, then use a fresh
reviewer. Ask the user when a material decision or missing evidence blocks
planning, or the same blocker survives two review cycles.
- Present only a passed plan, its premise summary, assumptions, and
non-blocking notes. Stop for explicit user approval.
Do not create a branch, save the plan, or implement before approval. Semantic
revisions return to full review and approval. A proven byte-only correction may
use focused independent review: rerun byte-hygiene checks, compute and approve
a new hash, reuse still-valid evidence, and do not reconstruct history solely
to make the corrected bytes its first commit.
3. Establish the Approved Work
- Recheck the branch and working tree.
- Create a branch and plan path that follow repository conventions. By
default, use
work/<slug> and docs/plans/<slug>.md; for a versioned
milestone, milestone/<version>-<slug> and
docs/plans/<version>-<slug>.md remain suitable examples.
- Save the approved plan and commit it before implementation.
- Keep the plan, task checkpoints, and release-ready documentation inside the
semantic work branch and PR. Avoid plan-only, checkpoint-only, or closeout
PRs unless independently valuable and mergeable.
- Create a task ledger from the approved tasks. Track
pending, building,
reviewing, accepted, or blocked, plus checkpoint and validation
evidence.
Keep approved plan bytes immutable except through that byte-only correction
path. Record progress in the ledger and commits.
4. Execute One Task at a Time
Do not begin a later task until the current task passes review, validation, and
has a stable checkpoint commit.
For each task:
- Mark it
building and record its review base.
- Spawn a fresh
pbr-builder with the decision summary, the approved
plan slice for one task, repository instructions, review base,
accepted-task summaries, working-tree state, and validation commands. When
the approved task has temporal risk, the builder must derive and exercise a
bounded temporal scenario matrix from the approved invariants and real
consumer interactions. The builder must stop and report rather than
mechanically implement when a task needs a new premise, crosses an unplanned
abstraction boundary, creates unexpected producer-consumer coupling, depends
on incidental environment state, adds validation that matches no actual
consumer or distinct purpose, or cannot leave the branch correct on its own.
- Inspect the returned delta and evidence. A task or PR is the smallest
semantically complete, independently mergeable, independently verifiable
unit; do not split only by file type, code layer, or a fixed template. Split
or combine work only when the resulting units each preserve a clear
invariant and do not rely on a future task to repair a known incomplete
state. Otherwise return to planning and approval. A feature normally uses
one PR for implementation, tests, current public descriptions, and
release-ready documentation. Treat post-merge defects as new corrective
work.
- Mark it
reviewing. Select the smallest sufficient review charter for the
change: implementation, final surface, integration, or another explicitly
stated risk-based charter. For temporal risk, the charter must challenge the
bounded scenario matrix against the approved invariants and
consumer-observable behavior. Spawn a fresh pbr-reviewer with the
decision summary, approved plan slice, task, review-base delta, repository
instructions, accepted-task summaries, validation evidence, selected
charter, and what that review is not intended to prove.
- On
CHANGES_REQUIRED, send accepted blocking findings to the same builder,
rerun validation, and use a fresh reviewer. On BLOCKED, obtain the missing
evidence, capability, or user decision. Stop when the same blocker survives
two review cycles.
- After
PASS, confirm the reviewed delta and validation inputs are unchanged.
Reuse evidence with available command, result, provenance, and applicability.
Rerun only invalidated or charter-specific checks, and review changed tracked
output.
- Commit the accepted delta with its task ID, mark it
accepted, and report
the checkpoint and evidence.
A material change invalidates PASS. A bounded finding fix that changes no
scope, premise, or charter needs targeted validation and explicit closure
against the new head; otherwise use a fresh reviewer.
Reviewer independence means independent judgment, not automatic repetition of
the builder's complete validation suite.
5. Integration Review
- After all tasks are accepted, decide whether a distinct integration gate
has a purpose not already covered by task review.
- For multiple tasks or real cross-task, cross-component, or cumulative risk,
run the relevant cumulative validation and spawn a fresh
pbr-reviewer
with the request, approved plan, ledger, checkpoints, verdicts, evidence,
repository instructions, and full branch diff.
- For one task with no distinct integration risk, let its final task review
serve as cumulative review only when the charter explicitly covers the
complete base-to-head acceptance criteria. Do not repeat the same review
under a second label.
- Reuse applicable validation evidence. Run additional checks only for the
cumulative risk this gate is intended to cover.
- Treat required fixes as a narrow task: build, validate, review, and
checkpoint it before repeating integration review.
The approved work is complete only after a cumulative PASS, whether supplied
by the final task review or a distinct integration review.
6. Visibility
Use the native plan display when available. Show setup, each task, integration
review, and publication; keep it synchronized with the ledger.
Keep internal role and ledger detail available for coordination, but report to
the human at each meaningful state change: current state, what happened, actual
impact, next expected event, and whether a decision is needed. Distinguish a
product or data correctness issue from a merge-gate failure and a workflow
issue. Include task ID, role, and review pass in internal task names. During
long operations, post a brief human-readable heartbeat at least once per
minute.
7. Publication Gate
Before requesting publication approval, confirm the required cumulative review
passed, validation is green, the branch contains only accepted work, and PR or
release prerequisites are available.
Keep release-ready repository documentation durable enough that publication
state can be owned by the release platform. Publication alone does not justify
a follow-up closeout PR.
At release, validate the delivered object instead of repeating earlier gates.
For a source-only release, verify the tag target, release metadata, and source
archive. Run tag CI only for tag-specific execution, assets, signing, or other
new coverage.
Summarize the outcome, checkpoints, tests, final verdict, non-blocking notes,
and working-tree state. Ask before pushing or opening a draft pull request.
Never merge automatically.
1---2name: plan-build-review3description: Plan and execute explicitly requested scoped work, from a feature to a milestone, through independent plan review, user approval, task-level build and review checkpoints, integration review, and controlled publication. Use only when the user explicitly invokes this skill by name (for example, $plan-build-review in Codex or /plan-build-review:plan-build-review in Claude Code) or clearly asks for this workflow in other words; do not invoke it for ordinary coding, review, or documentation tasks.4---56# Plan, Build, Review78Coordinate scoped work without mixing planning, implementation, and review.9The main agent owns scope, sequencing, global coherence, user communication,10and approval gates. It must not outsource product, architecture, or complexity11judgment to role verdicts.1213Spawn every named role with a fresh, isolated context and a minimal,14authoritative task packet. Self-contained does not mean copying the full plan15or parent conversation.1617- In Codex, always call `spawn_agent` with `fork_turns="none"` — the default18 is `fork_turns="all"`, which inherits the entire parent conversation.19- In Claude Code, use a normal non-fork custom subagent invocation.2021Do not rely on or inherit parent conversation history. Give each role a short22decision summary: project purpose, target user and deployment model, owner23decisions, superseded requirements, explicit exclusions, relevant roadmap24delta, and the current approval or release state. Add only the plan slice and25evidence needed for the role's assigned judgment. If this summary conflicts26with the source plan or repository evidence, stop and escalate.2728## 1. Preflight29301. Read applicable repository instructions and status documents.312. Inspect the base branch, working tree, relevant code, tests, and public32 contracts.333. Preserve unrelated changes. Stop if they prevent safe work.344. Identify a lowercase hyphenated scope slug. Record a version only when the35 work is a versioned milestone or release.3637## 2. Plan and Review38391. Spawn `pbr-explorer` only for a bounded investigation that materially40 improves planning.412. Spawn `pbr-planner` with the request, decision summary, repository42 instructions, preflight evidence, and explorer findings. Require a43 decision-complete plan with ordered, reviewable tasks. The plan must state44 which material requirements come from the owner and which are inferred;45 compare its scope with the roadmap; and explicitly flag any new public46 contract, compatibility promise, deployment model, or security posture for47 owner decision before the plan can pass. Choose validation by actual48 consumer. Review human-consumed artifacts against owner intent and49 change-specific claims without generic structural or semantic policy. Give50 machine-consumed artifacts proportionate structural and behavioral checks.51 When work includes asynchronous, concurrent, polling, or other time-sensitive52 coordination, state its temporal invariants and consumer-observable behavior.53 Give local, PR, main, release, and scheduled validation distinct purposes;54 justify equivalent coverage.553. Reconcile the draft with repository evidence in the main thread.564. Before hashing or freezing the draft, verify expected encoding and line57 endings, a final newline, no trailing whitespace, and diff hygiene. Hash58 only after all checks pass.595. Spawn a fresh `pbr-reviewer` with the decision summary, relevant60 evidence, and draft. Require one leading verdict: `PASS`,61 `CHANGES_REQUIRED`, or `BLOCKED`. The reviewer must make two separate62 judgments: a premise review (purpose, user, architecture, deployment,63 compatibility, security, and roadmap delta) and a specification review64 (scope, dependencies, actionability, acceptance, and validation). `PASS`65 requires both judgments to pass.666. Return accepted blocking findings to the same planner, then use a fresh67 reviewer. Ask the user when a material decision or missing evidence blocks68 planning, or the same blocker survives two review cycles.697. Present only a passed plan, its premise summary, assumptions, and70 non-blocking notes. Stop for explicit user approval.7172Do not create a branch, save the plan, or implement before approval. Semantic73revisions return to full review and approval. A proven byte-only correction may74use focused independent review: rerun byte-hygiene checks, compute and approve75a new hash, reuse still-valid evidence, and do not reconstruct history solely76to make the corrected bytes its first commit.7778## 3. Establish the Approved Work79801. Recheck the branch and working tree.812. Create a branch and plan path that follow repository conventions. By82 default, use `work/<slug>` and `docs/plans/<slug>.md`; for a versioned83 milestone, `milestone/<version>-<slug>` and84 `docs/plans/<version>-<slug>.md` remain suitable examples.853. Save the approved plan and commit it before implementation.864. Keep the plan, task checkpoints, and release-ready documentation inside the87 semantic work branch and PR. Avoid plan-only, checkpoint-only, or closeout88 PRs unless independently valuable and mergeable.895. Create a task ledger from the approved tasks. Track `pending`, `building`,90 `reviewing`, `accepted`, or `blocked`, plus checkpoint and validation91 evidence.9293Keep approved plan bytes immutable except through that byte-only correction94path. Record progress in the ledger and commits.9596## 4. Execute One Task at a Time9798Do not begin a later task until the current task passes review, validation, and99has a stable checkpoint commit.100101For each task:1021031. Mark it `building` and record its review base.1042. Spawn a fresh `pbr-builder` with the decision summary, the approved105 plan slice for one task, repository instructions, review base,106 accepted-task summaries, working-tree state, and validation commands. When107 the approved task has temporal risk, the builder must derive and exercise a108 bounded temporal scenario matrix from the approved invariants and real109 consumer interactions. The builder must stop and report rather than110 mechanically implement when a task needs a new premise, crosses an unplanned111 abstraction boundary, creates unexpected producer-consumer coupling, depends112 on incidental environment state, adds validation that matches no actual113 consumer or distinct purpose, or cannot leave the branch correct on its own.1143. Inspect the returned delta and evidence. A task or PR is the smallest115 semantically complete, independently mergeable, independently verifiable116 unit; do not split only by file type, code layer, or a fixed template. Split117 or combine work only when the resulting units each preserve a clear118 invariant and do not rely on a future task to repair a known incomplete119 state. Otherwise return to planning and approval. A feature normally uses120 one PR for implementation, tests, current public descriptions, and121 release-ready documentation. Treat post-merge defects as new corrective122 work.1234. Mark it `reviewing`. Select the smallest sufficient review charter for the124 change: implementation, final surface, integration, or another explicitly125 stated risk-based charter. For temporal risk, the charter must challenge the126 bounded scenario matrix against the approved invariants and127 consumer-observable behavior. Spawn a fresh `pbr-reviewer` with the128 decision summary, approved plan slice, task, review-base delta, repository129 instructions, accepted-task summaries, validation evidence, selected130 charter, and what that review is not intended to prove.1315. On `CHANGES_REQUIRED`, send accepted blocking findings to the same builder,132 rerun validation, and use a fresh reviewer. On `BLOCKED`, obtain the missing133 evidence, capability, or user decision. Stop when the same blocker survives134 two review cycles.1356. After `PASS`, confirm the reviewed delta and validation inputs are unchanged.136 Reuse evidence with available command, result, provenance, and applicability.137 Rerun only invalidated or charter-specific checks, and review changed tracked138 output.1397. Commit the accepted delta with its task ID, mark it `accepted`, and report140 the checkpoint and evidence.141142A material change invalidates `PASS`. A bounded finding fix that changes no143scope, premise, or charter needs targeted validation and explicit closure144against the new head; otherwise use a fresh reviewer.145146Reviewer independence means independent judgment, not automatic repetition of147the builder's complete validation suite.148149## 5. Integration Review1501511. After all tasks are accepted, decide whether a distinct integration gate152 has a purpose not already covered by task review.1532. For multiple tasks or real cross-task, cross-component, or cumulative risk,154 run the relevant cumulative validation and spawn a fresh `pbr-reviewer`155 with the request, approved plan, ledger, checkpoints, verdicts, evidence,156 repository instructions, and full branch diff.1573. For one task with no distinct integration risk, let its final task review158 serve as cumulative review only when the charter explicitly covers the159 complete base-to-head acceptance criteria. Do not repeat the same review160 under a second label.1614. Reuse applicable validation evidence. Run additional checks only for the162 cumulative risk this gate is intended to cover.1635. Treat required fixes as a narrow task: build, validate, review, and164 checkpoint it before repeating integration review.165166The approved work is complete only after a cumulative `PASS`, whether supplied167by the final task review or a distinct integration review.168169## 6. Visibility170171Use the native plan display when available. Show setup, each task, integration172review, and publication; keep it synchronized with the ledger.173174Keep internal role and ledger detail available for coordination, but report to175the human at each meaningful state change: current state, what happened, actual176impact, next expected event, and whether a decision is needed. Distinguish a177product or data correctness issue from a merge-gate failure and a workflow178issue. Include task ID, role, and review pass in internal task names. During179long operations, post a brief human-readable heartbeat at least once per180minute.181182## 7. Publication Gate183184Before requesting publication approval, confirm the required cumulative review185passed, validation is green, the branch contains only accepted work, and PR or186release prerequisites are available.187188Keep release-ready repository documentation durable enough that publication189state can be owned by the release platform. Publication alone does not justify190a follow-up closeout PR.191192At release, validate the delivered object instead of repeating earlier gates.193For a source-only release, verify the tag target, release metadata, and source194archive. Run tag CI only for tag-specific execution, assets, signing, or other195new coverage.196197Summarize the outcome, checkpoints, tests, final verdict, non-blocking notes,198and working-tree state. Ask before pushing or opening a draft pull request.199Never merge automatically.