claude-code-workflow 6.3.9 → 6.3.11

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 (91) hide show
  1. package/.claude/CLAUDE.md +1 -1
  2. package/.claude/agents/issue-plan-agent.md +21 -15
  3. package/.claude/agents/issue-queue-agent.md +114 -87
  4. package/.claude/commands/issue/discover.md +427 -0
  5. package/.claude/commands/issue/execute.md +195 -363
  6. package/.claude/commands/issue/new.md +13 -1
  7. package/.claude/commands/issue/plan.md +55 -32
  8. package/.claude/commands/issue/queue.md +145 -71
  9. package/.claude/commands/workflow/init.md +75 -29
  10. package/.claude/commands/workflow/lite-fix.md +8 -0
  11. package/.claude/commands/workflow/lite-plan.md +8 -0
  12. package/.claude/commands/workflow/review-module-cycle.md +4 -0
  13. package/.claude/commands/workflow/review-session-cycle.md +4 -0
  14. package/.claude/commands/workflow/review.md +4 -4
  15. package/.claude/commands/workflow/session/solidify.md +299 -0
  16. package/.claude/commands/workflow/session/start.md +10 -7
  17. package/.claude/commands/workflow/tools/context-gather.md +17 -10
  18. package/.claude/skills/software-manual/SKILL.md +184 -0
  19. package/.claude/skills/software-manual/phases/01-requirements-discovery.md +162 -0
  20. package/.claude/skills/software-manual/phases/02-project-exploration.md +101 -0
  21. package/.claude/skills/software-manual/phases/02.5-api-extraction.md +161 -0
  22. package/.claude/skills/software-manual/phases/03-parallel-analysis.md +183 -0
  23. package/.claude/skills/software-manual/phases/03.5-consolidation.md +82 -0
  24. package/.claude/skills/software-manual/phases/04-screenshot-capture.md +89 -0
  25. package/.claude/skills/software-manual/phases/05-html-assembly.md +132 -0
  26. package/.claude/skills/software-manual/phases/06-iterative-refinement.md +259 -0
  27. package/.claude/skills/software-manual/scripts/api-extractor.md +245 -0
  28. package/.claude/skills/software-manual/scripts/bundle-libraries.md +85 -0
  29. package/.claude/skills/software-manual/scripts/extract_apis.py +270 -0
  30. package/.claude/skills/software-manual/scripts/screenshot-helper.md +447 -0
  31. package/.claude/skills/software-manual/scripts/swagger-runner.md +419 -0
  32. package/.claude/skills/software-manual/scripts/typedoc-runner.md +357 -0
  33. package/.claude/skills/software-manual/specs/html-template.md +325 -0
  34. package/.claude/skills/software-manual/specs/quality-standards.md +253 -0
  35. package/.claude/skills/software-manual/specs/writing-style.md +298 -0
  36. package/.claude/skills/software-manual/templates/css/wiki-base.css +788 -0
  37. package/.claude/skills/software-manual/templates/css/wiki-dark.css +278 -0
  38. package/.claude/skills/software-manual/templates/tiddlywiki-shell.html +327 -0
  39. package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +219 -0
  40. package/.claude/workflows/cli-templates/schemas/discovery-state-schema.json +125 -0
  41. package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +168 -74
  42. package/.claude/workflows/cli-templates/schemas/queue-schema.json +225 -108
  43. package/.claude/workflows/cli-templates/schemas/solution-schema.json +6 -28
  44. package/.claude/workflows/context-tools.md +17 -25
  45. package/.codex/AGENTS.md +10 -5
  46. package/.codex/prompts/issue-execute.md +174 -84
  47. package/.codex/prompts/issue-plan.md +106 -0
  48. package/.codex/prompts/issue-queue.md +225 -0
  49. package/ccw/dist/cli.d.ts.map +1 -1
  50. package/ccw/dist/cli.js +1 -0
  51. package/ccw/dist/cli.js.map +1 -1
  52. package/ccw/dist/commands/issue.d.ts.map +1 -1
  53. package/ccw/dist/commands/issue.js +443 -123
  54. package/ccw/dist/commands/issue.js.map +1 -1
  55. package/ccw/dist/core/dashboard-generator.d.ts.map +1 -1
  56. package/ccw/dist/core/dashboard-generator.js +4 -1
  57. package/ccw/dist/core/dashboard-generator.js.map +1 -1
  58. package/ccw/dist/core/data-aggregator.d.ts +32 -0
  59. package/ccw/dist/core/data-aggregator.d.ts.map +1 -1
  60. package/ccw/dist/core/data-aggregator.js +55 -11
  61. package/ccw/dist/core/data-aggregator.js.map +1 -1
  62. package/ccw/dist/core/routes/discovery-routes.d.ts +37 -0
  63. package/ccw/dist/core/routes/discovery-routes.d.ts.map +1 -0
  64. package/ccw/dist/core/routes/discovery-routes.js +514 -0
  65. package/ccw/dist/core/routes/discovery-routes.js.map +1 -0
  66. package/ccw/dist/core/server.d.ts.map +1 -1
  67. package/ccw/dist/core/server.js +9 -1
  68. package/ccw/dist/core/server.js.map +1 -1
  69. package/ccw/dist/tools/codex-lens.d.ts +12 -1
  70. package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
  71. package/ccw/dist/tools/codex-lens.js +56 -7
  72. package/ccw/dist/tools/codex-lens.js.map +1 -1
  73. package/ccw/src/cli.ts +1 -0
  74. package/ccw/src/commands/issue.ts +498 -158
  75. package/ccw/src/core/dashboard-generator.ts +4 -1
  76. package/ccw/src/core/data-aggregator.ts +94 -11
  77. package/ccw/src/core/routes/discovery-routes.ts +607 -0
  78. package/ccw/src/core/server.ts +9 -1
  79. package/ccw/src/templates/dashboard-css/34-discovery.css +783 -0
  80. package/ccw/src/templates/dashboard-js/components/cli-status.js +1 -78
  81. package/ccw/src/templates/dashboard-js/components/navigation.js +8 -0
  82. package/ccw/src/templates/dashboard-js/i18n.js +140 -4
  83. package/ccw/src/templates/dashboard-js/views/cli-manager.js +0 -18
  84. package/ccw/src/templates/dashboard-js/views/codexlens-manager.js +13 -3
  85. package/ccw/src/templates/dashboard-js/views/issue-discovery.js +730 -0
  86. package/ccw/src/templates/dashboard-js/views/issue-manager.js +57 -26
  87. package/ccw/src/templates/dashboard-js/views/project-overview.js +153 -0
  88. package/ccw/src/templates/dashboard.html +5 -0
  89. package/ccw/src/tools/codex-lens.ts +75 -9
  90. package/package.json +1 -1
  91. package/.claude/workflows/context-tools-ace.md +0 -105
