/agentic-workflow:execute-phase <NN-slug> [P<k>|step] [--max-attempts N] [--force]from agentic-workflow
Executes triaged steps for units, handling step-local gates, commits, red-gate repair, and diff-size guard. Replaces PLAN.md/TASKS.md/ACCEPTANCE.md with unit doc Tasks, Evidence, and Progress sections.
Ships in agentic-workflow. 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.
Runner commands below are
runner <subcommand> [args…]— the launcher, its order and the pin are owned by references/RUNNER.md: read it before the first command, then keep it for the whole unit — nowhere else spells either.
Step executor for units. The unit doc (created by unit-lane) owns Tasks P1…Pn,
Evidence rows, and a Progress log — these replace PLAN.md, TASKS.md,
progress.md, and ACCEPTANCE.md. Each step runs as an atomic gate/commit.
Argument resolution (first match):
<NN-slug> P<k> — exactly the step named by the triage order (P1, P2, …)<NN-slug> (no step) — all remaining steps, one commit eachP<k> alone — the step by position in the current unit (last-known NN-slug)Never infer a step ID absent from the triage block in the unit doc.
Load and verify the canonical Turn contract (11 boxes) before ending every turn; the contract's Push policy supplement governs mid-phase commits when a PR is already open. Skill-specific additions (the → Next: box is canonical-owned and not restated here):
✓ Required user inputs were answered concretely (not defaulted). Nothing here
is inferred: a gap runs `runner needs-input <unit-dir>` and the
`open-questions@1` block is pasted, then the run stops.
✓ Tool choice re-made this turn — `bun` before `node` on manual invocation,
`rg` before `grep` on search; availability checked once with
`runner setup-env --check` (node and grep stay the documented fallback)
✓ Triage verified — unit doc Evidence section header matches
`runner unit-route --triage <slug>` output block (PREFLIGHT.md)
✓ Unit doc read and step selected (explicit P<k> or first unfinished)
✓ Step executed and committed (one commit per step, conventional format)
✓ Gate produced — the step's verification gate ran as `runner gate-receipt run`,
so the `GATE-RAN` mark's `manifest <sha>` slot carries the receipt digest and
the receipt is current at this head; a project with no handshake gate records
the declared absence instead (owner: LEDGERS.md §The producer)
✓ Phase read set consumed — the phase read its `Relevant files:` targets
(`runner relevant-files <unit-doc> --phase P<k>`) instead of
surveying the repo, and discovered-file appends landed at phase close
✓ Test impact derived — the phase's test set came from the hint's block
(TEST_IMPACT.md), and a prose-only phase recorded its `empty` verdict
✓ Evidence rows updated (command → exit/digest → output → verified-by)
— each row carries the command, observed output (reproduced, not typed by
hand), and the verifying-by credit. (S5 — claim-evidence loop: mandatory
reproduction, loop-until-green inside the same turn)
✓ Progress log updated with a dated `YYYY-MM-DD HH:MM` entry that names the
phase id (what, commit, next)
✓ Memory boundary ran — the phase's outcome saved under `unit/<NN-slug>/doc`,
or the mirror marked pending when the layer is degraded
✓ Diff guard passed (on implement steps) — see `diff-guard` in PREFLIGHT.md
✓ Self-audit box (S9 d): every claim the persist introduces was re-derived
with pasted output before the commit lands.
unit-lane: steps include implement/tests/evidence
→ invoke with <NN-slug> or <NN-slug> P<k>.[docs, evidence]) do not load this
skill — they are executed in-place by the unit-lane conductor.<NN-slug> with no step argument.<NN-slug> P<k> (retry the same step).This skill never interviews. It reads its inputs — the unit doc's Tasks,
unit-route.mjs --triage's block, the route's tier — and a missing or ambiguous
one is a gap, resolved in one fixed order and never by inference:
(0) provenance (search the repo's own docs and record where) →
(1) research (2–3 concrete options with trade-offs; asking for more research
is a legitimate answer) → (2) halt: run runner needs-input <unit-dir>, paste the open-questions@1 block verbatim, stop. Interactive the
block is the pause point, unattended it is a hard fail. Grammar and exit codes:
orchestration-envelope's references/TURN_CONTRACT.md §Open questions.
Bare <NN-slug> runs all remaining steps — the phase is not an input. File
targets are the unit doc's nested Relevant files: metadata plus the
path-protection checkpoint. --max-attempts N defaults to 3; --force skips the
stop on the dependency and phase-lint gates (never the check — PREFLIGHT.md
records the override in the Progress log) and has no bypass on the
path-protection checkpoint.
Per the agent guide's Workflow conventions + documentation map, read the
unit doc at docs/features/<NN-slug>/SPEC.md. Verify it carries ## Tasks (P1…Pn)
and the receipt sections of the shape it is written in (#308 accepts both):
the legacy shape carries ## Evidence + ## Progress log, a re-cut unit doc carries
## Specs, ## Findings + ## Log (its evidence and gate runs are E/G log
lines, its progress is P lines). If neither pair is present, the unit is not ready —
stop and suggest unit-lane triage first. runner unit-route resolves the
shape; never judge a re-cut unit by the legacy headings and stop it.
Run runner unit-route --triage <slug> and compare its block to the
Evidence section header in the unit doc. Mismatch → STOP and re-triage first.
This is the gate that ensures the executor and unit-lane agree on steps.
If a step argument is given (e.g. P2), use that step. Otherwise, the first
unfinished step — the first P in Tasks whose checkbox is unticked.
Never execute a step the triage skipped.
A ceremony-profile receipt is a recorded skip, not an error (issue #436):
when the triage block's Skipped: carries ceremony-profile@1: <piece> discarded by project charter, record the step in Evidence as
n/a — <the receipt verbatim> and move on — never emit the step as a
hand-off, never fail on its absence, and never read the profile to add
anything back (the profile can only narrow ceremony; the catalog plus the
computed risk tier remain the only expansion paths).
The ceremony belongs to the risk tier (risk-tiers.md owns that table). A phase never lowers its own tier.
Run gates in order; any fails → STOP (see PREFLIGHT.md):
tests/, fixtures/). Exit 1 → STOP with the gate rejection
block. No --force bypass (no flag can override).runner phase-lint <unit-doc> only when the
step is implement and the unit has Tasks P1…Pn. Parse the Tasks section
(not PLAN.md/TASKS.md). Exit 1 → STOP. If the script is absent, apply the
eight phase-contract rules by hand, label weaker, and disclose.implement steps, settle the pre-write mapper
contract before branch creation, planning commit, or source/test edit
(references/PRE_EXECUTION_GATE.md): it closes the seven evidence questions
and routes READY | REPLAN | NEEDS-DESIGN | BLOCKED; only READY
authorizes the first write.violates/introduces/
changes before edits).Follow the unit-lane reference for this step (references/STEPS.md catalog):
one line — read the step's reference file, perform its checklist, commit the
work. For implement steps: derive the test set first (TEST_IMPACT.md
owns the block and the RED-evidence shape) and write tests-first where they pay
(core/domain, orchestration). A new script+suite pair lands red-first — the
obligation is the guide's (AGENTS.md § Working rules), the mechanism is
TEST_IMPACT.md's, and this paragraph cites both instead of carrying a third
wording.
Context targeting (issue #269). The phase's read set is the unit doc's
nested Relevant files: metadata — resolve it with runner relevant-files <unit-doc> --phase P<k> and read those files plus
the step's one-hop references before the first edit, instead of surveying the
repository. A missing or empty list degrades to a scoped survey, recorded in
the Progress entry — never a silent repo-wide read. The sub-section is metadata
owned by phase-contract, so a file missing from it is never out of scope
(never-authority); the discovers-more path is the post-step's forward
propagation.
Orchestrate path (only when the unit or the operator declares it, issue
#260): the step dispatches instead of executing in-orchestrator — freeze the
delegate brief (exact files, exact gate command, exact expected values,
expected_duration + resource requirements, the model from
runner resolve-passes), pass resources admit before spawning,
then verify by running the gate and reading the diff — never by trusting the
subagent's summary. Orchestrate
owns the contract; a refused admission or an unresolvable model degrades
inline, stated in the report.
Before running post-step, verify every claim the step's repair introduces. This
is the repairer-owned verification that prevents the unit 79 F50-class failure
(closed gate-green with an unreproduced figure "170" without re-deriving via
git diff --numstat).
Output:
| claim | command | output | status |
|---|---|---|---|
| <claim> | `<command>` | `<observed output>` | ✓ |
The row shape is published grammar (evidence-row@1 in
@gtrabanco/agentic-workflow-schema), so a row missing its command, its
observed output or a ✓/✗ verdict is a shape violation rather than a style nit.
Bounded checkpoint (S13/S14). The claim-evidence loop is only paid if it is
cheap: runner test-route --check <changed path> names the minimal
suite a path needs, so an intermediate verification costs seconds instead of the
full gate. An unmatched path answers route: full-suite — never fewer tests —
and the full gate stays what the merge gate and CI run.
runner diff-guard --base <last-step-commit> --unit <unit> — paste the block verbatim. BREACH → STOP
(re-triage or record exception). Anti-gaming: NEVER shrink a diff by deleting
comments, blank lines, docs or tests.runner relevant-files <unit-doc> --base <last-step-commit> and require
exit 0 — the one failure it reports is a changed file neither listed in any
phase's Relevant files: nor logged in the unit doc (exit 1 names it: add
the file to a phase's list, or log the discovery on the spot — an unlisted
file is never out of scope, phase-contract owns that rule). Forward-propagation:
when this phase discovered files later phases will touch,
append them to those phases' Relevant files: lines in ## Tasks now — at
phase close — and note the append in the Progress entry.| AC | command | exit/digest | output (≤2 lines, reproduced via command, not typed by hand) | verified-by |
— append to the Evidence section. The evidence row is a reproduced receipt,
not an assertion (S5: mandatory reproduction extends to doc artifacts).YYYY-MM-DD HH:MM — <what was done> → <commit sha> — next: <what is next>.runner memory probe once and record its verdict
in Evidence; after the step, save the phase id, what it changed, its Evidence
outcome and any discovery under topic_key: "unit/<NN-slug>/doc", an explicit
project and explicit session attribution (§5). A degraded verdict is
recorded and the mirror marked pending — it never blocks the step.git add <changed files> then git commit -m "<type>(<scope>): <step-summary>" — run it, paste the SHA.After each step: run the project's verification gate (type-check + tests + build).
Gate green → proceed.
Gate red → record exit code + failing test names in the Progress log, repair
the same step, retry. Default --max-attempts 3 (user value overrides).
Exhausted → STOP with:
UNIT LOOP — <unit> BLOCKED at <P<k>>
Reason: <NO-PROGRESS|ATTEMPT-BUDGET> · Attempts: <n>
Last validator: <command> → <exit/status + compact failure>
Preserved: no red commit; acceptance blob <sha> unchanged
→ Next: inspect the named blocker, then re-run /execute-phase <unit> <P<k>>
· architecture/product decision required → resolve it before resuming
· continue atomically → /execute-phase <unit> <P<k>>
When invoked as <NN-slug> with no step: loop all remaining steps, one commit
each. This is an explicit operator choice only — the lane's hand-offs
always name exactly one phase (<NN-slug> P<k>), so a bare <NN-slug> from a
lane hand-off is a defect; re-read the hand-off before looping. After each
step: gates, execute, diff guard (if implement), evidence/progress update,
commit. Skip intermediate review checkpoints; the mandatory end review covers
the full accumulated diff. On gate red at any step: repair that step (up to
--max-attempts), then continue the loop. The close-out is part of the last
step's completion: open the PR against the project's default branch with
Closes #N (owner: AGENTS.md § Working rules — one PR per unit, never stacked,
and the one owner-ordered inline exception), write - PR: <url> into
References, and settle the index row with runner roadmap <index> rowUpsert '<json>' (docs/ROADMAP.md; a fix unit writes its ## Fixes
row with runner roadmap <index> fixrow '<json>' — keyed by the issue
number in its [#N](url) cell, never a hand edit).
runner roadmap-settle exits 0 (#316).
Terminal:
UNIT LOOP — <unit> COMPLETE
Steps: <n> · Commits: <sha list> · Gate: PASS
PR: <url>
→ Next: /review-change on the changed HEAD — the mandatory end review
· findings (REVIEW-FAIL) → /fold-findings repairs them; a fresh /review-change follows the fold
· merge gate after REVIEW-PASS → /audit-pr
Before creating any issue while executing: classify with the descope test.
A descope (moving an acceptance criterion or task out of scope) requires
explicit user approval first, then record in the unit doc's
## References section (not a follow-up issue) as:
- <YYYY-MM-DD> — descoped: "<criterion>" — approved by user.
An issue may never be the first record of a descope.
These files must be loaded when their topic is active:
skills/unit-lane/references/DESIGN.md (ask-dont-infer@1): an
expectation the tree, the docs, or a prior owner decision does not evidence
is asked, never invented.Allowed:
Forbidden:
docs/LOGS.md (S9 4b): LOGS.md must be pure code output —
no model writes it. The journal is append-only: a wrong past line gets a
new correcting line, never an edit. Machine-authored git-facts entries
(the extension's logSession: true, #394/#427) also kill the
"hand-tallied figure" class.unit-lane conducts (triage → judgment steps → close-out ladder) and hands
execution off one phase per turn (<NN-slug> P<k> with the catalog tier);
this executes the named phase — or, as an explicit operator choice only, all
remaining steps. The closing hand-off names exactly one phase and the tier
while phases remain, and resumes the lane after the last one. A phase run as a
pi-web Relay leg is this same contract and nothing more (owner:
unit-lane/references/RELAY.md): it runs
one named phase, records the same evidence and progress lines, then hands the
packet's baton to the next leg instead of resuming the lane.
fold-findings handles review finding repairs. The review pack axes
(review-implementation, review-code, review-security, review-perf,
review-a11y, review-debt) compose the review step; workflow-status routes
here. triage-issue feeds issues into the lane. This skill is the step
executor a turn invokes to perform one triaged step of a unit under the full
gate machinery.
Preamble + no-slash-menu fallback: owned by
PORTABILITY.md — this
section keeps only this skill's own fallbacks:
ORCHESTRATE.md owns that rule)./loop/subagents — invoke <NN-slug> for all remaining steps (the
built-in loop), or <NN-slug> P<k> for individual steps.→ Next: block is printed.Exactly one end-state applies — pick by the unit's Tasks section, never print a phase id the Tasks section does not define:
Phases remain:
→ Next: /execute-phase <NN-slug> P<k+1> (tier: <tier>) — one phase per turn; <tier> is the catalog's implement entry
· whole-unit operator run complete → /review-change (mandatory end review)
· findings (REVIEW-FAIL) → /fold-findings repairs them; a fresh /review-change follows the fold
· merge gate after REVIEW-PASS → /audit-pr — the merge gate
The last phase just closed (a lane-run unit):
→ Next: /unit-lane <NN-slug> — resume the conductor for the remaining judgment steps
· whole-unit operator run complete → /review-change (mandatory end review)
· findings (REVIEW-FAIL) → /fold-findings repairs them; a fresh /review-change follows the fold
· merge gate after REVIEW-PASS → /audit-pr — the merge gate
references/DESCOPE.md (opens in a new tab)references/EXECUTION_CONTRACT.md (opens in a new tab)references/FOLDING.md (opens in a new tab)references/FORGE_BODY.md (opens in a new tab)references/PREFLIGHT.md (opens in a new tab)references/PRE_EXECUTION_GATE.md (opens in a new tab)references/TEST_IMPACT.md (opens in a new tab)references/risk-tiers.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
step-executor, unit-execution, gate-commit, triage-execution
33 skills in this plugin
/agentic-workflow-doctorUser-initiated batch ceremony-failure triage: mine this project's own journal and unit docs for its accumulated ceremony failures, apply a fixed discard/report rubric, render one anonymized bundle, and route it upstream to an existing or new agentic-workflow issue — with consent. Read-only; the user starts it. Triggers: "agentic-workflow-doctor", "aw-doctor", "why do my reviews keep blocking", "triage my ceremony failures", "report a workflow bug upstream".
/audit-docsAudit cross-document coherence: docs ↔ READMEs ↔ roadmap ↔ code ↔ fix index ↔ issues. Finds drift — features in docs/ not in the roadmap (or vice versa), fix-index entries already merged/closed, broken documentation-map links, dependency cycles, artifacts in the wrong language, naming-convention violations, project-charter coverage — and reports them ranked by severity, fixing only low-risk items on request. Model-agnostic: the skill inherits whatever model and effort your agent session is already using. Triggers: "check doc consistency", "are the docs in sync", "audit the docs", "doc coherence review", "did the docs drift", "validate the roadmap".
/audit-prAudit a whole PR against the delivery contract and return MERGE-READY or evidenced blockers with the full URL. Consumes the current review-change REVIEW-PASS receipt instead of re-running review axes; posts a SHA-bound ready comment; never edits or merges. Triggers: "audit-pr", "is this PR ready", "merge gate".
npx claudepluginhub gtrabanco/agentic-workflow --plugin agentic-workflowOther plugins' skills for the same job