claude-code-workflow 7.2.24 → 7.2.25

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 (42) hide show
  1. package/.ccw/workflows/cli-tools-usage.md +123 -521
  2. package/.claude/skills/brainstorm/SKILL.md +408 -408
  3. package/.claude/skills/review-cycle/SKILL.md +132 -132
  4. package/.claude/skills/spec-generator/SKILL.md +1 -1
  5. package/.claude/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  6. package/.claude/skills/team-lifecycle-v4/SKILL.md +1 -1
  7. package/.claude/skills/team-review/SKILL.md +1 -1
  8. package/.claude/skills/team-ultra-analyze/SKILL.md +1 -1
  9. package/.claude/skills/workflow-multi-cli-plan/SKILL.md +1 -1
  10. package/.claude/skills/workflow-plan/SKILL.md +1 -1
  11. package/.claude/skills/workflow-test-fix/SKILL.md +1 -1
  12. package/.codex/skills/analyze-with-file/SKILL.md +966 -966
  13. package/.codex/skills/issue-discover/SKILL.md +361 -361
  14. package/.codex/skills/review-cycle/SKILL.md +1 -1
  15. package/.codex/skills/roadmap-with-file/SKILL.md +901 -901
  16. package/.codex/skills/spec-generator/SKILL.md +425 -425
  17. package/.codex/skills/spec-setup/SKILL.md +669 -669
  18. package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
  19. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +402 -402
  20. package/package.json +1 -1
  21. package/.claude/skills/team-iterdev/SKILL.md +0 -127
  22. package/.claude/skills/team-iterdev/roles/architect/role.md +0 -65
  23. package/.claude/skills/team-iterdev/roles/coordinator/commands/analyze.md +0 -62
  24. package/.claude/skills/team-iterdev/roles/coordinator/commands/dispatch.md +0 -234
  25. package/.claude/skills/team-iterdev/roles/coordinator/commands/monitor.md +0 -182
  26. package/.claude/skills/team-iterdev/roles/coordinator/role.md +0 -153
  27. package/.claude/skills/team-iterdev/roles/developer/role.md +0 -74
  28. package/.claude/skills/team-iterdev/roles/reviewer/role.md +0 -66
  29. package/.claude/skills/team-iterdev/roles/tester/role.md +0 -88
  30. package/.claude/skills/team-iterdev/specs/pipelines.md +0 -94
  31. package/.claude/skills/team-iterdev/specs/team-config.json +0 -172
  32. package/.codex/skills/team-iterdev/SKILL.md +0 -219
  33. package/.codex/skills/team-iterdev/roles/architect/role.md +0 -65
  34. package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +0 -62
  35. package/.codex/skills/team-iterdev/roles/coordinator/commands/dispatch.md +0 -187
  36. package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +0 -227
  37. package/.codex/skills/team-iterdev/roles/coordinator/role.md +0 -193
  38. package/.codex/skills/team-iterdev/roles/developer/role.md +0 -74
  39. package/.codex/skills/team-iterdev/roles/reviewer/role.md +0 -66
  40. package/.codex/skills/team-iterdev/roles/tester/role.md +0 -88
  41. package/.codex/skills/team-iterdev/specs/pipelines.md +0 -94
  42. package/.codex/skills/team-iterdev/specs/team-config.json +0 -172