@@ -1,104 +1,163 @@
1
1
  ---
2
- description: Execute issue queue tasks sequentially with git commit after each task
3
- argument-hint: "[--dry-run]"
2
+ description: Execute all solutions from issue queue with git commit after each task
3
+ argument-hint: ""
4
4
  ---
5
5
 
6
6
  # Issue Execute (Codex Version)
7
7
 
8
8
  ## Core Principle
9
9
 
10
- **Serial Execution**: Execute tasks ONE BY ONE from the issue queue. Complete each task fully (implement → test → commit) before moving to next. Continue autonomously until ALL tasks complete or queue is empty.
10
+ **Serial Execution**: Execute solutions ONE BY ONE from the issue queue via `ccw issue next`. For each solution, complete all tasks sequentially (implement → test → commit per task). Continue autonomously until queue is empty.
11
11
 
12
12
  ## Execution Flow
13
13
 
14
14
  ```
15
- INIT: Fetch first task via ccw issue next
16
-
17
- WHILE task exists:
18
- 1. Receive task JSON from ccw issue next
19
- 2. Execute full lifecycle:
20
- - IMPLEMENT: Follow task.implementation steps
21
- - TEST: Run task.test commands
22
- - VERIFY: Check task.acceptance criteria
23
- - COMMIT: Stage files, commit with task.commit.message_template
24
- 3. Report completion via ccw issue complete <item_id>
25
- 4. Fetch next task via ccw issue next
15
+ INIT: Fetch first solution via ccw issue next
16
+
17
+ WHILE solution exists:
18
+ 1. Receive solution JSON from ccw issue next
19
+ 2. Execute all tasks in solution.tasks sequentially:
20
+ FOR each task:
21
+ - IMPLEMENT: Follow task.implementation steps
22
+ - TEST: Run task.test commands
23
+ - VERIFY: Check task.acceptance criteria
24
+ - COMMIT: Stage files, commit with task.commit.message_template
25
+ 3. Report completion via ccw issue done <item_id>
26
+ 4. Fetch next solution via ccw issue next
26
27
 
27
28
  WHEN queue empty:
28
29
  Output final summary
29
30
  ```
