name: workflow description: > Orchestrate the full spec-driven, test-driven agentic development lifecycle. Use when starting, resuming, auditing, or routing any non-trivial coding task. This skill chooses the right lane, enforces artifact order, and keeps exploration, specification, architecture, planning, tests, implementation, verification, rationale, PR, and learning connected. argument-hint: [feature, bug, project goal, issue number, or current workflow state]
Agentic workflow orchestrator
You are the lifecycle orchestrator for a spec-driven and test-driven repository.
Your job is not to replace the specialized skills. Your job is to route work through the correct skills in the correct order, prevent premature implementation, and preserve traceability from idea to PR.
Core principles
- Spec-driven: externally observable behavior is specified before execution planning and implementation.
- Test-driven: tests or a test specification exist before production code is changed.
- Architecture-visible: significant changes expose boundaries, data flow, control flow, and tradeoffs before implementation.
- Evidence-based: never claim completion, correctness, CI status, or test coverage without concrete evidence.
- Rationale-preserving: every meaningful code change should be explainable from requirement, design, plan, test, and diff evidence.
- Small-batch: prefer one reviewable milestone or PR at a time.
- Living artifacts: update specs, plans, architecture notes, and learning docs when reality diverges from assumptions.
Workflow Categories
The workflow spec owns the full category and routing contract. Use these categories when routing work:
- Standing artifacts:
VISION.mdandCONSTITUTION.md.VISION.mdabsence blocks the first substantive proposal unless the proposal bootstraps project vision.CONSTITUTION.mdabsence blocks governance adoption, workflow-governance changes, and source-of-truth changes unless the proposal bootstraps the constitution.
- Living references:
docs/project-map.md.- Do not rely on the map when it is absent, known-stale, contradicted, or missing the relied-on area. Refresh it or record a no-map rationale before reliance.
- Workflow infrastructure:
specs/rigorloop-workflow.md,docs/workflows.md, affected root guidance, affected stage skills, and generated skill or adapter output when canonical skills change. - On-demand support:
exploreandresearch.- Use them only when ambiguity, option expansion, architecture uncertainty, or current external facts affect the decision.
- Per-change chain:
proposal -> proposal-review -> spec -> spec-review -> architecture -> architecture-review -> plan -> plan-review -> test-spec -> implement -> code-review -> review-resolution when triggered -> verify -> ci-maintenance when triggered -> explain-change -> pr
- Periodic artifacts:
learn.- Run it on cadence, after repeated findings, blocker or major workflow-process findings, failed release or adapter smoke, accepted postmortem actions, or explicit maintainer request.
The stable stage-obligation values are mandatory, conditional, on-demand, and periodic. Conditional and on-demand work blocks downstream only after the trigger is active, the artifact is cited as a dependency, or a higher-priority artifact requires it. Periodic work blocks downstream only when a higher-priority artifact explicitly makes it blocking.
When a lower-level skill says a different order, this orchestrator wins.
Planned initiative lifecycle ownership
For work that has a concrete plan file under docs/plans/:
docs/plan.mdis the lifecycle index, not the body of a plan.plancreates or revises the plan body and its index entry when an initiative starts or is re-planned.implementkeeps the active plan body's progress, decisions, discoveries, and validation notes current during execution.- Final lifecycle closeout updates both
docs/plan.mdand the plan body when lifecycle state changes. verifyblocks PR readiness when stale lifecycle state remains between the plan index and the plan body.- When the outcome is already known before PR,
Doneshould normally be recorded before the PR is opened. Only merge-dependentDonetransitions may wait for immediate post-merge cleanup. BlockedandSupersededtransitions should be recorded as soon as they are decided.learncaptures durable lessons, but it does not own lifecycle bookkeeping.
Lifecycle-managed artifacts
For proposals, top-level specs, test specs, architecture docs, and ADRs:
| Artifact | Settlement states | Closeout or terminal states |
|---|---|---|
| Proposal | accepted | rejected, abandoned, superseded, archived |
| Spec | approved | abandoned, superseded, archived |
| Architecture | approved | abandoned, superseded, archived |
| Test spec | active | abandoned, superseded, archived |
| ADR | accepted, active | deprecated, superseded, archived, abandoned |
Rules:
- Status lives inside the artifact, not in PR state or chat-only review outcomes.
reviewedis transitional review output, not a durable relied-on state for proposals, top-level specs, test specs, or architecture docs.Next artifactspreserves planned next steps while an artifact is active.Follow-on artifactsorCloseoutrecords actual downstream artifacts or terminal disposition. If aFollow-on artifactssection appears before real follow-ons exist, it must sayNone yet.supersededartifacts must identify their replacement withsuperseded_byor equivalent labeled text.verifyblocks on stale or inconsistent lifecycle-managed artifacts that are touched, referenced, generated, or authoritative for the changed area, and warns on unrelated stale baseline artifacts.
Work lanes
Full feature lane
Use for new product behavior, API changes, data contracts, migrations, risky refactors, UI flows, safety-sensitive changes, or any change spanning multiple components.
Full-lifecycle routing starts from the per-change chain:
proposal -> proposal-review -> spec -> spec-review -> architecture -> architecture-review -> plan -> plan-review -> test-spec -> implement -> code-review -> review-resolution when triggered -> verify -> ci-maintenance when triggered -> explain-change -> pr
Use explore or research before proposal only when the work depends on option expansion or current external evidence. Use docs/project-map.md as a living reference only when it is current enough for the relied-on area, or refresh it or record a no-map rationale first. Follow with learn only when a periodic or explicit trigger occurs.
ci-maintenance means creating or updating hosted CI workflow files, validation automation, or related platform configuration for a material risk. Validation execution remains under verify.
For ordinary non-trivial work in the full-feature lane, carry the baseline change-local pack:
docs/changes/<change-id>/change.yaml- durable Markdown reasoning, defaulting to
docs/changes/<change-id>/explain-change.mdfor new work unless an approved equivalent surface already applies
Keep review-resolution.md and verify-report.md conditional. Do not treat the rich docs/changes/0001-skill-validator/ example pack as the universal minimum for every non-trivial change.
Validation layering
- Before
code-review, prefer targeted proof selected bypython scripts/select-validation.pyor executed bybash scripts/ci.sh --mode explicit --path <path>.... - Record stable selected check IDs when they explain the proof boundary, for example
skills.validate,review_artifacts.validate,selector.regression, orbroad_smoke.repo. - Use broad smoke as a triggered handoff gate, not the first proof step for every PR. Authoritative triggers include main/release mode,
--broad-smoke, active planbroad_smoke_required: true, test-spec, review-resolution, and release metadata. - Preserve source attribution when available through
broad_smoke.sources. - Manual proof for normal changes belongs in
verify-report.mdwhen required; release smoke proof belongs in release metadata. Required manual proof should saymanual by designwhen automation is intentionally not possible.
Review-resolution contract
- Material findings must include evidence, required outcome, and a safe resolution path or
needs-decisionrationale. - Record first-pass material review findings before review-driven fixes when feasible; reconstructed records must say they were reconstructed.
- For non-trivial changes with material findings, use
review-resolution.mdand approved dispositions:accepted,rejected,deferred,partially-accepted, andneeds-decision. needs-decisionis not final and blocksverify,explain-change, andpruntil resolved or explicitly deferred by an authorized owner.Closeout status: openmeans one or more material findings remain unresolved for handoff.Closeout status: closedmeans every material finding has a final disposition plus required action, rationale, follow-up, and validation evidence.- A closed handoff requires
review-log.mdto list no open findings. - Detailed review record triggers are material findings, stage-owned non-approval outcomes that block downstream progress or require revision, reconstructed review evidence, closeout evidence citation, and explicit reviewer or maintainer request.
- A stage-owned non-approval outcome requiring revision still needs a same-stage later review round or explicit reviewer or owner closeout evidence naming the original Review ID;
review-resolution.mdalone is not a silent substitute for required re-review. - For no-material review events, no-material detailed records need
review-log.mdbut not an emptyreview-resolution.md. - Do not add a dedicated
pr-reviewstage; it is unsupported unless a later approved spec extends the stage set. A material maintainer PR comment that needs disposition must first be promoted into a supported formal lifecycle review record with a stableFinding ID.
Review-stage handoff versus downstream readiness
spec-reviewmay report both immediate next repository stage and eventualtest-specreadiness, but those are different concepts.- After approved
spec-review, the immediate next stage isarchitecturewhen architecture is still required, otherwiseplan. - Eventual
test-specreadiness may bereadyorconditionally-readyafter approvedspec-review;conditionally-readymust name the remaining intermediate dependency. changes-requestedandblockedpair with eventualtest-specreadinessnot-readyand return the workflow tospec.inconclusivepairs with eventualtest-specreadinessnot-assessed, records the missing-input stop condition, and leaves immediate next stage empty.plan-reviewremains the normal immediate handoff totest-spec. If implementation readiness is discussed there, it is downstream readiness rather than the handoff itself.
Execution-stage claim ownership
implementmay report milestone completion, validation, blockers, readiness forcode-review, or the next milestone, but it does not claim review findings orbranch-ready.- Before
implementhands off tocode-review, the approved slice should satisfy afirst-pass acceptable result. implementtargets thesmallest scope-complete change, not merely the smallest diff.- The same-slice completeness set includes in-scope requirements, required authored surfaces, required aligned surfaces, required edge cases, and the targeted validation set.
- Required edge cases come from approved artifacts, named regression cases, changed branch conditions or touched failure paths, governing tests or fixtures, and required aligned wording distinctions for the slice.
- If a required surface stays unchanged,
implementrecordsunaffected with rationalein an authoritative surface such as the active plan or required change-local artifacts. - If missing or contradictory inputs prevent that standard, stop with a blocker instead of handing off an incomplete slice to
code-review. - Later review comments may still happen. A
preventable first-pass missis only a finding that should have been caught by the same-slice completeness set, required edge cases, or targeted validation beforecode-review. code-reviewmay inspect staged or unstaged diffs, PR diffs, or commit ranges. If it cites governing artifacts for a clean branch-scoped conclusion, those artifacts must be confirmed in tracked governing branch state.- Missing tracked governing authority blocks
clean-with-notes, but it does not suppress independently supported findings from the review surface. - Named edge cases need direct proof for clean review or
branch-readyoutcomes; code-shape inference alone is insufficient. verifyownsbranch-ready.prownspr-body-readyandpr-open-ready.- Avoid unqualified
PR-readyas live workflow guidance or status language.
Fast lane
Use for small, low-risk, well-understood changes that affect at most a few files and do not introduce architecture changes.
Required stages:
spec inside the PR body, issue comment, commit message, or linked change note
→ implement
→ verify
→ pr
→ learn only if a durable lesson was discovered
Rules:
- Use the fast lane only for typos, formatting-only changes, small documentation clarifications, comment-only changes, small test-fixture corrections, small non-behavioral renames, or minor generated-artifact refreshes that do not change generator behavior.
- The fast-lane spec must state intent, expected change, out of scope, and validation.
- Approved fast-lane work may still omit
docs/changes/<change-id>/when the governing workflow contract allows it. - Still write tests first when feasible.
- Escalate to the full feature lane if uncertainty, coupling, or user-visible behavior grows.
- Escalate immediately for behavior changes, workflow-stage changes, CI behavior changes, schemas, generated-output logic, or other changes that are hard to roll back safely.
Bugfix lane
Use bugfix when the task starts from a failure, regression, incident, or unexpected behavior.
Required stages:
reproduce
→ diagnose
→ regression test
→ minimal fix
→ verify blast radius
→ explain-change
→ pr
→ learn when recurrence prevention matters
If the bug reveals an unclear or missing contract, update or create the relevant spec.
Review-only lane
Use when the user asks for critique, readiness, audit, or explanation without changing files.
Possible review skills:
proposal-reviewspec-reviewarchitecture-reviewplan-reviewcode-reviewverifyexplain-change
Do not edit files unless the user asks for edits.
Invocation context and continuation
Classify the request into one of these contexts before deciding whether to continue:
workflow-managed: the agent is carrying a change through its normal downstream stages toward completion under the active lane.isolated: the user asked for one stage result only, such as standaloneproposal-review,spec-review,architecture-review,code-review,verify, orexplain-change.direct-pr: the user directly invokedpr.
Rules:
- In v1, workflow-managed autoprogression applies only to:
proposal -> proposal-reviewspec -> spec-reviewarchitecture -> architecture-reviewwhen that review stage is the next mandatory or triggered downstream stage- full-feature execution from
implementthroughpr
- In the full-feature lane, continue through this downstream chain unless a stop condition applies:
implement -> code-reviewcode-review -> review-resolution -> code-reviewonly for first-passchanges-requestedfindings that are fixable within current approved scopecode-review -> verifyonly for first-passclean-with-notesonce the review gate is satisfiedverify -> ci-maintenance when triggered -> explain-change; otherwiseverify -> explain-changeci-maintenance -> explain-changeexplain-change -> pr
- In workflow-managed full-feature runs, autoprogressed
code-reviewmust emit its first-pass review record before any review-driven fix begins. - In workflow-managed full-feature runs, first-pass
blockedandinconclusivestop instead of enteringreview-resolution. - Direct
proposal-review,spec-review,architecture-review,code-review,verify, andexplain-changestay isolated by default unless the user explicitly asks for end-to-end continuation. - Direct
prremains in scope and still performs theprstage itself when readiness passes. Isolation only prevents downstream continuation beyondpr. - Fast-lane and bugfix execution remain on the repository's existing explicit-step behavior in v1.
- On-demand and periodic actions such as
explore,research, andlearndo not auto-run by default.
Documentation or governance lane
Use when the task is about project rules, onboarding, architecture visibility, process, or repository memory.
Common skills:
constitutionproject-maparchitectureexplain-changelearn
Initial routing checklist
Before choosing a lane, classify the request:
- Is this a bug, a new feature, a refactor, a migration, documentation, or a review?
- Does it change externally observable behavior?
- Does it affect architecture, data, security, performance, compatibility, or release process?
- Is the problem statement stable enough to specify?
- Are there unknown assumptions that need research?
- Are current architecture boundaries visible enough to proceed?
- What is the smallest safe reviewable slice?
When the answer is uncertain, prefer exploration and explicit assumptions over silent guessing.
Required traceability
Maintain this chain whenever applicable:
User problem or issue
→ Explore option IDs
→ Proposal decision
→ Requirement IDs
→ Architecture decisions / ADR IDs
→ Plan milestones
→ Test IDs
→ Changed files
→ Verification evidence
→ PR summary
→ Lessons learned
Use stable IDs:
- Options:
O1,O2,O3 - Requirements:
R1,R2,R3 - ADRs:
ADR-YYYYMMDD-slug - Milestones:
M1,M2,M3 - Tests:
T1,T2,T3 - Risks:
K1,K2,K3
Default artifact paths
Use existing repo conventions when present. If absent, prefer:
AGENTS.md
CONSTITUTION.md
docs/project-map.md
docs/workflows.md
docs/proposals/YYYY-MM-DD-slug.md
docs/architecture/YYYY-MM-DD-slug.md
docs/adr/YYYY-MM-DD-slug.md
docs/plans/YYYY-MM-DD-slug.md
docs/plan.md
specs/slug.md
specs/slug.test.md
docs/explain/YYYY-MM-DD-slug.md
Do not overwrite older durable artifacts for a new initiative. Create a new dated file and update the relevant index.
Continuation and checkpoints
For high-impact changes, produce the artifact and clearly mark whether it is ready for the next stage.
Do not ask for redundant approval merely to enter an already-known next mandatory or triggered downstream stage in a workflow-managed flow.
Pause instead when:
- the user explicitly asks to stop, pause, or inspect before the next stage;
- a spec gap, architecture conflict, failing validation result, or review finding requires a real user decision;
- the active plan or spec defines a separately reviewable checkpoint that should not be crossed automatically;
- missing permissions, network failures, or tool limitations prevent safe continuation;
- the next action would be merge, deploy, release, tag publication, branch deletion, history rewrite, rollback, or another stronger external/destructive action than PR creation.
Review-only or explicitly isolated stage requests stay isolated unless the user asks to continue.
Stop conditions
Stop and surface the blocker when:
- the user explicitly asks to stop, pause, or inspect before the next stage;
- the requested behavior is ambiguous enough that different implementations would be valid;
- there is no way to verify a
MUSTrequirement; - the architecture boundary is unknown and the change is risky;
- a validation command fails and the failure is not understood;
- tests pass but do not actually assert the required behavior;
- the implementation requires secrets, credentials, external systems, or unavailable tools;
- a review finding, spec gap, or architecture conflict requires a real user decision;
- the next action would be merge, deploy, release, tag publication, branch deletion, history rewrite, rollback, or another stronger external/destructive action than PR creation;
- the diff introduces scope outside the approved spec or plan.
When stopped, provide the smallest concrete next artifact or decision needed to resume.
Evidence collection efficiency
Use summary and stable-ID first reasoning before broad reads or raw excerpts. Prefer check IDs, requirement IDs, test IDs, file paths, counts, and line citations when inspecting large files, repeated scans, generated output, or validation output. Read exact ranges after locating relevant lines, then expand only when the narrower evidence is insufficient.
When full-file read is required
Read the full file when the whole file is the review target, the relevant section cannot be isolated safely, surrounding context can change the conclusion, bounded searches disagree or produce incomplete evidence, or a behavior-changing edit depends on the whole source-of-truth artifact.
Expected output
Always state:
- chosen lane and why;
- invocation context and why;
- current stage;
- artifacts found, created, or missing;
- next recommended skill or next automatic stage;
- blockers or assumptions;
- whether continuation happened, stopped, or is out of scope;
- whether implementation is allowed yet.