|
| 1 | +--- |
| 2 | +description: "Run the full Spec Kit pipeline (specify → clarify → plan → tasks → analyze → implement) from one feature description, with a single interactive clarify checkpoint and a deterministic, tailorable phase order." |
| 3 | +scripts: |
| 4 | + sh: scripts/bash/resolve-phases.sh |
| 5 | + ps: scripts/powershell/resolve-phases.ps1 |
| 6 | +--- |
| 7 | + |
| 8 | +# Pipeline: run |
| 9 | + |
| 10 | +Carry one feature from a plain-language description to an implemented change by chaining the existing Spec Kit phase commands into a single guided run. You (the agent) **are** the orchestrator: you follow this procedure turn by turn, invoking each `/speckit.*` command in order and verifying its artifact landed before moving on. This replaces hand-running `/speckit.specify`, `/speckit.clarify`, `/speckit.plan`, `/speckit.tasks`, `/speckit.analyze`, and `/speckit.implement` one at a time and hand-resolving analyze findings. |
| 11 | + |
| 12 | +## Input |
| 13 | + |
| 14 | +`$ARGUMENTS` — the feature description, optionally followed by flags: |
| 15 | + |
| 16 | +- `--skip <csv>` — drop default phases (e.g. `--skip clarify,analyze`). Cannot drop `specify` or `implement`. |
| 17 | +- `--add <csv>` — insert optional phases: `constitution` (before specify), `checklist` (after tasks). |
| 18 | +- `--yes` — unattended run. Does **not** skip clarification; instead you answer the clarify questions yourself, grounded in the spec and repo conventions, and halt before `plan` if a question is too consequential to answer without a human (see Step 4). Use `--skip clarify` if you genuinely want zero clarification. |
| 19 | + |
| 20 | +If the feature description is empty, report the missing input and stop — do not start. |
| 21 | + |
| 22 | +## Step 1 — Resolve the phase plan (deterministic) |
| 23 | + |
| 24 | +Run the resolver once and branch on its exit code: |
| 25 | + |
| 26 | +``` |
| 27 | +{SCRIPT} --skip "<skip csv>" --add "<add csv>" --json |
| 28 | +``` |
| 29 | + |
| 30 | +(`{SCRIPT}` is this command's configured `scripts.sh` / `scripts.ps`.) |
| 31 | + |
| 32 | +Exit codes: `0` OK · `10` unknown phase name · `11` skip/add name conflict · `12` add-name not insertable · `13` skip targets a required phase · `14` dependency break. On any non-zero code, report the resolver's stderr message verbatim and stop — do not run a partial or incoherent pipeline. The order is deterministic: the resolver consumes skip/add as sets and derives order from one fixed key, so flag ordering never changes the plan. |
| 33 | + |
| 34 | +## Step 2 — Preflight |
| 35 | + |
| 36 | +Confirm the project is Spec Kit-initialized (a `.specify/` directory exists) and that every `/speckit.*` command named in the resolved plan is available in this agent's command set. Report anything missing now — never mid-pipeline. If `--add constitution` or `--add checklist` was requested but that command isn't installed, report and stop. |
| 37 | + |
| 38 | +## Step 3 — Execute each phase in order |
| 39 | + |
| 40 | +For each phase in the resolved plan, invoke its `/speckit.*` command (the `command` field from the resolver output). After each phase: |
| 41 | + |
| 42 | +- **Verify the artifact.** Confirm the expected file was written (`spec.md`, `plan.md`, `tasks.md`, etc.) before proceeding. A phase reporting success is not enough — check the artifact is on disk. |
| 43 | +- **Halt on failure.** If a phase fails and the failure is not something you can safely resolve, stop and name the phase and reason. Never proceed past a broken artifact. |
| 44 | + |
| 45 | +Keep a short running ledger (which phases ran, which were skipped, outcome of each) so the run survives a context reset. |
| 46 | + |
| 47 | +## Step 4 — The clarify gate |
| 48 | + |
| 49 | +`clarify` is the single interactive checkpoint; everything after it runs unattended. |
| 50 | + |
| 51 | +**Default (no `--yes`)** — run `/speckit.clarify`, present its questions to the human, and **end your turn to wait** for answers. This is the one human checkpoint. |
| 52 | + |
| 53 | +**`--yes` set** — no human is present, so `--yes` does not mean "skip clarification", it means "answer it responsibly yourself": |
| 54 | + |
| 55 | +1. Run `/speckit.clarify`'s question generation as normal, but don't present the questions to a human. |
| 56 | +2. Answer each question as the operator plausibly would, grounded strictly in the spec's own content, the project's constitution/conventions, and established repo patterns. Integrate each answer into the spec exactly as `/speckit.clarify` integrates a human's answer. |
| 57 | +3. Emit one line noting that clarify was answered unattended, not by a human, so the audit trail is honest. |
| 58 | +4. **If any question is too consequential to answer without a human** — insufficient grounding, security/scope/privacy stakes, or a materially shape-changing decision the spec leaves open — do **not** guess. Halt before `plan`, name the unresolved question and why. This is a correct outcome, not a failure: it means the run recognized it should not proceed unattended past this point. |
| 59 | + |
| 60 | +## Step 5 — The analyze → resolve loop |
| 61 | + |
| 62 | +After `/speckit.analyze` reports findings, fix each finding (edit the spec/plan/tasks as needed), then re-run `/speckit.analyze`. Repeat **up to 3 cycles**. If findings remain unresolved after the third cycle, halt and report them rather than implementing against a known-inconsistent spec. |
| 63 | + |
| 64 | +## Step 6 — Unattended discipline (clarify-satisfied → implement) |
| 65 | + |
| 66 | +From the moment clarify is satisfied through `implement`, run without acknowledgment chatter between phases, but: |
| 67 | + |
| 68 | +- **Log every skip and every fallback.** Silent deviation from the plan is not allowed — if you skip or work around something, say so in the ledger. |
| 69 | +- **Halt on destructive or irreversible actions** during `implement` (deleting data, force-pushing, rewriting shared history) and ask, rather than proceeding blindly. |
| 70 | +- Any phase failure that isn't auto-resolvable, or is unsafe to continue past, halts **before** `implement`, naming the phase and reason. |
| 71 | + |
| 72 | +## Hard stops |
| 73 | + |
| 74 | +| Condition | Behavior | |
| 75 | +|---|---| |
| 76 | +| Empty feature description | Report missing input; do not start. | |
| 77 | +| Resolver returns non-zero | Report its message; run no phase. | |
| 78 | +| `.specify/` or a required `/speckit.*` command missing at preflight | Report; do not start. | |
| 79 | +| Expected artifact absent after a phase | Halt, name the phase; do not proceed. | |
| 80 | +| Analyze findings unresolved after 3 cycles | Halt; report the unresolved findings. | |
| 81 | +| A clarify question too consequential to answer unattended (`--yes`) | Halt before `plan`, name the question and why; never guess. | |
| 82 | +| Destructive/irreversible action during implement | Halt and ask. | |
| 83 | + |
| 84 | +## Notes |
| 85 | + |
| 86 | +- **Agent-neutral.** This command drives only stock `/speckit.*` commands and ships no dependency on any specific AI agent, model, or vendor tooling. In an agent that renders Spec Kit commands as skills, the same phases appear as `speckit-plan`, `speckit-tasks`, etc. — invoke whichever form your agent exposes. |
| 87 | +- **Preview first.** Run `/speckit.pipeline.preview` with the same flags to see the resolved plan before committing to a full run. |
0 commit comments