30
31
 
31
- ## Step 1: Fetch First Task
32
+ ## Step 1: Fetch First Solution
32
33
 
33
- Run this command to get your first task:
34
+ Run this command to get your first solution:
34
35
 
35
36
  ```bash
36
37
  ccw issue next
37
38
  ```
38
39
 
39
- This returns JSON with the full task definition:
40
- - `item_id`: Unique task identifier in queue (e.g., "T-1")
41
- - `issue_id`: Parent issue ID (e.g., "ISSUE-20251227-001")
42
- - `task`: Full task definition with implementation steps
43
- - `context`: Relevant files and patterns
40
+ This returns JSON with the full solution definition:
41
+ - `item_id`: Solution identifier in queue (e.g., "S-1")
42
+ - `issue_id`: Parent issue ID (e.g., "ISS-20251227-001")
43
+ - `solution_id`: Solution ID (e.g., "SOL-20251227-001")
44
+ - `solution`: Full solution with all tasks
44
45
  - `execution_hints`: Timing and executor hints
45
46
 
46
- If response contains `{ "status": "empty" }`, all tasks are complete - skip to final summary.
47
+ If response contains `{ "status": "empty" }`, all solutions are complete - skip to final summary.
47
48
 
48
- ## Step 2: Parse Task Response
49
+ ## Step 2: Parse Solution Response
49
50
 
50
- Expected task structure:
51
+ Expected solution structure:
51
52
 
52
53
  ```json
53
54
  {
54
- "item_id": "T-1",
55
- "issue_id": "ISSUE-20251227-001",
56
- "solution_id": "SOL-001",
57
- "task": {
58
- "id": "T1",
59
- "title": "Task title",
60
- "scope": "src/module/",
61
- "action": "Create|Modify|Fix|Refactor",
62
- "description": "What to do",
63
- "modification_points": [
64
- { "file": "path/to/file.ts", "target": "function name", "change": "description" }
55
+ "item_id": "S-1",
56
+ "issue_id": "ISS-20251227-001",
57
+ "solution_id": "SOL-20251227-001",
58
+ "status": "pending",
59
+ "solution": {
60
+ "id": "SOL-20251227-001",
61
+ "description": "Description of solution approach",
62
+ "tasks": [
63
+ {
64
+ "id": "T1",
65
+ "title": "Task title",
66
+ "scope": "src/module/",
67
+ "action": "Create|Modify|Fix|Refactor|Add",
68
+ "description": "What to do",
69
+ "modification_points": [
70
+ { "file": "path/to/file.ts", "target": "function name", "change": "description" }
71
+ ],
72
+ "implementation": [
73
+ "Step 1: Do this",
74
+ "Step 2: Do that"
75
+ ],
76
+ "test": {
77
+ "commands": ["npm test -- --filter=xxx"],
78
+ "unit": ["Unit test requirement 1", "Unit test requirement 2"]
79
+ },
80
+ "regression": ["Verify existing tests still pass"],
81
+ "acceptance": {
82
+ "criteria": ["Criterion 1: Must pass", "Criterion 2: Must verify"],
83
+ "verification": ["Run test command", "Manual verification step"]
84
+ },
85
+ "commit": {
86
+ "type": "feat|fix|test|refactor",
87
+ "scope": "module",
88
+ "message_template": "feat(scope): description"
89
+ },
90
+ "depends_on": [],
91
+ "estimated_minutes": 30,
92
+ "priority": 1
93
+ }
65
94
  ],
66
- "implementation": [
67
- "Step 1: Do this",
68
- "Step 2: Do that"
69
- ],
70
- "test": {
71
- "commands": ["npm test -- --filter=xxx"],
72
- "unit": "Unit test requirements",
73
- "integration": "Integration test requirements (optional)"
95
+ "exploration_context": {
96
+ "relevant_files": ["path/to/reference.ts"],
97
+ "patterns": "Follow existing pattern in xxx",
98
+ "integration_points": "Used by other modules"
74
99
  },
75
- "acceptance": [
76
- "Criterion 1: Must pass",
77
- "Criterion 2: Must verify"
78
- ],
79
- "commit": {
80
- "message_template": "feat(scope): description"
81
- }
100
+ "analysis": {
101
+ "risk": "low|medium|high",
102
+ "impact": "low|medium|high",
103
+ "complexity": "low|medium|high"
104
+ },
105
+ "score": 0.95,
106
+ "is_bound": true
82
107
  },
83
- "context": {
84
- "relevant_files": ["path/to/reference.ts"],
85
- "patterns": "Follow existing pattern in xxx"
108
+ "execution_hints": {
109
+ "executor": "codex",
110
+ "estimated_minutes": 180
86
111
  }
87
112
  }
88
113
  ```
