mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
Remove granular progress tracking across workflow system
- Remove detailed progress views (Total Tasks: X, Completed: Y %) from all templates - Simplify TODO_LIST.md structure by removing Progress Overview sections - Remove stats tracking from session-management-principles.json schema - Eliminate progress format and calculation logic from context command - Remove percentage-based progress displays from action-planning-agent - Simplify vibe command coordination by removing detailed task counts - Focus on essential JSON state changes rather than UI progress metrics 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,504 +1,386 @@
|
||||
---
|
||||
name: workflow-action-plan
|
||||
description: Action planning phase that integrates brainstorming insights or user input to create executable implementation plans
|
||||
usage: /workflow:action-plan [--from-brainstorming] [--skip-brainstorming] [--replan] [--trigger=<reason>]
|
||||
argument-hint: [optional: from brainstorming, skip brainstorming, replan mode, or replan trigger]
|
||||
description: Create implementation plans from various input sources
|
||||
usage: /workflow:action-plan [input-source] [--complexity=<simple|decompose>]
|
||||
argument-hint: [text|--from-file|--from-issue|--template|--interactive|--from-brainstorming] [optional: complexity]
|
||||
examples:
|
||||
- /workflow:action-plan "Build authentication system"
|
||||
- /workflow:action-plan --from-file requirements.md
|
||||
- /workflow:action-plan --from-issue ISS-001
|
||||
- /workflow:action-plan --template web-api
|
||||
- /workflow:action-plan --interactive
|
||||
- /workflow:action-plan --from-brainstorming
|
||||
- /workflow:action-plan --skip-brainstorming "implement OAuth authentication"
|
||||
- /workflow:action-plan --replan --trigger=requirement-change
|
||||
- /workflow:action-plan --from-brainstorming --scope=all --strategy=minimal-disruption
|
||||
---
|
||||
|
||||
# Workflow Action Plan Command (/workflow:action-plan)
|
||||
|
||||
## Overview
|
||||
Creates actionable implementation plans based on brainstorming insights or direct user input. Establishes project structure, understands existing workflow context, and generates executable plans with proper task decomposition and resource allocation.
|
||||
Creates actionable implementation plans from multiple input sources including direct text, files, issues, templates, interactive sessions, and brainstorming outputs. Supports flexible requirement gathering with optional task decomposition.
|
||||
|
||||
## Core Principles
|
||||
**System:** @~/.claude/workflows/unified-workflow-system-principles.md
|
||||
|
||||
## Input Sources & Planning Approaches
|
||||
## Input Sources & Processing
|
||||
|
||||
### Brainstorming-Based Planning (--from-brainstorming)
|
||||
**Prerequisites**: Completed brainstorming session with multi-agent analysis
|
||||
**Input Sources**:
|
||||
- `.workflow/WFS-[topic-slug]/.brainstorming/[agent]/analysis.md` files
|
||||
- `.workflow/WFS-[topic-slug]/.brainstorming/synthesis-analysis.md`
|
||||
- `.workflow/WFS-[topic-slug]/.brainstorming/recommendations.md`
|
||||
- `workflow-session.json` brainstorming phase results
|
||||
|
||||
### Direct User Input Planning (--skip-brainstorming)
|
||||
**Prerequisites**: User provides task description and requirements
|
||||
**Input Sources**:
|
||||
- User task description and requirements
|
||||
- Existing project structure analysis
|
||||
- Session context from workflow-session.json (if exists)
|
||||
|
||||
### Session Context Detection
|
||||
|
||||
⚠️ **CRITICAL**: Before planning, MUST check for existing active session to avoid creating duplicate sessions.
|
||||
|
||||
**Session Check Process:**
|
||||
1. **Query Session Registry**: Check `.workflow/session_status.jsonl` for active sessions. If the file doesn't exist, create it.
|
||||
2. **Session Selection**: Use existing active session or create new one only if none exists
|
||||
3. **Context Integration**: Load existing session state and brainstorming outputs
|
||||
|
||||
```json
|
||||
{
|
||||
"session_id": "WFS-[topic-slug]",
|
||||
"type": "simple|medium|complex",
|
||||
"current_phase": "PLAN",
|
||||
"session_source": "existing_active|new_creation",
|
||||
"brainstorming": {
|
||||
"status": "completed|skipped",
|
||||
"output_directory": ".workflow/WFS-[topic-slug]/.brainstorming/",
|
||||
"insights_available": true|false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Planning Depth & Document Generation
|
||||
- **Simple**: Skip detailed planning, generate minimal IMPL_PLAN.md or go direct to IMPLEMENT
|
||||
- **Medium**: Standard planning with IMPL_PLAN.md generation (1-2 agents)
|
||||
- **Complex**: Full planning with comprehensive IMPL_PLAN.md (enhanced structure)
|
||||
|
||||
## Execution Flow
|
||||
|
||||
### Phase 1: Context Understanding & Structure Establishment
|
||||
1. **Session Detection & Selection**:
|
||||
- **Check Active Sessions**: Query `.workflow/session_status.jsonl` for existing active sessions. If the file doesn't exist, create it.
|
||||
- **Session Priority**: Use existing active session if available, otherwise create new session
|
||||
- **Session Analysis**: Read and understand workflow-session.json from selected session
|
||||
- Detect existing brainstorming outputs
|
||||
- Identify current phase and progress
|
||||
- Understand project context and requirements
|
||||
|
||||
2. **File Structure Assessment**:
|
||||
- **If brainstorming exists**: Verify `.workflow/WFS-[topic-slug]/.brainstorming/` structure
|
||||
- **If no structure exists**: Create complete workflow directory structure
|
||||
- **Document Discovery**: Identify all existing planning documents
|
||||
|
||||
3. **Input Source Determination**:
|
||||
- **From Brainstorming**: Read all agent analyses and synthesis documents
|
||||
- **Skip Brainstorming**: Collect user requirements and context directly
|
||||
- **Hybrid**: Combine existing insights with new user input
|
||||
|
||||
### Phase 2: Context Integration & Requirements Analysis
|
||||
4. **Requirements Synthesis**:
|
||||
- **From Brainstorming**: Integrate multi-agent perspectives and recommendations
|
||||
- **From User Input**: Analyze and structure user-provided requirements
|
||||
- **Gap Analysis**: Identify missing information and clarify with user
|
||||
|
||||
5. **Complexity Assessment**: Determine planning depth needed based on:
|
||||
- Scope of requirements (brainstorming insights or user input)
|
||||
- Technical complexity indicators
|
||||
- Resource and timeline constraints
|
||||
- Risk assessment from available information
|
||||
|
||||
### Phase 3: Document Generation & Planning
|
||||
6. **Create Document Directory**: Setup `.workflow/WFS-[topic-slug]/` structure (if needed)
|
||||
|
||||
7. **Execute Planning**:
|
||||
- **Simple**: Minimal documentation, direct to IMPLEMENT
|
||||
- **Medium**: Generate IMPL_PLAN.md with task breakdown
|
||||
- **Complex**: Generate comprehensive IMPL_PLAN.md with staged approach and risk assessment
|
||||
|
||||
8. **Auto-Generate Tasks (NEW)**: Parse IMPL_PLAN.md and automatically create corresponding task JSON files
|
||||
- **Extract Tasks**: Parse task identifiers (IMPL-001, IMPL-002, etc.) from plan
|
||||
- **Create Task Files**: Generate `.task/impl-*.json` files with plan context
|
||||
- **Link to Plan**: Include `source_plan_ref` field linking tasks back to plan sections
|
||||
- **Set Dependencies**: Establish task dependencies based on plan structure
|
||||
|
||||
9. **Update Session**: Mark PLAN phase complete with document references and generated task list
|
||||
|
||||
10. **Link Documents**: Update JSON state with generated document paths and task file references
|
||||
|
||||
## Automated Task Generation (Single Source of Truth Integration)
|
||||
|
||||
### Planning-to-Execution Automation
|
||||
**NEW FEATURE**: Eliminates the gap between planning and execution by automatically creating executable task files from planning documents.
|
||||
|
||||
### Task Extraction Process
|
||||
1. **Parse IMPL_PLAN.md**: Scan for task identifiers in standardized format:
|
||||
- `IMPL-001`, `IMPL-002`, etc. (main tasks)
|
||||
- `IMPL-1.1`, `IMPL-1.2`, etc. (subtasks)
|
||||
- Task titles and descriptions from plan sections
|
||||
|
||||
2. **Generate Task JSON Files**: For each identified task, create structured JSON:
|
||||
```json
|
||||
{
|
||||
"id": "IMPL-001",
|
||||
"title": "Foundation/Infrastructure setup",
|
||||
"status": "pending",
|
||||
"type": "infrastructure",
|
||||
"agent": "code-developer",
|
||||
"effort": "2h",
|
||||
|
||||
"context": {
|
||||
"inherited_from": "WFS-[topic-slug]",
|
||||
"source_plan_ref": "IMPL_PLAN.md#phase-1-foundation",
|
||||
"requirements": ["Extracted from plan description"],
|
||||
"scope": ["Derived from plan context"],
|
||||
"acceptance": ["Extracted from success criteria"]
|
||||
},
|
||||
|
||||
"dependencies": {
|
||||
"upstream": [],
|
||||
"downstream": ["IMPL-002"],
|
||||
"phase_group": "Phase 1: Foundation"
|
||||
},
|
||||
|
||||
"metadata": {
|
||||
"created_at": "2025-09-07T15:00:00Z",
|
||||
"created_by": "workflow:action-plan",
|
||||
"auto_generated": true,
|
||||
"plan_version": "1.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
3. **Link Bidirectionally**:
|
||||
- Task files reference plan sections
|
||||
- Session state includes all generated task IDs
|
||||
- Ready for immediate execution via `/task:execute`
|
||||
|
||||
### Benefits of Automation
|
||||
- **Zero Manual Task Creation**: Plans immediately become executable
|
||||
- **Consistency**: All tasks derive from same authoritative plan
|
||||
- **Traceability**: Clear linkage from requirements through plan to tasks
|
||||
- **Immediate Execution**: Can run `/task:execute IMPL-001` immediately after planning
|
||||
|
||||
## Session State Analysis & Document Understanding
|
||||
|
||||
### Workflow Session Discovery
|
||||
**Command**: `workflow:action-plan` automatically detects and analyzes:
|
||||
|
||||
**Session Detection Process**:
|
||||
1. **Find Active Sessions**: Locate `.workflow/WFS-*/workflow-session.json` files
|
||||
2. **Session Validation**: Verify session completeness and current phase
|
||||
3. **Context Extraction**: Read session metadata, progress, and phase outputs
|
||||
|
||||
**Session State Analysis**:
|
||||
```json
|
||||
{
|
||||
"session_id": "WFS-user-auth-system",
|
||||
"current_phase": "PLAN",
|
||||
"brainstorming": {
|
||||
"status": "completed",
|
||||
"agents_completed": ["system-architect", "ui-designer", "security-expert"],
|
||||
"synthesis_available": true,
|
||||
"recommendations_count": 12
|
||||
},
|
||||
"documents": {
|
||||
"brainstorming": {
|
||||
"system-architect/analysis.md": {"status": "available", "insights": ["scalability", "microservices"]},
|
||||
"synthesis-analysis.md": {"status": "available", "key_themes": ["security-first", "user-experience"]}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Document Intelligence & Content Understanding
|
||||
**Process**: Action planning reads and interprets existing workflow documents
|
||||
|
||||
**Brainstorming Document Analysis**:
|
||||
- **Agent Analyses**: Extract key insights, recommendations, and constraints from each agent
|
||||
- **Synthesis Reports**: Understand cross-perspective themes and convergent solutions
|
||||
- **Recommendation Prioritization**: Identify high-impact, actionable items
|
||||
- **Context Preservation**: Maintain user requirements and constraints from discussions
|
||||
|
||||
**Content Integration Strategy**:
|
||||
- **Technical Requirements**: From system-architect, data-architect, security-expert analyses
|
||||
- **User Experience**: From ui-designer, user-researcher perspectives
|
||||
- **Business Context**: From product-manager, business-analyst insights
|
||||
- **Implementation Constraints**: From all agent recommendations and user discussions
|
||||
|
||||
**Gap Detection**:
|
||||
- Identify missing technical specifications
|
||||
- Detect undefined user requirements
|
||||
- Find unresolved architectural decisions
|
||||
- Highlight conflicting recommendations requiring resolution
|
||||
|
||||
## Output Format
|
||||
|
||||
### IMPL_PLAN.md Structure (Enhanced for Action Planning)
|
||||
```markdown
|
||||
# Action Implementation Plan
|
||||
|
||||
## Context & Requirements
|
||||
### From Brainstorming Analysis (if --from-brainstorming)
|
||||
- **Key Insights**: Synthesized from multi-agent perspectives
|
||||
- **Technical Requirements**: Architecture, security, data considerations
|
||||
- **User Experience Requirements**: UI/UX design and usability needs
|
||||
- **Business Requirements**: Product goals, stakeholder priorities, constraints
|
||||
- **User Discussion Context**: Captured requirements from user interactions
|
||||
|
||||
### From User Input (if --skip-brainstorming)
|
||||
- **User Provided Requirements**: Direct input and specifications
|
||||
- **Context Analysis**: Interpreted requirements and technical implications
|
||||
- **Gap Identification**: Areas needing clarification or additional information
|
||||
|
||||
## Strategic Approach
|
||||
- **Implementation Philosophy**: Core principles guiding development
|
||||
- **Success Metrics**: How progress and completion will be measured
|
||||
- **Risk Mitigation**: Key risks identified and mitigation strategies
|
||||
|
||||
## Task Breakdown
|
||||
- **IMPL-001**: Foundation/Infrastructure setup
|
||||
- **IMPL-002**: Core functionality implementation
|
||||
- **IMPL-003**: Integration and testing
|
||||
- **IMPL-004**: [Additional tasks based on complexity]
|
||||
|
||||
## Dependencies & Sequence
|
||||
- **Critical Path**: Essential task sequence
|
||||
- **Parallel Opportunities**: Tasks that can run concurrently
|
||||
- **External Dependencies**: Third-party integrations or resources needed
|
||||
|
||||
## Resource Allocation
|
||||
- **Technical Resources**: Required skills and expertise
|
||||
- **Timeline Estimates**: Duration estimates for each phase
|
||||
- **Quality Gates**: Review and approval checkpoints
|
||||
|
||||
## Success Criteria
|
||||
- **Functional Acceptance**: Core functionality validation
|
||||
- **Technical Acceptance**: Performance, security, scalability criteria
|
||||
- **User Acceptance**: Usability and experience validation
|
||||
```
|
||||
|
||||
### Enhanced IMPL_PLAN.md Structure (Complex Workflows)
|
||||
```markdown
|
||||
# Implementation Plan - [Project Name]
|
||||
|
||||
## Context & Requirements
|
||||
### From Brainstorming Analysis (if --from-brainstorming)
|
||||
- **Key Insights**: Synthesized from multi-agent perspectives
|
||||
- **Technical Requirements**: Architecture, security, data considerations
|
||||
- **User Experience Requirements**: UI/UX design and usability needs
|
||||
- **Business Requirements**: Product goals, stakeholder priorities, constraints
|
||||
- **User Discussion Context**: Captured requirements from user interactions
|
||||
|
||||
### From User Input (if --skip-brainstorming)
|
||||
- **User Provided Requirements**: Direct input and specifications
|
||||
- **Context Analysis**: Interpreted requirements and technical implications
|
||||
- **Gap Identification**: Areas needing clarification or additional information
|
||||
|
||||
## Strategic Approach
|
||||
- **Implementation Philosophy**: Core principles guiding development
|
||||
- **Success Metrics**: How progress and completion will be measured
|
||||
- **Risk Mitigation**: Key risks identified and mitigation strategies
|
||||
|
||||
## Phase Breakdown
|
||||
|
||||
### Phase 1: Foundation
|
||||
- **Objective**: [Core infrastructure/base components]
|
||||
- **Tasks**: IMPL-001, IMPL-002
|
||||
- **Duration**: [Estimate]
|
||||
- **Success Criteria**: [Measurable outcomes]
|
||||
|
||||
### Phase 2: Core Implementation
|
||||
- **Objective**: [Main functionality]
|
||||
- **Tasks**: IMPL-003, IMPL-004, IMPL-005
|
||||
- **Duration**: [Estimate]
|
||||
- **Dependencies**: Phase 1 completion
|
||||
|
||||
### Phase 3: Integration & Testing
|
||||
- **Objective**: [System integration and validation]
|
||||
- **Tasks**: IMPL-006, IMPL-007
|
||||
- **Duration**: [Estimate]
|
||||
|
||||
## Risk Assessment
|
||||
- **High Risk**: [Description] - Mitigation: [Strategy]
|
||||
- **Medium Risk**: [Description] - Mitigation: [Strategy]
|
||||
|
||||
## Quality Gates
|
||||
- Code review requirements
|
||||
- Testing coverage targets
|
||||
- Performance benchmarks
|
||||
- Security validation checks
|
||||
|
||||
## Rollback Strategy
|
||||
- Rollback triggers and procedures
|
||||
- Data preservation approach
|
||||
```
|
||||
|
||||
## Document Storage
|
||||
Generated documents are stored in session directory:
|
||||
```
|
||||
.workflow/WFS-[topic-slug]/
|
||||
├── IMPL_PLAN.md # Combined planning document (all complexities)
|
||||
└── workflow-session.json # Updated with document references
|
||||
```
|
||||
|
||||
## Session Updates (Enhanced with Task Generation)
|
||||
```json
|
||||
{
|
||||
"phases": {
|
||||
"PLAN": {
|
||||
"status": "completed",
|
||||
"output": {
|
||||
"primary": "IMPL_PLAN.md",
|
||||
"tasks_generated": [".task/impl-001.json", ".task/impl-002.json", ".task/impl-003.json"]
|
||||
},
|
||||
"documents_generated": ["IMPL_PLAN.md"],
|
||||
"tasks_auto_created": 3,
|
||||
"completed_at": "2025-09-05T11:00:00Z",
|
||||
"tasks_identified": ["IMPL-001", "IMPL-002", "IMPL-003"],
|
||||
"ready_for_implementation": true
|
||||
}
|
||||
},
|
||||
"documents": {
|
||||
"planning": {
|
||||
"IMPL_PLAN.md": {
|
||||
"status": "generated",
|
||||
"path": ".workflow/WFS-[topic-slug]/IMPL_PLAN.md",
|
||||
"tasks_extracted": 3,
|
||||
"auto_generation": "completed"
|
||||
}
|
||||
}
|
||||
},
|
||||
"task_system": {
|
||||
"enabled": true,
|
||||
"auto_generated": true,
|
||||
"directory": ".workflow/WFS-[topic-slug]/.task/",
|
||||
"task_count": {
|
||||
"total": 3,
|
||||
"pending": 3,
|
||||
"from_planning": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Complexity Decision Rules
|
||||
|
||||
### Document Generation Matrix
|
||||
| Complexity | IMPL_PLAN.md | Structure | Agent Requirements |
|
||||
|------------|--------------|-----------|-------------------|
|
||||
| **Simple** | Optional/Skip | Minimal | Direct to IMPLEMENT |
|
||||
| **Medium** | Required | Standard | planning-agent |
|
||||
| **Complex** | Required | Enhanced with phases + risk assessment | planning-agent + detailed analysis |
|
||||
|
||||
### Auto-Detection Triggers
|
||||
Complex planning triggered when:
|
||||
- Architecture changes required
|
||||
- Security implementation needed
|
||||
- Performance optimization planned
|
||||
- System integration involved
|
||||
- Estimated effort > 8 hours
|
||||
- Risk level assessed as high
|
||||
|
||||
### Manual Override
|
||||
### Direct Text Input (Default)
|
||||
```bash
|
||||
# Force complex planning even for medium tasks
|
||||
/workflow:action-plan --force-complex
|
||||
|
||||
# Force simple planning for quick fixes
|
||||
/workflow:action-plan --force-simple
|
||||
/workflow:action-plan "Build user authentication system with JWT and OAuth2"
|
||||
```
|
||||
**Processing**:
|
||||
- Parse natural language requirements
|
||||
- Extract technical components and constraints
|
||||
- Identify implementation scope and objectives
|
||||
- Generate structured plan from description
|
||||
|
||||
## Skip Option
|
||||
### File-based Input
|
||||
```bash
|
||||
/workflow:action-plan --skip-to-implement
|
||||
/workflow:action-plan --from-file requirements.md
|
||||
/workflow:action-plan --from-file PROJECT_SPEC.txt
|
||||
```
|
||||
- Generates minimal plan
|
||||
- Immediately transitions to IMPLEMENT
|
||||
- Useful for urgent fixes
|
||||
**Supported formats**: .md, .txt, .json, .yaml
|
||||
**Processing**:
|
||||
- Read and parse file contents
|
||||
- Extract structured requirements and specifications
|
||||
- Identify task descriptions and dependencies
|
||||
- Preserve original structure and priorities
|
||||
|
||||
## Replanning Mode
|
||||
|
||||
### Usage
|
||||
### Issue-based Input
|
||||
```bash
|
||||
# Basic replanning
|
||||
/workflow:action-plan --replan --trigger=requirement-change
|
||||
|
||||
# Strategic replanning with impact analysis
|
||||
/workflow:action-plan --replan --trigger=new-issue --scope=all --strategy=minimal-disruption --impact-analysis
|
||||
|
||||
# Conflict resolution
|
||||
/workflow:action-plan --replan --trigger=dependency-conflict --auto-resolve
|
||||
/workflow:action-plan --from-issue ISS-001
|
||||
/workflow:action-plan --from-issue "feature-request"
|
||||
```
|
||||
**Supported sources**: Issue IDs, issue titles, GitHub URLs
|
||||
**Processing**:
|
||||
- Load issue description and acceptance criteria
|
||||
- Parse technical requirements and constraints
|
||||
- Extract related issues and dependencies
|
||||
- Include issue context in planning
|
||||
|
||||
### Replan Parameters
|
||||
- `--trigger=<reason>` → Replanning trigger: `new-issue|requirement-change|dependency-conflict|optimization`
|
||||
- `--scope=<scope>` → Scope: `current-phase|all|documents-only|tasks-only`
|
||||
- `--strategy=<strategy>` → Strategy: `minimal-disruption|optimal-efficiency|risk-minimization|time-optimization`
|
||||
- `--impact-analysis` → Detailed impact analysis
|
||||
- `--auto-resolve` → Auto-resolve conflicts
|
||||
- `--dry-run` → Simulation mode
|
||||
|
||||
### Replanning Strategies
|
||||
|
||||
#### Minimal Disruption
|
||||
- Preserve completed tasks
|
||||
- Minimize impact on active work
|
||||
- Insert changes optimally
|
||||
|
||||
#### Optimal Efficiency
|
||||
- Re-optimize task order
|
||||
- Maximize parallelization
|
||||
- Optimize critical path
|
||||
|
||||
#### Risk Minimization
|
||||
- Prioritize high-risk tasks
|
||||
- Add buffer time
|
||||
- Strengthen dependencies
|
||||
|
||||
#### Time Optimization
|
||||
- Focus on core requirements
|
||||
- Defer non-critical tasks
|
||||
- Maximize parallel execution
|
||||
|
||||
### Integration with Issues
|
||||
When issues are created, replanning can be automatically triggered:
|
||||
### Template-based Input
|
||||
```bash
|
||||
# Create issue then replan
|
||||
/workflow:issue create --type=feature "OAuth2 support"
|
||||
/workflow:action-plan --replan --trigger=new-issue --issue=ISS-001
|
||||
/workflow:action-plan --template web-api
|
||||
/workflow:action-plan --template mobile-app "user management"
|
||||
```
|
||||
**Available templates**:
|
||||
- `web-api`: REST API development template
|
||||
- `mobile-app`: Mobile application template
|
||||
- `database-migration`: Database change template
|
||||
- `security-feature`: Security implementation template
|
||||
**Processing**:
|
||||
- Load template structure and best practices
|
||||
- Prompt for template-specific parameters
|
||||
- Customize template with user requirements
|
||||
- Generate plan following template patterns
|
||||
|
||||
### Interactive Mode
|
||||
```bash
|
||||
/workflow:action-plan --interactive
|
||||
```
|
||||
**Guided Process**:
|
||||
1. **Project Type**: Select development category
|
||||
2. **Requirements**: Structured requirement gathering
|
||||
3. **Constraints**: Technical and resource limitations
|
||||
4. **Success Criteria**: Define completion conditions
|
||||
5. **Plan Generation**: Create comprehensive plan
|
||||
|
||||
### Brainstorming Integration
|
||||
```bash
|
||||
/workflow:action-plan --from-brainstorming
|
||||
```
|
||||
**Prerequisites**: Completed brainstorming session
|
||||
**Processing**:
|
||||
- Read multi-agent brainstorming analyses
|
||||
- Synthesize recommendations and insights
|
||||
- Integrate diverse perspectives into unified plan
|
||||
- Preserve brainstorming context and decisions
|
||||
|
||||
### Web-based Input
|
||||
```bash
|
||||
/workflow:action-plan --from-url "https://github.com/project/issues/45"
|
||||
/workflow:action-plan --from-url "https://docs.example.com/spec"
|
||||
```
|
||||
**Processing**:
|
||||
- Fetch content from web URLs
|
||||
- Parse structured requirements from web pages
|
||||
- Extract technical specifications
|
||||
- Handle GitHub issues, documentation sites, specs
|
||||
|
||||
## Complexity Levels
|
||||
|
||||
### Simple (Default)
|
||||
```bash
|
||||
/workflow:action-plan "Build chat system"
|
||||
```
|
||||
**Output**: IMPL_PLAN.md document only
|
||||
**Use case**: Documentation-focused planning, quick overviews
|
||||
**Content**: Structured plan with task descriptions
|
||||
|
||||
### Decompose
|
||||
```bash
|
||||
/workflow:action-plan "Build chat system" --complexity=decompose
|
||||
```
|
||||
**Output**: IMPL_PLAN.md + task JSON files
|
||||
**Use case**: Full workflow execution with automated task system
|
||||
**Content**: Plan document + extracted task files in .task/ directory
|
||||
|
||||
## Input Processing Pipeline
|
||||
|
||||
### 1. Input Detection
|
||||
```pseudo
|
||||
function detect_input_type(args):
|
||||
if starts_with("--from-file"):
|
||||
return "file"
|
||||
elif starts_with("--from-issue"):
|
||||
return "issue"
|
||||
elif starts_with("--template"):
|
||||
return "template"
|
||||
elif args == "--interactive":
|
||||
return "interactive"
|
||||
elif args == "--from-brainstorming":
|
||||
return "brainstorming"
|
||||
elif starts_with("--from-url"):
|
||||
return "url"
|
||||
else:
|
||||
return "direct_text"
|
||||
```
|
||||
|
||||
## Integration with Workflow System
|
||||
### 2. Content Extraction
|
||||
**Per Input Type**:
|
||||
- **Direct Text**: Parse natural language requirements
|
||||
- **File**: Read file contents and structure
|
||||
- **Issue**: Load issue data and related context
|
||||
- **Template**: Load template and gather parameters
|
||||
- **Interactive**: Conduct guided requirement session
|
||||
- **Brainstorming**: Read brainstorming outputs
|
||||
- **URL**: Fetch web content and parse
|
||||
|
||||
### Action Planning Integration Points
|
||||
**Prerequisite Commands**:
|
||||
- `/workflow:session start` → Initialize workflow session
|
||||
- `/brainstorm` → (Optional) Multi-agent brainstorming phase
|
||||
### 3. Requirement Analysis
|
||||
- Structure extracted information
|
||||
- Identify tasks and dependencies
|
||||
- Determine technical requirements
|
||||
- Extract success criteria
|
||||
- Assess complexity and scope
|
||||
|
||||
**Action Planning Execution**:
|
||||
- `/workflow:action-plan --from-brainstorming` → Plan from completed brainstorming
|
||||
- `/workflow:action-plan --skip-brainstorming "task description"` → Plan from user input
|
||||
- `/workflow:action-plan --replan` → Revise existing plans
|
||||
### 4. Plan Generation
|
||||
- Create IMPL_PLAN.md with structured content
|
||||
- Include requirements, tasks, and success criteria
|
||||
- Maintain traceability to input sources
|
||||
- Format for readability and execution
|
||||
|
||||
**Follow-up Commands**:
|
||||
- `/workflow:implement` → Execute the action plan
|
||||
- `/workflow:status` → View current workflow state
|
||||
- `/task:create` → Create specific implementation tasks
|
||||
- `/workflow:review` → Validate completed implementation
|
||||
### 5. Optional Decomposition
|
||||
**If --complexity=decompose**:
|
||||
- Parse IMPL_PLAN.md for task identifiers
|
||||
- Create .task/impl-*.json files
|
||||
- Establish task relationships
|
||||
- Update session with task references
|
||||
|
||||
## Session Management
|
||||
|
||||
### Session Check Process
|
||||
⚠️ **CRITICAL**: Check for existing active session before planning
|
||||
|
||||
1. **Query Session Registry**: Check `.workflow/session_status.jsonl`
|
||||
2. **Session Selection**: Use existing active session or create new
|
||||
3. **Context Integration**: Load session state and existing context
|
||||
|
||||
### Session State Updates
|
||||
After action planning completion:
|
||||
```json
|
||||
{
|
||||
"current_phase": "IMPLEMENT",
|
||||
"current_phase": "PLAN",
|
||||
"input_source": "direct_text|file|issue|template|interactive|brainstorming|url",
|
||||
"input_details": {
|
||||
"type": "detected_input_type",
|
||||
"source": "input_identifier_or_path",
|
||||
"processed_at": "2025-09-08T15:00:00Z"
|
||||
},
|
||||
"phases": {
|
||||
"BRAINSTORM": {"status": "completed|skipped"},
|
||||
"PLAN": {
|
||||
"status": "completed",
|
||||
"input_source": "brainstorming|user_input",
|
||||
"complexity": "simple|decompose",
|
||||
"documents_generated": ["IMPL_PLAN.md"],
|
||||
"tasks_identified": ["IMPL-001", "IMPL-002", "IMPL-003"],
|
||||
"complexity_assessed": "simple|medium|complex"
|
||||
"tasks_created": 0,
|
||||
"input_processed": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Quality Assurance
|
||||
**Action Planning Excellence**:
|
||||
- **Context Integration** → All brainstorming insights or user requirements incorporated
|
||||
- **Actionable Output** → Plans translate directly to executable tasks
|
||||
- **Comprehensive Coverage** → Technical, UX, and business considerations included
|
||||
- **Clear Sequencing** → Dependencies and critical path clearly defined
|
||||
- **Measurable Success** → Concrete acceptance criteria established
|
||||
## IMPL_PLAN.md Template
|
||||
|
||||
This action planning command bridges brainstorming insights and implementation execution, ensuring comprehensive planning based on multi-perspective analysis or direct user input.
|
||||
### Standard Structure
|
||||
```markdown
|
||||
# Implementation Plan - [Project Name]
|
||||
*Generated from: [input_source]*
|
||||
|
||||
## Requirements
|
||||
[Extracted requirements from input source]
|
||||
|
||||
## Technical Scope
|
||||
[Technical components and architecture needs]
|
||||
|
||||
## Task Breakdown
|
||||
- **IMPL-001**: [Task description]
|
||||
- **IMPL-002**: [Task description]
|
||||
- **IMPL-003**: [Task description]
|
||||
|
||||
## Dependencies & Sequence
|
||||
[Task execution order and relationships]
|
||||
|
||||
## Success Criteria
|
||||
[Measurable completion conditions]
|
||||
|
||||
## Input Source Context
|
||||
[Traceability information back to original input]
|
||||
```
|
||||
|
||||
## Task Decomposition (Decompose Mode)
|
||||
|
||||
### Automatic Task Generation
|
||||
**Process**:
|
||||
1. Parse IMPL_PLAN.md for task patterns: `IMPL-\d+`
|
||||
2. Extract task titles and descriptions
|
||||
3. Create JSON files in `.task/` directory
|
||||
4. Establish dependencies from plan structure
|
||||
|
||||
### Generated Task JSON Structure
|
||||
```json
|
||||
{
|
||||
"id": "impl-1",
|
||||
"title": "[Extracted from IMPL_PLAN.md]",
|
||||
"status": "pending",
|
||||
"type": "feature",
|
||||
"agent": "code-developer",
|
||||
"context": {
|
||||
"requirements": ["From input source"],
|
||||
"scope": ["Inferred from task description"],
|
||||
"acceptance": ["From success criteria"],
|
||||
"inherited_from": "WFS-[session]",
|
||||
"input_source": "direct_text|file|issue|template|interactive|brainstorming|url"
|
||||
},
|
||||
"relations": {
|
||||
"parent": null,
|
||||
"subtasks": [],
|
||||
"dependencies": []
|
||||
},
|
||||
"execution": {
|
||||
"attempts": 0,
|
||||
"last_attempt": null
|
||||
},
|
||||
"meta": {
|
||||
"created": "[timestamp]",
|
||||
"updated": "[timestamp]",
|
||||
"generated_from": "IMPL_PLAN.md"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Template System
|
||||
|
||||
### Available Templates
|
||||
|
||||
#### Web API Template
|
||||
```markdown
|
||||
Requirements:
|
||||
- REST endpoints design
|
||||
- Database schema
|
||||
- Authentication/authorization
|
||||
- API documentation
|
||||
- Error handling
|
||||
- Testing strategy
|
||||
```
|
||||
|
||||
#### Mobile App Template
|
||||
```markdown
|
||||
Requirements:
|
||||
- Platform selection (iOS/Android/Cross-platform)
|
||||
- UI/UX design
|
||||
- State management
|
||||
- API integration
|
||||
- Local storage
|
||||
- App store deployment
|
||||
```
|
||||
|
||||
#### Security Feature Template
|
||||
```markdown
|
||||
Requirements:
|
||||
- Security requirements analysis
|
||||
- Threat modeling
|
||||
- Implementation approach
|
||||
- Testing and validation
|
||||
- Compliance considerations
|
||||
- Documentation updates
|
||||
```
|
||||
|
||||
### Template Customization
|
||||
Templates prompt for:
|
||||
- Project-specific requirements
|
||||
- Technology stack preferences
|
||||
- Scale and performance needs
|
||||
- Integration requirements
|
||||
- Timeline constraints
|
||||
|
||||
## Interactive Planning Process
|
||||
|
||||
### Step-by-Step Guidance
|
||||
1. **Project Category**: Web app, mobile app, API, library, etc.
|
||||
2. **Core Requirements**: Main functionality and features
|
||||
3. **Technical Stack**: Languages, frameworks, databases
|
||||
4. **Constraints**: Timeline, resources, performance needs
|
||||
5. **Dependencies**: External systems, APIs, libraries
|
||||
6. **Success Criteria**: How to measure completion
|
||||
7. **Review & Confirmation**: Validate gathered information
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Input Processing Errors
|
||||
```bash
|
||||
# File not found
|
||||
❌ File requirements.md not found
|
||||
→ Check file path and try again
|
||||
|
||||
# Invalid issue
|
||||
❌ Issue ISS-001 not found
|
||||
→ Verify issue ID or create issue first
|
||||
|
||||
# Template not available
|
||||
❌ Template "custom-template" not available
|
||||
→ Available templates: web-api, mobile-app, database-migration, security-feature
|
||||
|
||||
# URL fetch failed
|
||||
❌ Cannot fetch content from URL
|
||||
→ Check URL accessibility and format
|
||||
```
|
||||
|
||||
## Integration Points
|
||||
|
||||
### Command Flow
|
||||
```bash
|
||||
# Planning from various sources
|
||||
/workflow:action-plan [input-source]
|
||||
|
||||
# View generated plan
|
||||
/context
|
||||
|
||||
# Execute tasks (if decomposed)
|
||||
/task:execute impl-1
|
||||
|
||||
# Move to implementation
|
||||
/workflow:vibe
|
||||
```
|
||||
|
||||
### Session Integration
|
||||
- Updates workflow-session.json with planning results
|
||||
- Creates document references for generated files
|
||||
- Establishes task system if decomposition enabled
|
||||
- Preserves input source traceability
|
||||
|
||||
## Related Commands
|
||||
|
||||
- `/context` - View generated plan and task status
|
||||
- `/task:execute` - Execute decomposed tasks
|
||||
- `/workflow:vibe` - Coordinate multi-agent execution
|
||||
- `/workflow:review` - Validate completed implementation
|
||||
|
||||
---
|
||||
|
||||
**System ensures**: Flexible planning from multiple input sources with optional task decomposition and full workflow integration
|
||||
@@ -1,345 +0,0 @@
|
||||
---
|
||||
name: workflow-implement
|
||||
description: Implementation phase with simple, medium, and complex execution modes
|
||||
usage: /workflow:implement [--type=<simple|medium|complex>] [--auto-create-tasks]
|
||||
argument-hint: [optional: complexity type and auto-create]
|
||||
examples:
|
||||
- /workflow:implement
|
||||
- /workflow:implement --type=simple
|
||||
- /workflow:implement --type=complex --auto-create-tasks
|
||||
---
|
||||
|
||||
# Workflow Implement Command (/workflow:implement)
|
||||
|
||||
## Overview
|
||||
Executes implementation phase with three complexity modes (simple/medium/complex), replacing separate complexity commands.
|
||||
|
||||
## Core Principles
|
||||
|
||||
**Session Management:** @~/.claude/workflows/session-management-principles.md
|
||||
|
||||
## Complexity Modes
|
||||
|
||||
### Simple Mode (Single file, bug fixes)
|
||||
```bash
|
||||
/workflow:implement --type=simple
|
||||
```
|
||||
**Agent Flow:** code-developer → code-review-agent
|
||||
**TodoWrite:** 3-4 items
|
||||
**Documents:** TODO_LIST.md + IMPLEMENTATION_LOG.md (auto-generated)
|
||||
- Streamlined planning, direct implementation
|
||||
- Quick review cycle
|
||||
- < 2 hours effort
|
||||
|
||||
### Medium Mode (Multi-file features)
|
||||
```bash
|
||||
/workflow:implement --type=medium
|
||||
```
|
||||
**Agent Flow:** planning-agent → code-developer → code-review-agent
|
||||
**TodoWrite:** 5-7 items
|
||||
**Documents:** IMPL_PLAN.md + TODO_LIST.md (auto-triggered)
|
||||
- Structured planning with hierarchical JSON task decomposition
|
||||
- Test-driven development
|
||||
- Comprehensive review
|
||||
- 2-8 hours effort
|
||||
|
||||
### Complex Mode (System-level changes)
|
||||
```bash
|
||||
/workflow:implement --type=complex
|
||||
```
|
||||
**Agent Flow:** planning-agent → code-developer → code-review-agent → iterate
|
||||
**TodoWrite:** 7-10 items
|
||||
**Documents:** IMPL_PLAN.md + TODO_LIST.md (mandatory)
|
||||
- Detailed planning with mandatory 3-level JSON task hierarchy
|
||||
- Risk assessment and quality gates
|
||||
- Multi-faceted review with multiple iterations
|
||||
- > 8 hours effort
|
||||
|
||||
## Execution Flow
|
||||
|
||||
1. **Detect Complexity** (if not specified)
|
||||
- Read from workflow-session.json
|
||||
- Auto-detect from task description
|
||||
- Default to medium if unclear
|
||||
|
||||
2. **Initialize Based on Complexity**
|
||||
|
||||
**Simple:**
|
||||
- Use existing IMPL_PLAN.md (minimal updates)
|
||||
- Direct JSON task creation (impl-*.json)
|
||||
- Minimal state tracking
|
||||
|
||||
**Medium:**
|
||||
- Update IMPL_PLAN.md with implementation strategy
|
||||
- Auto-trigger TODO_LIST.md creation
|
||||
- Create hierarchical JSON tasks (impl-*.*.json up to 2 levels)
|
||||
- Standard agent flow
|
||||
|
||||
**Complex:**
|
||||
- Comprehensive IMPL_PLAN.md with risk assessment
|
||||
- Mandatory TODO_LIST.md with progress tracking
|
||||
- Full 3-level JSON task hierarchy (impl-*.*.*.json)
|
||||
- Full iteration support with cross-document synchronization
|
||||
|
||||
3. **Update Session**
|
||||
```json
|
||||
{
|
||||
"current_phase": "IMPLEMENT",
|
||||
"type": "simple|medium|complex",
|
||||
"phases": {
|
||||
"IMPLEMENT": {
|
||||
"status": "active",
|
||||
"complexity": "simple|medium|complex",
|
||||
"agent_flow": [...],
|
||||
"todos": [...],
|
||||
"tasks": ["impl-1", "impl-2", "impl-3"],
|
||||
"progress": 0,
|
||||
"documents_generated": ["TODO_LIST.md", "IMPLEMENTATION_LOG.md"],
|
||||
"documents_updated": ["IMPL_PLAN.md"]
|
||||
}
|
||||
},
|
||||
"documents": {
|
||||
"IMPL_PLAN.md": {
|
||||
"status": "updated",
|
||||
"path": ".workflow/WFS-[topic-slug]/IMPL_PLAN.md",
|
||||
"last_updated": "2025-09-05T10:30:00Z"
|
||||
},
|
||||
"TODO_LIST.md": {
|
||||
"status": "generated",
|
||||
"path": ".workflow/WFS-[topic-slug]/TODO_LIST.md",
|
||||
"last_updated": "2025-09-05T11:20:00Z",
|
||||
"type": "task_tracking"
|
||||
},
|
||||
"IMPLEMENTATION_LOG.md": {
|
||||
"status": "generated",
|
||||
"path": ".workflow/WFS-[topic-slug]/IMPLEMENTATION_LOG.md",
|
||||
"last_updated": "2025-09-05T11:20:00Z",
|
||||
"type": "execution_log",
|
||||
"auto_update": true
|
||||
}
|
||||
},
|
||||
"task_system": {
|
||||
"max_depth": 3,
|
||||
"task_count": {
|
||||
"main_tasks": 3,
|
||||
"total_tasks": 8
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
4. **Execute Agent Flow**
|
||||
- Create TodoWrite entries
|
||||
- Execute agents based on complexity
|
||||
- Track checkpoints
|
||||
- Support pause/resume
|
||||
|
||||
## Document Generation Rules
|
||||
|
||||
### Decomposition Triggers (Medium Workflows)
|
||||
Task decomposition documents generated when ANY condition met:
|
||||
- Task involves >3 modules/components
|
||||
- >5 distinct subtasks identified
|
||||
- Complex interdependencies detected
|
||||
- Estimated effort >4 hours
|
||||
- Cross-team coordination required
|
||||
|
||||
### Mandatory Generation (Complex Workflows)
|
||||
Always generates complete document suite:
|
||||
- **Enhanced IMPL_PLAN.md structure** - Hierarchical task breakdown integrated into main plan
|
||||
- **TODO_LIST.md** - Progress tracking with cross-links
|
||||
- Links to existing IMPL_PLAN.md from planning phase
|
||||
|
||||
### Document-JSON Synchronization
|
||||
- **Document Creation** → Update workflow session with document references
|
||||
- **Task Status Changes** → Update TODO_LIST.md progress
|
||||
- **Task Completion** → Mark items complete in checklist
|
||||
- **New Tasks Added** → Add to both JSON and enhanced implementation plan
|
||||
|
||||
### Document Storage Structure
|
||||
```
|
||||
.workflow/WFS-[topic-slug]/
|
||||
├── IMPL_PLAN.md # From planning phase (all complexities)
|
||||
├── (enhanced IMPL_PLAN.md) # Enhanced structure in implement phase (medium+/complex)
|
||||
├── TODO_LIST.md # Generated in implement phase (ALL complexities)
|
||||
├── IMPLEMENTATION_LOG.md # Execution progress log (ALL complexities)
|
||||
├── workflow-session.json # Updated with document references
|
||||
└── artifacts/
|
||||
├── logs/
|
||||
├── backups/ # Task state backups
|
||||
└── implementation/ # Implementation artifacts
|
||||
```
|
||||
|
||||
## File Generation Details
|
||||
|
||||
### TODO_LIST.md Generation (All Complexities)
|
||||
**Always Generated**: Now created for Simple, Medium, and Complex workflows
|
||||
|
||||
**Simple Workflow Structure:**
|
||||
```markdown
|
||||
# Implementation Task List
|
||||
*Session: WFS-[topic-slug]*
|
||||
|
||||
## Quick Implementation Tasks
|
||||
- [ ] **IMPL-001**: Core implementation
|
||||
- [ ] **IMPL-002**: Basic testing
|
||||
- [ ] **IMPL-003**: Review and cleanup
|
||||
|
||||
## Progress Tracking
|
||||
- **Total Tasks**: 3
|
||||
- **Completed**: 0/3 (0%)
|
||||
- **Estimated Time**: < 2 hours
|
||||
|
||||
---
|
||||
*Generated by /workflow:implement --type=simple*
|
||||
```
|
||||
|
||||
**Medium/Complex Workflow Structure:**
|
||||
```markdown
|
||||
# Implementation Task List
|
||||
*Session: WFS-[topic-slug]*
|
||||
|
||||
## Main Implementation Tasks
|
||||
|
||||
### Phase 1: Foundation
|
||||
- [ ] **IMPL-001**: Set up base infrastructure
|
||||
- Dependencies: None
|
||||
- Effort: 2h
|
||||
- Agent: code-developer
|
||||
|
||||
### Phase 2: Core Features
|
||||
- [ ] **IMPL-002**: Implement main functionality
|
||||
- Dependencies: IMPL-001
|
||||
- Effort: 4h
|
||||
- Agent: code-developer
|
||||
|
||||
### Phase 3: Testing & Review
|
||||
- [ ] **IMPL-003**: Comprehensive testing
|
||||
- Dependencies: IMPL-002
|
||||
- Effort: 2h
|
||||
- Agent: code-review-agent
|
||||
|
||||
## Progress Summary
|
||||
- **Total Tasks**: 8
|
||||
- **Completed**: 0/8 (0%)
|
||||
- **Current Phase**: Foundation
|
||||
- **Estimated Completion**: 2025-09-07 18:00
|
||||
|
||||
---
|
||||
*Generated by /workflow:implement --type=medium*
|
||||
```
|
||||
|
||||
### IMPLEMENTATION_LOG.md Generation (All Complexities)
|
||||
**Always Generated**: Real-time execution progress tracking
|
||||
|
||||
```markdown
|
||||
# Implementation Execution Log
|
||||
*Session: WFS-[topic-slug] | Started: 2025-09-07 14:00:00*
|
||||
|
||||
## Execution Summary
|
||||
- **Workflow Type**: Medium
|
||||
- **Total Tasks**: 8
|
||||
- **Current Status**: In Progress
|
||||
- **Progress**: 3/8 (37.5%)
|
||||
|
||||
## Execution Timeline
|
||||
|
||||
### 2025-09-07 14:00:00 - Implementation Started
|
||||
- **Phase**: IMPLEMENT
|
||||
- **Agent**: code-developer
|
||||
- **Status**: Task execution initialized
|
||||
|
||||
### 2025-09-07 14:15:00 - IMPL-001 Started
|
||||
- **Task**: Set up base infrastructure
|
||||
- **Agent**: code-developer
|
||||
- **Approach**: Standard project structure setup
|
||||
|
||||
### 2025-09-07 14:45:00 - IMPL-001 Completed
|
||||
- **Duration**: 30 minutes
|
||||
- **Status**: ✅ Successful
|
||||
- **Output**: Base project structure created
|
||||
- **Next**: IMPL-002
|
||||
|
||||
### 2025-09-07 15:00:00 - IMPL-002 Started
|
||||
- **Task**: Implement main functionality
|
||||
- **Agent**: code-developer
|
||||
- **Dependencies**: IMPL-001 ✅
|
||||
|
||||
## Current Task Progress
|
||||
- **Active Task**: IMPL-002
|
||||
- **Progress**: 60%
|
||||
- **Estimated Completion**: 15:30
|
||||
- **Agent**: code-developer
|
||||
|
||||
## Issues & Resolutions
|
||||
- No issues reported
|
||||
|
||||
## Next Actions
|
||||
1. Complete IMPL-002 implementation
|
||||
2. Begin IMPL-003 testing phase
|
||||
3. Schedule review checkpoint
|
||||
|
||||
---
|
||||
*Log updated: 2025-09-07 15:15:00*
|
||||
```
|
||||
|
||||
## Individual Task Files Structure
|
||||
```json
|
||||
{
|
||||
"id": "IMPL-001",
|
||||
"title": "Build authentication module",
|
||||
"status": "pending",
|
||||
"type": "feature",
|
||||
"agent": "code-developer",
|
||||
"effort": "4h",
|
||||
"context": {
|
||||
"inherited_from": "WFS-2025-001",
|
||||
"requirements": ["JWT authentication"],
|
||||
"scope": ["src/auth/*"],
|
||||
"acceptance": ["Module handles JWT tokens"]
|
||||
},
|
||||
"dependencies": {
|
||||
"upstream": [],
|
||||
"downstream": ["IMPL-002"]
|
||||
},
|
||||
"subtasks": [],
|
||||
"execution": {
|
||||
"attempts": 0,
|
||||
"current_attempt": null,
|
||||
"history": []
|
||||
},
|
||||
"metadata": {
|
||||
"created_at": "2025-09-05T10:30:00Z",
|
||||
"version": "1.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Integration Points
|
||||
|
||||
### Automatic Behaviors
|
||||
- Creates individual task JSON files (.task/tasks/IMPL-XXX.json) as needed
|
||||
- Generates decomposition documents based on complexity triggers
|
||||
- Links documents to workflow-session.json with paths and status
|
||||
- Enables task commands (/task:*) with document integration
|
||||
- Initializes tasks in 'pending' state within their JSON files
|
||||
- Synchronizes task creation between documents and JSON states
|
||||
|
||||
### Next Actions
|
||||
```bash
|
||||
# After /workflow:implement
|
||||
/task:create "First task" # Create tasks
|
||||
/task:status # View task list
|
||||
/task:execute IMPL-001 # Execute tasks
|
||||
```
|
||||
|
||||
## Sync Mechanism
|
||||
- Every task operation updates workflow-session.json
|
||||
- Progress calculated from task completion
|
||||
- Issues automatically linked
|
||||
|
||||
## Related Commands
|
||||
- `/workflow:plan` - Should complete first
|
||||
- `/task:create` - Create implementation tasks
|
||||
- `/task:status` - Monitor progress
|
||||
- `/workflow:review` - Next phase after implementation
|
||||
267
.claude/commands/workflow/vibe.md
Normal file
267
.claude/commands/workflow/vibe.md
Normal file
@@ -0,0 +1,267 @@
|
||||
---
|
||||
name: workflow-vibe
|
||||
description: Coordinate agents for existing workflow tasks with automatic discovery
|
||||
usage: /workflow:vibe [workflow-folder]
|
||||
argument-hint: [optional: workflow folder path]
|
||||
examples:
|
||||
- /workflow:vibe
|
||||
- /workflow:vibe .workflow/WFS-user-auth
|
||||
---
|
||||
|
||||
# Workflow Vibe Command (/workflow:vibe)
|
||||
|
||||
## Overview
|
||||
Coordinates multiple agents for executing existing workflow tasks through automatic discovery and intelligent task orchestration. Analyzes workflow folders, checks task statuses, and coordinates agent execution based on discovered plans.
|
||||
|
||||
## Core Principles
|
||||
|
||||
**Session Management:** @~/.claude/workflows/session-management-principles.md
|
||||
**Agent Orchestration:** @~/.claude/workflows/agent-orchestration-patterns.md
|
||||
|
||||
## Vibe Philosophy
|
||||
|
||||
The "vibe" approach focuses on:
|
||||
- **Discovery-first execution** - Automatically discover existing plans and tasks
|
||||
- **Status-aware coordination** - Execute only tasks that are ready
|
||||
- **Context-rich agent assignment** - Use complete task JSON data for agent context
|
||||
- **Dynamic task orchestration** - Coordinate based on discovered task relationships
|
||||
- **Progress tracking** - Update task status after agent completion
|
||||
|
||||
**IMPORTANT**: Gemini context analysis is automatically applied based on discovered task scope and requirements.
|
||||
|
||||
## Execution Flow
|
||||
|
||||
### 1. Discovery & Analysis Phase
|
||||
```
|
||||
Workflow Discovery:
|
||||
├── Locate workflow folder (provided or current session)
|
||||
├── Load workflow-session.json for session state
|
||||
├── Scan .task/ directory for all task JSON files
|
||||
├── Read IMPL_PLAN.md for workflow context
|
||||
├── Analyze task statuses and dependencies
|
||||
└── Determine executable tasks
|
||||
```
|
||||
|
||||
**Discovery Logic:**
|
||||
- **Folder Detection**: Use provided folder or find current active session
|
||||
- **Task Inventory**: Load all impl-*.json files from .task/ directory
|
||||
- **Status Analysis**: Check pending/active/completed/blocked states
|
||||
- **Dependency Check**: Verify all task dependencies are met
|
||||
- **Execution Queue**: Build list of ready-to-execute tasks
|
||||
|
||||
### 2. TodoWrite Coordination Setup
|
||||
**Always First**: Create comprehensive TodoWrite based on discovered tasks
|
||||
|
||||
```markdown
|
||||
# Workflow Vibe Coordination
|
||||
*Session: WFS-[topic-slug]*
|
||||
|
||||
## Execution Plan
|
||||
- [ ] **TASK-001**: [Agent: planning-agent] [GEMINI_CLI_REQUIRED] Design auth schema (impl-1.1)
|
||||
- [ ] **TASK-002**: [Agent: code-developer] [GEMINI_CLI_REQUIRED] Implement auth logic (impl-1.2)
|
||||
- [ ] **TASK-003**: [Agent: code-review-agent] Review implementations
|
||||
- [ ] **TASK-004**: Update task statuses and session state
|
||||
```
|
||||
|
||||
### 3. Agent Context Assignment
|
||||
For each executable task:
|
||||
|
||||
```json
|
||||
{
|
||||
"task": {
|
||||
"id": "impl-1.1",
|
||||
"title": "Design auth schema",
|
||||
"context": {
|
||||
"requirements": ["JWT authentication", "User model design"],
|
||||
"scope": ["src/auth/models/*"],
|
||||
"acceptance": ["Schema validates JWT tokens"]
|
||||
}
|
||||
},
|
||||
"workflow": {
|
||||
"session": "WFS-user-auth",
|
||||
"phase": "IMPLEMENT",
|
||||
"plan_context": "Authentication system with OAuth2 support"
|
||||
},
|
||||
"focus_modules": ["src/auth/", "tests/auth/"],
|
||||
"gemini_required": true
|
||||
}
|
||||
```
|
||||
|
||||
**Context Assignment Rules:**
|
||||
- **Complete Context**: Use full task JSON context for agent execution
|
||||
- **Workflow Integration**: Include session state and IMPL_PLAN.md context
|
||||
- **Scope Focus**: Direct agents to specific files from task.context.scope
|
||||
- **Gemini Flags**: Automatically add [GEMINI_CLI_REQUIRED] for multi-file tasks
|
||||
|
||||
### 4. Agent Execution & Progress Tracking
|
||||
|
||||
```bash
|
||||
Task(subagent_type="code-developer",
|
||||
prompt="[GEMINI_CLI_REQUIRED] Implement authentication logic based on schema",
|
||||
description="Execute impl-1.2 with full workflow context and status tracking")
|
||||
```
|
||||
|
||||
**Execution Protocol:**
|
||||
- **Sequential Execution**: Respect task dependencies and execution order
|
||||
- **Progress Monitoring**: Track through TodoWrite updates
|
||||
- **Status Updates**: Update task JSON status after each completion
|
||||
- **Cross-Agent Handoffs**: Coordinate results between related tasks
|
||||
|
||||
## Discovery & Analysis Process
|
||||
|
||||
### File Structure Analysis
|
||||
```
|
||||
.workflow/WFS-[topic-slug]/
|
||||
├── workflow-session.json # Session state and stats
|
||||
├── IMPL_PLAN.md # Workflow context and requirements
|
||||
├── .task/ # Task definitions
|
||||
│ ├── impl-1.json # Main tasks
|
||||
│ ├── impl-1.1.json # Subtasks
|
||||
│ └── impl-1.2.json # Detailed tasks
|
||||
└── .summaries/ # Completed task summaries
|
||||
```
|
||||
|
||||
### Task Status Assessment
|
||||
```pseudo
|
||||
function analyze_tasks(task_files):
|
||||
executable_tasks = []
|
||||
|
||||
for task in task_files:
|
||||
if task.status == "pending" and dependencies_met(task):
|
||||
if task.subtasks.length == 0: // leaf task
|
||||
executable_tasks.append(task)
|
||||
else: // container task - check subtasks
|
||||
if all_subtasks_ready(task):
|
||||
executable_tasks.extend(task.subtasks)
|
||||
|
||||
return executable_tasks
|
||||
```
|
||||
|
||||
### Automatic Agent Assignment
|
||||
Based on discovered task data:
|
||||
- **task.agent field**: Use specified agent from task JSON
|
||||
- **task.type analysis**:
|
||||
- "feature" → code-developer
|
||||
- "test" → test-agent
|
||||
- "docs" → docs-agent
|
||||
- "review" → code-review-agent
|
||||
- **Gemini context**: Auto-assign based on task.context.scope and requirements
|
||||
|
||||
## Agent Task Assignment Patterns
|
||||
|
||||
### Discovery-Based Assignment
|
||||
```bash
|
||||
# Agent receives complete discovered context
|
||||
Task(subagent_type="code-developer",
|
||||
prompt="[GEMINI_CLI_REQUIRED] Execute impl-1.2: Implement auth logic
|
||||
|
||||
Context from discovery:
|
||||
- Requirements: JWT authentication, OAuth2 support
|
||||
- Scope: src/auth/*, tests/auth/*
|
||||
- Dependencies: impl-1.1 (completed)
|
||||
- Workflow: WFS-user-auth authentication system",
|
||||
|
||||
description="Agent executes with full discovered context")
|
||||
```
|
||||
|
||||
### Status Tracking Integration
|
||||
```bash
|
||||
# After agent completion, update discovered task status
|
||||
update_task_status("impl-1.2", "completed")
|
||||
mark_dependent_tasks_ready(task_dependencies)
|
||||
```
|
||||
|
||||
## Coordination Strategies
|
||||
|
||||
### Automatic Coordination
|
||||
- **Task Dependencies**: Execute in dependency order from discovered relationships
|
||||
- **Agent Handoffs**: Pass results between agents based on task hierarchy
|
||||
- **Progress Updates**: Update TodoWrite and JSON files after each completion
|
||||
|
||||
### Context Distribution
|
||||
- **Rich Context**: Each agent gets complete task JSON + workflow context
|
||||
- **Focus Areas**: Direct agents to specific files from task.context.scope
|
||||
- **Inheritance**: Subtasks inherit parent context automatically
|
||||
- **Session Integration**: Include workflow-session.json state in agent context
|
||||
|
||||
## Status Management
|
||||
|
||||
### Task Status Updates
|
||||
```json
|
||||
// Before execution
|
||||
{
|
||||
"id": "impl-1.2",
|
||||
"status": "pending",
|
||||
"execution": {
|
||||
"attempts": 0,
|
||||
"last_attempt": null
|
||||
}
|
||||
}
|
||||
|
||||
// After execution
|
||||
{
|
||||
"id": "impl-1.2",
|
||||
"status": "completed",
|
||||
"execution": {
|
||||
"attempts": 1,
|
||||
"last_attempt": "2025-09-08T14:30:00Z"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Session State Updates
|
||||
```json
|
||||
{
|
||||
"current_phase": "VIBE",
|
||||
"last_vibe_execution": "2025-09-08T14:30:00Z"
|
||||
}
|
||||
```
|
||||
|
||||
## Error Handling & Recovery
|
||||
|
||||
### Discovery Issues
|
||||
```bash
|
||||
# No workflow found
|
||||
❌ No workflow folder found
|
||||
→ Use: /workflow init "project name" first
|
||||
|
||||
# No executable tasks
|
||||
⚠️ All tasks completed or blocked
|
||||
→ Check: /context for task status overview
|
||||
|
||||
# Missing task files
|
||||
❌ Task impl-1.2 referenced but JSON file missing
|
||||
→ Fix: Recreate task or repair references
|
||||
```
|
||||
|
||||
### Execution Recovery
|
||||
- **Failed Agent**: Retry with adjusted context or different agent
|
||||
- **Blocked Dependencies**: Skip and continue with available tasks
|
||||
- **Context Issues**: Reload from JSON files and session state
|
||||
|
||||
## Integration Points
|
||||
|
||||
### Automatic Behaviors
|
||||
- **Discovery on start** - Analyze workflow folder structure
|
||||
- **TodoWrite coordination** - Generate based on discovered tasks
|
||||
- **Agent context preparation** - Use complete task JSON data
|
||||
- **Status synchronization** - Update JSON files after completion
|
||||
|
||||
### Next Actions
|
||||
```bash
|
||||
# After /workflow:vibe execution
|
||||
/context # View updated task status
|
||||
/task:execute impl-X # Execute specific remaining tasks
|
||||
/workflow:review # Move to review phase when complete
|
||||
```
|
||||
|
||||
## Related Commands
|
||||
|
||||
- `/context` - View discovered tasks and current status
|
||||
- `/task:execute` - Execute individual tasks (user-controlled)
|
||||
- `/task:status` - Check task progress and dependencies
|
||||
- `/workflow:review` - Move to review phase after completion
|
||||
|
||||
---
|
||||
|
||||
**System ensures**: Intelligent task discovery with context-rich agent coordination and automatic progress tracking
|
||||
Reference in New Issue
Block a user