@@ -1,901 +1,901 @@
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 csv-wave-pipeline.
4
- argument-hint: "[-y|--yes] [-c|--continue] [-m progressive|direct|auto] \"requirement description\""
5
- ---
6
-
7
- ## Auto Mode
8
-
9
- When `--yes` or `-y`: Auto-confirm strategy selection, use recommended mode, skip interactive refinement rounds. **This skill is planning-only — it NEVER executes code or modifies source files. Output is the roadmap + issues for user review.**
10
-
11
- # Roadmap-with-file Skill
12
-
13
- ## Usage
14
-
15
- ```bash
16
- $roadmap-with-file "Implement user authentication system with OAuth and 2FA"
17
- $roadmap-with-file -m progressive "Build real-time notification system"
18
- $roadmap-with-file -m direct "Refactor payment module"
19
- $roadmap-with-file -m auto "Add data export feature"
20
- $roadmap-with-file --continue "auth system"
21
- $roadmap-with-file -y "Implement caching layer"
22
- ```
23
-
24
- **Flags**:
25
- - `-y, --yes`: Skip all confirmations (auto mode)
26
- - `-c, --continue`: Continue existing session
27
- - `-m, --mode`: Strategy selection (progressive / direct / auto)
28
-
29
- **Context Source**: cli-explore-agent (optional) + requirement analysis
30
- **Output Directory**: `.workflow/.roadmap/{session-id}/`
31
- **Core Output**: `roadmap.md` (single source, human-readable) + `issues.jsonl` (global, machine-executable)
32
-
33
- ---
34
-
35
- ## Subagent API Reference
36
-
37
- ### spawn_agent
38
- Create a new subagent with task assignment.
39
-
40
- ```javascript
41
- const agentId = spawn_agent({
42
- agent_type: "{agent_type}",
43
- message: `
44
- ## TASK ASSIGNMENT
45
-
46
- ### MANDATORY FIRST STEPS (Agent Execute)
47
- 1. Read: .workflow/project-tech.json
48
- 2. Read: .workflow/project-guidelines.json
49
-
50
- ## TASK CONTEXT
51
- ${taskContext}
52
-
53
- ## DELIVERABLES
54
- ${deliverables}
55
- `
56
- })
57
- ```
58
-
59
- ### wait
60
- Get results from subagent (only way to retrieve results).
61
-
62
- ```javascript
63
- const result = wait({
64
- ids: [agentId],
65
- timeout_ms: 600000 // 10 minutes
66
- })
67
-
68
- if (result.timed_out) {
69
- // Handle timeout - can continue waiting or send_input to prompt completion
70
- }
71
- ```
72
-
73
- ### send_input
74
- Continue interaction with active subagent (for clarification or follow-up).
75
-
76
- ```javascript
77
- send_input({
78
- id: agentId,
79
- message: `
80
- ## CLARIFICATION ANSWERS
81
- ${answers}
82
-
83
- ## NEXT STEP
84
- Continue with plan generation.
85
- `
86
- })
87
- ```
88
-
89
- ### close_agent
90
- Clean up subagent resources (irreversible).
91
-
92
- ```javascript
93
- close_agent({ id: agentId })
94
- ```
95
-
96
- ---
97
-
98
- ## Output Artifacts
99
-
100
- ### Single Source of Truth
101
-
102
- | Artifact | Purpose | Consumer |
103
- |----------|---------|----------|
104
- | `roadmap.md` | ⭐ Human-readable strategic roadmap with all context | Human review, csv-wave-pipeline handoff |
105
- | `.workflow/issues/issues.jsonl` | Global issue store (appended) | csv-wave-pipeline, issue commands |
106
-
107
- ### Why No Separate JSON Files?
108
-
109
- | Original File | Why Removed | Where Content Goes |
110
- |---------------|-------------|-------------------|
111
- | `strategy-assessment.json` | Duplicates roadmap.md content | Embedded in `roadmap.md` Strategy Assessment section |
112
- | `exploration-codebase.json` | Single-use intermediate | Embedded in `roadmap.md` Codebase Context appendix |
113
-
114
- ---
115
-
116
- ## Overview
117
-
118
- Strategic requirement roadmap with **iterative decomposition**. Creates a single `roadmap.md` that evolves through discussion, with issues persisted to global `issues.jsonl` for execution.
119
-
120
- **Core workflow**: Understand → Decompose → Iterate → Validate → Handoff
121
-
122
- ```
123
- ┌─────────────────────────────────────────────────────────────────────────┐
124
- │ ROADMAP ITERATIVE WORKFLOW │
125
- ├─────────────────────────────────────────────────────────────────────────┤
126
- │ │
127
- │ Phase 1: Requirement Understanding & Strategy │
128
- │ ├─ Parse requirement: goal / constraints / stakeholders │
129
- │ ├─ Assess uncertainty level → recommend mode │
130
- │ ├─ User confirms strategy (-m skips, -y auto-selects) │
131
- │ └─ Initialize roadmap.md with Strategy Assessment │
132
- │ │
133
- │ Phase 2: Decomposition & Issue Creation │
134
- │ ├─ cli-roadmap-plan-agent executes decomposition │
135
- │ ├─ Progressive: 2-4 layers (MVP→Optimized) with convergence │
136
- │ ├─ Direct: Topological task sequence with convergence │
137
- │ ├─ Create issues via ccw issue create → issues.jsonl │
138
- │ └─ Update roadmap.md with Roadmap table + Issue references │
139
- │ │
140
- │ Phase 3: Iterative Refinement (Multi-Round) │
141
- │ ├─ Present roadmap to user │
142
- │ ├─ Feedback: Approve | Adjust Scope | Modify Convergence | Replan │
143
- │ ├─ Update roadmap.md with each round │
144
- │ └─ Repeat until approved (max 5 rounds) │
145
- │ │
146
- │ Phase 4: Handoff (PLANNING ENDS HERE) │
147
- │ ├─ Final roadmap.md with Issue ID references │
148
- │ ├─ Options: view issues | done (show next-step commands) │
149
- │ └─ Issues ready in .workflow/issues/issues.jsonl │
150
- │ │
151
- └─────────────────────────────────────────────────────────────────────────┘
152
- ```
153
-
154
- ---
155
-
156
- ## Dual Modes
157
-
158
- | Mode | Strategy | Best For | Decomposition |
159
- |------|----------|----------|---------------|
160
- | **Progressive** | MVP → Usable → Refined → Optimized | High uncertainty, need validation | 2-4 layers, each with full convergence |
161
- | **Direct** | Topological task sequence | Clear requirements, confirmed tech | Tasks with explicit inputs/outputs |
162
-
163
- **Auto-selection logic**:
164
- - ≥3 high uncertainty factors → Progressive
165
- - ≥3 low uncertainty factors → Direct
166
- - Otherwise → Ask user preference
167
-
168
- ---
169
-
170
- ## Output Structure
171
-
172
- ```
173
- .workflow/.roadmap/RMAP-{slug}-{date}/
174
- └── roadmap.md # ⭐ Single source of truth
175
- # - Strategy Assessment (embedded)
176
- # - Roadmap Table
177
- # - Convergence Criteria per Issue
178
- # - Codebase Context (appendix, if applicable)
179
- # - Iteration History
180
-
181
- .workflow/issues/issues.jsonl # Global issue store (appended)
182
- # - One JSON object per line
183
- # - Consumed by csv-wave-pipeline, issue commands
184
- ```
185
-
186
- ---
187
-
188
- ## roadmap.md Template
189
-
190
- ```markdown
191
- # Requirement Roadmap
192
-
193
- **Session**: RMAP-{slug}-{date}
194
- **Requirement**: {requirement}
195
- **Strategy**: {progressive|direct}
196
- **Status**: {Planning|Refining|Ready}
197
- **Created**: {timestamp}
198
-
199
- ---
200
-
201
- ## Strategy Assessment
202
-
203
- - **Uncertainty Level**: {high|medium|low}
204
- - **Decomposition Mode**: {progressive|direct}
205
- - **Assessment Basis**: {factors summary}
206
- - **Goal**: {extracted goal}
207
- - **Constraints**: {extracted constraints}
208
- - **Stakeholders**: {extracted stakeholders}
209
-
210
- ---
211
-
212
- ## Roadmap
213
-
214
- ### Progressive Mode
215
- | Wave | Issue ID | Layer | Goal | Priority | Dependencies |
216
- |------|----------|-------|------|----------|--------------|
217
- | 1 | ISS-xxx | MVP | ... | 2 | - |
218
- | 2 | ISS-yyy | Usable | ... | 3 | ISS-xxx |
219
-
220
- ### Direct Mode
221
- | Wave | Issue ID | Title | Type | Dependencies |
222
- |------|----------|-------|------|--------------|
223
- | 1 | ISS-xxx | ... | infrastructure | - |
224
- | 2 | ISS-yyy | ... | feature | ISS-xxx |
225
-
226
- ---
227
-
228
- ## Convergence Criteria
229
-
230
- ### ISS-xxx: {Issue Title}
231
- - **Criteria**: [testable conditions]
232
- - **Verification**: [executable steps/commands]
233
- - **Definition of Done**: [business language, non-technical]
234
-
235
- ### ISS-yyy: {Issue Title}
236
- ...
237
-
238
- ---
239
-
240
- ## Risks
241
-
242
- | Risk | Severity | Mitigation |
243
- |------|----------|------------|
244
- | ... | ... | ... |
245
-
246
- ---
247
-
248
- ## Iteration History
249
-
250
- ### Round 1 - {timestamp}
251
- **User Feedback**: {feedback summary}
252
- **Changes Made**: {adjustments}
253
- **Status**: {approved|continue iteration}
254
-
255
- ---
256
-
257
- ## Codebase Context (Optional)
258
-
259
- *Included when codebase exploration was performed*
260
-
261
- - **Relevant Modules**: [...]
262
- - **Existing Patterns**: [...]
263
- - **Integration Points**: [...]
264
- ```
265
-
266
- ---
267
-
268
- ## Issues JSONL Specification
269
-
270
- ### Location & Format
271
-
272
- ```
273
- Path: .workflow/issues/issues.jsonl
274
- Format: JSONL (one complete JSON object per line)
275
- Encoding: UTF-8
276
- Mode: Append-only (new issues appended to end)
277
- ```
278
-
279
- ### Record Schema
280
-
281
- ```json
282
- {
283
- "id": "ISS-YYYYMMDD-NNN",
284
- "title": "[LayerName] goal or [TaskType] title",
285
- "status": "pending",
286
- "priority": 2,
287
- "context": "Markdown with goal, scope, convergence, verification, DoD",
288
- "source": "text",
289
- "tags": ["roadmap", "progressive|direct", "wave-N", "layer-name"],
290
- "extended_context": {
291
- "notes": {
292
- "session": "RMAP-{slug}-{date}",
293
- "strategy": "progressive|direct",
294
- "wave": 1,
295
- "depends_on_issues": []
296
- }
297
- },
298
- "lifecycle_requirements": {
299
- "test_strategy": "unit",
300
- "regression_scope": "affected",
301
- "acceptance_type": "automated",
302
- "commit_strategy": "per-issue"
303
- }
304
- }
305
- ```
306
-
307
- ### Query Interface
308
-
309
- ```bash
310
- # By ID (detail view)
311
- ccw issue list ISS-20260227-001
312
-
313
- # List all with status filter
314
- ccw issue list --status planned,queued
315
- ccw issue list --brief # JSON minimal output
316
-
317
- # Queue operations (wave-based execution)
318
- ccw issue queue list # List all queues
319
- ccw issue queue dag # Get dependency graph (JSON)
320
- ccw issue next --queue <queue-id> # Get next task
321
-
322
- # Execute
323
- ccw issue queue add <issue-id> # Add to active queue
324
- ccw issue done <item-id> # Mark completed
325
- ```
326
-
327
- > **Note**: Issues are tagged with `wave-N` in `tags[]` field for filtering. Use `--brief` for programmatic parsing.
328
-
329
- ---
330
-
331
- ## Implementation
332
-
333
- ### Session Initialization
334
-
335
- ```javascript
336
- const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
337
-
338
- // Parse flags
339
- const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
340
- const continueMode = $ARGUMENTS.includes('--continue') || $ARGUMENTS.includes('-c')
341
- const modeMatch = $ARGUMENTS.match(/(?:--mode|-m)\s+(progressive|direct|auto)/)
342
- const requestedMode = modeMatch ? modeMatch[1] : 'auto'
343
-
344
- // Clean requirement text (remove flags)
345
- const requirement = $ARGUMENTS
346
- .replace(/--yes|-y|--continue|-c|--mode\s+\w+|-m\s+\w+/g, '')
347
- .trim()
348
-
349
- const slug = requirement.toLowerCase()
350
- .replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-')
351
- .substring(0, 40)
352
- const dateStr = getUtc8ISOString().substring(0, 10)
353
- const sessionId = `RMAP-${slug}-${dateStr}`
354
- const sessionFolder = `.workflow/.roadmap/${sessionId}`
355
-
356
- // Auto-detect continue mode
357
- if (continueMode || file_exists(`${sessionFolder}/roadmap.md`)) {
358
- // Resume existing session
359
- const existingRoadmap = Read(`${sessionFolder}/roadmap.md`)
360
- // Extract current phase and continue from there
361
- }
362
-
363
- Bash(`mkdir -p ${sessionFolder}`)
364
- ```
365
-
366
- ---
367
-
368
- ### Phase 1: Requirement Understanding & Strategy
369
-
370
- **Objective**: Parse requirement, assess uncertainty, select decomposition strategy, initialize roadmap.md.
371
-
372
- **Steps**:
373
-
374
- 1. **Parse Requirement**
375
- - Extract: goal, constraints, stakeholders, keywords
376
-
377
- 2. **Assess Uncertainty**
378
- ```javascript
379
- const uncertaintyFactors = {
380
- scope_clarity: 'low|medium|high',
381
- technical_risk: 'low|medium|high',
382
- dependency_unknown: 'low|medium|high',
383
- domain_familiarity: 'low|medium|high',
384
- requirement_stability: 'low|medium|high'
385
- }
386
-
387
- // Calculate recommendation
388
- const highCount = Object.values(uncertaintyFactors).filter(v => v === 'high').length
389
- const lowCount = Object.values(uncertaintyFactors).filter(v => v === 'low').length
390
-
391
- let recommendedMode
392
- if (highCount >= 3) recommendedMode = 'progressive'
393
- else if (lowCount >= 3) recommendedMode = 'direct'
394
- else recommendedMode = 'progressive' // default safer choice
395
- ```
396
-
397
- 3. **Strategy Selection** (skip if `-m` specified or AUTO_YES)
398
- ```javascript
399
- let selectedMode
400
-
401
- if (requestedMode !== 'auto') {
402
- selectedMode = requestedMode
403
- } else if (AUTO_YES) {
404
- selectedMode = recommendedMode
405
- } else {
406
- const answer = request_user_input({
407
- questions: [{
408
- header: "Strategy",
409
- id: "strategy",
410
- question: `Decomposition strategy:\nUncertainty: ${uncertaintyLevel}\nRecommended: ${recommendedMode}`,
411
- options: [
412
- { label: recommendedMode === 'progressive' ? "Progressive (Recommended)" : "Progressive" },
413
- { label: recommendedMode === 'direct' ? "Direct (Recommended)" : "Direct" }
414
- ]
415
- }]
416
- }) // BLOCKS (wait for user response)
417
-
418
- selectedMode = answer.answers.strategy.answers[0]
419
- }
420
- ```
421
-
422
- 4. **Initialize roadmap.md**
423
- ```javascript
424
- const roadmapContent = `# Requirement Roadmap
425
-
426
- **Session**: ${sessionId}
427
- **Requirement**: ${requirement}
428
- **Strategy**: ${selectedMode}
429
- **Status**: Planning
430
- **Created**: ${getUtc8ISOString()}
431
-
432
- ---
433
-
434
- ## Strategy Assessment
435
-
436
- - **Uncertainty Level**: ${uncertaintyLevel}
437
- - **Decomposition Mode**: ${selectedMode}
438
- - **Assessment Basis**: ${factorsSummary}
439
- - **Goal**: ${extractedGoal}
440
- - **Constraints**: ${extractedConstraints}
441
- - **Stakeholders**: ${extractedStakeholders}
442
-
443
- ---
444
-
445
- ## Roadmap
446
-
447
- > To be populated after Phase 2 decomposition
448
-
449
- ---
450
-
451
- ## Convergence Criteria Details
452
-
453
- > To be populated after Phase 2 decomposition
454
-
455
- ---
456
-
457
- ## Risks
458
-
459
- > To be populated after Phase 2 decomposition
460
-
461
- ---
462
-
463
- ## Iteration History
464
-
465
- > To be populated during Phase 3 refinement
466
-
467
- ---
468
-
469
- ## Codebase Context (Optional)
470
-
471
- > To be populated if codebase exploration was performed
472
- `
473
-
474
- Write(`${sessionFolder}/roadmap.md`, roadmapContent)
475
- ```
476
-
477
- **Success Criteria**:
478
- - roadmap.md created with Strategy Assessment
479
- - Strategy selected (progressive or direct)
480
- - Uncertainty factors documented
481
-
482
- ---
483
-
484
- ### Phase 2: Decomposition & Issue Creation
485
-
486
- **Objective**: Execute decomposition via `cli-roadmap-plan-agent`, create issues, update roadmap.md.
487
-
488
- **Steps**:
489
-
490
- 1. **Optional Codebase Exploration** (if codebase detected)
491
- ```javascript
492
- const hasCodebase = Bash(`
493
- test -f package.json && echo "nodejs" ||
494
- test -f go.mod && echo "golang" ||
495
- test -f Cargo.toml && echo "rust" ||
496
- test -f pyproject.toml && echo "python" ||
497
- test -d src && echo "generic" ||
498
- echo "none"
499
- `).trim()
500
-
501
- let codebaseContext = null
502
-
503
- if (hasCodebase !== 'none') {
504
- const exploreAgentId = spawn_agent({
505
- agent_type: "cli_explore_agent",
506
- message: `
507
- ## TASK ASSIGNMENT
508
-
509
- ### MANDATORY FIRST STEPS (Agent Execute)
510
- 1. Read: .workflow/project-tech.json
511
- 2. Read: .workflow/project-guidelines.json
512
-
513
- ---
514
-
515
- ## Exploration Context
516
- - **Requirement**: ${requirement}
517
- - **Strategy**: ${selectedMode}
518
- - **Project Type**: ${hasCodebase}
519
- - **Session**: ${sessionFolder}
520
-
521
- ## Exploration Focus
522
- - Identify modules/components related to the requirement
523
- - Find existing patterns that should be followed
524
- - Locate integration points for new functionality
525
- - Assess current architecture constraints
526
-
527
- ## Output
528
- Return findings as JSON with schema:
529
- {
530
- "project_type": "${hasCodebase}",
531
- "relevant_modules": [{name, path, relevance}],
532
- "existing_patterns": [{pattern, files, description}],
533
- "integration_points": [{location, description, risk}],
534
- "architecture_constraints": [string],
535
- "tech_stack": {languages, frameworks, tools}
536
- }
537
- `
538
- })
539
-
540
- const exploreResult = wait({
541
- ids: [exploreAgentId],
542
- timeout_ms: 120000
543
- })
544
-
545
- close_agent({ id: exploreAgentId })
546
-
547
- if (exploreResult.status[exploreAgentId].completed) {
548
- codebaseContext = exploreResult.status[exploreAgentId].completed
549
- }
550
- }
551
- ```
552
-
553
- 2. **Execute Decomposition Agent**
554
- ```javascript
555
- const decompositionAgentId = spawn_agent({
556
- agent_type: "cli_roadmap_plan_agent",
557
- message: `
558
- ## TASK ASSIGNMENT
559
-
560
- ### MANDATORY FIRST STEPS (Agent Execute)
561
- 1. Read: .workflow/project-tech.json
562
- 2. Read: .workflow/project-guidelines.json
563
-
564
- ---
565
-
566
- ## Roadmap Decomposition Task
567
-
568
- ### Input Context
569
- - **Requirement**: ${requirement}
570
- - **Selected Mode**: ${selectedMode}
571
- - **Session ID**: ${sessionId}
572
- - **Session Folder**: ${sessionFolder}
573
-
574
- ### Strategy Assessment
575
- ${JSON.stringify(strategyAssessment, null, 2)}
576
-
577
- ### Codebase Context
578
- ${codebaseContext
579
- ? JSON.stringify(codebaseContext, null, 2)
580
- : 'No codebase detected - pure requirement decomposition'}
581
-
582
- ---
583
-
584
- ### Mode-Specific Requirements
585
-
586
- ${selectedMode === 'progressive' ? `**Progressive Mode**:
587
- - 2-4 layers from MVP to full implementation
588
- - Each layer: id (L0-L3), name, goal, scope, excludes, convergence, risks, effort, depends_on
589
- - L0 (MVP) must be a self-contained closed loop with no dependencies
590
- - Scope: each feature belongs to exactly ONE layer (no overlap)
591
- - Layer names: MVP / Usable / Refined / Optimized` :
592
-
593
- `**Direct Mode**:
594
- - Topologically-sorted task sequence
595
- - Each task: id (T1-Tn), title, type, scope, inputs, outputs, convergence, depends_on, parallel_group
596
- - Inputs must come from preceding task outputs or existing resources
597
- - Tasks in same parallel_group must be truly independent`}
598
-
599
- ---
600
-
601
- ### Convergence Quality Requirements
602
- - criteria[]: MUST be testable (can write assertions or manual verification steps)
603
- - verification: MUST be executable (command, script, or explicit steps)
604
- - definition_of_done: MUST use business language (non-technical person can judge)
605
-
606
- ---
607
-
608
- ### Expected Output
609
- 1. **Update ${sessionFolder}/roadmap.md** with Roadmap table + Convergence sections
610
- 2. **Create issues via ccw issue create** - append to .workflow/issues/issues.jsonl
611
-
612
- ### Issue Format (for ccw issue create)
613
- - id: ISS-YYYYMMDD-NNN (auto-generated)
614
- - title: [LayerName] goal or [TaskType] title
615
- - context: Markdown with goal, scope, convergence criteria, verification, DoD
616
- - priority: small→4, medium→3, large→2
617
- - tags: ["roadmap", mode, wave-N, layer-name]
618
- - extended_context.notes: {session, strategy, wave, depends_on_issues}
619
-
620
- ### Execution Steps
621
- 1. Analyze requirement and build decomposition context
622
- 2. Execute decomposition (internal reasoning)
623
- 3. Validate records, check convergence quality
624
- 4. For each decomposed item:
625
- - Run: ccw issue create --title "..." --context "..." --tags "..." --priority N
626
- - Record returned Issue ID
627
- 5. Update roadmap.md with Issue ID references
628
- 6. Return brief completion summary with Issue IDs
629
- `
630
- })
631
-
632
- const decompositionResult = wait({
633
- ids: [decompositionAgentId],
634
- timeout_ms: 300000 // 5 minutes for complex decomposition
635
- })
636
-
637
- close_agent({ id: decompositionAgentId })
638
-
639
- if (!decompositionResult.status[decompositionAgentId].completed) {
640
- throw new Error('Decomposition agent failed to complete')
641
- }
642
-
643
- const issueIds = decompositionResult.status[decompositionAgentId].completed.issueIds || []
644
- ```
645
-
646
- **Success Criteria**:
647
- - Issues created in `.workflow/issues/issues.jsonl`
648
- - roadmap.md updated with Issue references
649
- - No circular dependencies
650
- - Convergence criteria testable
651
-
652
- ---
653
-
654
- ### Phase 3: Iterative Refinement
655
-
656
- **Objective**: Multi-round user feedback to refine roadmap.
657
-
658
- **Steps**:
659
-
660
- 1. **Display Current Roadmap**
661
- - Read and display Roadmap table + key Convergence criteria
662
- - Show issue count and wave breakdown
663
-
664
- 2. **Feedback Loop** (skip if AUTO_YES)
665
- ```javascript
666
- let round = 0
667
- let approved = false
668
-
669
- while (!approved && round < 5) {
670
- round++
671
-
672
- const feedback = request_user_input({
673
- questions: [{
674
- header: "Validate",
675
- id: "feedback",
676
- question: `Roadmap validation (round ${round}):\n${issueIds.length} issues across ${waveCount} waves. Feedback?`,
677
- options: [
678
- { label: "Approve", description: "Proceed to handoff" },
679
- { label: "Adjust Scope", description: "Modify issue scopes" },
680
- { label: "Modify Convergence", description: "Refine criteria/verification" },
681
- { label: "Re-decompose", description: "Change strategy/layering" }
682
- ]
683
- }]
684
- }) // BLOCKS (wait for user response)
685
-
686
- const feedbackChoice = feedback.answers.feedback.answers[0]
687
- if (feedbackChoice === 'Approve') {
688
- approved = true
689
- } else {
690
- // CONSTRAINT: All modifications below ONLY touch roadmap.md and issues.jsonl
691
- // NEVER modify source code or project files during interactive rounds
692
- switch (feedbackChoice) {
693
- case 'Adjust Scope':
694
- // Collect scope adjustments
695
- const scopeAdjustments = request_user_input({
696
- questions: [{
697
- header: "Scope",
698
- id: "adjustments",
699
- question: "Describe scope adjustments needed:"
700
- }]
701
- }) // BLOCKS
702
-
703
- // Update ONLY roadmap.md Roadmap table + Convergence sections
704
- Edit({ path: `${sessionFolder}/roadmap.md`, /* scope changes */ })
705
- // Update ONLY issues.jsonl entries (scope/context fields)
706
-
707
- break
708
-
709
- case 'Modify Convergence':
710
- // Collect convergence refinements
711
- const convergenceRefinements = request_user_input({
712
- questions: [{
713
- header: "Convergence",
714
- id: "refinements",
715
- question: "Describe convergence refinements needed:"
716
- }]
717
- }) // BLOCKS
718
-
719
- // Update ONLY roadmap.md Convergence Criteria section
720
- Edit({ path: `${sessionFolder}/roadmap.md`, /* convergence changes */ })
721
-
722
- break
723
-
724
- case 'Re-decompose':
725
- // Return to Phase 2 with new strategy
726
- const newStrategy = request_user_input({
727
- questions: [{
728
- header: "Strategy",
729
- id: "strategy",
730
- question: "Select new decomposition strategy:",
731
- options: [
732
- { label: "Progressive" },
733
- { label: "Direct" }
734
- ]
735
- }]
736
- }) // BLOCKS
737
-
738
- selectedMode = newStrategy.answers.strategy.answers[0]
739
- // Re-execute Phase 2 (updates roadmap.md + issues.jsonl only)
740
- break
741
- }
742
-
743
- // Update Iteration History in roadmap.md
744
- const iterationEntry = `
745
- ### Round ${round} - ${getUtc8ISOString()}
746
- **User Feedback**: ${feedback.feedback}
747
- **Changes Made**: ${changesMade}
748
- **Status**: continue iteration
749
- `
750
- Edit({
751
- path: `${sessionFolder}/roadmap.md`,
752
- old_string: "## Iteration History\n\n> To be populated during Phase 3 refinement",
753
- new_string: `## Iteration History\n${iterationEntry}`
754
- })
755
- }
756
- }
757
- ```
758
-
759
- 3. **Finalize Iteration History**
760
- ```javascript
761
- // Update final status in roadmap.md
762
- Edit({
763
- path: `${sessionFolder}/roadmap.md`,
764
- old_string: "**Status**: Planning",
765
- new_string: "**Status**: Ready"
766
- })
767
- ```
768
-
769
- **Success Criteria**:
770
- - User approved OR max rounds reached
771
- - All changes recorded in Iteration History
772
- - roadmap.md reflects final state
773
-
774
- ---
775
-
776
- ### Phase 4: Handoff
777
-
778
- **Objective**: Present final roadmap, offer execution options.
779
-
780
- **Steps**:
781
-
782
- 1. **Display Summary**
783
- ```markdown
784
- ## Roadmap Complete
785
-
786
- - **Session**: RMAP-{slug}-{date}
787
- - **Strategy**: {progressive|direct}
788
- - **Issues Created**: {count} across {waves} waves
789
- - **Roadmap**: .workflow/.roadmap/RMAP-{slug}-{date}/roadmap.md
790
-
791
- | Wave | Issue Count | Layer/Type |
792
- |------|-------------|------------|
793
- | 1 | 2 | MVP / infrastructure |
794
- | 2 | 3 | Usable / feature |
795
- ```
796
-
797
- 2. **Offer Options** (skip if AUTO_YES)
798
- ```javascript
799
- let nextStep
800
-
801
- if (AUTO_YES) {
802
- nextStep = "done" // Default to done in auto mode
803
- } else {
804
- const answer = request_user_input({
805
- questions: [{
806
- header: "Next Step",
807
- id: "next_step",
808
- question: `${issueIds.length} issues ready. Next step:`,
809
- options: [
810
- { label: "View issues", description: "Display issue details" },
811
- { label: "Done", description: "Planning complete — show next-step commands" }
812
- ]
813
- }]
814
- }) // BLOCKS (wait for user response)
815
-
816
- nextStep = answer.answers.next_step.answers[0]
817
- }
818
- ```
819
-
820
- 3. **Execute Selection**
821
- ```javascript
822
- switch (nextStep) {
823
- case 'view':
824
- // Display issues from issues.jsonl
825
- Bash(`ccw issue list --session ${sessionId}`)
826
- // Fall through to show next-step commands
827
- // STOP — do not execute anything
828
-
829
- case 'done':
830
- // Output paths and end — this skill is planning-only
831
- console.log([
832
- `Roadmap saved: ${sessionFolder}/roadmap.md`,
833
- `Issues created: ${issueIds.length}`,
834
- '',
835
- 'Planning complete. To execute, run:',
836
- ` $csv-wave-pipeline "${requirement}"`,
837
- ` ccw issue list --session ${sessionId}`
838
- ].join('\n'))
839
- return // STOP — this skill is planning-only, NEVER proceed to execution
840
- }
841
- ```
842
-
843
- **Success Criteria**:
844
- - User selection executed
845
- - Session complete
846
- - All artifacts accessible
847
-
848
- ---
849
-
850
- ## Error Handling
851
-
852
- | Error | Resolution |
853
- |-------|------------|
854
- | cli-explore-agent fails | Skip code exploration, proceed with pure requirement decomposition |
855
- | cli-roadmap-plan-agent fails | Retry once, fallback to manual decomposition prompt |
856
- | No codebase | Normal flow, skip exploration step |
857
- | Circular dependency detected | Prompt user, re-decompose |
858
- | User timeout in feedback loop | Save roadmap.md, show `--continue` command |
859
- | Max rounds reached | Force proceed with current roadmap |
860
- | Session folder conflict | Append timestamp suffix |
861
-
862
- ---
863
-
864
- ## Core Rules
865
-
866
- 1. **Start Immediately**: First action is session initialization, then Phase 1 execution
867
- 2. **Single Source**: All context embedded in roadmap.md, no separate JSON files
868
- 3. **Iterate on Roadmap**: Use feedback rounds to refine, not recreate
869
- 4. **Testable Convergence**: criteria = assertions, DoD = business language
870
- 5. **Explicit Lifecycle**: Always close_agent after wait completes to free resources
871
- 6. **Planning-Only Skill**: This skill ONLY produces roadmap and issues. It NEVER executes code, creates source files, or runs implementation. All code changes happen via separate execution skills after user manually triggers them
872
- 7. **Plan-Only Modifications**: Interactive feedback (Phase 3) MUST only update `roadmap.md` and `issues.jsonl`. NEVER modify source code, configuration files, or any project files during any phase. Code changes happen only after handoff when user manually runs `$csv-wave-pipeline` or other execution skills
873
- 8. **MANDATORY CONFIRMATION GATE**: After Phase 2 decomposition completes, you MUST present the roadmap to the user and wait for confirmation (Phase 3) before proceeding to handoff. NEVER skip Phase 3 user validation
874
-
875
- ---
876
-
877
- ## Best Practices
878
-
879
- 1. **Clear Requirements**: Detailed description → better decomposition
880
- 2. **Iterate on Roadmap**: Use feedback rounds to refine convergence criteria
881
- 3. **Testable Convergence**: criteria = assertions, DoD = business language
882
- 4. **Use Continue Mode**: Resume to iterate on existing roadmap
883
- 5. **Wave Execution**: Start with wave-1 (MVP) to validate before full execution
884
-
885
- ---
886
-
887
- ## Usage Recommendations
888
-
889
- **When to Use Roadmap vs Other Skills:**
890
-
891
- | Scenario | Recommended Skill |
892
- |----------|------------------|
893
- | Strategic planning, need issue tracking | `$roadmap-with-file` |
894
- | Quick task breakdown, immediate execution | `$lite-plan` |
895
- | Collaborative multi-agent planning | `$collaborative-plan-with-file` |
896
- | Full specification documents | `$spec-generator` |
897
- | Code implementation from existing plan | `$workflow-lite-plan` |
898
-
899
- ---
900
-
901
- **Now plan roadmap for**: $ARGUMENTS
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).
4
+ argument-hint: "[-y|--yes] [-c|--continue] [-m progressive|direct|auto] \"requirement description\""
5
+ ---
6
+
7
+ ## Auto Mode
8
+
9
+ When `--yes` or `-y`: Auto-confirm strategy selection, use recommended mode, skip interactive refinement rounds. **This skill is planning-only — it NEVER executes code or modifies source files. Output is the roadmap + issues for user review.**
10
+
11
+ # Roadmap-with-file Skill
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ $roadmap-with-file "Implement user authentication system with OAuth and 2FA"
17
+ $roadmap-with-file -m progressive "Build real-time notification system"
18
+ $roadmap-with-file -m direct "Refactor payment module"
19
+ $roadmap-with-file -m auto "Add data export feature"
20
+ $roadmap-with-file --continue "auth system"
21
+ $roadmap-with-file -y "Implement caching layer"
22
+ ```
23
+
24
+ **Flags**:
25
+ - `-y, --yes`: Skip all confirmations (auto mode)
26
+ - `-c, --continue`: Continue existing session
27
+ - `-m, --mode`: Strategy selection (progressive / direct / auto)
28
+
29
+ **Context Source**: cli-explore-agent (optional) + requirement analysis
30
+ **Output Directory**: `.workflow/.roadmap/{session-id}/`
31
+ **Core Output**: `roadmap.md` (single source, human-readable) + `issues.jsonl` (global, machine-executable)
32
+
33
+ ---
34
+
35
+ ## Subagent API Reference
36
+
37
+ ### spawn_agent
38
+ Create a new subagent with task assignment.
39
+
40
+ ```javascript
41
+ const agentId = spawn_agent({
42
+ agent_type: "{agent_type}",
43
+ message: `
44
+ ## TASK ASSIGNMENT
45
+
46
+ ### MANDATORY FIRST STEPS (Agent Execute)
47
+ 1. Read: .workflow/project-tech.json
48
+ 2. Read: .workflow/project-guidelines.json
49
+
50
+ ## TASK CONTEXT
51
+ ${taskContext}
52
+
53
+ ## DELIVERABLES
54
+ ${deliverables}
55
+ `
56
+ })
57
+ ```
58
+
59
+ ### wait
60
+ Get results from subagent (only way to retrieve results).
61
+
62
+ ```javascript
63
+ const result = wait({
64
+ ids: [agentId],
65
+ timeout_ms: 600000 // 10 minutes
66
+ })
67
+
68
+ if (result.timed_out) {
69
+ // Handle timeout - can continue waiting or send_input to prompt completion
70
+ }
71
+ ```
72
+
73
+ ### send_input
74
+ Continue interaction with active subagent (for clarification or follow-up).
75
+
76
+ ```javascript
77
+ send_input({
78
+ id: agentId,
79
+ message: `
80
+ ## CLARIFICATION ANSWERS
81
+ ${answers}
82
+
83
+ ## NEXT STEP
84
+ Continue with plan generation.
85
+ `
86
+ })
87
+ ```
88
+
89
+ ### close_agent
90
+ Clean up subagent resources (irreversible).
91
+
92
+ ```javascript
93
+ close_agent({ id: agentId })
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Output Artifacts
99
+
100
+ ### Single Source of Truth
101
+
102
+ | Artifact | Purpose | Consumer |
103
+ |----------|---------|----------|
104
+ | `roadmap.md` | ⭐ Human-readable strategic roadmap with all context | Human review, csv-wave-pipeline handoff |
105
+ | `.workflow/issues/issues.jsonl` | Global issue store (appended) | csv-wave-pipeline, issue commands |
106
+
107
+ ### Why No Separate JSON Files?
108
+
109
+ | Original File | Why Removed | Where Content Goes |
110
+ |---------------|-------------|-------------------|
111
+ | `strategy-assessment.json` | Duplicates roadmap.md content | Embedded in `roadmap.md` Strategy Assessment section |
112
+ | `exploration-codebase.json` | Single-use intermediate | Embedded in `roadmap.md` Codebase Context appendix |
113
+
114
+ ---
115
+
116
+ ## Overview
117
+
118
+ Strategic requirement roadmap with **iterative decomposition**. Creates a single `roadmap.md` that evolves through discussion, with issues persisted to global `issues.jsonl` for execution.
119
+
120
+ **Core workflow**: Understand → Decompose → Iterate → Validate → Handoff
121
+
122
+ ```
123
+ ┌─────────────────────────────────────────────────────────────────────────┐
124
+ │ ROADMAP ITERATIVE WORKFLOW │
125
+ ├─────────────────────────────────────────────────────────────────────────┤
126
+ │ │
127
+ │ Phase 1: Requirement Understanding & Strategy │
128
+ │ ├─ Parse requirement: goal / constraints / stakeholders │
129
+ │ ├─ Assess uncertainty level → recommend mode │
130
+ │ ├─ User confirms strategy (-m skips, -y auto-selects) │
131
+ │ └─ Initialize roadmap.md with Strategy Assessment │
132
+ │ │
133
+ │ Phase 2: Decomposition & Issue Creation │
134
+ │ ├─ cli-roadmap-plan-agent executes decomposition │
135
+ │ ├─ Progressive: 2-4 layers (MVP→Optimized) with convergence │
136
+ │ ├─ Direct: Topological task sequence with convergence │
137
+ │ ├─ Create issues via ccw issue create → issues.jsonl │
138
+ │ └─ Update roadmap.md with Roadmap table + Issue references │
139
+ │ │
140
+ │ Phase 3: Iterative Refinement (Multi-Round) │
141
+ │ ├─ Present roadmap to user │
142
+ │ ├─ Feedback: Approve | Adjust Scope | Modify Convergence | Replan │
143
+ │ ├─ Update roadmap.md with each round │
144
+ │ └─ Repeat until approved (max 5 rounds) │
145
+ │ │
146
+ │ Phase 4: Handoff (PLANNING ENDS HERE) │
147
+ │ ├─ Final roadmap.md with Issue ID references │
148
+ │ ├─ Options: view issues | done (show next-step commands) │
149
+ │ └─ Issues ready in .workflow/issues/issues.jsonl │
150
+ │ │
151
+ └─────────────────────────────────────────────────────────────────────────┘
152
+ ```
153
+
154
+ ---
155
+
156
+ ## Dual Modes
157
+
158
+ | Mode | Strategy | Best For | Decomposition |
159
+ |------|----------|----------|---------------|
160
+ | **Progressive** | MVP → Usable → Refined → Optimized | High uncertainty, need validation | 2-4 layers, each with full convergence |
161
+ | **Direct** | Topological task sequence | Clear requirements, confirmed tech | Tasks with explicit inputs/outputs |
162
+
163
+ **Auto-selection logic**:
164
+ - ≥3 high uncertainty factors → Progressive
165
+ - ≥3 low uncertainty factors → Direct
166
+ - Otherwise → Ask user preference
167
+
168
+ ---
169
+
170
+ ## Output Structure
171
+
172
+ ```
173
+ .workflow/.roadmap/RMAP-{slug}-{date}/
174
+ └── roadmap.md # ⭐ Single source of truth
175
+ # - Strategy Assessment (embedded)
176
+ # - Roadmap Table
177
+ # - Convergence Criteria per Issue
178
+ # - Codebase Context (appendix, if applicable)
179
+ # - Iteration History
180
+
181
+ .workflow/issues/issues.jsonl # Global issue store (appended)
182
+ # - One JSON object per line
183
+ # - Consumed by csv-wave-pipeline, issue commands
184
+ ```
185
+
186
+ ---
187
+
188
+ ## roadmap.md Template
189
+
190
+ ```markdown
191
+ # Requirement Roadmap
192
+
193
+ **Session**: RMAP-{slug}-{date}
194
+ **Requirement**: {requirement}
195
+ **Strategy**: {progressive|direct}
196
+ **Status**: {Planning|Refining|Ready}
197
+ **Created**: {timestamp}
198
+
199
+ ---
200
+
201
+ ## Strategy Assessment
202
+
203
+ - **Uncertainty Level**: {high|medium|low}
204
+ - **Decomposition Mode**: {progressive|direct}
205
+ - **Assessment Basis**: {factors summary}
206
+ - **Goal**: {extracted goal}
207
+ - **Constraints**: {extracted constraints}
208
+ - **Stakeholders**: {extracted stakeholders}
209
+
210
+ ---
211
+
212
+ ## Roadmap
213
+
214
+ ### Progressive Mode
215
+ | Wave | Issue ID | Layer | Goal | Priority | Dependencies |
216
+ |------|----------|-------|------|----------|--------------|
217
+ | 1 | ISS-xxx | MVP | ... | 2 | - |
218
+ | 2 | ISS-yyy | Usable | ... | 3 | ISS-xxx |
219
+
220
+ ### Direct Mode
221
+ | Wave | Issue ID | Title | Type | Dependencies |
222
+ |------|----------|-------|------|--------------|
223
+ | 1 | ISS-xxx | ... | infrastructure | - |
224
+ | 2 | ISS-yyy | ... | feature | ISS-xxx |
225
+
226
+ ---
227
+
228
+ ## Convergence Criteria
229
+
230
+ ### ISS-xxx: {Issue Title}
231
+ - **Criteria**: [testable conditions]
232
+ - **Verification**: [executable steps/commands]
233
+ - **Definition of Done**: [business language, non-technical]
234
+
235
+ ### ISS-yyy: {Issue Title}
236
+ ...
237
+
238
+ ---
239
+
240
+ ## Risks
241
+
242
+ | Risk | Severity | Mitigation |
243
+ |------|----------|------------|
244
+ | ... | ... | ... |
245
+
246
+ ---
247
+
248
+ ## Iteration History
249
+
250
+ ### Round 1 - {timestamp}
251
+ **User Feedback**: {feedback summary}
252
+ **Changes Made**: {adjustments}
253
+ **Status**: {approved|continue iteration}
254
+
255
+ ---
256
+
257
+ ## Codebase Context (Optional)
258
+
259
+ *Included when codebase exploration was performed*
260
+
261
+ - **Relevant Modules**: [...]
262
+ - **Existing Patterns**: [...]
263
+ - **Integration Points**: [...]
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Issues JSONL Specification
269
+
270
+ ### Location & Format
271
+
272
+ ```
273
+ Path: .workflow/issues/issues.jsonl
274
+ Format: JSONL (one complete JSON object per line)
275
+ Encoding: UTF-8
276
+ Mode: Append-only (new issues appended to end)
277
+ ```
278
+
279
+ ### Record Schema
280
+
281
+ ```json
282
+ {
283
+ "id": "ISS-YYYYMMDD-NNN",
284
+ "title": "[LayerName] goal or [TaskType] title",
285
+ "status": "pending",
286
+ "priority": 2,
287
+ "context": "Markdown with goal, scope, convergence, verification, DoD",
288
+ "source": "text",
289
+ "tags": ["roadmap", "progressive|direct", "wave-N", "layer-name"],
290
+ "extended_context": {
291
+ "notes": {
292
+ "session": "RMAP-{slug}-{date}",
293
+ "strategy": "progressive|direct",
294
+ "wave": 1,
295
+ "depends_on_issues": []
296
+ }
297
+ },
298
+ "lifecycle_requirements": {
299
+ "test_strategy": "unit",
300
+ "regression_scope": "affected",
301
+ "acceptance_type": "automated",
302
+ "commit_strategy": "per-issue"
303
+ }
304
+ }
305
+ ```
306
+
307
+ ### Query Interface
308
+
309
+ ```bash
310
+ # By ID (detail view)
311
+ ccw issue list ISS-20260227-001
312
+
313
+ # List all with status filter
314
+ ccw issue list --status planned,queued
315
+ ccw issue list --brief # JSON minimal output
316
+
317
+ # Queue operations (wave-based execution)
318
+ ccw issue queue list # List all queues
319
+ ccw issue queue dag # Get dependency graph (JSON)
320
+ ccw issue next --queue <queue-id> # Get next task
321
+
322
+ # Execute
323
+ ccw issue queue add <issue-id> # Add to active queue
324
+ ccw issue done <item-id> # Mark completed
325
+ ```
326
+
327
+ > **Note**: Issues are tagged with `wave-N` in `tags[]` field for filtering. Use `--brief` for programmatic parsing.
328
+
329
+ ---
330
+
331
+ ## Implementation
332
+
333
+ ### Session Initialization
334
+
335
+ ```javascript
336
+ const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
337
+
338
+ // Parse flags
339
+ const AUTO_YES = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
340
+ const continueMode = $ARGUMENTS.includes('--continue') || $ARGUMENTS.includes('-c')
341
+ const modeMatch = $ARGUMENTS.match(/(?:--mode|-m)\s+(progressive|direct|auto)/)
342
+ const requestedMode = modeMatch ? modeMatch[1] : 'auto'
343
+
344
+ // Clean requirement text (remove flags)
345
+ const requirement = $ARGUMENTS
346
+ .replace(/--yes|-y|--continue|-c|--mode\s+\w+|-m\s+\w+/g, '')
347
+ .trim()
348
+
349
+ const slug = requirement.toLowerCase()
350
+ .replace(/[^a-z0-9\u4e00-\u9fa5]+/g, '-')
351
+ .substring(0, 40)
352
+ const dateStr = getUtc8ISOString().substring(0, 10)
353
+ const sessionId = `RMAP-${slug}-${dateStr}`
354
+ const sessionFolder = `.workflow/.roadmap/${sessionId}`
355
+
356
+ // Auto-detect continue mode
357
+ if (continueMode || file_exists(`${sessionFolder}/roadmap.md`)) {
358
+ // Resume existing session
359
+ const existingRoadmap = Read(`${sessionFolder}/roadmap.md`)
360
+ // Extract current phase and continue from there
361
+ }
362
+
363
+ Bash(`mkdir -p ${sessionFolder}`)
364
+ ```
365
+
366
+ ---
367
+
368
+ ### Phase 1: Requirement Understanding & Strategy
369
+
370
+ **Objective**: Parse requirement, assess uncertainty, select decomposition strategy, initialize roadmap.md.
371
+
372
+ **Steps**:
373
+
374
+ 1. **Parse Requirement**
375
+ - Extract: goal, constraints, stakeholders, keywords
376
+
377
+ 2. **Assess Uncertainty**
378
+ ```javascript
379
+ const uncertaintyFactors = {
380
+ scope_clarity: 'low|medium|high',
381
+ technical_risk: 'low|medium|high',
382
+ dependency_unknown: 'low|medium|high',
383
+ domain_familiarity: 'low|medium|high',
384
+ requirement_stability: 'low|medium|high'
385
+ }
386
+
387
+ // Calculate recommendation
388
+ const highCount = Object.values(uncertaintyFactors).filter(v => v === 'high').length
389
+ const lowCount = Object.values(uncertaintyFactors).filter(v => v === 'low').length
390
+
391
+ let recommendedMode
392
+ if (highCount >= 3) recommendedMode = 'progressive'
393
+ else if (lowCount >= 3) recommendedMode = 'direct'
394
+ else recommendedMode = 'progressive' // default safer choice
395
+ ```
396
+
397
+ 3. **Strategy Selection** (skip if `-m` specified or AUTO_YES)
398
+ ```javascript
399
+ let selectedMode
400
+
401
+ if (requestedMode !== 'auto') {
402
+ selectedMode = requestedMode
403
+ } else if (AUTO_YES) {
404
+ selectedMode = recommendedMode
405
+ } else {
406
+ const answer = request_user_input({
407
+ questions: [{
408
+ header: "Strategy",
409
+ id: "strategy",
410
+ question: `Decomposition strategy:\nUncertainty: ${uncertaintyLevel}\nRecommended: ${recommendedMode}`,
411
+ options: [
412
+ { label: recommendedMode === 'progressive' ? "Progressive (Recommended)" : "Progressive" },
413
+ { label: recommendedMode === 'direct' ? "Direct (Recommended)" : "Direct" }
414
+ ]
415
+ }]
416
+ }) // BLOCKS (wait for user response)
417
+
418
+ selectedMode = answer.answers.strategy.answers[0]
419
+ }
420
+ ```
421
+
422
+ 4. **Initialize roadmap.md**
423
+ ```javascript
424
+ const roadmapContent = `# Requirement Roadmap
425
+
426
+ **Session**: ${sessionId}
427
+ **Requirement**: ${requirement}
428
+ **Strategy**: ${selectedMode}
429
+ **Status**: Planning
430
+ **Created**: ${getUtc8ISOString()}
431
+
432
+ ---
433
+
434
+ ## Strategy Assessment
435
+
436
+ - **Uncertainty Level**: ${uncertaintyLevel}
437
+ - **Decomposition Mode**: ${selectedMode}
438
+ - **Assessment Basis**: ${factorsSummary}
439
+ - **Goal**: ${extractedGoal}
440
+ - **Constraints**: ${extractedConstraints}
441
+ - **Stakeholders**: ${extractedStakeholders}
442
+
443
+ ---
444
+
445
+ ## Roadmap
446
+
447
+ > To be populated after Phase 2 decomposition
448
+
449
+ ---
450
+
451
+ ## Convergence Criteria Details
452
+
453
+ > To be populated after Phase 2 decomposition
454
+
455
+ ---
456
+
457
+ ## Risks
458
+
459
+ > To be populated after Phase 2 decomposition
460
+
461
+ ---
462
+
463
+ ## Iteration History
464
+
465
+ > To be populated during Phase 3 refinement
466
+
467
+ ---
468
+
469
+ ## Codebase Context (Optional)
470
+
471
+ > To be populated if codebase exploration was performed
472
+ `
473
+
474
+ Write(`${sessionFolder}/roadmap.md`, roadmapContent)
475
+ ```
476
+
477
+ **Success Criteria**:
478
+ - roadmap.md created with Strategy Assessment
479
+ - Strategy selected (progressive or direct)
480
+ - Uncertainty factors documented
481
+
482
+ ---
483
+
484
+ ### Phase 2: Decomposition & Issue Creation
485
+
486
+ **Objective**: Execute decomposition via `cli-roadmap-plan-agent`, create issues, update roadmap.md.
487
+
488
+ **Steps**:
489
+
490
+ 1. **Optional Codebase Exploration** (if codebase detected)
491
+ ```javascript
492
+ const hasCodebase = Bash(`
493
+ test -f package.json && echo "nodejs" ||
494
+ test -f go.mod && echo "golang" ||
495
+ test -f Cargo.toml && echo "rust" ||
496
+ test -f pyproject.toml && echo "python" ||
497
+ test -d src && echo "generic" ||
498
+ echo "none"
499
+ `).trim()
500
+
501
+ let codebaseContext = null
502
+
503
+ if (hasCodebase !== 'none') {
504
+ const exploreAgentId = spawn_agent({
505
+ agent_type: "cli_explore_agent",
506
+ message: `
507
+ ## TASK ASSIGNMENT
508
+
509
+ ### MANDATORY FIRST STEPS (Agent Execute)
510
+ 1. Read: .workflow/project-tech.json
511
+ 2. Read: .workflow/project-guidelines.json
512
+
513
+ ---
514
+
515
+ ## Exploration Context
516
+ - **Requirement**: ${requirement}
517
+ - **Strategy**: ${selectedMode}
518
+ - **Project Type**: ${hasCodebase}
519
+ - **Session**: ${sessionFolder}
520
+
521
+ ## Exploration Focus
522
+ - Identify modules/components related to the requirement
523
+ - Find existing patterns that should be followed
524
+ - Locate integration points for new functionality
525
+ - Assess current architecture constraints
526
+
527
+ ## Output
528
+ Return findings as JSON with schema:
529
+ {
530
+ "project_type": "${hasCodebase}",
531
+ "relevant_modules": [{name, path, relevance}],
532
+ "existing_patterns": [{pattern, files, description}],
533
+ "integration_points": [{location, description, risk}],
534
+ "architecture_constraints": [string],
535
+ "tech_stack": {languages, frameworks, tools}
536
+ }
537
+ `
538
+ })
539
+
540
+ const exploreResult = wait({
541
+ ids: [exploreAgentId],
542
+ timeout_ms: 120000
543
+ })
544
+
545
+ close_agent({ id: exploreAgentId })
546
+
547
+ if (exploreResult.status[exploreAgentId].completed) {
548
+ codebaseContext = exploreResult.status[exploreAgentId].completed
549
+ }
550
+ }
551
+ ```
552
+
553
+ 2. **Execute Decomposition Agent**
554
+ ```javascript
555
+ const decompositionAgentId = spawn_agent({
556
+ agent_type: "cli_roadmap_plan_agent",
557
+ message: `
558
+ ## TASK ASSIGNMENT
559
+
560
+ ### MANDATORY FIRST STEPS (Agent Execute)
561
+ 1. Read: .workflow/project-tech.json
562
+ 2. Read: .workflow/project-guidelines.json
563
+
564
+ ---
565
+
566
+ ## Roadmap Decomposition Task
567
+
568
+ ### Input Context
569
+ - **Requirement**: ${requirement}
570
+ - **Selected Mode**: ${selectedMode}
571
+ - **Session ID**: ${sessionId}
572
+ - **Session Folder**: ${sessionFolder}
573
+
574
+ ### Strategy Assessment
575
+ ${JSON.stringify(strategyAssessment, null, 2)}
576
+
577
+ ### Codebase Context
578
+ ${codebaseContext
579
+ ? JSON.stringify(codebaseContext, null, 2)
580
+ : 'No codebase detected - pure requirement decomposition'}
581
+
582
+ ---
583
+
584
+ ### Mode-Specific Requirements
585
+
586
+ ${selectedMode === 'progressive' ? `**Progressive Mode**:
587
+ - 2-4 layers from MVP to full implementation
588
+ - Each layer: id (L0-L3), name, goal, scope, excludes, convergence, risks, effort, depends_on
589
+ - L0 (MVP) must be a self-contained closed loop with no dependencies
590
+ - Scope: each feature belongs to exactly ONE layer (no overlap)
591
+ - Layer names: MVP / Usable / Refined / Optimized` :
592
+
593
+ `**Direct Mode**:
594
+ - Topologically-sorted task sequence
595
+ - Each task: id (T1-Tn), title, type, scope, inputs, outputs, convergence, depends_on, parallel_group
596
+ - Inputs must come from preceding task outputs or existing resources
597
+ - Tasks in same parallel_group must be truly independent`}
598
+
599
+ ---
600
+
601
+ ### Convergence Quality Requirements
602
+ - criteria[]: MUST be testable (can write assertions or manual verification steps)
603
+ - verification: MUST be executable (command, script, or explicit steps)
604
+ - definition_of_done: MUST use business language (non-technical person can judge)
605
+
606
+ ---
607
+
608
+ ### Expected Output
609
+ 1. **Update ${sessionFolder}/roadmap.md** with Roadmap table + Convergence sections
610
+ 2. **Create issues via ccw issue create** - append to .workflow/issues/issues.jsonl
611
+
612
+ ### Issue Format (for ccw issue create)
613
+ - id: ISS-YYYYMMDD-NNN (auto-generated)
614
+ - title: [LayerName] goal or [TaskType] title
615
+ - context: Markdown with goal, scope, convergence criteria, verification, DoD
616
+ - priority: small→4, medium→3, large→2
617
+ - tags: ["roadmap", mode, wave-N, layer-name]
618
+ - extended_context.notes: {session, strategy, wave, depends_on_issues}
619
+
620
+ ### Execution Steps
621
+ 1. Analyze requirement and build decomposition context
622
+ 2. Execute decomposition (internal reasoning)
623
+ 3. Validate records, check convergence quality
624
+ 4. For each decomposed item:
625
+ - Run: ccw issue create --title "..." --context "..." --tags "..." --priority N
626
+ - Record returned Issue ID
627
+ 5. Update roadmap.md with Issue ID references
628
+ 6. Return brief completion summary with Issue IDs
629
+ `
630
+ })
631
+
632
+ const decompositionResult = wait({
633
+ ids: [decompositionAgentId],
634
+ timeout_ms: 300000 // 5 minutes for complex decomposition
635
+ })
636
+
637
+ close_agent({ id: decompositionAgentId })
638
+
639
+ if (!decompositionResult.status[decompositionAgentId].completed) {
640
+ throw new Error('Decomposition agent failed to complete')
641
+ }
642
+
643
+ const issueIds = decompositionResult.status[decompositionAgentId].completed.issueIds || []
644
+ ```
645
+
646
+ **Success Criteria**:
647
+ - Issues created in `.workflow/issues/issues.jsonl`
648
+ - roadmap.md updated with Issue references
649
+ - No circular dependencies
650
+ - Convergence criteria testable
651
+
652
+ ---
653
+
654
+ ### Phase 3: Iterative Refinement
655
+
656
+ **Objective**: Multi-round user feedback to refine roadmap.
657
+
658
+ **Steps**:
659
+
660
+ 1. **Display Current Roadmap**
661
+ - Read and display Roadmap table + key Convergence criteria
662
+ - Show issue count and wave breakdown
663
+
664
+ 2. **Feedback Loop** (skip if AUTO_YES)
665
+ ```javascript
666
+ let round = 0
667
+ let approved = false
668
+
669
+ while (!approved && round < 5) {
670
+ round++
671
+
672
+ const feedback = request_user_input({
673
+ questions: [{
674
+ header: "Validate",
675
+ id: "feedback",
676
+ question: `Roadmap validation (round ${round}):\n${issueIds.length} issues across ${waveCount} waves. Feedback?`,
677
+ options: [
678
+ { label: "Approve", description: "Proceed to handoff" },
679
+ { label: "Adjust Scope", description: "Modify issue scopes" },
680
+ { label: "Modify Convergence", description: "Refine criteria/verification" },
681
+ { label: "Re-decompose", description: "Change strategy/layering" }
682
+ ]
683
+ }]
684
+ }) // BLOCKS (wait for user response)
685
+
686
+ const feedbackChoice = feedback.answers.feedback.answers[0]
687
+ if (feedbackChoice === 'Approve') {
688
+ approved = true
689
+ } else {
690
+ // CONSTRAINT: All modifications below ONLY touch roadmap.md and issues.jsonl
691
+ // NEVER modify source code or project files during interactive rounds
692
+ switch (feedbackChoice) {
693
+ case 'Adjust Scope':
694
+ // Collect scope adjustments
695
+ const scopeAdjustments = request_user_input({
696
+ questions: [{
697
+ header: "Scope",
698
+ id: "adjustments",
699
+ question: "Describe scope adjustments needed:"
700
+ }]
701
+ }) // BLOCKS
702
+
703
+ // Update ONLY roadmap.md Roadmap table + Convergence sections
704
+ Edit({ path: `${sessionFolder}/roadmap.md`, /* scope changes */ })
705
+ // Update ONLY issues.jsonl entries (scope/context fields)
706
+
707
+ break
708
+
709
+ case 'Modify Convergence':
710
+ // Collect convergence refinements
711
+ const convergenceRefinements = request_user_input({
712
+ questions: [{
713
+ header: "Convergence",
714
+ id: "refinements",
715
+ question: "Describe convergence refinements needed:"
716
+ }]
717
+ }) // BLOCKS
718
+
719
+ // Update ONLY roadmap.md Convergence Criteria section
720
+ Edit({ path: `${sessionFolder}/roadmap.md`, /* convergence changes */ })
721
+
722
+ break
723
+
724
+ case 'Re-decompose':
725
+ // Return to Phase 2 with new strategy
726
+ const newStrategy = request_user_input({
727
+ questions: [{
728
+ header: "Strategy",
729
+ id: "strategy",
730
+ question: "Select new decomposition strategy:",
731
+ options: [
732
+ { label: "Progressive" },
733
+ { label: "Direct" }
734
+ ]
735
+ }]
736
+ }) // BLOCKS
737
+
738
+ selectedMode = newStrategy.answers.strategy.answers[0]
739
+ // Re-execute Phase 2 (updates roadmap.md + issues.jsonl only)
740
+ break
741
+ }
742
+
743
+ // Update Iteration History in roadmap.md
744
+ const iterationEntry = `
745
+ ### Round ${round} - ${getUtc8ISOString()}
746
+ **User Feedback**: ${feedback.feedback}
747
+ **Changes Made**: ${changesMade}
748
+ **Status**: continue iteration
749
+ `
750
+ Edit({
751
+ path: `${sessionFolder}/roadmap.md`,
752
+ old_string: "## Iteration History\n\n> To be populated during Phase 3 refinement",
753
+ new_string: `## Iteration History\n${iterationEntry}`
754
+ })
755
+ }
756
+ }
757
+ ```
758
+
759
+ 3. **Finalize Iteration History**
760
+ ```javascript
761
+ // Update final status in roadmap.md
762
+ Edit({
763
+ path: `${sessionFolder}/roadmap.md`,
764
+ old_string: "**Status**: Planning",
765
+ new_string: "**Status**: Ready"
766
+ })
767
+ ```
768
+
769
+ **Success Criteria**:
770
+ - User approved OR max rounds reached
771
+ - All changes recorded in Iteration History
772
+ - roadmap.md reflects final state
773
+
774
+ ---
775
+
776
+ ### Phase 4: Handoff
777
+
778
+ **Objective**: Present final roadmap, offer execution options.
779
+
780
+ **Steps**:
781
+
782
+ 1. **Display Summary**
783
+ ```markdown
784
+ ## Roadmap Complete
785
+
786
+ - **Session**: RMAP-{slug}-{date}
787
+ - **Strategy**: {progressive|direct}
788
+ - **Issues Created**: {count} across {waves} waves
789
+ - **Roadmap**: .workflow/.roadmap/RMAP-{slug}-{date}/roadmap.md
790
+
791
+ | Wave | Issue Count | Layer/Type |
792
+ |------|-------------|------------|
793
+ | 1 | 2 | MVP / infrastructure |
794
+ | 2 | 3 | Usable / feature |
795
+ ```
796
+
797
+ 2. **Offer Options** (skip if AUTO_YES)
798
+ ```javascript
799
+ let nextStep
800
+
801
+ if (AUTO_YES) {
802
+ nextStep = "done" // Default to done in auto mode
803
+ } else {
804
+ const answer = request_user_input({
805
+ questions: [{
806
+ header: "Next Step",
807
+ id: "next_step",
808
+ question: `${issueIds.length} issues ready. Next step:`,
809
+ options: [
810
+ { label: "View issues", description: "Display issue details" },
811
+ { label: "Done", description: "Planning complete — show next-step commands" }
812
+ ]
813
+ }]
814
+ }) // BLOCKS (wait for user response)
815
+
816
+ nextStep = answer.answers.next_step.answers[0]
817
+ }
818
+ ```
819
+
820
+ 3. **Execute Selection**
821
+ ```javascript
822
+ switch (nextStep) {
823
+ case 'view':
824
+ // Display issues from issues.jsonl
825
+ Bash(`ccw issue list --session ${sessionId}`)
826
+ // Fall through to show next-step commands
827
+ // STOP — do not execute anything
828
+
829
+ case 'done':
830
+ // Output paths and end — this skill is planning-only
831
+ console.log([
832
+ `Roadmap saved: ${sessionFolder}/roadmap.md`,
833
+ `Issues created: ${issueIds.length}`,
834
+ '',
835
+ 'Planning complete. To execute, run:',
836
+ ` $csv-wave-pipeline "${requirement}"`,
837
+ ` ccw issue list --session ${sessionId}`
838
+ ].join('\n'))
839
+ return // STOP — this skill is planning-only, NEVER proceed to execution
840
+ }
841
+ ```
842
+
843
+ **Success Criteria**:
844
+ - User selection executed
845
+ - Session complete
846
+ - All artifacts accessible
847
+
848
+ ---
849
+
850
+ ## Error Handling
851
+
852
+ | Error | Resolution |
853
+ |-------|------------|
854
+ | cli-explore-agent fails | Skip code exploration, proceed with pure requirement decomposition |
855
+ | cli-roadmap-plan-agent fails | Retry once, fallback to manual decomposition prompt |
856
+ | No codebase | Normal flow, skip exploration step |
857
+ | Circular dependency detected | Prompt user, re-decompose |
858
+ | User timeout in feedback loop | Save roadmap.md, show `--continue` command |
859
+ | Max rounds reached | Force proceed with current roadmap |
860
+ | Session folder conflict | Append timestamp suffix |
861
+
862
+ ---
863
+
864
+ ## Core Rules
865
+
866
+ 1. **Start Immediately**: First action is session initialization, then Phase 1 execution
867
+ 2. **Single Source**: All context embedded in roadmap.md, no separate JSON files
868
+ 3. **Iterate on Roadmap**: Use feedback rounds to refine, not recreate
869
+ 4. **Testable Convergence**: criteria = assertions, DoD = business language
870
+ 5. **Explicit Lifecycle**: Always close_agent after wait completes to free resources
871
+ 6. **Planning-Only Skill**: This skill ONLY produces roadmap and issues. It NEVER executes code, creates source files, or runs implementation. All code changes happen via separate execution skills after user manually triggers them
872
+ 7. **Plan-Only Modifications**: Interactive feedback (Phase 3) MUST only update `roadmap.md` and `issues.jsonl`. NEVER modify source code, configuration files, or any project files during any phase. Code changes happen only after handoff when user manually runs `$csv-wave-pipeline` or other execution skills
873
+ 8. **MANDATORY CONFIRMATION GATE**: After Phase 2 decomposition completes, you MUST present the roadmap to the user and wait for confirmation (Phase 3) before proceeding to handoff. NEVER skip Phase 3 user validation
874
+
875
+ ---
876
+
877
+ ## Best Practices
878
+
879
+ 1. **Clear Requirements**: Detailed description → better decomposition
880
+ 2. **Iterate on Roadmap**: Use feedback rounds to refine convergence criteria
881
+ 3. **Testable Convergence**: criteria = assertions, DoD = business language
882
+ 4. **Use Continue Mode**: Resume to iterate on existing roadmap
883
+ 5. **Wave Execution**: Start with wave-1 (MVP) to validate before full execution
884
+
885
+ ---
886
+
887
+ ## Usage Recommendations
888
+
889
+ **When to Use Roadmap vs Other Skills:**
890
+
891
+ | Scenario | Recommended Skill |
892
+ |----------|------------------|
893
+ | Strategic planning, need issue tracking | `$roadmap-with-file` |
894
+ | Quick task breakdown, immediate execution | `$lite-plan` |
895
+ | Collaborative multi-agent planning | `$collaborative-plan-with-file` |
896
+ | Full specification documents | `$spec-generator` |
897
+ | Code implementation from existing plan | `$workflow-lite-plan` |
898
+
899
+ ---
900
+
901
+ **Now plan roadmap for**: $ARGUMENTS