@endgame-build/claude-workflows
Version:
Claude Code workflow system with commands, agents, and templates for AI-native development
147 lines (113 loc) • 4.46 kB
Markdown
description: Break down architecture into actionable implementation tasks
argument-hint: <instance-name> <@architecture.md>
# /eg:plan
You are tasked with transforming an architectural design into a step-by-step implementation plan with ordered tasks, dependencies, effort estimates, and risk assessments.
Input: `$ARGUMENTS`
## Step 1: Parse Arguments and Load Architecture
Parse the arguments to extract:
- Instance name (first word before space)
- Architecture document path (everything after first space)
Read the architecture document from `.eg/{instance-name}/architecture.md`
## Step 2: Analyze Architecture for Task Breakdown
Use the Task tool to create an optimized implementation plan:
```
Task(
description="Create actionable implementation plan",
prompt=`
Transform the architecture from @.eg/{instance-name}/architecture.md into a detailed implementation plan.
Use zen-mcp planner or thinkdeep for optimal task decomposition.
Use the provided plan template from .claude/templates/plan.template.md
Fill in all template sections:
- Overview: Summary of what will be built
- Prerequisites: What must exist before starting
- Task Breakdown: Detailed tasks with:
- Task ID and clear description
- Dependencies on other tasks
- Effort estimate (XS/S/M/L/XL or hours)
- Risk level and mitigation
- Acceptance criteria
- Implementation Order: Critical path and parallel work
- Risk Analysis: Major risks and mitigation strategies
- Resource Requirements: Team skills and tools needed
- Timeline: Realistic schedule with milestones
Optimize for:
- Parallel execution where possible
- Clear dependency chains
- Risk mitigation early
- Incremental delivery of value
Save the plan to: .eg/{instance-name}/plan.md
`,
subagent_type="planner"
)
```
## Step 3: Validate Plan for Atomicity
After the plan is created, validate it using the plan-validator:
```
Task(
description="Validate plan for atomic task criteria",
prompt=`
Validate the implementation plan at .eg/{instance-name}/plan.md
Use the plan-validator agent to check:
- Each task meets atomic criteria (max 3 files, 15-30 min)
- Tasks have specific file paths
- Single testable outcome per task
- Clear success criteria
- Tasks are agent-executable
The validator will output PASS/NEEDS_IMPROVEMENT/MAJOR_ISSUES
Pay special attention to tasks that are too broad and need breakdown.
`,
subagent_type="plan-validator"
)
```
## Step 4: Review and Iterate
If validation result is NEEDS_IMPROVEMENT or MAJOR_ISSUES:
1. Use the validator feedback to break down non-atomic tasks
2. Re-run the planner with specific task breakdowns
3. Re-validate until PASS is achieved
## Step 5: Review and Optimize Plan
Once validation passes, invoke the plan reviewer for optimization:
```
Task(
description="Review plan for efficiency and completeness",
prompt=`
Review the implementation plan at @.eg/{instance-name}/plan.md
Validate:
- All architecture components are covered
- Task estimates are realistic
- Dependencies are correctly mapped
- Parallelization opportunities are identified
- Risks have mitigation strategies
- Acceptance criteria are testable
- Resource allocation is feasible
Optimize for:
- Shorter critical path
- Better parallelization
- Earlier risk mitigation
- Clearer task boundaries
If improvements are found, update the plan document.
`,
subagent_type="plan-reviewer"
)
```
## Step 6: Initialize Progress Tracking
Create the progress tracking structure:
```
!echo '{
"plan_created": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
"total_tasks": 0,
"completed_tasks": 0,
"current_phase": "planning",
"tasks": {}
}' > .eg/{instance-name}/progress.json
```
## Step 7: Finalize and Phase Gate
Based on all feedback:
1. Make any necessary final updates to the plan
2. Present the validated implementation plan to the user
3. Show the number of atomic tasks and estimated timeline
4. Ask for explicit approval: "The implementation plan has been validated with X atomic tasks. Shall we proceed to implementation? (yes/no)"
5. Only proceed to implementation after receiving "yes"
Once approved, inform the user that the next step would be:
`/eg:implement {instance-name} @.eg/{instance-name}/plan.md`