claude-code-workflow 7.2.29 → 7.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json +2 -2
  2. package/.ccw/workflows/cli-templates/schemas/task-schema.json +14 -7
  3. package/.claude/agents/action-planning-agent.md +7 -4
  4. package/.claude/agents/cli-explore-agent.md +77 -63
  5. package/.claude/agents/cli-lite-planning-agent.md +11 -10
  6. package/.claude/agents/issue-plan-agent.md +421 -426
  7. package/.claude/commands/workflow/spec/setup.md +1 -1
  8. package/.claude/skills/ccw-chain/SKILL.md +119 -0
  9. package/.claude/skills/ccw-chain/chains/ccw-cycle.json +21 -0
  10. package/.claude/skills/ccw-chain/chains/ccw-exploration.json +47 -0
  11. package/.claude/skills/ccw-chain/chains/ccw-issue.json +33 -0
  12. package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +57 -0
  13. package/.claude/skills/ccw-chain/chains/ccw-main.json +52 -0
  14. package/.claude/skills/ccw-chain/chains/ccw-standard.json +39 -0
  15. package/.claude/skills/ccw-chain/chains/ccw-team.json +10 -0
  16. package/.claude/skills/ccw-chain/chains/ccw-with-file.json +31 -0
  17. package/.claude/skills/ccw-chain/phases/analyze-with-file.md +788 -0
  18. package/.claude/skills/ccw-chain/phases/brainstorm/SKILL.md +408 -0
  19. package/.claude/skills/ccw-chain/phases/brainstorm/phases/01-mode-routing.md +207 -0
  20. package/.claude/skills/ccw-chain/phases/brainstorm/phases/02-artifacts.md +567 -0
  21. package/.claude/skills/ccw-chain/phases/brainstorm/phases/03-role-analysis.md +748 -0
  22. package/.claude/skills/ccw-chain/phases/brainstorm/phases/04-synthesis.md +827 -0
  23. package/.claude/skills/ccw-chain/phases/brainstorm-with-file.md +482 -0
  24. package/.claude/skills/ccw-chain/phases/collaborative-plan-with-file.md +639 -0
  25. package/.claude/skills/ccw-chain/phases/debug-with-file.md +656 -0
  26. package/.claude/skills/ccw-chain/phases/integration-test-cycle.md +936 -0
  27. package/.claude/skills/ccw-chain/phases/issue-convert-to-plan.md +720 -0
  28. package/.claude/skills/ccw-chain/phases/issue-discover.md +483 -0
  29. package/.claude/skills/ccw-chain/phases/issue-execute.md +629 -0
  30. package/.claude/skills/ccw-chain/phases/issue-from-brainstorm.md +382 -0
  31. package/.claude/skills/ccw-chain/phases/issue-plan.md +343 -0
  32. package/.claude/skills/ccw-chain/phases/issue-queue.md +464 -0
  33. package/.claude/skills/ccw-chain/phases/refactor-cycle.md +852 -0
  34. package/.claude/skills/ccw-chain/phases/review-cycle/SKILL.md +132 -0
  35. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-fix.md +760 -0
  36. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-module.md +764 -0
  37. package/.claude/skills/ccw-chain/phases/review-cycle/phases/review-session.md +775 -0
  38. package/.claude/skills/ccw-chain/phases/roadmap-with-file.md +544 -0
  39. package/.claude/skills/ccw-chain/phases/spec-generator/SKILL.md +338 -0
  40. package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-5-requirement-clarification.md +404 -0
  41. package/.claude/skills/ccw-chain/phases/spec-generator/phases/01-discovery.md +257 -0
  42. package/.claude/skills/ccw-chain/phases/spec-generator/phases/02-product-brief.md +274 -0
  43. package/.claude/skills/ccw-chain/phases/spec-generator/phases/03-requirements.md +184 -0
  44. package/.claude/skills/ccw-chain/phases/spec-generator/phases/04-architecture.md +248 -0
  45. package/.claude/skills/ccw-chain/phases/spec-generator/phases/05-epics-stories.md +178 -0
  46. package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-5-auto-fix.md +144 -0
  47. package/.claude/skills/ccw-chain/phases/spec-generator/phases/06-readiness-check.md +480 -0
  48. package/.claude/skills/ccw-chain/phases/team-planex.md +123 -0
  49. package/.claude/skills/ccw-chain/phases/ui-design-explore-auto.md +678 -0
  50. package/.claude/skills/ccw-chain/phases/unified-execute-with-file.md +870 -0
  51. package/.claude/skills/ccw-chain/phases/workflow-execute/SKILL.md +625 -0
  52. package/.claude/skills/ccw-chain/phases/workflow-execute/phases/06-review.md +215 -0
  53. package/.claude/skills/ccw-chain/phases/workflow-lite-plan.md +616 -0
  54. package/.claude/skills/ccw-chain/phases/workflow-multi-cli-plan.md +424 -0
  55. package/.claude/skills/ccw-chain/phases/workflow-plan/SKILL.md +466 -0
  56. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/01-session-discovery.md +99 -0
  57. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/02-context-gathering.md +338 -0
  58. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/03-conflict-resolution.md +422 -0
  59. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/04-task-generation.md +440 -0
  60. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/05-plan-verify.md +395 -0
  61. package/.claude/skills/ccw-chain/phases/workflow-plan/phases/06-replan.md +594 -0
  62. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/SKILL.md +527 -0
  63. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/01-session-discovery.md +57 -0
  64. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/02-context-gathering.md +407 -0
  65. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/03-test-coverage-analysis.md +172 -0
  66. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -0
  67. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/05-tdd-task-generation.md +473 -0
  68. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/06-tdd-structure-validation.md +189 -0
  69. package/.claude/skills/ccw-chain/phases/workflow-tdd-plan/phases/07-tdd-verify.md +635 -0
  70. package/.claude/skills/ccw-chain/phases/workflow-test-fix/SKILL.md +482 -0
  71. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/01-session-start.md +60 -0
  72. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/02-test-context-gather.md +493 -0
  73. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/03-test-concept-enhanced.md +150 -0
  74. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/04-test-task-generate.md +346 -0
  75. package/.claude/skills/ccw-chain/phases/workflow-test-fix/phases/05-test-cycle-execute.md +538 -0
  76. package/.claude/skills/ccw-chain/specs/auto-mode.md +47 -0
  77. package/.claude/skills/ccw-chain/specs/intent-patterns.md +60 -0
  78. package/.claude/skills/chain-loader/SKILL.md +78 -0
  79. package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -0
  80. package/.claude/skills/chain-loader/phases/02-design-graph.md +73 -0
  81. package/.claude/skills/chain-loader/phases/03-generate-validate.md +75 -0
  82. package/.claude/skills/chain-loader/specs/chain-schema.md +99 -0
  83. package/.claude/skills/chain-loader/specs/design-patterns.md +99 -0
  84. package/.claude/skills/chain-loader/templates/chain-json.md +63 -0
  85. package/.claude/skills/review-cycle/phases/review-module.md +764 -764
  86. package/.claude/skills/review-cycle/phases/review-session.md +775 -775
  87. package/.claude/skills/workflow-multi-cli-plan/SKILL.md +2 -2
  88. package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -422
  89. package/.claude/skills/workflow-plan/phases/05-plan-verify.md +395 -395
  90. package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +407 -407
  91. package/.claude/skills/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -426
  92. package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +493 -493
  93. package/README.md +14 -0
  94. package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
  95. package/ccw/dist/core/routes/litellm-api-routes.js +0 -23
  96. package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
  97. package/ccw/dist/tools/chain-loader.d.ts +10 -0
  98. package/ccw/dist/tools/chain-loader.d.ts.map +1 -0
  99. package/ccw/dist/tools/chain-loader.js +642 -0
  100. package/ccw/dist/tools/chain-loader.js.map +1 -0
  101. package/ccw/dist/tools/index.d.ts.map +1 -1
  102. package/ccw/dist/tools/index.js +2 -0
  103. package/ccw/dist/tools/index.js.map +1 -1
  104. package/ccw/dist/tools/json-builder.js +20 -0
  105. package/ccw/dist/tools/json-builder.js.map +1 -1
  106. package/ccw/dist/types/chain-types.d.ts +72 -0
  107. package/ccw/dist/types/chain-types.d.ts.map +1 -0
  108. package/ccw/dist/types/chain-types.js +5 -0
  109. package/ccw/dist/types/chain-types.js.map +1 -0
  110. package/ccw/scripts/prepublish-clean.mjs +0 -1
  111. package/package.json +1 -3
  112. package/ccw-litellm/README.md +0 -180
  113. package/ccw-litellm/pyproject.toml +0 -35
  114. package/ccw-litellm/src/ccw_litellm/__init__.py +0 -47
  115. package/ccw-litellm/src/ccw_litellm/cli.py +0 -108
  116. package/ccw-litellm/src/ccw_litellm/clients/__init__.py +0 -12
  117. package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +0 -270
  118. package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +0 -198
  119. package/ccw-litellm/src/ccw_litellm/config/__init__.py +0 -22
  120. package/ccw-litellm/src/ccw_litellm/config/loader.py +0 -343
  121. package/ccw-litellm/src/ccw_litellm/config/models.py +0 -162
  122. package/ccw-litellm/src/ccw_litellm/interfaces/__init__.py +0 -14
  123. package/ccw-litellm/src/ccw_litellm/interfaces/embedder.py +0 -52
  124. package/ccw-litellm/src/ccw_litellm/interfaces/llm.py +0 -45
