- Implemented task-generate-agent for autonomous task generation using action-planning-agent with discovery and output phases. - Introduced task-generate command to generate task JSON files and IMPL_PLAN.md from analysis results with automatic artifact detection and integration. - Enhanced documentation for both commands, detailing execution lifecycle, phases, and output structures. - Established clear integration points and error handling for improved user experience.
14 KiB
name, description, usage, argument-hint, examples
| name | description | usage | argument-hint | examples | ||||
|---|---|---|---|---|---|---|---|---|
| plan | Create implementation plans by orchestrating intelligent context gathering and analysis modules | /workflow:plan [--agent] <input> | [--agent] "text description"|file.md|ISS-001 |
|
Workflow Plan Command (/workflow:plan)
Overview
Creates comprehensive implementation plans by orchestrating intelligent context gathering and analysis modules. Integrates with workflow session management, brainstorming artifacts, and automated task generation.
Execution Modes:
- Manual Mode (default): Command-driven task generation with phase-by-phase control
- Agent Mode (
--agent): Autonomous agent-driven task generation using action-planning-agent
Core Planning Principles
⚡ Autonomous Execution Mandate: Complete all planning phases sequentially without user interruption—from session initialization through task generation—ensuring full workflow integrity.
Task Decomposition Standards
Core Principle: Task Merging Over Decomposition
- Merge Rule: Tasks that can be executed together should not be separated - avoid unnecessary decomposition
- Decomposition Criteria: Only decompose tasks in the following situations:
- Excessive Workload: Code exceeds 2500 lines or modifies more than 6 files
- Context Separation: Involves completely different tech stacks or business domains
- Dependency Blocking: Subsequent tasks must wait for prerequisite task completion
- Parallel Execution: Independent features that can be developed simultaneously by different developers
Task Limits & Structure:
- Maximum 10 tasks: Hard limit - exceeding requires re-scoping
- Function-based: Complete functional units with related files (logic + UI + tests + config)
- File cohesion: Group tightly coupled components in same task
- Hierarchy: Flat (≤5 tasks) | Two-level (6-10 tasks) | Re-scope (>10 tasks)
Task Pattern Examples:
- ✅ Correct (Function-based):
IMPL-001: User authentication system(models + routes + components + middleware + tests) - ❌ Wrong (File/step-based):
IMPL-001: Create database model,IMPL-002: Create API endpoint
Task JSON Creation Process
Task JSON Generation Philosophy:
- Analysis-Driven: Task definitions generated from intelligent analysis results
- Context-Rich: Each task includes comprehensive context for autonomous execution
- Flow-Control Ready: Pre-analysis steps and implementation approach pre-defined
- Agent-Optimized: Complete context provided for specialized agent execution
- Artifacts-Integrated: Automatically detect and reference brainstorming artifacts
- Design-Context-Aware: Ensure design documents are loaded in pre_analysis steps
Automatic Task Generation Workflow:
- Parse Analysis Results: Extract task recommendations from ANALYSIS_RESULTS.md
- Extract Task Details: Parse task ID, title, scope, complexity from structured analysis
- Detect Brainstorming Artifacts: Scan for ui-designer, system-architect, and other role outputs
- Generate Context: Create requirements, focus_paths, acceptance criteria, and artifacts references
- Build Enhanced Flow Control: Define pre_analysis steps with artifact loading and implementation approach
- Create Artifact-Aware JSON Files: Generate individual .task/IMPL-*.json files with enhanced schema
Critical Process Requirements
Session Management ⚠️ CRITICAL FIRST STEP
- ⚡ FIRST ACTION: Execute
SlashCommand(command="/workflow:session:start --auto \"[task-description]\"")for intelligent session discovery - Command Integration: Uses
/workflow:session:start --autofor automated session discovery and creation - Auto Mode Behavior: Automatically analyzes relevance and selects/creates appropriate session
- Relevance Analysis: Keyword-based matching between task description and existing session projects
- Auto-session creation:
WFS-[topic-slug]only if no active session exists or task is unrelated - Session continuity: MUST use selected active session to maintain context
- ⚠️ Dependency context: MUST read ALL previous task summary documents from selected session before planning
- Session isolation: Each session maintains independent context and state
- Output Parsing: Extract session ID from output line matching pattern
SESSION_ID: WFS-[id]
Session ID Transmission Guidelines ⚠️ CRITICAL
- Format:
WFS-[topic-slug]from active session markers - Usage:
SlashCommand(command="/workflow:tools:context-gather --session WFS-[id]")andSlashCommand(command="/workflow:tools:concept-enhanced --session WFS-[id]") - Rule: ALL modular commands MUST receive current session ID for context continuity
Brainstorming Artifacts Integration ⚠️ NEW FEATURE
- Artifact Detection: Automatically scan .brainstorming/ directory for role outputs
- Role-Task Mapping: Map brainstorming roles to task types (ui-designer → UI tasks)
- Artifact References: Create structured references to design documents and specifications
- Context Enhancement: Load artifacts in pre_analysis steps to provide complete design context
Planning Execution Lifecycle
Phase 1: Session Management & Discovery ⚠️ TodoWrite Control
- TodoWrite Initialization: Initialize flow control, mark first phase as
in_progress - Session Discovery: Execute
SlashCommand(command="/workflow:session:start --auto \"[task-description]\"") - Parse Session ID: Extract session ID from command output matching pattern
SESSION_ID: WFS-[id] - Validate Session: Verify session directory structure and metadata exist
- Context Preparation: Load session state and prepare for planning
- TodoWrite Update: Mark phase 1 as
completed, phase 2 asin_progress
Note: The --auto flag enables automatic relevance analysis and session selection/creation without user interaction.
Phase 2: Context Gathering & Asset Discovery ⚠️ TodoWrite Control
- Context Collection: Execute
SlashCommand(command="/workflow:tools:context-gather --session WFS-[id] \"task description\"") - Asset Discovery: Gather relevant documentation, code, and configuration files
- Context Packaging: Generate standardized context-package.json
- Validation: Ensure context package contains sufficient information for analysis
- TodoWrite Update: Mark phase 2 as
completed, phase 3 asin_progress
Phase 3: Intelligent Analysis & Tool Orchestration ⚠️ TodoWrite Control
- Analysis Execution: Execute
SlashCommand(command="/workflow:tools:concept-enhanced --session WFS-[id] --context path/to/context-package.json")(delegated to independent concept-enhanced command) - Context Passing: Pass session ID and context package path from Phase 2 to enable comprehensive analysis
- Result Generation: Produce structured ANALYSIS_RESULTS.md with task recommendations via concept-enhanced command
- Validation: Verify analysis completeness and task recommendations from concept-enhanced output
- TodoWrite Update: Mark phase 3 as
completed, phase 4 asin_progress
Phase 4: Plan Assembly & Artifact Integration ⚠️ TodoWrite Control
Delegated to:
- Manual Mode:
/workflow:tools:task-generate --session WFS-[id] - Agent Mode:
/workflow:tools:task-generate-agent --session WFS-[id]
Execute task generation command to:
- Artifact Detection: Scan session for brainstorming outputs (.brainstorming/ directory)
- Plan Generation: Create IMPL_PLAN.md from analysis results and artifacts
- Enhanced Task JSON Creation: Generate task JSON files with artifacts integration (5-field schema)
- TODO List Creation: Generate TODO_LIST.md with artifact references
- Session Update: Mark session as ready for execution with artifact context
- TodoWrite Completion Validation: Ensure all phases are marked as
completedfor complete execution
Command Execution:
# Manual Mode (default)
SlashCommand(command="/workflow:tools:task-generate --session WFS-[id]")
# Agent Mode (if --agent flag provided)
SlashCommand(command="/workflow:tools:task-generate-agent --session WFS-[id]")
Reference Documentation:
- Manual:
@.claude/commands/workflow/tools/task-generate.md - Agent:
@.claude/commands/workflow/tools/task-generate-agent.md
TodoWrite Progress Tracking ⚠️ CRITICAL FLOW CONTROL
TodoWrite Control Ensures Complete Workflow Execution - Guarantees planning lifecycle integrity through real-time status tracking:
TodoWrite Flow Control Rules ⚠️ MANDATORY
- Process Integrity Guarantee: TodoWrite is the key control mechanism ensuring all planning phases execute in sequence
- Phase Gating: Must wait for previous phase
completedbefore starting next phase - SlashCommand Synchronization: Update TodoWrite status before and after each SlashCommand execution
- Error Recovery: If phase fails, TodoWrite maintains
in_progressstatus until issue resolved - Process Validation: Verify all required phases completed through TodoWrite
TodoWrite Execution Control Rules
- Initial Creation: Generate TodoWrite task list from planning phases
- Single Execution: Only one task can be
in_progressat any time - Immediate Updates: Update status to
completedimmediately after each phase completion - Continuous Tracking: Maintain TodoWrite state throughout entire planning workflow
- Integrity Validation: Final verification that all tasks are
completedstatus
TodoWrite Tool Usage
Core Control Rule: Monitor SlashCommand completion status to ensure sequential execution
// Flow Control Example: Ensure Complete Execution of All Planning Phases
// Step 1: Initialize Flow Control
TodoWrite({
todos: [
{"content": "Initialize session management and discovery", "status": "in_progress", "activeForm": "Initializing session management and discovery"},
{"content": "Detect and analyze brainstorming artifacts", "status": "pending", "activeForm": "Detecting and analyzing brainstorming artifacts"},
{"content": "Gather intelligent context and assets", "status": "pending", "activeForm": "Gathering intelligent context and assets"},
{"content": "Execute intelligent analysis and tool orchestration", "status": "pending", "activeForm": "Executing intelligent analysis and tool orchestration"},
{"content": "Generate artifact-enhanced implementation plan and tasks", "status": "pending", "activeForm": "Generating artifact-enhanced implementation plan and tasks"}
]
})
// Step 2: Execute SlashCommand and Update Status Immediately
SlashCommand(command="/workflow:session:start --auto \"task-description\"")
// After command completion:
TodoWrite({
todos: [
{"content": "Initialize session management and discovery", "status": "completed", "activeForm": "Initializing session management and discovery"},
{"content": "Detect and analyze brainstorming artifacts", "status": "in_progress", "activeForm": "Detecting and analyzing brainstorming artifacts"},
{"content": "Gather intelligent context and assets", "status": "pending", "activeForm": "Gathering intelligent context and assets"},
{"content": "Execute intelligent analysis and tool orchestration", "status": "pending", "activeForm": "Executing intelligent analysis and tool orchestration"},
{"content": "Generate artifact-enhanced implementation plan and tasks", "status": "pending", "activeForm": "Generating artifact-enhanced implementation plan and tasks"}
]
})
// Step 3: Continue Next SlashCommand
SlashCommand(command="/workflow:tools:context-gather --session WFS-[id] \"task description\"")
// Repeat this pattern until all phases completed
Flow Control Validation Checkpoints
- ✅ Phase Completion Verification: Check return status after each SlashCommand execution
- ✅ Dependency Checking: Ensure prerequisite phases completed before starting next phase
- ✅ Error Handling: If command fails, remain in current phase until issue resolved
- ✅ Final Validation: All todos status must be
completedfor planning completion
Output Documents
Generated Files
Documents Created by Phase 4 (/workflow:tools:task-generate):
- IMPL_PLAN.md: Implementation plan with context analysis and artifact references
- .task/*.json: Task definitions using 5-field schema with flow_control and artifacts
- TODO_LIST.md: Progress tracking (container tasks with ▸, leaf tasks with checkboxes)
Key Schemas:
- Task JSON: 5-field schema (id, title, status, meta, context, flow_control) with artifacts integration
- Artifacts: synthesis-specification.md (highest), topic-framework.md (medium), role analyses (low)
- Flow Control: Pre-analysis steps for artifact loading, MCP tools, and pattern analysis
Architecture Reference: @~/.claude/workflows/workflow-architecture.md
Command Chain Integration
/workflow:plan [--agent]→ Orchestrates planning phases and delegates to modular commands/workflow:tools:context-gather→ Collects project context (Phase 2)/workflow:tools:concept-enhanced→ Analyzes and generates recommendations (Phase 3)/workflow:tools:task-generateor/workflow:tools:task-generate-agent→ Creates tasks and documents (Phase 4)
Next Steps (manual execution):
- Run
/workflow:executeto begin task execution - Run
/workflow:statusto check planning results and task status