|
| 1 | +--- |
| 2 | +name: workflow-lite-plan |
| 3 | +description: Unified lightweight planning skill with mode selection (Lite Plan, Multi-CLI Plan, Lite Fix). Supports exploration, diagnosis, multi-CLI collaboration, and shared execution via lite-execute. |
| 4 | +allowed-tools: Task, AskUserQuestion, TodoWrite, Read, Write, Edit, Bash, Glob, Grep, Skill, mcp__ace-tool__search_context |
| 5 | +--- |
| 6 | + |
| 7 | +# Planning Workflow |
| 8 | + |
| 9 | +Unified lightweight planning skill that consolidates multiple planning approaches into a single entry point with mode selection. Default mode: **Lite Plan**. All planning modes share a common execution phase (lite-execute). |
| 10 | + |
| 11 | +## Architecture Overview |
| 12 | + |
| 13 | +``` |
| 14 | +┌──────────────────────────────────────────────────────────┐ |
| 15 | +│ Planning Workflow Orchestrator (SKILL.md) │ |
| 16 | +│ → Parse args → Mode selection → Load phase → Execute │ |
| 17 | +└────────────┬─────────────────────────────────────────────┘ |
| 18 | + │ Mode Selection (default: Lite Plan) |
| 19 | + ┌────────┼────────┬──────────┐ |
| 20 | + ↓ ↓ ↓ ↓ (shared) |
| 21 | +┌────────┐ ┌────────┐ ┌────────┐ ┌────────────┐ |
| 22 | +│Phase 1 │ │Phase 2 │ │Phase 3 │ │ Phase 4 │ |
| 23 | +│ Lite │ │Multi- │ │ Lite │ │ Lite │ |
| 24 | +│ Plan │ │CLI Plan│ │ Fix │ │ Execute │ |
| 25 | +└────────┘ └────────┘ └────────┘ └────────────┘ |
| 26 | + │ │ │ ↑ |
| 27 | + └──────────┴──────────┴───────────┘ |
| 28 | + (all hand off to Phase 4) |
| 29 | +``` |
| 30 | + |
| 31 | +## Key Design Principles |
| 32 | + |
| 33 | +1. **Mode Selection First**: User chooses planning approach before any work begins |
| 34 | +2. **Shared Execution**: All planning modes produce `executionContext` consumed by Phase 4 (lite-execute) |
| 35 | +3. **Progressive Phase Loading**: Only load the selected planning phase + execution phase |
| 36 | +4. **Auto-Continue**: Planning phase completes → automatically loads execution phase |
| 37 | +5. **Default Lite Plan**: When no mode specified, use Lite Plan (most common) |
| 38 | + |
| 39 | +## Auto Mode |
| 40 | + |
| 41 | +When `--yes` or `-y`: Skip mode selection (use default or flag-specified mode), auto-approve plan, skip clarifications. |
| 42 | + |
| 43 | +## Usage |
| 44 | + |
| 45 | +``` |
| 46 | +Skill(skill="workflow-lite-plan", args="<task description>") |
| 47 | +Skill(skill="workflow-lite-plan", args="[FLAGS] \"<task description>\"") |
| 48 | +
|
| 49 | +# Flags |
| 50 | +--mode lite-plan|multi-cli|lite-fix Planning mode selection (default: lite-plan) |
| 51 | +-y, --yes Skip all confirmations (auto mode) |
| 52 | +-e, --explore Force exploration (lite-plan only) |
| 53 | +--hotfix Fast hotfix mode (lite-fix only) |
| 54 | +
|
| 55 | +# Examples |
| 56 | +Skill(skill="workflow-lite-plan", args="\"Implement JWT authentication\"") # Default: lite-plan |
| 57 | +Skill(skill="workflow-lite-plan", args="--mode multi-cli \"Refactor payment module\"") # Multi-CLI planning |
| 58 | +Skill(skill="workflow-lite-plan", args="--mode lite-fix \"Login fails with 500 error\"") # Bug fix mode |
| 59 | +Skill(skill="workflow-lite-plan", args="-y \"Add user profile page\"") # Auto mode |
| 60 | +Skill(skill="workflow-lite-plan", args="--mode lite-fix --hotfix \"Production DB timeout\"") # Hotfix mode |
| 61 | +``` |
| 62 | + |
| 63 | +## Execution Flow |
| 64 | + |
| 65 | +``` |
| 66 | +Input Parsing: |
| 67 | + ├─ Extract flags: --mode, --yes, --explore, --hotfix |
| 68 | + └─ Extract task description (string or file path) |
| 69 | +
|
| 70 | +Mode Selection: |
| 71 | + └─ Decision: |
| 72 | + ├─ --mode lite-plan (or no --mode flag) → Read phases/01-lite-plan.md |
| 73 | + ├─ --mode multi-cli → Read phases/02-multi-cli-plan.md |
| 74 | + ├─ --mode lite-fix → Read phases/03-lite-fix.md |
| 75 | + └─ No flag + not --yes → AskUserQuestion (default: Lite Plan) |
| 76 | +
|
| 77 | +Planning Phase (one of): |
| 78 | + ├─ Phase 1: Lite Plan |
| 79 | + │ └─ Ref: phases/01-lite-plan.md |
| 80 | + │ └─ Output: executionContext (plan.json + explorations + selections) |
| 81 | + │ |
| 82 | + ├─ Phase 2: Multi-CLI Plan |
| 83 | + │ └─ Ref: phases/02-multi-cli-plan.md |
| 84 | + │ └─ Output: executionContext (plan.json + synthesis rounds + selections) |
| 85 | + │ |
| 86 | + └─ Phase 3: Lite Fix |
| 87 | + └─ Ref: phases/03-lite-fix.md |
| 88 | + └─ Output: executionContext (fix-plan.json + diagnoses + selections) |
| 89 | +
|
| 90 | +Execution Phase (always): |
| 91 | + └─ Phase 4: Lite Execute |
| 92 | + └─ Ref: phases/04-lite-execute.md |
| 93 | + └─ Input: executionContext from planning phase |
| 94 | + └─ Output: Executed tasks + optional code review |
| 95 | +``` |
| 96 | + |
| 97 | +**Phase Reference Documents** (read on-demand when phase executes): |
| 98 | + |
| 99 | +| Phase | Document | Purpose | |
| 100 | +|-------|----------|---------| |
| 101 | +| 1 | [phases/01-lite-plan.md](phases/01-lite-plan.md) | Lightweight planning with exploration, clarification, and plan generation | |
| 102 | +| 2 | [phases/02-multi-cli-plan.md](phases/02-multi-cli-plan.md) | Multi-CLI collaborative planning with ACE context and cross-verification | |
| 103 | +| 3 | [phases/03-lite-fix.md](phases/03-lite-fix.md) | Bug diagnosis and fix planning with severity-based workflow | |
| 104 | +| 4 | [phases/04-lite-execute.md](phases/04-lite-execute.md) | Shared execution engine: task grouping, batch execution, code review | |
| 105 | + |
| 106 | +## Mode Selection Logic |
| 107 | + |
| 108 | +```javascript |
| 109 | +// Flag parsing |
| 110 | +const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y') |
| 111 | +const modeFlag = extractFlag($ARGUMENTS, '--mode') // 'lite-plan' | 'multi-cli' | 'lite-fix' | null |
| 112 | + |
| 113 | +// Mode determination |
| 114 | +let selectedMode |
| 115 | + |
| 116 | +if (modeFlag) { |
| 117 | + // Explicit mode flag |
| 118 | + selectedMode = modeFlag |
| 119 | +} else if (autoYes) { |
| 120 | + // Auto mode: default to lite-plan |
| 121 | + selectedMode = 'lite-plan' |
| 122 | +} else { |
| 123 | + // Interactive: ask user |
| 124 | + const selection = AskUserQuestion({ |
| 125 | + questions: [{ |
| 126 | + question: "Select planning approach:", |
| 127 | + header: "Mode", |
| 128 | + multiSelect: false, |
| 129 | + options: [ |
| 130 | + { label: "Lite Plan (Recommended)", description: "Lightweight planning with exploration and clarification" }, |
| 131 | + { label: "Multi-CLI Plan", description: "Multi-model collaborative planning (Gemini + Codex + Claude)" }, |
| 132 | + { label: "Lite Fix", description: "Bug diagnosis and fix planning with severity assessment" } |
| 133 | + ] |
| 134 | + }] |
| 135 | + }) |
| 136 | + selectedMode = parseSelection(selection) // Map to 'lite-plan' | 'multi-cli' | 'lite-fix' |
| 137 | +} |
| 138 | + |
| 139 | +// Load phase document |
| 140 | +const phaseDoc = { |
| 141 | + 'lite-plan': 'phases/01-lite-plan.md', |
| 142 | + 'multi-cli': 'phases/02-multi-cli-plan.md', |
| 143 | + 'lite-fix': 'phases/03-lite-fix.md' |
| 144 | +}[selectedMode] |
| 145 | + |
| 146 | +Read(phaseDoc) // Load selected planning phase |
| 147 | +// Execute planning phase... |
| 148 | +// After planning completes: |
| 149 | +Read('phases/04-lite-execute.md') // Load execution phase |
| 150 | +``` |
| 151 | + |
| 152 | +## Data Flow |
| 153 | + |
| 154 | +``` |
| 155 | +Planning Phase (01/02/03) |
| 156 | + │ |
| 157 | + ├─ Produces: executionContext = { |
| 158 | + │ planObject: plan.json or fix-plan.json, |
| 159 | + │ explorationsContext / diagnosisContext / synthesis rounds, |
| 160 | + │ clarificationContext, |
| 161 | + │ executionMethod: "Agent" | "Codex" | "Auto", |
| 162 | + │ codeReviewTool: "Skip" | "Gemini Review" | ..., |
| 163 | + │ originalUserInput: string, |
| 164 | + │ session: { id, folder, artifacts } |
| 165 | + │ } |
| 166 | + │ |
| 167 | + ↓ |
| 168 | +Execution Phase (04) |
| 169 | + │ |
| 170 | + ├─ Consumes: executionContext |
| 171 | + ├─ Task grouping → Batch creation → Parallel/sequential execution |
| 172 | + ├─ Optional code review |
| 173 | + └─ Development index update |
| 174 | +``` |
| 175 | + |
| 176 | +## TodoWrite Pattern |
| 177 | + |
| 178 | +**Initialization** (after mode selection): |
| 179 | +```json |
| 180 | +[ |
| 181 | + {"content": "Mode: {selectedMode} - Planning", "status": "in_progress", "activeForm": "Planning ({selectedMode})"}, |
| 182 | + {"content": "Execution (Phase 4)", "status": "pending", "activeForm": "Executing tasks"} |
| 183 | +] |
| 184 | +``` |
| 185 | + |
| 186 | +**After planning completes**: |
| 187 | +```json |
| 188 | +[ |
| 189 | + {"content": "Mode: {selectedMode} - Planning", "status": "completed", "activeForm": "Planning ({selectedMode})"}, |
| 190 | + {"content": "Execution (Phase 4)", "status": "in_progress", "activeForm": "Executing tasks"} |
| 191 | +] |
| 192 | +``` |
| 193 | + |
| 194 | +Phase-internal sub-tasks are managed by each phase document (attach/collapse pattern). |
| 195 | + |
| 196 | +## Core Rules |
| 197 | + |
| 198 | +1. **Planning phases NEVER execute code** - all execution delegated to Phase 4 |
| 199 | +2. **Only ONE planning phase runs** per invocation (Phase 1, 2, or 3) |
| 200 | +3. **Phase 4 ALWAYS runs** after planning completes |
| 201 | +4. **executionContext is the contract** between planning and execution phases |
| 202 | +5. **Progressive loading**: Read phase doc ONLY when about to execute |
| 203 | +6. **No cross-phase loading**: Don't load Phase 2 if user selected Phase 1 |
| 204 | + |
| 205 | +## Error Handling |
| 206 | + |
| 207 | +| Error | Resolution | |
| 208 | +|-------|------------| |
| 209 | +| Unknown --mode value | Default to lite-plan with warning | |
| 210 | +| Planning phase failure | Display error, offer retry or mode switch | |
| 211 | +| executionContext missing | Error: planning phase did not produce context | |
| 212 | +| Phase file not found | Error with file path for debugging | |
| 213 | + |
| 214 | +## Related Skills |
| 215 | + |
| 216 | +- Full planning workflow: [workflow-plan/SKILL.md](../workflow-plan/SKILL.md) |
| 217 | +- Brainstorming: [workflow-brainstorm-auto-parallel/SKILL.md](../workflow-brainstorm-auto-parallel/SKILL.md) |
0 commit comments