Planning Strategies
Structured approach for complex task execution.
Instructions
- Task Decomposition
Break large tasks into manageable subtasks:
flowchart TD A[Complex Task] --> B[Subtask 1] A --> C[Subtask 2] A --> D[Subtask 3] B --> E[Sub-subtask 1.1] B --> F[Sub-subtask 1.2]
Task Breakdown Template
Main Goal: [Description]
Phase 1: Research
- Understand requirements
- Explore existing code
- Identify dependencies
Phase 2: Implementation
- Create types/interfaces
- Implement core logic
- Add error handling
Phase 3: Verification
- Test functionality
- Check edge cases
- Review code quality
- Dependency Analysis
Before execution, identify dependencies:
// Dependency Graph Example const taskDependencies = { 'create-api': [], // Independent 'create-types': [], // Independent 'create-service': ['create-types'], // Depends on types 'create-controller': ['create-service'], // Depends on service 'write-tests': ['create-controller'], // Depends on controller };
- Execution Order
Execution Strategy
-
Parallel Tasks: Independent tasks first
-
Sequential Tasks: Follow dependency order
-
Validation Points: Verify after each phase
-
Rollback Plan: Know how to undo
-
Goal-Oriented Planning
SMART Goals
- Specific: Clear, unambiguous objective
- Measurable: Quantifiable success criteria
- Achievable: Realistic within constraints
- Relevant: Aligned with user needs
- Time-bound: Has clear completion point
- Adaptive Re-Planning
When plans fail, adapt:
Re-Planning Protocol
- Detect: Identify the blocker
- Analyze: Why did the plan fail?
- Adapt: Modify the approach
- Continue: Resume with new plan
Common Blockers
| Blocker | Response |
|---|---|
| Missing dependency | Install or find alternative |
| Type error | Fix types first |
| API unavailable | Mock or wait |
| Unclear requirement | Ask user |
- Progress Tracking
Progress Template
Task: [Name]
- Status: 🟡 In Progress
- Progress: 3/7 steps complete
- Blockers: None
- ETA: 2 more tool calls
Completed
- Step 1: Research
- Step 2: Types
- Step 3: Core logic
Remaining
- Step 4: Error handling
- Step 5: Tests
- Step 6: Documentation
- Step 7: Review
- Risk Assessment
Risk Matrix
| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Breaking change | Medium | High | Test thoroughly |
| Performance issue | Low | Medium | Profile if needed |
| Type mismatch | High | Low | Use strict mode |
References
-
Hierarchical Task Network
-
Goal-Oriented Action Planning