Phase: 2 — Plan
Usage: /flow-plan, /flow-plan --auto, /flow-plan --manual, or
/flow-plan --continue-step
Invokes the decompose plugin for DAG-based task decomposition,
explores the codebase, validates the DAG against reality, and produces
an ordered implementation plan with a dependency graph.
prompt field in the state file
(the full text passed to /flow-start)#N patterns in the prompt) and
checks for the “decomposed” label/decompose:decompose for structured
DAG decomposition (configurable via dag mode — see below), then
self-invokes with --continue-step to ensure continuation after
the turn boundaryThe Plan phase optionally invokes the
decompose plugin
to decompose the feature into a Directed Acyclic Graph with explicit
dependencies, node types, and topological ordering. The DAG output is
stored to .flow-states/<branch>-dag.md and used to inform the plan
file’s Dependency Graph and task ordering.
Before invoking decompose, the skill sets _continue_pending and
_continue_context so the stop-continue hook forces continuation after
the plugin returns. After the decompose plugin returns, the complete
output — XML DAG plan, node executions with quality scores, and
synthesis block — is captured verbatim to .flow-states/<branch>-dag.md
with a markdown heading. The path is stored in files.dag in the state
file. The skill then self-invokes with --continue-step to dispatch to
the plan writing step via the Resume Check.
Configurable via .flow.json under skills.flow-plan.dag:
"auto" (default) — use DAG decomposition"always" — always use DAG decomposition"never" — skip DAG decomposition entirelyWhen a referenced issue has the “decomposed” label (applied by
/create-issue), the Plan phase skips the decompose plugin invocation
entirely. The issue body — which contains verified file paths, acceptance
criteria, scope boundaries, and architectural context from a prior
decompose run — is written to .flow-states/<branch>-dag.md as a
pre-existing analysis and used as a head start for plan writing. This
applies regardless of the configured DAG mode.
No self-invocation or continuation flags are needed when skipping decompose — execution proceeds directly to codebase exploration and plan writing in the same turn.
The plan file lives at .flow-states/<branch>-plan.md and includes:
The Resume Check handles both session restarts and mid-session self-invocation (after decompose returns). It checks the state file:
files.dag set, files.plan null — DAG was produced, skip to plan
writing (triggered by self-invocation or session restart)files.plan set — plan was written, complete the phaseMode is configurable via .flow.json (default: manual) under
skills.flow-plan.continue. In auto mode, the phase transition
advances to Code without asking. Flags --auto and --manual
override the configured mode.