89
114
 
90
- ## Step 3: Execute Task Lifecycle
115
+ ## Step 2.5: Initialize Todo Tracking
116
+
117
+ After parsing solution, create todo list to track each task:
118
+
119
+ ```javascript
120
+ // Create todos for all tasks in current solution
121
+ TodoWrite({
122
+ todos: solution.tasks.map(task => ({
123
+ content: `${task.id}: ${task.title}`,
124
+ activeForm: `Executing ${task.id}: ${task.title}`,
125
+ status: "pending"
126
+ }))
127
+ })
128
+ ```
129
+
130
+ ## Step 3: Execute Tasks Sequentially
131
+
132
+ Iterate through `solution.tasks` array and execute each task.
133
+
134
+ **Before starting each task**, mark it as in_progress:
135
+ ```javascript
136
+ // Update current task status to in_progress
137
+ TodoWrite({ todos: [...existingTodos.map(t =>
138
+ t.content.startsWith(currentTask.id) ? {...t, status: "in_progress"} : t
139
+ )] })
140
+ ```
141
+
142
+ **After completing each task** (commit done), mark it as completed:
143
+ ```javascript
144
+ // Update completed task status
145
+ TodoWrite({ todos: [...existingTodos.map(t =>
146
+ t.content.startsWith(completedTask.id) ? {...t, status: "completed"} : t
147
+ )] })
148
+ ```
91
149
 
92
150
  ### Phase A: IMPLEMENT
93
151
 
94
- 1. Read all `context.relevant_files` to understand existing patterns
152
+ 1. Read all `solution.exploration_context.relevant_files` to understand existing patterns
95
153
  2. Follow `task.implementation` steps in order
96
154
  3. Apply changes to `task.modification_points` files
97
- 4. Follow `context.patterns` for code style consistency
155
+ 4. Follow `solution.exploration_context.patterns` for code style consistency
156
+ 5. Run `task.regression` checks if specified to ensure no breakage
98
157
 
99
158
  **Output format:**
100
159
  ```
101
- ## Implementing: [task.title]
160
+ ## Implementing: [task.title] (Task [N]/[Total])
102
161
 
103
162
  **Scope**: [task.scope]
104
163
  **Action**: [task.action]
@@ -132,7 +191,7 @@ Expected task structure:
132
191
 
133
192
  ### Phase C: VERIFY
134
193
 
135
- Check all `task.acceptance` criteria are met:
194
+ Check all `task.acceptance.criteria` are met using `task.acceptance.verification` steps:
136
195
 
137
196
  ```
138
197
  ## Verifying: [task.title]
@@ -142,6 +201,10 @@ Check all `task.acceptance` criteria are met:
142
201
  - [x] Criterion 2: Verified
