Skip to content

Workflow Reference (.mspec/workflow.yaml)

The workflow file declares the ordered list of steps, their gating behavior, and the enforcement flags the CLI applies per step. The default lives at packages/cli/templates/workflow.default.yaml and is copied by mspec init.

Top-level shape

yaml
version: 1
name: mspec-default
description: <free text>
steps: [ <Step>, ... ]
modes:
  typo:    { skip: [...], force: [...] }
  minor:   { skip: [...], force: [...] }
  bugfix:  { skip: [...], force: [...] }

Step schema

KeyTypeNotes
idstringUnique step identifier (e.g. proposal).
commandstringSlash command the user types in Claude Code (e.g. /mspec:proposal).
skillstringName of the matching skill in .claude/skills/.
requiresarray of stringsArtifact filenames (or globs) that must exist before this step can start.
producesarray of stringsArtifact filenames this step writes. Use [] for steps that don't produce a file.
blockbooleanIf true, the workflow halts after this step until the user runs /mspec:continue. If false, auto-continue.
removablebooleanIf true, the user may delete the produced artifact and re-run the step.
skippablebooleanIf true, mspec skip <step-id> is allowed (with a non-empty reason).
subagentbooleanIf true, the step's skill delegates the heavy work to a Claude Code subagent.
ask_questionsbooleanIf true, the skill is allowed to invoke AskUserQuestion.
constitution_checkbooleanIf true, the artifact must contain a Phase 0 / Phase 1 Constitution Check table.
enforce_fr_idsboolean(delta) Require unique FR-NNN and #### Scenario: blocks per Requirement.
enforce_anchorboolean(implement) Every FR-ID in the Delta Spec must be anchored from code or test.
enforce_e2eboolean(implement) Every Scenario must have a corresponding E2E task in tasks.md.
enforce_tddboolean(implement) mspec test expect-red must run before expect-green per task.

The 11 standard steps

#idblocksubagentKey enforcement
1newtrue
2proposaltrueconstitution_check
3deltafalseenforce_fr_ids
4researchtrueyesconstitution_check, skippable
5designtrueconstitution_check
6quickstartfalseskippable
7checklistfalseyesskippable
8self-reviewtrueyesconstitution_check, skippable
9taskstrueconstitution_check
10implementtrueenforce_anchor, enforce_e2e, enforce_tdd
11archivefalse(deterministic CLI merge)

Modes (lightweight changes)

yaml
modes:
  typo:    { skip: [proposal, quickstart], force: [] }
  minor:   { skip: [proposal, quickstart], force: [] }
  bugfix:  { skip: [proposal, quickstart], force: [research] }

skip lists steps that will be auto-skipped; force lists steps that must run even if they are otherwise skippable. See ../how-to/lightweight-changes.md.

Validation

bash
mspec schema validate

The CLI rejects unknown keys, missing required keys, and circular requires dependencies.

Customization

See ../how-to/customize-workflow.md for the common edits — disabling subagents, toggling block gates, adding a custom step.