description: Generate implementation plan from a spec
handoffs:
- label: Create Tasks
agent: speckit.tasks
prompt: Break the plan into tasks
send: true
- label: Create Checklist
agent: speckit.checklist
prompt: Create a checklist for the following domain...
scripts:
sh: scripts/bash/setup-plan.sh --json
ps: scripts/powershell/setup-plan.ps1 -Json
agent_scripts:
sh: scripts/bash/update-agent-context.sh AGENT
ps: scripts/powershell/update-agent-context.ps1 -AgentType AGENT
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Outline
Setup: Run {SCRIPT} from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'''m Groot' (or double-quote if possible: "I'm Groot").
Load context: Read FEATURE_SPEC and /memory/constitution.md. Load IMPL_PLAN template (already copied).
Execute plan workflow: Follow the structure in IMPL_PLAN template to:
- Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
- Fill Constitution Check section from constitution
- Evaluate gates (ERROR if violations unjustified)
- Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
- Phase 1: Generate data-model.md, contracts/, quickstart.md
- Phase 1: Database migrations — When Storage is not N/A, generate
db-migration.md (or e.g. mongodb-migration.md): required vs no-op, schema/index/backfill, rollback; link data-model.md. Stateless: omit file; note N/A in plan.md.
- Phase 1: Update agent context by running the agent script
- Re-evaluate Constitution Check post-design
Stop and report: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.
Phases
Phase 0: Outline & Research
Extract unknowns from Technical Context above:
- For each NEEDS CLARIFICATION → research task
- For each dependency → best practices task
- For each integration → patterns task
Generate and dispatch research agents:
For each unknown in Technical Context:
Task: "Research {unknown} for {feature context}"
For each technology choice:
Task: "Find best practices for {tech} in {domain}"
Consolidate findings in research.md using format:
- Decision: [what was chosen]
- Rationale: [why chosen]
- Alternatives considered: [what else evaluated]
Output: research.md with all NEEDS CLARIFICATION resolved
Phase 1: Design & Contracts
Prerequisites: research.md complete
Extract entities from feature spec → data-model.md:
- Entity name, fields, relationships
- Validation rules from requirements
- State transitions if applicable
Define interface contracts (if project has external interfaces) → /contracts/:
- Identify what interfaces the project exposes to users or other systems
- Document the contract format appropriate for the project type
- Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications
- Skip if project is purely internal (build scripts, one-off tools, etc.)
Database migrations (when feature uses persisted storage):
- Produce
db-migration.md or project-specific name in the feature spec directory per plan template
Agent context update:
- Run
{AGENT_SCRIPT}
- These scripts detect which AI agent is in use
- Update the appropriate agent-specific context file
- Add only new technology from current plan
- Preserve manual additions between markers
Output: data-model.md, /contracts/*, quickstart.md, db-migration.md when Storage ≠ N/A, agent-specific file
Key rules
- Use absolute paths
- ERROR on gate failures or unresolved clarifications
1---2name: speckit-plan3description: <!-- Generate implementation plan from a spec -->4---5<!-- Generate implementation plan from a spec -->6<!-- AUTO-GENERATED — DO NOT EDIT -->7<!-- Source: .specify/templates/commands/plan.md -->8<!-- Regenerate: make generate-agent-files -->910---11description: Generate implementation plan from a spec12handoffs: 13 - label: Create Tasks14 agent: speckit.tasks15 prompt: Break the plan into tasks16 send: true17 - label: Create Checklist18 agent: speckit.checklist19 prompt: Create a checklist for the following domain...20scripts:21 sh: scripts/bash/setup-plan.sh --json22 ps: scripts/powershell/setup-plan.ps1 -Json23agent_scripts:24 sh: scripts/bash/update-agent-context.sh __AGENT__25 ps: scripts/powershell/update-agent-context.ps1 -AgentType __AGENT__26---2728## User Input2930```text31$ARGUMENTS32```3334You **MUST** consider the user input before proceeding (if not empty).3536## Outline37381. **Setup**: Run `{SCRIPT}` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'''m Groot' (or double-quote if possible: "I'm Groot").39402. **Load context**: Read FEATURE_SPEC and `/memory/constitution.md`. Load IMPL_PLAN template (already copied).41423. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:43 - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")44 - Fill Constitution Check section from constitution45 - Evaluate gates (ERROR if violations unjustified)46 - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)47 - Phase 1: Generate data-model.md, contracts/, quickstart.md48 - Phase 1: **Database migrations** — When **Storage** is not N/A, generate `db-migration.md` (or e.g. `mongodb-migration.md`): required vs no-op, schema/index/backfill, rollback; link `data-model.md`. Stateless: omit file; note N/A in plan.md.49 - Phase 1: Update agent context by running the agent script50 - Re-evaluate Constitution Check post-design51524. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.5354## Phases5556### Phase 0: Outline & Research57581. **Extract unknowns from Technical Context** above:59 - For each NEEDS CLARIFICATION → research task60 - For each dependency → best practices task61 - For each integration → patterns task62632. **Generate and dispatch research agents**:6465 ```text66 For each unknown in Technical Context:67 Task: "Research {unknown} for {feature context}"68 For each technology choice:69 Task: "Find best practices for {tech} in {domain}"70 ```71723. **Consolidate findings** in `research.md` using format:73 - Decision: [what was chosen]74 - Rationale: [why chosen]75 - Alternatives considered: [what else evaluated]7677**Output**: research.md with all NEEDS CLARIFICATION resolved7879### Phase 1: Design & Contracts8081**Prerequisites:** `research.md` complete82831. **Extract entities from feature spec** → `data-model.md`:84 - Entity name, fields, relationships85 - Validation rules from requirements86 - State transitions if applicable87882. **Define interface contracts** (if project has external interfaces) → `/contracts/`:89 - Identify what interfaces the project exposes to users or other systems90 - Document the contract format appropriate for the project type91 - Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications92 - Skip if project is purely internal (build scripts, one-off tools, etc.)93943. **Database migrations** (when feature uses persisted storage):95 - Produce `db-migration.md` or project-specific name in the feature spec directory per plan template96974. **Agent context update**:98 - Run `{AGENT_SCRIPT}`99 - These scripts detect which AI agent is in use100 - Update the appropriate agent-specific context file101 - Add only new technology from current plan102 - Preserve manual additions between markers103104**Output**: data-model.md, /contracts/*, quickstart.md, **db-migration.md when Storage ≠ N/A**, agent-specific file105106## Key rules107108- Use absolute paths109- ERROR on gate failures or unresolved clarifications