143
202
  ...
144
203
 
204
+ **Verification Steps**:
205
+ - [x] Run test command
206
+ - [x] Manual verification step
207
+
145
208
  All criteria met: YES
146
209
  ```
147
210
 
@@ -149,7 +212,7 @@ All criteria met: YES
149
212
 
150
213
  ### Phase D: COMMIT
151
214
 
152
- After all phases pass, commit the changes:
215
+ After all phases pass, commit the changes for this task:
153
216
 
154
217
  ```bash
155
218
  # Stage all modified files
@@ -159,7 +222,7 @@ git add path/to/file1.ts path/to/file2.ts ...
159
222
  git commit -m "$(cat <<'EOF'
160
223
  [task.commit.message_template]
161
224
 
162
- Item-ID: [item_id]
225
+ Solution-ID: [solution_id]
163
226
  Issue-ID: [issue_id]
164
227
  Task-ID: [task.id]
165
228
  EOF
@@ -175,30 +238,44 @@ EOF
175
238
  **Files**: N files changed
176
239
  ```
177
240
 
241
+ ### Repeat for Next Task
242
+
243
+ Continue to next task in `solution.tasks` array until all tasks are complete.
244
+
178
245
  ## Step 4: Report Completion
179
246
 
180
- After commit succeeds, report to queue system:
247
+ After ALL tasks in the solution are complete, report to queue system:
181
248
 
182
249
  ```bash
183
- ccw issue complete [item_id] --result '{
250
+ ccw issue done <item_id> --result '{
184
251
  "files_modified": ["path1", "path2"],
185
252
  "tests_passed": true,
186
253
  "acceptance_passed": true,
187
254
  "committed": true,
188
- "commit_hash": "[actual hash]",
255
+ "commits": [
256
+ { "task_id": "T1", "hash": "abc123" },
257
+ { "task_id": "T2", "hash": "def456" }
258
+ ],
189
259
  "summary": "[What was accomplished]"
190
260
  }'
191
261
  ```
192
262
 
193
- **If task failed and cannot be fixed:**
263
+ **If solution failed and cannot be fixed:**
194
264
 
195
265
  ```bash
196
- ccw issue fail [item_id] --reason "Phase [X] failed: [details]"
266
+ ccw issue done <item_id> --fail --reason "Task [task.id] failed: [details]"
197
267
  ```
198
268
 
199
- ## Step 5: Continue to Next Task
269
+ ## Step 5: Continue to Next Solution
270
+
271
+ Clear current todo list and fetch next solution:
200
272
 
201
- Immediately fetch the next task:
273
+ ```javascript
274
+ // Reset todos for next solution
275
+ TodoWrite({ todos: [] })
276
+ ```
277
+
278
+ Then fetch next solution:
202
279
 
203
280
  ```bash
204
281
  ccw issue next
@@ -206,8 +283,8 @@ ccw issue next
206
283
 
207
284
  **Output progress:**
208
285
  ```
209
- ✓ [N/M] Completed: [item_id] - [task.title]
210
- → Fetching next task...
286
+ ✓ [N/M] Completed: [item_id] - [solution.approach]
287
+ → Fetching next solution...
211
288
  ```
212
289
 
213
290
  **DO NOT STOP.** Return to Step 2 and continue until queue is empty.
