From agentic-workflow
Implements features or fixes one phase at a time from a SPEC's ## Phases ledger, enforcing branch safety, verification gates, and per-phase commit discipline. Handles small features end-to-end when no phases exist.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agentic-workflow:execute-phase <NN> [P<k>] | --fix <n> [P<k>] | [--force]<NN> [P<k>] | --fix <n> [P<k>] | [--force]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Three modes:
Three modes:
docs/features/<NN>-<slug>/ using its TASKS.md.Size: XS/S; only a SPEC.md, no planning artifacts): execute its SPEC's ## Phases one phase per invocation; a SPEC without ## Phases runs end-to-end in one pass (legacy fallback — see Workflows).--fix — implement a fix from docs/fix/<n>-<topic>/: same phased consumption and legacy fallback.✓ 1. Branch verified FIRST: `git branch --show-current` was RUN and its output
pasted. Output = the default branch → `git switch -c <branch>` was RUN
before any edit. NEVER work on main/master.
✓ 2. Phase-lint pre-flight guard RUN against the target phase (after the
dependency/own-status gates, before any edit) — its 8 boxes were checked,
not assumed. Any FAIL without `--force` → STOP with the fixed block; no
edit happens on a non-atomic phase.
✓ 3. The gate was RUN (not assumed): commands + exit codes pasted.
✓ 4. `git add <files>` and `git commit -m "<type>(<scope>): <summary>"` were
EXECUTED and the resulting sha is pasted. Describing a commit you did not
run counts as NOT committed.
✓ 5. Unit finished (single-pass, --fix, or final phase)? Then `git push` and
`gh pr create` were EXECUTED and **the PR URL is printed in the chat**
(not every agent shows open PRs — the link in the chat is the contract).
The PR body is NEVER empty: what it does, why, evidence, and
`Closes #<n>` when issue-born. The body is passed with `--body-file`
(real Markdown, NO `\`-escaped backticks — see Issue policy). AND the roadmap row (or fix-index entry)
was updated to `done · [#<pr>](<pr-url>)` in a follow-up
`docs: link PR #<n>` commit, pushed to the same branch. A `done` row
without its PR link is an UNFINISHED unit. Unit not finished? Then
NOTHING was pushed.
✓ 6. Clean-tree check LAST: `git status --porcelain` was RUN and its output
pasted immediately before ending the turn. Any tracked modification —
CODE OR DOCS (`docs/**` counts; doc updates left uncommitted are the #1
close-out failure) — was committed before the turn ended. AND if the
branch has an open PR: `git status -sb` shows the branch is NOT ahead of
its remote (every commit pushed). A dirty tree or an unpushed commit on a
PR-backed branch = the turn is NOT done.
✓ 7. Artifact language: explicit user instruction > the project's declared
docs language > English. The CONVERSATION language never decides — a
Spanish prompt still produces English commits/PRs/issues unless one of
the first two says otherwise.
✓ 8. Descope guard applied to every issue created this turn (see *Descope
guard* under *Issue policy*): each classified discovered vs. descope; any
descope has a user-approved, dated `## Amendments` entry in the governing
SPEC created BEFORE the issue, and the issue links it. No issue created
this turn is the first record of a descope. No issues created this turn?
Box passes trivially — state so.
✓ 9. The closing `→ Next:` block is printed as the ABSOLUTE last output.
Push policy — two regimes, by whether the PR exists yet. Before the PR:
push happens exactly once, at the PR step — never mid-phase, never unasked,
never to the default branch. After the PR exists: every subsequent commit
on that branch (folded review findings, audit-blocker fixes, doc updates, the
docs: link PR commit) is pushed immediately after committing — an open
PR must always show the branch's latest state; CI and the merge gate judge
the remote, not your working copy. If, about to end the turn, any box is
unchecked: STOP and complete it now — a turn that ends with work implemented
but uncommitted, committed but unpushed (PR open), or committed but missing
its PR (finished units), is a FAILED turn, not a done one.
git branch --show-current before any edit/commit; if main, create the working branch first (assistant only; the user may use main).P1, P2, …. The <phase> argument and every reference in PLAN.md/TASKS.md/progress.md/commits is P1, P2, … ("phase N") — never S1/S2/"Step N". If a plan you're handed uses S1-style labels, normalize it to P1, … before executing and note it in decisions.md.TASKS.md, progress.md, testing.md, known-issues.md each phase (and decisions.md if architecture moved).TASKS.md/PLAN.md and record why in decisions.md — never silently diverge from the written plan.--force.--force.SPEC.md, the phase's TASKS.md section, progress.md).
Targeted reads (≤ 50 lines of a named range) and grep/glob results do NOT
count against the cap. About to exceed it → STOP reading; record what you
know and what's still unverified in the phase's Gotchas: line, then
proceed on what targeted reads can confirm, or report the blocker — never
sweep the codebase.file:line) into your working notes / the
progress entry and work from the note. Never re-read a file already
summarized; never quote whole files into the conversation.Layer:. Nothing else by default; every additional doc counts
against the file cap.progress.md — fixed schema)Every phase ends by APPENDING one entry to the unit's progress.md. Feature
mode: the file plan-feature-scaffold created. Phased XS/S single-pass and
--fix units: create progress.md beside the SPEC on P1 (the SPEC's
checkboxes stay the task ledger; this file is the handoff channel).
Fixed schema — all five lines present, none is a valid value, free prose
is not:
## P<k> — <YYYY-MM-DD>
- Done: <the phase's delivered tasks, one line>
- Remains: <in-unit work still open, or none>
- Gotchas: <surprises, workarounds, or decisions the NEXT phase must know, or none>
- Files: <paths touched>
- Next: P<k+1> — <its title> | unit finished
The entry rides the phase commit (no sha in the entry — the commit that
carries it IS the phase's sha; git log resolves it). The next phase
starts in a fresh conversation and reads ONLY SPEC.md, its own phase's
TASKS.md section (or SPEC ## Phases), and progress.md — this file IS
the handoff; never rely on session memory from a previous phase.
Run this check for every mode (feature phase, single-pass, and --fix)
before touching anything:
Read the unit's Depends on: (SPEC) and its roadmap/fix-index row.
Build the transitive closure: for each dependency, read its roadmap row and collect its dependencies too, until none remain.
For each entry in the closure, its status must be merged in the forge
(gh pr view on its PR, or the row's PR reference) — done-but-PR-open is
NOT met (its code isn't on the default branch), and a missing folder/row is
NOT met.
All met → proceed to the own-status precondition below.
Any unmet → STOP before any edit and print exactly:
DEPENDENCY GATE — <NN>-<slug> BLOCKED
Unmet chain (deepest first is the one to start):
<NN> ← <dep> (<status>) [← <dep-of-dep> (<status>) …]
Build order to unblock: <deepest> → … → <NN>
→ Next: /execute-phase <deepest> P1 — the deepest unmet dependency (plan it
first with /plan-feature <deepest> if it has no SPEC)
· fix-type dependency → /plan-fix then /execute-phase --fix
· proceed anyway, at your own risk → /execute-phase <NN> <phase> --force
(the override is recorded in decisions.md — never silent)
--force skips the stop (never the check): the gate still runs and its
result is recorded in decisions.md ("started with unmet deps: ,
user-forced ") before implementation begins. --force is a
user-only escape hatch — the autopilot (ship-roadmap) must never pass it.
Feature mode only (a fix has no roadmap-status equivalent — its own state is
the fix-index entry, unaffected). Read this unit's own roadmap row status
(the five-state machine — docs/features/ROADMAP.md → Status legend):
idea (or no SPEC.md with ## Design status: designed) → STOP,
before any edit:
OWN-STATUS GATE — <NN>-<slug> BLOCKED (idea)
This unit has no completed product design yet.
→ Next: /design-feature <slug> — write the product half first
· proceed anyway, at your own risk → /execute-phase <NN> <phase> --force
(the override is recorded in decisions.md — never silent)
defined (product half designed, engineering half / planning
artifacts not yet scaffolded) → STOP:
OWN-STATUS GATE — <NN>-<slug> BLOCKED (defined)
Product half designed; engineering half + planning artifacts not yet scaffolded.
→ Next: /plan-feature <slug> — scaffold the engineering half + TASKS.md
· proceed anyway, at your own risk → /execute-phase <NN> <phase> --force
(the override is recorded in decisions.md — never silent)
planned+ → proceed to the normal workflow.
Legacy compat. A row still reading a plain planned with no
five-state history: check its SPEC.md product half. Complete
(## Design status: designed) → treat as defined+planned, no
redirect. Incomplete/absent → treat as idea, redirect per step 1. See
docs/workflow/MIGRATION.md.
--force skips the STOP (never the check), same rule as the
dependency gate: recorded in decisions.md before implementation begins;
the autopilot (ship-roadmap) must never pass it.
Legacy-SPEC carve-out (check this first, before anything else in this
section): if the target SPEC has no ## Phases section, skip this
guard entirely — no lint run, no STOP — and fall straight through to the
Workflows section's legacy single-pass flow ("A SPEC without ## Phases
… runs the legacy flow … end-to-end in one pass"). The guard below applies
only to a SPEC that carries a ## Phases ledger.
Before touching any code, run the canonical 8-box phase-lint
(docs/fix/_TEMPLATE/SPEC.md ## Phases "Phase-lint" — the authoritative
copy, also quoted in docs/features/_TEMPLATE/SPEC.md ### Phases) against
the target phase (its title, declared layer, task list, and done-when).
All 8 boxes tick → proceed to the normal workflow.
Any box FAILs → STOP before any edit and print exactly:
PHASE-LINT GATE — <NN|n>-<slug> <phase> BLOCKED
Failed boxes:
✗ <box label> — <one-line reason>
[✗ <box label> — <one-line reason>] …
→ Next: /plan-feature <NN> — re-cut or split the phase (feature)
· fix-type unit → /plan-fix — re-cut or split the phase
· proceed anyway, at your own risk → /execute-phase <NN|--fix n> <phase> --force
(the override is recorded in decisions.md — never silent)
--force skips the STOP (never the check): the lint still runs and its
result is recorded in decisions.md (feature mode) or the fix SPEC's
own notes / progress.md if present ("executed non-atomic phase: , user-forced ") before implementation begins. --force is a
user-only escape hatch — the autopilot (ship-roadmap) must never pass it.
The recommended, skippable checkpoint fires on what accumulated since the
last checkpoint, not on a phase count — a phase-counter cadence re-miscalibrates
whenever phase size changes (see #77). After each phase commit, check all
three; recommend the checkpoint (naming which trigger fired) the moment any
one does:
Layer: (the phase-lint enum) than the phase just committed. The just-closed
layer is a coherent reviewable unit.git diff --stat <baseline>..HEAD. Covers a long run
of small same-layer phases the layer-boundary trigger would miss.review-change's
own once-per-unit adversarial cadence (skills/review-change/SKILL.md
"Cadence — once per unit") — the two are independent mechanisms.Last-reviewed marker. Home: progress.md's header line
Last reviewed: <sha>. Sole writer: execute-phase — stamped with the
just-committed phase's sha immediately after a checkpoint is taken (review
happens in a separate turn, so this skill records the marker at the start of
the next phase it executes, using the sha the user confirmed was reviewed).
If the marker is absent (unit's first checkpoint, or a legacy progress.md
predating this rule), the baseline is git merge-base <default-branch> HEAD —
never treat a missing marker as a blocker or crash condition.
Allowed changes in a phase:
TASKS.md, or the SPEC for single-pass/fix)Forbidden — never, even if it "would help":
## Amendments entry (see Descope guard
under Issue policy below) — an issue may never be the first record of a
descopeSomething forbidden looks necessary → stop, record it in decisions.md or
known-issues.md, and surface it — never do it silently.
✓ Verification gate green — type-check + tests + build actually RUN (paste exit
status), never assumed
✓ Every task of this phase checked off in TASKS.md, each mapped to evidence
(code path or test name)
✓ Tests updated/added for every behavior this phase changed
✓ No TODO/FIXME/HACK markers left in the diff
✓ No duplicated logic (reuse the existing helper — cite it if one existed)
✓ No dead code introduced (unused imports, functions, unreachable branches)
✓ No hidden breaking change (changed public contracts diffed against their
consumers)
✓ Architecture doc respected (dependency directions, layer boundaries)
✓ Docs updated — at minimum verify each of: TASKS.md (checkboxes),
progress.md (one handoff entry in the fixed schema — Done / Remains /
Gotchas / Files / Next), testing.md, known-issues.md, decisions.md (if any
decision was taken), SPEC.md (only if scope/acceptance changed — with the
change logged), docs/CAPABILITIES.md (only if this phase introduced a new
cross-cutting subsystem, role, or permission — append the row, additive,
never rewrite existing ones; explicitly n/a when the project has no
inventory file)
✓ Docs COMMITTED with the phase — after the phase commit,
`git status --porcelain -- docs/` returns nothing. Doc updates ride the
phase commit (same `git add`), never sit uncommitted "for later"
A phase that cannot tick every box is not done: fix within the phase's
scope, or record the blocker in known-issues.md, leave the work uncommitted,
and stop with a clear report. Never commit red; never tick a box you didn't
verify.
| Mode | Format |
|---|---|
| feature / single-pass | feat/<NN>-<slug> |
--fix | fix/<issue-number>-<topic> |
Read the SPEC's Branch field; create with git switch -c <name>. If absent/ambiguous, ask. Never commit, amend, or force-push on main.
Honor the project's declared Git workflow (Workflow conventions — branches
or worktrees). Default and assumption everywhere: branches — one active
unit at a time, sequential, plain git switch -c; never create a worktree.
Only when the project explicitly declares worktrees may a unit get its own
checkout — and then one worktree per unit, removed after merge.
Forge operations use the project's declared forge CLI (Workflow conventions —
examples use gh; translate if the project declares another forge).
Forge bodies are Markdown, not shell — never hand-escape them. Backticks,
*,_,#,|in an issue / PR / comment body are formatting; a\before them renders literally (\`code\`instead of`code`) — the #1 forge-formatting bug (worse on some agents than others). Fix it at the source: never pass a Markdown body inline (--body "…", a quoted<<'EOF'heredoc, or single quotes — all of these preserve a stray\or mangle backticks). Instead write the body to a file with the Write tool (plain Markdown — real backticks, zero backslashes; scratchpad is fine) and pass--body-file <path>:gh issue create --body-file <path>,gh pr create --body-file <path>,gh issue comment <n> --body-file <path>(or the declared forge's equivalent). Short one-liners with no Markdown (e.g. a bareCloses #12) may stay inline. Verify after creating:gh issue view <n> --json body/gh pr view <n> --json bodymust show backticks rendering — a literal\`in the output means redo it with--body-file.
--fix: every fix needs a tracked issue; create with gh issue create --template fix.yml --body-file <path> if missing, populating the body from the SPEC (body as a Markdown file — see the Markdown rule above). Use the returned number for branch and folder.Closes #<n> in the PR body. Don't create issues for features that didn't originate from one.A cheap way to look finished is to quietly convert unfinished SPEC scope into a follow-up issue — the unit reads as done, the scope silently moved to the backlog. Before creating any issue while executing this unit, classify it with the fixed descope test:
triage-issue is for.On a descope → STOP before creating the issue. An issue may never be the first record of a descope. The descope must first be recorded as an explicit, user-approved, dated SPEC amendment:
## Acceptance (or
## Phases ledger), and log it in the governing SPEC's ## Amendments
section (create the section if absent) with this canonical row format:
- <YYYY-MM-DD> — descoped: "<criterion/task>" — approved by user — follow-up: #<n>
## Amendments row to replace the
#<n> placeholder with the real issue number, and commit that edit — a
row still reading the literal #<n> placeholder is unlinked and fails
audit-pr's symmetric check.audit-pr's scope-bleed gate and product-audit's recurrence signal both key
off this same ## Amendments log — it is the single authoritative record of
every descope, defined once here.
Feature phase (default) — docs/features/<NN>-<slug>/
main). P1 only: if the planning artifacts
(docs/features/<NN>-<slug>/) are still uncommitted, commit them first on the
feature branch — git add docs/features/<NN>-<slug> && git commit -m "docs(<NN>-<slug>): planning artifacts" —
so planning history stays separate from implementation.progress.md first (the phase handoff record — fixed schema above;
the last entry's Remains:/Gotchas: lines are the previous phase's
message to you), then SPEC.md + the requested phase's TASKS.md
section. That is the whole handoff — never rely on session memory from a
previous phase, and honor the Context budget for everything beyond
these files.known-issues.md, leave the work
uncommitted, and stop with a clear report.git add <changed files> then git commit -m "<type>(<scope>): <summary>" — one commit per phase, conventional format. Run this; don't just describe what should be committed./review-change in the closing block, naming the trigger (see below). The user decides: review now, or continue straight to the next phase — the skill never forces the intermediate stop. The end-of-unit review stays mandatory (it feeds audit-pr, the merge gate). Never run the review in this skill's turn.Resuming an interrupted phase (stated contract — any agent must honor it).
If, on entry, the unit branch already carries dirty files or commits belonging
to the requested phase (a prior run died mid-turn — e.g. the driver process
restarted), do not restart the phase from scratch: reconcile against
TASKS.md first — verify each ticked task's evidence actually exists (code
path / test present), untick any tick without evidence, then continue from the
first unticked task. Idempotent re-entry is the contract workflow-status's
crash-recovery verdict RESUMABLE relies on. If the ledger contradicts the
commits in a way that has no unique next task, stop and report instead of
guessing (that is its AMBIGUOUS verdict — a human decides).
Phased single-pass units — the default for both modes below. Every fix
SPEC and every XS/S feature SPEC drafted since plan-fix 2.1.0 /
plan-feature-scaffold 1.8.0 carries a ## Phases section (≥ 2 phases;
the final one is always Hardening & PR). When the SPEC has it, run one
phase per invocation: execute-phase <NN> [P<k>] /
execute-phase --fix <n> [P<k>] — P<k> omitted → the first phase with an
unticked task (deterministic; no judgement). The SPEC's checkboxes are the
execution ledger (there is no TASKS.md): tick each task with evidence, and
reconcile on re-entry exactly as Resuming an interrupted phase above
prescribes for TASKS.md. Each phase appends its handoff entry to a
progress.md beside the SPEC (created on P1 — see Phase handoff record). Implementation phases run the mode's steps below
but STOP after the phase commit — no push, no PR (the per-phase stop and
the turn contract's box 5 "unit not finished" rule). The final
Hardening & PR phase runs the close-out — the mode's "Mark done + open the
PR" step — in its own invocation: its pre-written tasks ARE the close-out
chain; execute them literally, in order. A SPEC without ## Phases
(drafted before those versions) runs the legacy flow below unchanged,
end-to-end in one pass.
Single-pass — small feature with only a SPEC.md, no planning artifacts
(SPEC carries ## Phases → phased per the block above; otherwise legacy,
all steps in one pass):
SPEC.md (+ DECISIONS.md if present) and the docs its documentation map points to.CHECKLIST.md (below).git add <changed files> then git commit -m "<type>(<scope>): <summary>".Hardening & PR phase's tasks, run in their own
invocation). Flip the roadmap
row to done (it's built; merge state lives in the forge, not the status —
see Marking done), commit that flip, then git push and open the PR
(body written to a file as Markdown, per the Markdown rule above):
gh pr create --base main --title "<type>(<scope>): <summary>" --body-file <path>
(put Closes #<n> in that body when issue-born). Then, with the URL gh pr create
returned: print it in the chat, update the roadmap row to
done · [#<pr>](<pr-url>), commit (docs: link PR #<n>), and push again —
the link commit rides the same open PR. A single-pass unit never ends
branch-only — it always leaves an open, chat-linked PR, regardless of the
review/audit still to come./review-change (the required final quality step;
see Review checkpoint), then audit-pr as the merge gate. Print the next step.--fix — docs/fix/<n>-<topic>/, template docs/fix/_TEMPLATE/SPEC.md, index docs/fix/README.md (SPEC carries ## Phases → phased per the block above; otherwise legacy, all steps in one pass):
gh issue view <n>); if it doesn't, create it
(gh issue create --template fix.yml --body-file <path>, body from the SPEC
written to a Markdown file — per the Markdown rule above).docs/fix/<n>-<topic>/SPEC.md already exists (e.g. from plan-fix), use it — do not re-draft. Otherwise copy the template, fill every section, and register the entry in docs/fix/README.md.fix/<n>-<topic>).## Phases ledger are enough).git add <changed files> then git commit -m "fix(<scope>): <summary>".Hardening & PR phase's tasks, run in their own
invocation). Set the
docs/fix/README.md entry's status to done (built, not yet merged), commit,
git push, then open the PR with the body written to a Markdown file (per the
Markdown rule above): gh pr create --base main --title "fix(<scope>): <summary>" --body-file <path>
(the body includes Closes #<n>). Run the commands. Then, with the returned URL: print it in the chat,
set the docs/fix/README.md entry to done · [#<pr>](<pr-url>), commit
(docs: link PR #<n>), and push again. A fix never ends branch-only —
it always leaves an open, chat-linked PR./review-change, then audit-pr as the merge gate.
Print the next step. Keep the fix-index entry until the PR is actually merged
(don't drop issue tracking early; the merge gate also blocks on pending docs).docs/fix/README.md entry (or archive it to the
project's fix history per its convention) — never before the merge.(The Depends on: check for fixes is the same Dependency gate above — it runs
before step 1, transitively, and blocks unless --force.)
Tests first where they pay. For core/domain and orchestration phases, write the phase's acceptance/integration tests first (red), then implement to green — the SPEC's dev scenarios are the test list, so its failure modes get exercised, not just documented. UI and adapter glue may test after implementation.
Map each change to the project's layers per its architecture doc; build inner layers first, outer last:
Write docs/features/<NN>-<slug>/CHECKLIST.md: schema migration applied (if any) · core layer has no outer imports · orchestration idempotent + typed errors · adapters implement ports · tests pass · type-check/lint green · UI strings localized (if UI) · domain value-object rules respected · user-facing limitations disclosed · new deps pinned. Note any decisions not captured in the SPEC.
review-change is mandatory — every unit gets a final review before merge, no
exceptions. It runs in its own turn (hand-off, not composed): a skill's model and
effort are fixed at turn start, so invoking review-change from here would run it at
execute-phase's sonnet/medium rather than its own opus/high — under-powering
the review. So suggest it; don't compose it. (General rule: across a model/effort
boundary, hand off; don't compose.) On agents without per-skill model config the same
rule holds by hand: run the review as a separate, fresh invocation on your
strongest model — never inline in the implementation run.
Cadence. Feature mode: after each completed phase, the closing block
recommends the hand-off whenever a Review checkpoint trigger fires
(layer boundary, accumulation, or sensitivity — see above), naming which one —
a suggestion the user may skip to keep executing phases; the skill never
blocks on an intermediate review. What is never optional is the end: every
unit gets one review-change pass before merge (single-pass and --fix
included — they have no intermediate phases, so the end review is their only
one).
Finishing a unit (single-pass, --fix, or a feature's final phase): the last step
is always an open PR. Mark the unit done, commit the flip, push, and gh pr create
(see the mode steps above) — regardless of the review/audit still to come. Then hand
off to /review-change (mandatory), which feeds audit-pr (the merge gate).
Adversarial pass at that mandatory end review. review-change evaluates its
own recommendation checklist there (L/sensitive change, reviewer not the
fleet's strongest or weaker than the author, or a single model family on a
≥M change) and — only when a box fires — recommends --adversarial N
(N=2 default, N=3 on a security/auth surface or a single-family fleet) instead
of its default single-reviewer pass. This is evaluated once, at that mandatory
end review; it does not change the trigger-based checkpoint cadence above.
Checkpoint hand-off (print it — every invocation ends by suggesting the next step; when a trigger fires, the review is the recommendation, continuing is a listed alternative — the user picks):
Phase <N> done and committed. Review checkpoint (recommended) — <trigger name> fired: <one-line reason>.
→ Next: /review-change — it reviews the branch at its own model/effort
· skip the checkpoint → /execute-phase <NN> <next phase> (the mandatory end review still covers everything)
· findings (if you review) → fold fix-now into the branch; non-fix-now → /triage-issue; then re-review
<trigger name> is one of layer boundary, accumulation, or sensitivity
(see Review checkpoint triggers); <one-line reason> cites the evidence
(e.g. "next phase declares api, this one was domain", "612 lines / 11
files since a1b2c3d", "phase touched auth middleware"). No trigger fired?
Omit the checkpoint line entirely and go straight to naming the next phase.
/fold-findings is the standalone skill for this cycle — it carries the
full frozen-classification rule and forbidden list (no known-issues dump, no
severity downgrade, no test loosening, no suppression-as-fix) as a fixed,
independently-invocable contract; prefer it as a fresh hand-off (its own
turn, its own model/effort) whenever one is available. The checklist below is
the in-context / portability fallback for folding inline within this skill's
own turn (e.g. no slash-command menu, or an agent that folds without leaving
its current context).
When review-change findings (fix-now) or audit-pr blockers are folded back
into a branch that already has an open PR, the fold is complete only when
every step below ran — fixing the code and stopping is the classic way findings
end up "solved" locally but absent from the merged PR:
✓ Fixes implemented (scope: only the routed findings — nothing extra)
✓ Gate RUN and green (exit codes pasted)
✓ Per-phase / unit docs updated where the finding touched them
(known-issues.md entry resolved? progress.md notes the fold)
✓ Each folded finding's row in the unit's `review-findings.md` ledger (if one
exists — the ledger is optional; a unit with no fix-now findings has none)
flipped `folded: no → yes` — the one and only ledger state transition, owned
solely by this fold cycle
✓ `git add` + `git commit` RUN (sha pasted) — e.g.
`fix(<scope>): fold review findings — <summary>`
✓ `git push` RUN (PR is open → every commit pushes immediately)
✓ `git status --porcelain` RUN → empty; `git status -sb` → not ahead of remote
Then hand back to the gate that sent you (/review-change re-review, or
/audit-pr re-audit). Never report findings as resolved while any box is
unchecked — an unpushed fix does not exist for CI, the reviewer, or the merge.
Final-phase / single-pass / fix hand-off:
<unit> implemented, gate green, marked done.
PR opened: <FULL PR URL — always printed here; not every agent shows open PRs>
Roadmap/fix-index row: done · #<n> (linked and pushed)
→ Next: /review-change (mandatory final review)
· clean → /audit-pr (merge gate) → human merges
· findings → fold fix-now into this PR; non-fix-now → /triage-issue; re-review
· docs site declared (documentation map has a `Docs site` block) →
/generate-docs <unit> — document what this unit changed; the generated
pages ride this same PR (commit + push them before the merge gate)
The /generate-docs line appears only when the project's documentation
map declares a Docs site block — never suggest it otherwise (a project
without a docs site has nowhere to publish).
This never auto-merges and never skips the per-phase stop: one phase at a time, human in the loop, gate enforced each phase, every unit reviewed before merge.
A unit flips to done when its last step runs — opening the PR — even though it
isn't merged yet. done means built and PR-open; merge state lives in the forge
(the open/merged PR), not in the status. A done row always carries its PR
reference — done · [#<pr>](<pr-url>) — added right after gh pr create
returns the URL (follow-up docs: link PR #<n> commit on the same branch);
done without a PR link is the tell-tale of an unfinished close-out. The flip is a doc change, so it rides the
PR-bound commit (never a lone commit on the default branch). Never merge with docs
still pending, and never drop the issue / fix-index entry before merge — those are
audit-pr's gates, not removed at done-time.
One phase = one session. Never execute two phases in one conversation on a
non-frontier model — models degrade over long horizons; a fresh session per
phase preserves the cheap-execution guarantee. The /loop batch shape below
already clears and re-invokes per phase; this rule is why it does — an
external orchestrator or a by-hand loop must honor it the same way (see
Portability, "No /loop").
/loopTo run all phases without manual re-invocation, use Claude Code's self-paced
/loop with a goal rather than a direct command (the skill requires a phase
argument, so /loop /execute-phase NN alone won't advance automatically):
/loop implement all phases of feature NN one by one using /execute-phase,
commit each phase, and stop when TASKS.md shows all phases checked
The loop reads TASKS.md to pick the next uncompleted phase, implements it,
and terminates naturally when nothing remains — no explicit stop condition
needed. Trigger-based checkpoints are skipped in this mode, but the end review is
not optional: at the end, mark done + open the PR, then run /review-change
once (the mandatory final review) → audit-pr.
Use this when the SPEC is solid and you want to review the whole branch at once rather than at each intermediate checkpoint. For incremental, phase-by-phase review, stick to the default (manual re-invocation + checkpoint hand-offs).
No /loop on your agent? Two vendor-neutral equivalents: (a) an
external orchestrator loops this skill headless, injecting the
driver-facing envelope requirement (see orchestration-envelope) so each
invocation's state/next.recommended say exactly what to run next
(CONTINUE → next phase on a cheap tier, READY_FOR_REVIEW → review on a
strong tier); protocol + driver skeleton in docs/workflow/ORCHESTRATION.md.
(b) Run the same loop by hand: after each phase, re-invoke this skill with the
next phase (execute-phase <NN> <next>) — the closing block always names the
exact next command — and keep the mandatory end review. The sequence is
identical; only the automation differs.
The workflow is the contract; Claude Code features are conveniences. On an agent that lacks one, apply the fallback — never skip the step the feature enables:
/<skill>, open that
skill's SKILL.md (wherever your agent installed the skills) and follow it
literally, in a fresh conversation: hand-offs assume a clean context.model:/effort: — on the #claude branch the frontmatter pins these tiers; here, pick tiers yourself:
planning, review, and audit need your strongest model; mechanical
execution may run cheaper. Never review a change with a model weaker than
the one that wrote it — and prefer a different model family than the
writer's: same-family instances share training blind spots, cross-family
decorrelates errors./loop — re-invoke the skill by hand per phase, following its closing
→ Next: block each time (see Batch execution above).plan-feature (features) or plan-fix (fixes); executes their SPEC.review-change — recommended at a trigger-based checkpoint
(layer boundary, accumulation, or sensitivity; skippable), mandatory when
finishing a unit — it runs at its own model/effort, not composed in this
skill's turn. fix-now findings fold back here; non-fix-now routes through
triage-issue.--fix, or final phase) always opens its PR and
flips to done; audit-pr then gates the merge (it blocks on pending docs or a
prematurely-dropped issue entry).--fix), the project's gate is green, per-phase docs are updated, and
the work is committed on the correct branch — nothing bundled beyond the requested
scope.git status --porcelain is empty
(docs included) and, when the branch has an open PR, nothing is left unpushed.done, has its PR opened (never
branch-only) with the PR URL printed in the chat, and prints the mandatory
/review-change hand-off as the next step.npx claudepluginhub gtrabanco/agentic-workflowCreates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.