User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Pre-Execution Checks
Check for extension hooks (before planning):
- Check if
.specify/extensions.yml exists in the project root.
- If it exists, read it and look for entries under the
hooks.before_plan key
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
- Filter out hooks where
enabled is explicitly false. Treat hooks without an enabled field as enabled by default.
- For each remaining hook, do not attempt to interpret or evaluate hook
condition expressions:
- If the hook has no
condition field, or it is null/empty, treat the hook as executable
- If the hook defines a non-empty
condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- For each executable hook, output the following based on its
optional flag:
- Optional hook (
optional: true):## Extension Hooks
**Optional Pre-Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
- Mandatory hook (
optional: false):## Extension Hooks
**Automatic Pre-Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
Wait for the result of the hook command before proceeding to the Outline.
- If no hooks are registered or
.specify/extensions.yml does not exist, skip silently
Outline
Setup: Run .specify/scripts/bash/setup-plan.sh --json 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 .specify/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: 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.
Check for extension hooks: After reporting, check if .specify/extensions.yml exists in the project root.
- If it exists, read it and look for entries under the
hooks.after_plan key
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
- Filter out hooks where
enabled is explicitly false. Treat hooks without an enabled field as enabled by default.
- For each remaining hook, do not attempt to interpret or evaluate hook
condition expressions:
- If the hook has no
condition field, or it is null/empty, treat the hook as executable
- If the hook defines a non-empty
condition, skip the hook and leave condition evaluation to the HookExecutor implementation
- For each executable hook, output the following based on its
optional flag:
- Optional hook (
optional: true):## Extension Hooks
**Optional Hook**: {extension}
Command: `/{command}`
Description: {description}
Prompt: {prompt}
To execute: `/{command}`
- Mandatory hook (
optional: false):## Extension Hooks
**Automatic Hook**: {extension}
Executing: `/{command}`
EXECUTE_COMMAND: {command}
- If no hooks are registered or
.specify/extensions.yml does not exist, skip silently
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.)
Agent context update:
- Run
.specify/scripts/bash/update-agent-context.sh claude
- 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, agent-specific file
Key rules
- Use absolute paths
- ERROR on gate failures or unresolved clarifications
1---2name: speckit-plan-33description: Execute the implementation planning workflow using the plan template to generate design artifacts.4---56## User Input78```text9$ARGUMENTS10```1112You **MUST** consider the user input before proceeding (if not empty).1314## Pre-Execution Checks1516**Check for extension hooks (before planning)**:17- Check if `.specify/extensions.yml` exists in the project root.18- If it exists, read it and look for entries under the `hooks.before_plan` key19- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally20- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.21- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:22 - If the hook has no `condition` field, or it is null/empty, treat the hook as executable23 - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation24- For each executable hook, output the following based on its `optional` flag:25 - **Optional hook** (`optional: true`):26 ```27 ## Extension Hooks2829 **Optional Pre-Hook**: {extension}30 Command: `/{command}`31 Description: {description}3233 Prompt: {prompt}34 To execute: `/{command}`35 ```36 - **Mandatory hook** (`optional: false`):37 ```38 ## Extension Hooks3940 **Automatic Pre-Hook**: {extension}41 Executing: `/{command}`42 EXECUTE_COMMAND: {command}4344 Wait for the result of the hook command before proceeding to the Outline.45 ```46- If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently4748## Outline49501. **Setup**: Run `.specify/scripts/bash/setup-plan.sh --json` 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").51522. **Load context**: Read FEATURE_SPEC and `.specify/memory/constitution.md`. Load IMPL_PLAN template (already copied).53543. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:55 - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")56 - Fill Constitution Check section from constitution57 - Evaluate gates (ERROR if violations unjustified)58 - Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)59 - Phase 1: Generate data-model.md, contracts/, quickstart.md60 - Phase 1: Update agent context by running the agent script61 - Re-evaluate Constitution Check post-design62634. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, and generated artifacts.64655. **Check for extension hooks**: After reporting, check if `.specify/extensions.yml` exists in the project root.66 - If it exists, read it and look for entries under the `hooks.after_plan` key67 - If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally68 - Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.69 - For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:70 - If the hook has no `condition` field, or it is null/empty, treat the hook as executable71 - If the hook defines a non-empty `condition`, skip the hook and leave condition evaluation to the HookExecutor implementation72 - For each executable hook, output the following based on its `optional` flag:73 - **Optional hook** (`optional: true`):74 ```75 ## Extension Hooks7677 **Optional Hook**: {extension}78 Command: `/{command}`79 Description: {description}8081 Prompt: {prompt}82 To execute: `/{command}`83 ```84 - **Mandatory hook** (`optional: false`):85 ```86 ## Extension Hooks8788 **Automatic Hook**: {extension}89 Executing: `/{command}`90 EXECUTE_COMMAND: {command}91 ```92 - If no hooks are registered or `.specify/extensions.yml` does not exist, skip silently9394## Phases9596### Phase 0: Outline & Research97981. **Extract unknowns from Technical Context** above:99 - For each NEEDS CLARIFICATION → research task100 - For each dependency → best practices task101 - For each integration → patterns task1021032. **Generate and dispatch research agents**:104105 ```text106 For each unknown in Technical Context:107 Task: "Research {unknown} for {feature context}"108 For each technology choice:109 Task: "Find best practices for {tech} in {domain}"110 ```1111123. **Consolidate findings** in `research.md` using format:113 - Decision: [what was chosen]114 - Rationale: [why chosen]115 - Alternatives considered: [what else evaluated]116117**Output**: research.md with all NEEDS CLARIFICATION resolved118119### Phase 1: Design & Contracts120121**Prerequisites:** `research.md` complete1221231. **Extract entities from feature spec** → `data-model.md`:124 - Entity name, fields, relationships125 - Validation rules from requirements126 - State transitions if applicable1271282. **Define interface contracts** (if project has external interfaces) → `/contracts/`:129 - Identify what interfaces the project exposes to users or other systems130 - Document the contract format appropriate for the project type131 - Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications132 - Skip if project is purely internal (build scripts, one-off tools, etc.)1331343. **Agent context update**:135 - Run `.specify/scripts/bash/update-agent-context.sh claude`136 - These scripts detect which AI agent is in use137 - Update the appropriate agent-specific context file138 - Add only new technology from current plan139 - Preserve manual additions between markers140141**Output**: data-model.md, /contracts/*, quickstart.md, agent-specific file142143## Key rules144145- Use absolute paths146- ERROR on gate failures or unresolved clarifications