@@ -219,12 +296,15 @@ When `ccw issue next` returns `{ "status": "empty" }`:
219
296
  ```markdown
220
297
  ## Issue Queue Execution Complete
221
298
 
222
- **Total Tasks Executed**: N
299
+ **Total Solutions Executed**: N
300
+ **Total Tasks Executed**: M
301
+
223
302
  **All Commits**:
224
- | # | Item ID | Task | Commit |
225
- |---|---------|------|--------|
226
- | 1 | T-1 | Task title | abc123 |
227
- | 2 | T-2 | Task title | def456 |
303
+ | # | Solution | Task | Commit |
304
+ |---|----------|------|--------|
305
+ | 1 | S-1 | T1 | abc123 |
306
+ | 2 | S-1 | T2 | def456 |
307
+ | 3 | S-2 | T1 | ghi789 |
228
308
 
229
309
  **Files Modified**:
230
310
  - path/to/file1.ts
@@ -237,23 +317,33 @@ When `ccw issue next` returns `{ "status": "empty" }`:
237
317
  ## Execution Rules
238
318
 
239
319
  1. **Never stop mid-queue** - Continue until queue is empty
240
- 2. **One task at a time** - Fully complete (including commit) before moving on
241
- 3. **Tests MUST pass** - Do not proceed to commit if tests fail
242
- 4. **Commit after each task** - Each task gets its own commit
243
- 5. **Self-verify** - All acceptance criteria must pass before commit
244
- 6. **Report accurately** - Use ccw issue complete/fail after each task
245
- 7. **Handle failures gracefully** - If a task fails, report via ccw issue fail and continue to next
320
+ 2. **One solution at a time** - Fully complete (all tasks + report) before moving on
321
+ 3. **Sequential within solution** - Complete each task (including commit) before next
322
+ 4. **Tests MUST pass** - Do not proceed to commit if tests fail
323
+ 5. **Commit after each task** - Each task gets its own commit
324
+ 6. **Self-verify** - All acceptance criteria must pass before commit
325
+ 7. **Report accurately** - Use `ccw issue done` after each solution
326
+ 8. **Handle failures gracefully** - If a solution fails, report via `ccw issue done --fail` and continue to next
327
+ 9. **Track with todos** - Use TodoWrite to track task progress within each solution
246
328
 
247
329
  ## Error Handling
248
330
 
249
331
  | Situation | Action |
250
332
  |-----------|--------|
251
- | ccw issue next returns empty | All done - output final summary |
333
+ | `ccw issue next` returns empty | All done - output final summary |
252
334
  | Tests fail | Fix code, re-run tests |
253
335
  | Verification fails | Go back to implement phase |
254
336
  | Git commit fails | Check staging, retry commit |
255
- | ccw issue complete fails | Log error, continue to next task |
256
- | Unrecoverable error | Call ccw issue fail, continue to next |
337
+ | `ccw issue done` fails | Log error, continue to next solution |
338
+ | Unrecoverable error | Call `ccw issue done --fail`, continue to next |
339
+
340
+ ## CLI Command Reference
341
+
342
+ | Command | Purpose |
343
+ |---------|---------|
344
+ | `ccw issue next` | Fetch next solution from queue |
345
+ | `ccw issue done <id>` | Mark solution complete with result |
346
+ | `ccw issue done <id> --fail` | Mark solution failed with reason |
257
347
 
258
348
  ## Start Execution
259
349
 
@@ -263,4 +353,4 @@ Begin by running:
263
353
  ccw issue next
264
354
  ```
265
355
 
