This doc explains the orchestration model: how Story Automator decides what mode it is in, what happens during preflight, and how the state document, tmux sessions, and sprint status fit together.
Story Automator is a BMAD orchestrator that can coordinate Claude or Codex child workflows in isolated tmux sessions.
The important parts are:
- the main installed skill under each qualifying dependency skill root
- the helper CLI at
scripts/story-automator - the markdown orchestration state document
- sibling BMAD skills such as
bmad-create-story,bmad-dev-story,bmad-retrospective, and optionalbmad-qa-generate-e2e-tests - the bundled
bmad-story-automator-reviewskill sprint-status.yamlas the implementation-progress source of truth
The orchestrator supports four modes.
flowchart TD
A["Start Story Automator"] --> B["Load _bmad/bmm/config.yaml"]
B --> C["Resolve project_name, output_folder, communication_language"]
C --> D{"Requested mode"}
D -->|Create| E["steps-c/step-01-init.md"]
D -->|Resume| F["steps-c/step-01b-continue.md"]
D -->|Validate| G["steps-v/step-v-01-check.md"]
D -->|Edit| H["steps-e/step-e-01-load.md"]
Mode meanings:
Create: start a new orchestrationResume: continue a saved orchestration from its last safe stepValidate: audit state integrity and progress consistencyEdit: modify orchestration configuration and optionally resume
The workflow is intentionally split into many small files.
workflow.mddecides mode and routes to the first stepsteps-c/owns create and execution phasessteps-v/owns validationsteps-e/owns edit flowsdata/holds execution rules, retry guidance, parsing contracts, and operator promptstemplates/holds the state-document template
This is not just organization. It is an execution rule:
- read the current step file completely
- follow it in order
- update state
- then move to the next step
flowchart TD
A["Step 1: Init"] --> B["Verify stop hook"]
B --> C["Check for incomplete orchestration"]
C --> D["Confirm sprint-status.yaml exists"]
D --> E["Step 2: Preflight"]
E --> F["Parse epic and story selection"]
F --> G["Compute complexity for every selected story"]
G --> H["Display Complexity Matrix"]
H --> I["Step 2a: Configure"]
I --> J["Set skipAutomate and maxParallel"]
J --> K["Build agent config"]
K --> L["Create state document"]
L --> M["Step 2b: Finalize"]
M --> N["Write complexity JSON and agents file"]
N --> O["Create active marker"]
O --> P["Start execution loop"]
Key rules:
- stop-hook must exist before execution can continue
sprint-status.yamlmust exist before create mode can continue- complexity must be computed programmatically before agent selection
- the state doc is created before execution starts
sequenceDiagram
autonumber
participant U as User
participant O as Orchestrator
participant H as Helper CLI
participant S as State Doc
participant T as tmux Child
participant P as Sprint Status
U->>O: Run Story Automator
O->>H: parse-epic / parse-story / build-state-doc
H-->>O: Deterministic JSON
O->>S: Create orchestration file
O->>T: Spawn child session
T-->>O: monitor-session result
O->>P: Verify story or review completion
O->>S: Update progress, current step, action log
The helper CLI exists so the skill does not need to do everything through raw shell parsing or manual markdown edits.
The state document is the control plane for the run.
It records:
- current orchestration status
- current story and current step
- overrides such as
skipAutomateandmaxParallel - agent configuration
- references to generated complexity and agent-plan files
- progress table for each story
- action log
- active and completed sessions
Without it, resume, validation, and edit mode would be guesswork.
Story Automator distinguishes between orchestration state and workflow truth.
- orchestration state lives in the markdown state file
- session state lives in tmux plus helper-generated capture files
- workflow truth lives in
sprint-status.yamland story files
That distinction matters most during review:
- a child session exiting does not automatically mean the story is done
- review completion is verified against sprint status or story-file status
- monitor output is advisory; verification comes from the workflow artifacts
If the selected range spans multiple epics:
- stories are still processed in order
- epic completion is checked after each story
- retrospective is triggered per epic when every story in that epic is done
- one failed retrospective does not block later stories or epics