Plan Task
Role: Create informed implementation plans. Does NOT implement, only plans.
When to Use
- •After
skill:research-externalhas populated the research cache - •Starting a new ticket (after START phase)
- •Re-planning after review rejection (with reduced scope)
Prerequisites (MANDATORY)
Before planning, verify:
- •
Research cache exists for all technologies
bashls .claude/ledger/research/ # Must contain files for technologies in this ticket
If missing → STOP → invoke
skill:research-externalfirst - •
Session ledger initialized
bashcat .claude/ledger/sessions/{TICKET-ID}.mdIf missing → STOP → invoke
skill:context-keeperfirst
Process
Step 1: Read Research Cache
Load ALL research files relevant to the ticket:
cat .claude/ledger/research/prisma.md cat .claude/ledger/research/nestjs.md # etc.
Extract:
- •Version-specific APIs
- •Patterns to follow
- •Gotchas to avoid
Step 2: Review Existing Code
This is NOT optional. Before planning new code, understand what exists:
- •
Related modules - How are similar features structured?
bashls src/modules/
- •
Existing patterns - What patterns are already in use?
bash# Example: check how other entities are structured cat src/modules/events/domain/entities/event.entity.ts
- •
Shared code - What can be reused?
bashls src/shared/
- •
Infrastructure - What's already configured?
bashcat src/app.module.ts
Record findings in plan.
Step 3: Load Context Files
Based on ticket type, load relevant contexts:
| Ticket Type | Contexts to Load |
|---|---|
| New Entity | patterns/entities.md, patterns/cqrs.md |
| New Module | structure/feature-sliced.md, structure/module-setup.md |
| Repository | patterns/repositories.md |
| Controller | patterns/controllers.md |
| Infrastructure | infrastructure/*.md (relevant) |
Always load:
- •
conventions/naming.md - •
conventions/error-handling.md
Step 4: Generate Plan
Create a structured plan with:
## Plan: {TICKET-ID}
### Research Summary
Technologies: {list with versions}
Key findings:
- Finding 1 from research
- Finding 2 from research
### Existing Code Review
Related code found:
- `path/to/file.ts` - Description of what it does
- `path/to/other.ts` - Can reuse X pattern
### Components to Create
| Component | Path | Skill |
|-----------|------|-------|
| Entity | `domain/entities/x.entity.ts` | implement-feature |
| Command | `application/commands/x/x.command.ts` | implement-feature |
| Handler | `application/commands/x/x.handler.ts` | implement-feature |
| Tests | `*.spec.ts` | write-tests |
### Implementation Steps
#### 1. {Step name}
**Skill:** `implement-feature`
**Contexts:** `patterns/entities.md`
**Research:** `prisma.md` (entity mapping)
Tasks:
- Task 1
- Task 2
**Checkpoint:** `git commit -m "feat(x): [TTV-XXX] add X entity"`
#### 2. {Step name}
...
### Validation Criteria
- [ ] Criteria 1
- [ ] Criteria 2
Re-Planning After Review Rejection
When invoked with review feedback:
- •Read the feedback from review-code
- •Scope is REDUCED - only fix reported issues
- •Do NOT refactor unrelated code
- •Reference session ledger for context
## Re-Plan: {TICKET-ID} (Attempt {N}/3)
### Review Feedback
{paste feedback from review-code}
### Focused Fixes
#### Fix 1: {Issue from feedback}
**File:** `path/to/file.ts`
**Current:** {what's wrong}
**Fix:** {what to do}
**Skill:** implement-feature
#### Fix 2: ...
### Scope Boundary
ONLY fix the above issues. Do not:
- Refactor unrelated code
- Add new features
- Change working code
Output
The plan is used by subsequent skills:
- •
implement-featurefollows the steps - •
write-testsknows what to test - •
review-codevalidates against criteria
Critical Rules
- •NEVER plan without research cache - Hallucinations come from assumptions
- •ALWAYS review existing code - Don't reinvent what exists
- •ALWAYS specify contexts per step - Skills need to know what to load
- •ALWAYS define commit checkpoints - Small, functional commits
- •Planner does NOT implement - Only plans,
implement-featureexecutes