266
- Then follow the lifecycle for each task until queue is empty.
356
+ Then follow the solution lifecycle for each solution until queue is empty.
@@ -0,0 +1,106 @@
1
+ ---
2
+ description: Plan issue(s) into bound solutions (writes solutions JSONL via ccw issue bind)
3
+ argument-hint: "<issue-id>[,<issue-id>,...] [--all-pending] [--batch-size 3]"
4
+ ---
5
+
6
+ # Issue Plan (Codex Version)
7
+
8
+ ## Goal
9
+
10
+ Create executable solution(s) for issue(s) and bind the selected solution to each issue using `ccw issue bind`.
11
+
12
+ This workflow is **planning + registration** (no implementation): it explores the codebase just enough to produce a high-quality task breakdown that can be executed later (e.g., by `issue-execute.md`).
13
+
14
+ ## Inputs
15
+
16
+ - **Explicit issues**: comma-separated IDs, e.g. `ISS-123,ISS-124`
17
+ - **All pending**: `--all-pending` → plan all issues in `registered` status
18
+ - **Batch size**: `--batch-size N` (default `3`) → max issues per batch
19
+
20
+ ## Output Requirements
21
+
22
+ For each issue:
23
+ - Register at least one solution and bind one solution to the issue (updates `.workflow/issues/issues.jsonl` and appends to `.workflow/issues/solutions/{issue-id}.jsonl`).
24
+ - Ensure tasks conform to `.claude/workflows/cli-templates/schemas/solution-schema.json`.
25
+ - Each task includes quantified `acceptance.criteria` and concrete `acceptance.verification`.
26
+
27
+ Return a final summary JSON:
28
+ ```json
29
+ {
30
+ "bound": [{ "issue_id": "...", "solution_id": "...", "task_count": 0 }],
31
+ "pending_selection": [{ "issue_id": "...", "solutions": [{ "id": "...", "task_count": 0, "description": "..." }] }],
32
+ "conflicts": [{ "file": "...", "issues": ["..."] }]
33
+ }
34
+ ```
35
+
36
+ ## Workflow
37
+
38
+ ### Step 1: Resolve issue list
39
+
40
+ - If `--all-pending`:
41
+ - Run `ccw issue list --status registered --json` and plan all returned issues.
42
+ - Else:
43
+ - Parse IDs from user input (split by `,`), and ensure each issue exists:
44
+ - `ccw issue init <issue-id> --title "Issue <issue-id>"` (safe if already exists)
45
+
46
+ ### Step 2: Load issue details
47
+
48
+ For each issue ID:
49
+ - `ccw issue status <issue-id> --json`
50
+ - Extract the issue title/context/labels and any discovery hints (affected files, snippets, etc. if present).
51
+
52
+ ### Step 3: Minimal exploration (evidence-based)
53
+
54
+ - If issue context names specific files or symbols: open them first.
55
+ - Otherwise:
56
+ - Use `rg` to locate relevant code paths by keywords from the title/context.
57
+ - Read 3+ similar patterns before proposing refactors or API changes.
58
+
59
+ ### Step 4: Draft solutions and tasks (schema-driven)
60
+
61
+ Default to **one** solution per issue unless there are genuinely different approaches.
62
+
63
+ Task rules (from schema):
64
+ - `id`: `T1`, `T2`, ...
65
+ - `action`: one of `Create|Update|Implement|Refactor|Add|Delete|Configure|Test|Fix`
66
+ - `implementation`: step-by-step, executable instructions
67
+ - `test.commands`: include at least one command per task when feasible
68
+ - `acceptance.criteria`: testable statements
69
+ - `acceptance.verification`: concrete steps/commands mapping to criteria
70
+ - Prefer small, independently testable tasks; encode dependencies in `depends_on`.
71
+
72
+ ### Step 5: Register & bind solutions via CLI
73
+
74
+ Create an import JSON file per solution (NOT JSONL), then bind it:
75
+
76
+ 1. Write a file (example path):
77
+ - `.workflow/issues/solutions/_imports/<issue-id>-<timestamp>.json`
78
+ 2. File contents shape (minimum):
79
+ ```json
80
+ {
81
+ "description": "High-level summary",
82
+ "approach": "Technical approach",
83
+ "tasks": []
84
+ }
85
+ ```
86
+ 3. Register+bind in one step:
87
+ - `ccw issue bind <issue-id> --solution <import-file>`
88
+
89
+ If you intentionally generated multiple solutions for the same issue:
90
+ - Register each via `ccw issue bind <issue-id> <solution-id> --solution <import-file>` (do NOT bind yet).
91
+ - Present the alternatives in `pending_selection` and stop for user choice.
92
+ - Bind chosen solution with: `ccw issue bind <issue-id> <solution-id>`.
93
+
94
+ ### Step 6: Detect cross-issue file conflicts (best-effort)
95
+
96
+ Across the issues planned in this run:
97
+ - Build a set of touched files from each solution’s `modification_points.file` (and/or task `scope` when explicit files are missing).
98
+ - If the same file appears in multiple issues, add it to `conflicts` with all involved issue IDs.
99
+ - Recommend a safe execution order (sequential) when conflicts exist.
100
+
101
+ ## Done Criteria
102
+
103
+ - A bound solution exists for each issue unless explicitly deferred for user selection.
104
+ - All tasks validate against the solution schema fields (especially acceptance criteria + verification).
105
+ - The final summary JSON matches the required shape.
106
+