--- name: plan description: "Generate an implementation plan from a specification. Phase 2 of Spec Kit workflow." argument-hint: "" allowed-tools: Read, Glob, Grep, Write, Edit, Skill, Task --- # Generate Implementation Plan Generate an implementation design document from a canonical specification. ## Workflow 1. **Load Specification** - Read the specification file from provided path - If no path provided, search `.specs/` for recent specifications - Parse requirements and acceptance criteria 2. **Analyze Codebase** - Explore existing codebase for: - Existing patterns and conventions - Related components and modules - Integration points - Technology stack 3. **Generate Design** - Create implementation approach - Identify components to create/modify - Define data models (if applicable) - Design API contracts (if applicable) - Document alternatives considered - Map design elements to requirements 4. **Validate Coverage** - Verify design addresses all requirements - Check alignment with codebase conventions - Identify risks and mitigation strategies 5. **Save Design** - Save to `.specs/{feature-name}/design.md` - Update specification with design reference - Report design summary ## Arguments - `$ARGUMENTS` - Path to specification file ## Examples ```bash # From specification file /spec-driven-development:plan .specs/user-auth/spec.md # Auto-detect recent specification /spec-driven-development:plan ``` ## Design Document Structure ```markdown # Design: {Feature Name} ## Overview [High-level implementation approach] ## Components ### {Component 1} - **Responsibility:** [What it does] - **Location:** [File path] - **Interfaces:** [How it connects] ## Data Model [Entity definitions if applicable] ## API Design [Endpoint specifications if applicable] ## Alternatives Considered [Other approaches and why rejected] ## Requirements Coverage | Requirement | Covered By | | --- | --- | | FR-1 | Component A | | FR-2 | Component B | ``` ## Related Commands - `/spec-driven-development:specify` - Generate specification (Phase 1) - `/spec-driven-development:tasks` - Generate task breakdown (Phase 3) - `/spec-driven-development:implement` - Guide implementation (Phase 4)