/speckit.plan command executes the implementation planning workflow, transforming your feature specification into concrete technical architecture, design decisions, and development artifacts.
Purpose
Generate production-ready design documents:- Research and resolve all technical unknowns
- Define data models and entity relationships
- Create API contracts and interface specifications
- Document technology stack and architecture decisions
- Update AI agent context with project specifics
- Validate against constitution principles
Planning focuses on how to build the feature (architecture, tech stack, design patterns) while specifications focus on what to build (requirements, user value).
Usage
How It Works
Setup
Runs setup script and parses JSON for:
FEATURE_SPEC: Path to spec.mdIMPL_PLAN: Path to plan.md (newly created from template)SPECS_DIR: Feature directoryBRANCH: Current feature branch name
Load Context
Reads:
- Feature specification (spec.md)
- Project constitution (.specify/memory/constitution.md)
- Plan template (already copied to feature directory)
Fill Technical Context
Populates plan.md Technical Context section:
- Language/Version (from user input or project files)
- Primary Dependencies (framework, libraries)
- Storage (database, file system, cache)
- Testing approach (framework, strategy)
- Target Platform (server, mobile, desktop, browser)
- Project Type (library, CLI, web service, mobile app)
- Performance Goals (latency, throughput)
- Constraints (memory, offline, compliance)
- Scale/Scope (users, data volume, complexity)
Constitution Check
Validates against constitutional principles:
- Complexity limits (e.g., max 3 services)
- Architectural patterns (required/forbidden)
- Technology constraints
- Quality gates (testing, security, observability)
Phase 0: Research
For each “NEEDS CLARIFICATION” in Technical Context:
- Research best practices for the domain
- Evaluate technology options
- Document decisions with rationale
- Consider alternatives
research.md with all unknowns resolvedPhase 1: Design
Creates design artifacts:data-model.md: Entity definitions
- Extract entities from spec.md
- Define fields, types, relationships
- Add validation rules from requirements
- Document state transitions
- API endpoints (for web services)
- CLI command schemas (for CLI tools)
- Public interfaces (for libraries)
- Event schemas (for event-driven systems)
- Development environment setup
- Running tests
- Common workflows
- Example usage scenarios
Phase 1: Agent Context Update
Runs agent-specific script to update AI assistant context:
- Detects which AI agent is in use
- Updates agent context file (e.g.,
.claude/commands/specify-context.md) - Adds new technologies from current plan
- Preserves manual additions between markers
Re-evaluate Constitution
Post-design constitution check:
- Verify design doesn’t violate principles
- Ensure complexity tracking justifies any violations
- Confirm quality gates can be met
Plan Structure
Metadata
Summary
High-level overview extracted from spec:Technical Context
Concrete technology decisions:Best Practices
Provide Tech Stack Hints
Justify Constitution Violations
If your design requires complexity:- Add entry to Complexity Tracking table
- Explain why it’s needed
- Document simpler alternative and why it’s insufficient
- Get buy-in before proceeding
Document Research Thoroughly
Future developers (including you) will ask:- Why did we choose X over Y?
- What were the tradeoffs?
- Can we switch to Z now?
Keep Contracts Implementation-Agnostic
Define the interface, not the implementation:- API endpoints: request/response schemas, status codes
- CLI commands: argument formats, output structure
- Library interfaces: function signatures, return types
- Events: schema and semantics
Handoffs
After planning:Create Tasks
Break the plan into actionable, dependency-ordered tasks
Create Checklist
Generate quality checklists for the plan (optional)
File Structure
Next Steps
Tasks
Break down the plan into executable tasks