// Create comprehensive implementation plan in .plans directory based on analysis or report. Use when user asks to create a plan, plan implementation, design a solution, or structure work for a feature/refactor/fix.
| name | create-plan |
| description | Create comprehensive implementation plan in .plans directory based on analysis or report. Use when user asks to create a plan, plan implementation, design a solution, or structure work for a feature/refactor/fix. |
Create a detailed, high-quality implementation plan in .plans/ directory that adheres to strict quality standards and provides complete guidance for implementation.
CRITICAL: Never create a plan without thorough codebase understanding
For each item in the report, perform comprehensive analysis:
DO NOT SKIP THIS STEP - Rushed plans lead to bad implementations
Read ALL relevant CLAUDE.md files in:
Extract requirements:
Format: [descriptive-name].todo.md
Rules:
implement-user-authentication.todo.md โ
refactor-database-layer.todo.md โ
new-features.todo.md โ (too vague)CRITICAL RULES:
foo_v2.ts, foo-new.ts, foo-enhanced.tssimple-*.ts, temp-*.tsProcess:
Create plan document with ALL of the following sections:
# [Plan Title]
## Summary
[2-3 sentences explaining what and why]
## Type
[Feature | Refactor | Fix | Enhancement]
## Status
Todo (will be renamed to .done.md when complete)
## Context
[Why is this needed? What problem does it solve?]
## Current State
[What exists now? What are the limitations?]
## Desired State
[What will exist after? What improvements will we gain?]
## CLAUDE.md Requirements
### Naming Conventions
- [List relevant naming rules from CLAUDE.md]
### Architecture Requirements
- [List relevant architectural rules]
### Type Requirements
- [List type-related rules]
### Other Guidelines
- [Any other relevant rules]
## Existing Types
### Types to Reuse
- `TypeName` from `path/to/file.ts` - [what it represents]
- [List ALL types that can be reused]
### Types to Create
- `NewTypeName` - [what it will represent, why needed]
- [Only create if NO existing type works]
### Type Guidelines
- โ NEVER use `any`
- โ NEVER use `unknown` (unless absolutely necessary with justification)
- โ
ALWAYS prefer existing types
- โ
ALWAYS use strict typing
## Impact Analysis
### Files to Modify
- `path/to/file1.ts` - [what changes, why]
- `path/to/file2.ts` - [what changes, why]
### Files to Create
- `path/to/newfile.ts` - [purpose, why not existing file]
### Files to Delete
- `path/to/oldfile.ts` - [why removing, what replaces it]
### Dependencies Affected
- [List what depends on changed code]
- [How will dependencies be updated?]
### Breaking Changes
- [List any breaking changes]
- [How will they be handled?]
## Implementation Steps
Each step should be:
- Specific and actionable
- Single responsibility
- Ordered correctly (dependencies first)
### Step 1: [Descriptive Title]
**File**: `path/to/file.ts`
**Action**: [What to do]
**Why**: [Why this step]
**Details**:
- [Specific implementation detail]
- [Another detail]
### Step 2: [Next Step]
[Same structure]
[Continue for all steps]
## REMOVAL SPECIFICATION
**CRITICAL**: This section tracks OLD code that must be REMOVED.
### Code to Remove
#### From `path/to/file1.ts`
- **Lines X-Y**: `function oldFunction() {...}`
- **Why removing**: Replaced by newFunction
- **Replacement**: Step 3 in implementation
- **Dependencies**: Used by A, B, C (all updated in steps 5, 6, 7)
#### File to Delete: `path/to/old-file.ts`
- **Why removing**: Functionality moved to new-file.ts
- **Replacement**: Step 2 creates replacement
- **Dependencies**: Imported by X, Y, Z (all updated in steps 8, 9, 10)
### Removal Checklist
- [ ] All deprecated functions removed
- [ ] All old files deleted
- [ ] All imports updated
- [ ] All references updated
- [ ] No dead code remains
**VERIFICATION**: At completion, grep for old symbols to ensure complete removal.
## Anti-Patterns to Avoid
โ **NEVER** include:
- Migration mechanisms (gradual rollout, feature flags for this)
- Fallback mechanisms (keeping old code "just in case")
- Risk mitigation (running old and new in parallel)
- Backward compatibility layers (unless external API)
- Temporary bridges between old and new
โ
**ALWAYS** instead:
- Replace completely and cleanly
- Make all necessary changes at once
- Remove old code immediately
- Trust the plan and execute fully
**Why**: Half-migrations leave bad code in the codebase forever.
## Validation Criteria
### Pre-Implementation Checklist
- [ ] All CLAUDE.md files reviewed
- [ ] All existing types identified
- [ ] All affected files identified
- [ ] All naming follows patterns
- [ ] Impact fully analyzed
### Post-Implementation Checklist
- [ ] All steps completed
- [ ] All old code removed (per REMOVAL SPEC)
- [ ] TypeScript compiles (`tsc --noEmit`)
- [ ] Linting passes (`npm run lint`)
- [ ] Tests pass (if applicable)
- [ ] No `any` or `unknown` types added
- [ ] CLAUDE.md compliance verified
- [ ] Single responsibility maintained
.plans/ directory.todo.md extensionChecklist:
any or unknown types plannedDouble-check:
Before finalizing, consider:
If yes, recommend using the audit skill for those areas.
Provide summary:
# Plan Created: [plan-name]
## Location
`.plans/[plan-name].todo.md`
## Summary
[Brief description of what the plan covers]
## Key Points
- [Important aspect 1]
- [Important aspect 2]
- [Important aspect 3]
## Files Affected
- X files to modify
- Y files to create
- Z files to delete
## REMOVAL SPEC
- [Summary of what will be removed]
## Ready to Implement
The plan is complete and ready for implementation. All required sections are included, CLAUDE.md compliance is verified, and the removal specification is thorough.
## Next Steps
Review the plan and begin implementation when ready.
See templates/ directory for:
feature-plan-template.md - Template for new featuresrefactor-plan-template.md - Template for refactoringfix-plan-template.md - Template for bug fixes