Creates structured plans from requirements. Generates comprehensive plans with steps, dependencies, risks, and success criteria. Coordinates with specialist agents for planning input and validates plan completeness. Uses template-renderer for formatted output.
Instrucciones de origen · Vista previa de solo lectura
name
plan-generator
description
Creates structured plans from requirements. Generates comprehensive plans with steps, dependencies, risks, and success criteria. Coordinates with specialist agents for planning input and validates plan completeness. Uses template-renderer for formatted output.
["Coordinate with Analyst, PM, Architect for planning input","Break down requirements into actionable steps (<=7 per section)","Identify dependencies and sequencing","Assess risks with mitigation strategies","Validate plan completeness and feasibility","Use template-renderer for formatted plan output"]
error_handling
graceful
streaming
supported
related_skills
["template-renderer","writing-plans"]
Plan Generator Skill
Plan Generator Skill - Creates structured, validated plans from requirements by coordinating with specialist agents and generating comprehensive planning artifacts.
- Creating plans for new features
- Planning refactoring efforts
- Planning system migrations
- Planning architecture changes
- Breaking down complex requirements
- Validating existing plans
Step 1: Analyze Requirements
Parse user requirements:
Extract explicit requirements
Identify implicit requirements
Determine planning scope
Assess complexity
Step 2: Coordinate Specialists
Request planning input from relevant agents:
Analyst: Business requirements and market context
PM: Product requirements and user stories
Architect: Technical architecture and design
Database Architect: Data requirements
UX Expert: Interface requirements
Step 3: Generate Plan Structure
Create plan following this EXECUTABLE structure:
# Plan: [Title]## Executive Summary
[2-3 sentence overview]
## Objectives- [Objective 1]
- [Objective 2]
## Phases### Phase N: [Phase Title]**Dependencies**: [Phase numbers or 'None']
**Parallel OK**: [Yes/No - can tasks run concurrently?]
#### Tasks- [ ] **N.1** [Task description] (~X min)
-**Command**: `actual shell command here` -**Verify**: `command to verify success` -**Rollback**: `command to undo if needed`- [ ] **N.2** [Task description] (~X min) [⚡ parallel OK]
-**Command**:
:
If any task fails:
Run rollback commands for completed tasks (reverse order)
Document error:
Do NOT proceed to Phase N+1
`...`
-
**Verify**
`...`
#### Phase N Error Handling
1.
2.
`echo "Phase N failed: [error]" >> .claude/context/memory/issues.md`
3.
#### Phase N Verification Gate
```bash
# All must pass before proceeding
[verification commands]
```
Risks
Risk
Impact
Mitigation
Rollback
[Risk]
[H/M/L]
[Strategy]
[Command]
Timeline Summary
Phase
Tasks
Est. Time
Parallel?
1
5
30 min
Partial
2
3
20 min
No
### The Executable Task Format (MANDATORY)
Every task MUST include:
1. **Checkbox** - `- [ ]` for progress tracking
2. **ID** - `N.M` format for reference
3. **Time estimate** - `(~X min)`
4. **Command** - Actual executable command
5. **Verify** - Command to confirm success
6. **Rollback** - Command to undo (if applicable)
7. **Parallel marker** - `[⚡ parallel OK]` if can run concurrently
### Guidelines
- Define clear objectives
- Break down into phases (<=7 phases total)
- Each phase has <=7 tasks
- Every task has executable commands
- Include verification gates between phases
### Step 4: Assess Risks
Identify risks and mitigation:
- Technical risks
- Resource risks
- Timeline risks
- Dependency risks
- Mitigation strategies
### Step 5: Validate Plan
Validate plan completeness:
- All requirements addressed
- Dependencies mapped
- Success criteria defined
- Risks identified
- Plan is feasible
### Step 6: Generate Artifacts
Create plan artifacts using the template-renderer skill:
**Using Template-Renderer**:
After creating plan data structure, invoke template-renderer to generate formatted output:
```javascript
// Map plan data to template tokens
const planTokens = {
PLAN_TITLE: plan.title,
DATE: new Date().toISOString().split('T')[0],
FRAMEWORK_VERSION: 'Agent-Studio v2.2.1',
STATUS: plan.status || 'Phase 0 - Research',
EXECUTIVE_SUMMARY: plan.executiveSummary,
TOTAL_TASKS: `${plan.totalTasks} atomic tasks`,
FEATURES_COUNT: plan.features.length,
ESTIMATED_TIME: plan.estimatedTime,
STRATEGY: plan.strategy,
KEY_DELIVERABLES_LIST: plan.keyDeliverables.map(d => `- ${d}`).join('\n'),
// Phase-specific tokens
PHASE_0_PURPOSE: plan.phases[0].purpose,
PHASE_0_DURATION: plan.phases[0].duration,
PHASE_1_NAME: plan.phases[1].name,
PHASE_1_PURPOSE: plan.phases[1].purpose,
PHASE_1_DURATION: plan.phases[1].duration,
DEPENDENCIES: plan.phases[1].dependencies,
PARALLEL_OK: plan.phases[1].parallelOk ? 'Yes' : 'No',
VERIFICATION_COMMANDS: plan.phases[1].verificationCommands,
// Add more phase tokens as needed
};
// Invoke template-renderer skill
Skill({
skill: 'template-renderer',
args: {
templateName: 'plan-template',
outputPath: `.claude/context/plans/${planId}.md`,
tokens: planTokens
}
});
```
**Output Locations**:
- Plan markdown (from template): `.claude/context/plans/<plan-id>.md`
- Plan JSON (structured data): `.claude/context/plans/<plan-id>.json`
- Plan summary (for quick reference)
</execution_process>
<plan_types>
**Feature Development Plan**:
- Objectives: Feature goals
- Steps: Analysis -> Design -> Implementation -> Testing
- Agents: Analyst -> PM -> Architect -> Developer -> QA
**Refactoring Plan**:
- Objectives: Code quality goals
- Steps: Analysis -> Planning -> Implementation -> Validation
- Agents: Code Reviewer -> Refactoring Specialist -> Developer -> QA
**Migration Plan**:
- Objectives: Migration goals
- Steps: Analysis -> Planning -> Execution -> Validation
- Agents: Architect -> Legacy Modernizer -> Developer -> QA
**Architecture Plan**:
- Objectives: Architecture goals
- Steps: Analysis -> Design -> Validation -> Documentation
- Agents: Architect -> Database Architect -> Security Architect -> Technical Writer
</plan_types>
<integration>
**Integration with Planner Agent**:
Planner agent uses this skill to:
- Generate plans from requirements
- Coordinate specialist input
- Validate plan completeness
- Track plan execution
</integration>
<best_practices>
1. **Coordinate Early**: Get specialist input before finalizing plan
2. **Keep Steps Focused**: <=7 steps per plan section
3. **Map Dependencies**: Clearly identify prerequisites
4. **Assess Risks**: Identify and mitigate risks proactively
5. **Validate Thoroughly**: Ensure plan is complete and feasible
</best_practices>
</instructions>
<examples>
<formatting_example>
**Example Plan Output**
**Command**: "Generate plan for user authentication feature"
**Generated Plan**:
```markdown
# Plan: User Authentication Feature
## Executive Summary
Add JWT-based authentication with login/logout endpoints. Includes password hashing, session management, and security testing.
## Objectives
- Implement JWT-based authentication
- Support login, logout, and session management
- Provide secure password handling
## Phases
### Phase 1: Setup & Design
**Dependencies**: None
**Parallel OK**: Partial
#### Tasks
- [ ] **1.1** Create feature branch (~2 min)
- **Command**: `git checkout -b feature/auth`
- **Verify**: `git branch --show-current | grep feature/auth`
- [ ] **1.2** Create auth module directory (~1 min) [⚡ parallel OK]
- **Command**: `mkdir -p src/auth`
- **Verify**: `ls -d src/auth`
- [ ] **1.3** Design auth architecture (~15 min)
- **Command**: `Task({ task_id: 'task-1', agent: "architect", prompt: "Design JWT auth..." })`
- **Verify**: `ls .claude/context/artifacts/auth-design.md`
#### Phase 1 Verification Gate
```bash
git branch --show-current | grep feature/auth && ls src/auth && ls .claude/context/artifacts/auth-design.md
Phase 2: Implementation
Dependencies: Phase 1
Parallel OK: No (sequential TDD)