@@ -0,0 +1,544 @@
1
+ ---
2
+ name: roadmap-with-file
3
+ description: Strategic requirement roadmap with iterative decomposition and issue creation. Outputs roadmap.md (human-readable, single source) + issues.jsonl (machine-executable). Handoff to team-planex.
4
+ argument-hint: "[-y|--yes] [-c|--continue] [-m progressive|direct|auto] \"requirement description\""
5
+ allowed-tools: TodoWrite(*), Agent(*), AskUserQuestion(*), Read(*), Grep(*), Glob(*), Bash(*), Edit(*), Write(*)
6
+ ---
7
+
8
+ ## Auto Mode
9
+
10
+ When `--yes` or `-y`: Auto-confirm strategy selection, use recommended mode, skip interactive rounds.
11
+
12
+ # Workflow Roadmap Command (/workflow:roadmap-with-file)
13
+
14
+ ## Quick Start
15
+
16
+ ```bash
17
+ # Basic usage
18
+ /workflow:roadmap-with-file "Implement user authentication system with OAuth and 2FA"
19
+
20
+ # With mode selection
21
+ /workflow:roadmap-with-file -m progressive "Build real-time notification system" # MVP→iterations
22
+ /workflow:roadmap-with-file -m direct "Refactor payment module" # Topological sequence
23
+ /workflow:roadmap-with-file -m auto "Add data export feature" # Auto-select
24
+
25
+ # Continue existing session
26
+ /workflow:roadmap-with-file --continue "auth system"
27
+
28
+ # Auto mode
29
+ /workflow:roadmap-with-file -y "Implement caching layer"
30
+ ```
31
+
32
+ **Context Source**: cli-explore-agent (optional) + requirement analysis
33
+ **Output Directory**: `.workflow/.roadmap/{session-id}/`
34
+ **Core Output**: `roadmap.md` (single source, human-readable) + `issues.jsonl` (global, machine-executable)
35
+
36
+ ## Output Artifacts
37
+
38
+ ### Single Source of Truth
39
+
40
+ | Artifact | Purpose | Consumer |
41
+ |----------|---------|----------|
42
+ | `roadmap.md` | ⭐ Human-readable strategic roadmap with all context | Human review, team-planex handoff |
43
+ | `.workflow/issues/issues.jsonl` | Global issue store (appended) | team-planex, issue commands |
44
+
45
+ ### Why No Separate JSON Files?
46
+
47
+ | Original File | Why Removed | Where Content Goes |
48
+ |---------------|-------------|-------------------|
49
+ | `strategy-assessment.json` | Duplicates roadmap.md content | Embedded in `roadmap.md` Strategy Assessment section |
50
+ | `exploration-codebase.json` | Single-use intermediate | Embedded in `roadmap.md` Codebase Context appendix |
51
+
52
+ ## Overview
53
+
54
+ Strategic requirement roadmap with **iterative decomposition**. Creates a single `roadmap.md` that evolves through discussion, with issues persisted to global `issues.jsonl` for execution.
55
+
56
+ **Core workflow**: Understand → Decompose → Iterate → Validate → Handoff
57
+
58
+ ```
59
+ ┌─────────────────────────────────────────────────────────────────────────┐
60
+ │ ROADMAP ITERATIVE WORKFLOW │
61
+ ├─────────────────────────────────────────────────────────────────────────┤
62
+ │ │
63
+ │ Phase 1: Requirement Understanding & Strategy │
64
+ │ ├─ Parse requirement: goal / constraints / stakeholders │
65
+ │ ├─ Assess uncertainty level → recommend mode │
66
+ │ ├─ User confirms strategy (-m skips, -y auto-selects) │
67
+ │ └─ Initialize roadmap.md with Strategy Assessment │
68
+ │ │
69
+ │ Phase 2: Decomposition & Issue Creation │
70
+ │ ├─ cli-roadmap-plan-agent executes decomposition │
71
+ │ ├─ Progressive: 2-4 layers (MVP→Optimized) with convergence │
72
+ │ ├─ Direct: Topological task sequence with convergence │
73
+ │ ├─ Create issues via ccw issue create → issues.jsonl │
74
+ │ └─ Update roadmap.md with Roadmap table + Issue references │
75
+ │ │
76
+ │ Phase 3: Iterative Refinement (Multi-Round) │
77
+ │ ├─ Present roadmap to user │
78
+ │ ├─ Feedback: Approve | Adjust Scope | Modify Convergence | Replan │
79
+ │ ├─ Update roadmap.md with each round │
80
+ │ └─ Repeat until approved (max 5 rounds) │
81
+ │ │
82
+ │ Phase 4: Handoff │
83
+ │ ├─ Final roadmap.md with Issue ID references │
84
+ │ ├─ Options: team-planex | first wave | view issues | done │
85
+ │ └─ Issues ready in .workflow/issues/issues.jsonl │
86
+ │ │
87
+ └─────────────────────────────────────────────────────────────────────────┘
88
+ ```
89
+
90
+ ## Dual Modes
91
+
92
+ | Mode | Strategy | Best For | Decomposition |
93
+ |------|----------|----------|---------------|
94
+ | **Progressive** | MVP → Usable → Refined → Optimized | High uncertainty, need validation | 2-4 layers, each with full convergence |
95
+ | **Direct** | Topological task sequence | Clear requirements, confirmed tech | Tasks with explicit inputs/outputs |
96
+
97
+ **Auto-selection logic**:
98
+ - ≥3 high uncertainty factors → Progressive
99
+ - ≥3 low uncertainty factors → Direct
100
+ - Otherwise → Ask user preference
101
+
102
+ ## Output Structure
103
+
104
+ ```
105
+ .workflow/.roadmap/RMAP-{slug}-{date}/
106
+ └── roadmap.md # ⭐ Single source of truth
107
+ # - Strategy Assessment (embedded)
108
+ # - Roadmap Table
109
+ # - Convergence Criteria per Issue
110
+ # - Codebase Context (appendix, if applicable)
111
+ # - Iteration History
112
+
113
+ .workflow/issues/issues.jsonl # Global issue store (appended)
114
+ # - One JSON object per line
115
+ # - Consumed by team-planex, issue commands
116
+ ```
117
+
118
+ ## roadmap.md Template
119
+
120
+ ```markdown
121
+ # Requirement Roadmap
122
+
123
+ **Session**: RMAP-{slug}-{date}
124
+ **Requirement**: {requirement}
125
+ **Strategy**: {progressive|direct}
126
+ **Status**: {Planning|Refining|Ready}
127
+ **Created**: {timestamp}
128
+
129
+ ---
130
+
131
+ ## Strategy Assessment
132
+
133
+ - **Uncertainty Level**: {high|medium|low}
134
+ - **Decomposition Mode**: {progressive|direct}
135
+ - **Assessment Basis**: {factors summary}
136
+ - **Goal**: {extracted goal}
137
+ - **Constraints**: {extracted constraints}
138
+ - **Stakeholders**: {extracted stakeholders}
139
+
140
+ ---
141
+
142
+ ## Roadmap
143
+
144
+ ### Progressive Mode
145
+ | Wave | Issue ID | Layer | Goal | Priority | Dependencies |
146
+ |------|----------|-------|------|----------|--------------|
147
+ | 1 | ISS-xxx | MVP | ... | 2 | - |
148
+ | 2 | ISS-yyy | Usable | ... | 3 | ISS-xxx |
149
+
150
+ ### Direct Mode
151
+ | Wave | Issue ID | Title | Type | Dependencies |
152
+ |------|----------|-------|------|--------------|
153
+ | 1 | ISS-xxx | ... | infrastructure | - |
154
+ | 2 | ISS-yyy | ... | feature | ISS-xxx |
155
+
156
+ ---
157
+
158
+ ## Convergence Criteria
159
+
160
+ ### ISS-xxx: {Issue Title}
161
+ - **Criteria**: [testable conditions]
162
+ - **Verification**: [executable steps/commands]
163
+ - **Definition of Done**: [business language, non-technical]
164
+
165
+ ### ISS-yyy: {Issue Title}
166
+ ...
167
+
168
+ ---
169
+
170
+ ## Risks
171
+
172
+ | Risk | Severity | Mitigation |
173
+ |------|----------|------------|
174
+ | ... | ... | ... |
175
+
176
+ ---
177
+
178
+ ## Iteration History
179
+
180
+ ### Round 1 - {timestamp}
181
+ **User Feedback**: {feedback summary}
182
+ **Changes Made**: {adjustments}
183
+ **Status**: {approved|continue iteration}
184
+
185
+ ---
186
+
187
+ ## Codebase Context (Optional)
188
+
189
+ *Included when codebase exploration was performed*
190
+
191
+ - **Relevant Modules**: [...]
192
+ - **Existing Patterns**: [...]
193
+ - **Integration Points**: [...]
194
+ ```
195
+
196
+ ## Issues JSONL Specification
197
+
198
+ ### Location & Format
199
+
200
+ ```
201
+ Path: .workflow/issues/issues.jsonl
202
+ Format: JSONL (one complete JSON object per line)
203
+ Encoding: UTF-8
204
+ Mode: Append-only (new issues appended to end)
205
+ ```
206
+
207
+ ### Record Schema
208
+
209
+ ```json
210
+ {
211
+ "id": "ISS-YYYYMMDD-NNN",
212
+ "title": "[LayerName] goal or [TaskType] title",
213
+ "status": "pending",
214
+ "priority": 2,
215
+ "context": "Markdown with goal, scope, convergence, verification, DoD",
216
+ "source": "text",
217
+ "tags": ["roadmap", "progressive|direct", "wave-N", "layer-name"],
218
+ "extended_context": {
219
+ "notes": {
220
+ "session": "RMAP-{slug}-{date}",
221
+ "strategy": "progressive|direct",
222
+ "wave": 1,
223
+ "depends_on_issues": []
224
+ }
225
+ },
226
+ "lifecycle_requirements": {
227
+ "test_strategy": "unit",
228
+ "regression_scope": "affected",
229
+ "acceptance_type": "automated",
230
+ "commit_strategy": "per-issue"
231
+ }
232
+ }
233
+ ```
234
+
235
+ ### Query Interface
236
+
237
+ ```bash
238
+ # By ID (detail view)
239
+ ccw issue list ISS-20260227-001
240
+
241
+ # List all with status filter
242
+ ccw issue list --status planned,queued
243
+ ccw issue list --brief # JSON minimal output
244
+
245
+ # Queue operations (wave-based execution)
246
+ ccw issue queue list # List all queues
247
+ ccw issue queue dag # Get dependency graph (JSON)
248
+ ccw issue next --queue <queue-id> # Get next task
249
+
250
+ # Execute
251
+ ccw issue queue add <issue-id> # Add to active queue
252
+ ccw issue done <item-id> # Mark completed
253
+ ```
254
+
255
+ > **Note**: Issues are tagged with `wave-N` in `tags[]` field for filtering. Use `--brief` for programmatic parsing.
256
+
257
+ ### Consumers
258
+
259
+ | Consumer | Usage |
260
+ |----------|-------|
261
+ | `team-planex` | Load by ID or tag, execute in wave order |
262
+ | `issue-manage` | CRUD operations on issues |
263
+ | `issue:execute` | DAG-based parallel execution |
264
+ | `issue:queue` | Form execution queue from solutions |
265
+
266
+ ## Implementation
267
+
268
+ ### Session Initialization
269
+
270
+ ```javascript
271
+ const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
272
+
273
+ // Parse flags
274
+ const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
275
+ const continueMode = $ARGUMENTS.includes('--continue') || $ARGUMENTS.includes('-c')
276
+ const modeMatch = $ARGUMENTS.match(/(?:--mode|-m)\s+(progressive|direct|auto)/)
277
+ const requestedMode = modeMatch ? modeMatch[1] : 'auto'
278
+
279
+ // Clean requirement text
280
+ const requirement = $ARGUMENTS
281
+ .replace(/--yes|-y|--continue|-c|--mode\s+\w+|-m\s+\w+/g, '')
282
+ .trim()
283
+
284
+ const slug = requirement.toLowerCase()
285
+ .replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-')
286
+ .substring(0, 40)
287
+ const dateStr = getUtc8ISOString().substring(0, 10)
288
+ const sessionId = `RMAP-${slug}-${dateStr}`
289
+ const sessionFolder = `.workflow/.roadmap/${sessionId}`
290
+
291
+ // Auto-detect continue
292
+ if (continueMode || file_exists(`${sessionFolder}/roadmap.md`)) {
293
+ // Resume existing session
294
+ }
295
+ Bash(`mkdir -p ${sessionFolder}`)
296
+ ```
297
+
298
+ ### Phase 1: Requirement Understanding & Strategy
299
+
300
+ **Objective**: Parse requirement, assess uncertainty, select decomposition strategy, initialize roadmap.md.
301
+
302
+ **Steps**:
303
+
304
+ 1. **Parse Requirement**
305
+ - Extract: goal, constraints, stakeholders, keywords
306
+
307
+ 2. **Assess Uncertainty**
308
+ ```javascript
309
+ const uncertaintyFactors = {
310
+ scope_clarity: 'low|medium|high',
311
+ technical_risk: 'low|medium|high',
312
+ dependency_unknown: 'low|medium|high',
313
+ domain_familiarity: 'low|medium|high',
314
+ requirement_stability: 'low|medium|high'
315
+ }
316
+ // ≥3 high → progressive, ≥3 low → direct, else → ask
317
+ ```
318
+
319
+ 3. **Strategy Selection** (skip if `-m` specified or autoYes)
320
+ ```javascript
321
+ AskUserQuestion({
322
+ questions: [{
323
+ question: `Decomposition strategy:\nUncertainty: ${uncertaintyLevel}\nRecommended: ${recommendedMode}`,
324
+ header: "Strategy",
325
+ multiSelect: false,
326
+ options: [
327
+ { label: recommendedMode === 'progressive' ? "Progressive (Recommended)" : "Progressive",
328
+ description: "MVP→iterations, validate core first" },
329
+ { label: recommendedMode === 'direct' ? "Direct (Recommended)" : "Direct",
330
+ description: "Topological task sequence, clear dependencies" }
331
+ ]
332
+ }]
333
+ })
334
+ ```
335
+
336
+ 4. **Initialize roadmap.md** with Strategy Assessment section
337
+
338
+ **Success Criteria**:
339
+ - roadmap.md created with Strategy Assessment
340
+ - Strategy selected (progressive or direct)
341
+ - Uncertainty factors documented
342
+
343
+ ### Phase 2: Decomposition & Issue Creation
344
+
345
+ **Objective**: Execute decomposition via `cli-roadmap-plan-agent`, create issues, update roadmap.md.
346
+
347
+ **Agent**: `cli-roadmap-plan-agent`
348
+
349
+ **Agent Tasks**:
350
+ 1. Analyze requirement with strategy context
351
+ 2. Execute CLI-assisted decomposition (Gemini → Qwen fallback)
352
+ 3. Create issues via `ccw issue create`
353
+ 4. Generate roadmap table with Issue ID references
354
+ 5. Update roadmap.md
355
+
356
+ **Agent Prompt Template**:
357
+ ```javascript
358
+ Agent({
359
+ subagent_type: "cli-roadmap-plan-agent",
360
+ run_in_background: false,
361
+ description: `Roadmap decomposition: ${slug}`,
362
+ prompt: `
363
+ ## Roadmap Decomposition Agent
364
+
365
+ ### Input Context
366
+ - **Requirement**: ${requirement}
367
+ - **Strategy**: ${selectedMode}
368
+ - **Session**: ${sessionId}
369
+ - **Folder**: ${sessionFolder}
370
+
371
+ ### Mode-Specific Requirements
372
+
373
+ ${selectedMode === 'progressive' ? `**Progressive Mode**:
374
+ - 2-4 layers: MVP / Usable / Refined / Optimized
375
+ - Each layer: goal, scope, excludes, convergence, risks, effort
376
+ - L0 (MVP) must be self-contained, no dependencies
377
+ - Scope: each feature in exactly ONE layer (no overlap)` :
378
+
379
+ `**Direct Mode**:
380
+ - Topologically-sorted task sequence
381
+ - Each task: title, type, scope, inputs, outputs, convergence, depends_on
382
+ - Inputs from preceding outputs or existing resources
383
+ - parallel_group for truly independent tasks`}
384
+
385
+ ### Convergence Quality Requirements
386
+ - criteria[]: MUST be testable
387
+ - verification: MUST be executable
388
+ - definition_of_done: MUST use business language
389
+
390
+ ### Output
391
+ 1. **${sessionFolder}/roadmap.md** - Update with Roadmap table + Convergence sections
392
+ 2. **Append to .workflow/issues/issues.jsonl** via ccw issue create
393
+
394
+ ### CLI Configuration
395
+ - Primary: gemini, Fallback: qwen, Timeout: 60000ms
396
+ `
397
+ })
398
+ ```
399
+
400
+ **Success Criteria**:
401
+ - Issues created in `.workflow/issues/issues.jsonl`
402
+ - roadmap.md updated with Issue references
403
+ - No circular dependencies
404
+ - Convergence criteria testable
405
+
406
+ ### Phase 3: Iterative Refinement
407
+
408
+ **Objective**: Multi-round user feedback to refine roadmap.
409
+
410
+ **Workflow Steps**:
411
+
412
+ 1. **Present Roadmap**
413
+ - Display Roadmap table + key Convergence criteria
414
+ - Show issue count and wave breakdown
415
+
416
+ 2. **Gather Feedback** (skip if autoYes)
417
+ ```javascript
418
+ const feedback = AskUserQuestion({
419
+ questions: [{
420
+ question: `Roadmap validation (round ${round}):\n${issueCount} issues across ${waveCount} waves. Feedback?`,
421
+ header: "Feedback",
422
+ multiSelect: false,
423
+ options: [
424
+ { label: "Approve", description: "Proceed to handoff" },
425
+ { label: "Adjust Scope", description: "Modify issue scopes" },
426
+ { label: "Modify Convergence", description: "Refine criteria/verification" },
427
+ { label: "Re-decompose", description: "Change strategy/layering" }
428
+ ]
429
+ }]
430
+ })
431
+ ```
432
+
433
+ 3. **Process Feedback**
434
+ - **Approve**: Exit loop, proceed to Phase 4
435
+ - **Adjust Scope**: Modify issue context, update roadmap.md
436
+ - **Modify Convergence**: Refine criteria/verification, update roadmap.md
437
+ - **Re-decompose**: Return to Phase 2 with new strategy
438
+
439
+ 4. **Update roadmap.md**
440
+ - Append to Iteration History section
441
+ - Update Roadmap table if changed
442
+ - Increment round counter
443
+
444
+ 5. **Loop** (max 5 rounds, then force proceed)
445
+
446
+ **Success Criteria**:
447
+ - User approved OR max rounds reached
448
+ - All changes recorded in Iteration History
449
+ - roadmap.md reflects final state
450
+
451
+ ### Phase 4: Handoff
452
+
453
+ **Objective**: Present final roadmap, offer execution options.
454
+
455
+ **Steps**:
456
+
457
+ 1. **Display Summary**
458
+ ```markdown
459
+ ## Roadmap Complete
460
+
461
+ - **Session**: RMAP-{slug}-{date}
462
+ - **Strategy**: {progressive|direct}
463
+ - **Issues Created**: {count} across {waves} waves
464
+ - **Roadmap**: .workflow/.roadmap/RMAP-{slug}-{date}/roadmap.md
465
+
466
+ | Wave | Issue Count | Layer/Type |
467
+ |------|-------------|------------|
468
+ | 1 | 2 | MVP / infrastructure |
469
+ | 2 | 3 | Usable / feature |
470
+ ```
471
+
472
+ 2. **Offer Options** (skip if autoYes)
473
+ ```javascript
474
+ AskUserQuestion({
475
+ questions: [{
476
+ question: `${issueIds.length} issues ready. Next step:`,
477
+ header: "Next Step",
478
+ multiSelect: false,
479
+ options: [
480
+ { label: "Execute with team-planex (Recommended)",
481
+ description: `Run all ${issueIds.length} issues via team-planex` },
482
+ { label: "Execute first wave",
483
+ description: "Run wave-1 issues only" },
484
+ { label: "View issues",
485
+ description: "Display issue details from issues.jsonl" },
486
+ { label: "Done",
487
+ description: "Save and exit, execute later" }
488
+ ]
489
+ }]
490
+ })
491
+ ```
492
+
493
+ 3. **Execute Selection**
494
+ | Selection | Action |
495
+ |-----------|--------|
496
+ | Execute with team-planex | `Skill(skill="team-planex", args="${issueIds.join(' ')}")` |
497
+ | Execute first wave | Filter by `wave-1` tag, pass to team-planex |
498
+ | View issues | Display from `.workflow/issues/issues.jsonl` |
499
+ | Done | Output paths, end |
500
+
501
+ ## Configuration
502
+
503
+ | Flag | Default | Description |
504
+ |------|---------|-------------|
505
+ | `-y, --yes` | false | Auto-confirm all decisions |
506
+ | `-c, --continue` | false | Continue existing session |
507
+ | `-m, --mode` | auto | Strategy: progressive / direct / auto |
508
+
509
+ **Session ID format**: `RMAP-{slug}-{YYYY-MM-DD}`
510
+
511
+ ## Error Handling
512
+
513
+ | Error | Resolution |
514
+ |-------|------------|
515
+ | cli-roadmap-plan-agent fails | Retry once, fallback to manual decomposition |
516
+ | No codebase | Skip exploration, pure requirement decomposition |
517
+ | Circular dependency detected | Prompt user, re-decompose |
518
+ | User feedback timeout | Save roadmap.md, show `--continue` command |
519
+ | Max rounds reached | Force proceed with current roadmap |
520
+ | Session folder conflict | Append timestamp suffix |
521
+
522
+ ## Best Practices
523
+
524
+ 1. **Clear Requirements**: Detailed description → better decomposition
525
+ 2. **Iterate on Roadmap**: Use feedback rounds to refine convergence criteria
526
+ 3. **Testable Convergence**: criteria = assertions, DoD = business language
527
+ 4. **Use Continue Mode**: Resume to iterate on existing roadmap
528
+ 5. **Wave Execution**: Start with wave-1 (MVP) to validate before full execution
529
+
530
+ ## Usage Recommendations
531
+
532
+ **When to Use Roadmap vs Other Commands:**
533
+
534
+ | Scenario | Recommended Command |
535
+ |----------|-------------------|
536
+ | Strategic planning, need issue tracking | `/workflow:roadmap-with-file` |
537
+ | Quick task breakdown, immediate execution | `/workflow-lite-plan` |
538
+ | Collaborative multi-agent planning | `/workflow:collaborative-plan-with-file` |
539
+ | Full specification documents | `spec-generator` skill |
540
+ | Code implementation from existing plan | `/workflow-lite-plan` (Phase 1: plan → Phase 2: execute) |
541
+
542
+ ---
543
+
544
+ **Now execute roadmap-with-file for**: $ARGUMENTS