Plan a new feature or task with proper structure before implementation.
Plans new features or tasks with structured implementation steps. Use before coding complex changes to define requirements, approach, and file modifications.
/plugin marketplace add benshapyro/cadre-devkit-claude/plugin install benshapyro-cadre-devkit-claude@benshapyro/cadre-devkit-claudePlan a new feature or task with proper structure before implementation.
Reference skills based on feature type:
.claude/skills/api-design-patterns/SKILL.md.claude/skills/react-patterns/SKILL.md.claude/skills/tailwind-conventions/SKILL.md.claude/skills/error-handler/SKILL.md.claude/skills/test-generator/SKILL.mdFor new projects: Use /greenfield first to define specs, then /plan for implementation.
--tdd - Enable Test-Driven Development mode (write tests first)If no feature description provided, ask for one.
You MUST read relevant files before creating a plan. Don't plan based on assumptions.
Before planning:
Use Explore agent or direct file reads to understand:
Ask clarifying questions if needed:
Structure the implementation with specific details:
Detail Level Guidelines:
| Change Type | Detail Level |
|---|---|
| Complex/risky changes | Line numbers + code snippets |
| Medium changes | Function/method names |
| Simple/obvious changes | File paths only |
| New files | File path + structure outline |
Output Format:
## Feature: [description]
### Requirements
- [ ] Requirement 1
- [ ] Requirement 2
### Technical Approach
1. Step 1 - [description]
- Why: [reasoning for this approach]
2. Step 2 - [description]
### Files to Modify
#### `path/to/file.ts` (lines 45-67)
**Current:** [brief description of current state]
**Change:** [what will change]
```typescript
// Example of the change (for complex modifications)
function existingFunction() {
// Add: new caching logic here
}
path/to/new-file.ts (NEW)Purpose: [why this file is needed] Structure:
functionA() - [purpose]functionB() - [purpose]path/to/tests/file.test.ts
### 4. TDD Mode (if --tdd flag)
When `--tdd` is specified, modify the plan to include:
Acceptance Criteria → Test Cases
Write Failing Tests First Files to create/modify:
__tests__/feature.test.ts - [test descriptions]Implement to Pass Tests
Refactor
**TDD Workflow:**
Write test → Run (FAIL) → Implement → Run (PASS) → Refactor → Run (PASS)
### 5. Confidence Check
Run Pre-Implementation Confidence Check before proceeding.
### 6. Await Approval
Present plan and wait for user approval before implementation.
**Key review points for user:**
- Are the file changes correct?
- Is the approach sound?
- Any concerns about the changes?
## Example (Standard)
src/middleware/rateLimitMiddleware.ts (NEW)Purpose: Rate limiting middleware Structure:
rateLimiter() - Express middlewaregetRateKey() - Generate Redis keysrc/app.ts (line 23)Current: Auth middleware only Change: Add rate limiter after auth
app.use(authMiddleware);
app.use(rateLimiter({ limit: 100, window: 60 })); // ADD
__tests__/middleware/rateLimitMiddleware.test.ts
## Example (TDD Mode)
/plan --tdd Add rate limiting to API
Acceptance Criteria → Test Cases
Write Failing Tests First
File: __tests__/middleware/rateLimitMiddleware.test.ts
describe('rateLimiter', () => {
it('allows requests under limit', async () => { ... });
it('returns 429 when limit exceeded', async () => { ... });
it('resets after window expires', async () => { ... });
});
Implement to Pass Tests
rateLimitMiddleware.tsrateLimiter() functionRefactor
## Next Steps
After approval:
- If `--tdd`: Write tests first, then implement
- Otherwise: Start implementation
- Use `/review` for code review
- Use `/validate` to verify before completion
- Use `/ship` when ready to commit