Planning Workflow Skill
Purpose
Workflow for complex plans requiring multiple iterations and context management.
When to use
- •Tasks affecting multiple subsystems
- •Plans requiring extensive codebase exploration
- •Situations where context limits may become an issue
Workflow
Phase 1: Initial Understanding (Explore agents)
- •Launch 1-3 Explore agents in parallel
- •Give each agent a specific focus:
- •Agent 1: Current implementation and patterns
- •Agent 2: Related components/dependencies
- •Agent 3: Test patterns and edge cases
- •Agents report findings with file locations
Phase 2: Design (Plan agents)
- •Launch Plan agent(s) with context from Phase 1
- •Provide:
- •Findings from Explore agents
- •Specific requirements
- •Constraints and preconditions
- •Agent produces implementation plan
Phase 3: Consolidation
- •Read critical files yourself
- •Combine agent findings
- •Ask clarifying questions to user
- •Write final plan to plan file
Phase 4: Plan Refinement Iterations
For complex plans, perform iterative self-review until stable:
Iteration 1 - Completeness Review:
- •Clear current context (start fresh agent)
- •Provide agent with:
- •Original user request
- •Current plan file contents
- •Agent reviews plan for:
- •Completeness (all requirements covered?)
- •Correctness (implementation details accurate?)
- •Edge cases (error handling, validation?)
- •Agent updates plan with improvements
- •Agent reports: "Improvements found: yes/no"
Iteration 2 - Quality Review:
- •Clear context again (fresh agent)
- •Provide agent with:
- •Original user request
- •Updated plan from iteration 1
- •Agent reviews for:
- •Code quality (patterns, best practices?)
- •Testing strategy (coverage, scenarios?)
- •Verification steps (how to validate?)
- •Agent updates plan with improvements
- •Agent reports: "Improvements found: yes/no"
Iteration 3+ - Stability Check (if improvements were found):
- •Clear context (fresh agent)
- •Provide agent with:
- •Original user request
- •Current plan version
- •Agent reviews for any remaining improvements
- •If improvements found:
- •Update plan
- •Trigger another iteration
- •If no improvements found:
- •Plan is stable, proceed to user review
Convergence criteria:
- •Maximum 10 iterations to prevent infinite loops
- •Stop when agent reports "no improvements found"
- •Stop when changes are only cosmetic (formatting, wording)
Phase 5: User Review
- •Present final plan to user
- •Discuss each section
- •Adjust based on feedback
- •Document decisions and rationale
Context management tips
- •Agents start with clean context (no prior conversation)
- •Provide agents with sufficient background info in the prompt
- •Use agents for broad exploration, do targeted reads yourself
- •Summarize agent output before proceeding
Example agent prompts
Explore agent:
Search for all places where [X] is used. Focus on:
- •Direct calls
- •Related configuration
- •Test coverage Report filename:line_number for each finding.
Plan agent:
Design implementation for [feature]. Context:
- •Current implementation: [summary]
- •Involved files: [list]
- •Requirements: [list] Produce step-by-step plan with concrete code changes.