claude-code-workflow 6.3.37 → 6.3.39

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 (173) hide show
  1. package/.claude/commands/workflow/lite-execute.md +2 -0
  2. package/.codex/agents/action-planning-agent.md +885 -0
  3. package/.codex/agents/ccw-loop-b-complete.md +227 -0
  4. package/.codex/agents/ccw-loop-b-debug.md +172 -0
  5. package/.codex/agents/ccw-loop-b-develop.md +147 -0
  6. package/.codex/agents/ccw-loop-b-init.md +82 -0
  7. package/.codex/agents/ccw-loop-b-validate.md +204 -0
  8. package/.codex/agents/ccw-loop-executor.md +260 -0
  9. package/.codex/agents/cli-discuss-agent.md +391 -0
  10. package/.codex/agents/cli-execution-agent.md +333 -0
  11. package/.codex/agents/cli-explore-agent.md +186 -0
  12. package/.codex/agents/cli-lite-planning-agent.md +736 -0
  13. package/.codex/agents/cli-planning-agent.md +562 -0
  14. package/.codex/agents/code-developer.md +408 -0
  15. package/.codex/agents/conceptual-planning-agent.md +321 -0
  16. package/.codex/agents/context-search-agent.md +585 -0
  17. package/.codex/agents/debug-explore-agent.md +436 -0
  18. package/.codex/agents/doc-generator.md +334 -0
  19. package/.codex/agents/issue-plan-agent.md +417 -0
  20. package/.codex/agents/issue-queue-agent.md +311 -0
  21. package/.codex/agents/memory-bridge.md +96 -0
  22. package/.codex/agents/test-context-search-agent.md +402 -0
  23. package/.codex/agents/test-fix-agent.md +359 -0
  24. package/.codex/agents/ui-design-agent.md +595 -0
  25. package/.codex/agents/universal-executor.md +135 -0
  26. package/.codex/prompts/clean.md +409 -0
  27. package/.codex/prompts/issue-discover-by-prompt.md +364 -0
  28. package/.codex/prompts/issue-discover.md +261 -0
  29. package/.codex/prompts/issue-execute.md +10 -0
  30. package/.codex/prompts/issue-new.md +285 -0
  31. package/.codex/prompts/issue-plan.md +161 -63
  32. package/.codex/prompts/issue-queue.md +298 -288
  33. package/.codex/prompts/lite-execute.md +627 -133
  34. package/.codex/prompts/lite-fix.md +670 -0
  35. package/.codex/prompts/lite-plan-a.md +337 -0
  36. package/.codex/prompts/lite-plan-b.md +485 -0
  37. package/.codex/prompts/{lite-plan.md → lite-plan-c.md} +601 -469
  38. package/.codex/skills/ccw-loop/README.md +171 -0
  39. package/.codex/skills/ccw-loop/SKILL.md +349 -0
  40. package/.codex/skills/ccw-loop/phases/actions/action-complete.md +269 -0
  41. package/.codex/skills/ccw-loop/phases/actions/action-debug.md +286 -0
  42. package/.codex/skills/ccw-loop/phases/actions/action-develop.md +183 -0
  43. package/.codex/skills/ccw-loop/phases/actions/action-init.md +164 -0
  44. package/.codex/skills/ccw-loop/phases/actions/action-menu.md +205 -0
  45. package/.codex/skills/ccw-loop/phases/actions/action-validate.md +250 -0
  46. package/.codex/skills/ccw-loop/phases/orchestrator.md +416 -0
  47. package/.codex/skills/ccw-loop/phases/state-schema.md +388 -0
  48. package/.codex/skills/ccw-loop/specs/action-catalog.md +182 -0
  49. package/.codex/skills/ccw-loop-b/README.md +301 -0
  50. package/.codex/skills/ccw-loop-b/SKILL.md +322 -0
  51. package/.codex/skills/ccw-loop-b/phases/orchestrator.md +257 -0
  52. package/.codex/skills/ccw-loop-b/phases/state-schema.md +181 -0
  53. package/.codex/skills/ccw-loop-b/specs/action-catalog.md +383 -0
  54. package/.codex/skills/parallel-dev-cycle/README.md +382 -0
  55. package/.codex/skills/parallel-dev-cycle/SKILL.md +512 -0
  56. package/.codex/skills/parallel-dev-cycle/phases/agents/code-developer.md +242 -0
  57. package/.codex/skills/parallel-dev-cycle/phases/agents/exploration-planner.md +285 -0
  58. package/.codex/skills/parallel-dev-cycle/phases/agents/requirements-analyst.md +285 -0
  59. package/.codex/skills/parallel-dev-cycle/phases/agents/validation-archivist.md +381 -0
  60. package/.codex/skills/parallel-dev-cycle/phases/orchestrator.md +696 -0
  61. package/.codex/skills/parallel-dev-cycle/phases/state-schema.md +436 -0
  62. package/.codex/skills/parallel-dev-cycle/specs/communication-optimization.md +423 -0
  63. package/.codex/skills/parallel-dev-cycle/specs/coordination-protocol.md +391 -0
  64. package/.codex/skills/parallel-dev-cycle/specs/versioning-strategy.md +330 -0
  65. package/ccw/dist/cli.d.ts.map +1 -1
  66. package/ccw/dist/cli.js +4 -0
  67. package/ccw/dist/cli.js.map +1 -1
  68. package/ccw/dist/commands/install.d.ts.map +1 -1
  69. package/ccw/dist/commands/install.js +39 -8
  70. package/ccw/dist/commands/install.js.map +1 -1
  71. package/ccw/dist/commands/issue.d.ts +3 -0
  72. package/ccw/dist/commands/issue.d.ts.map +1 -1
  73. package/ccw/dist/commands/issue.js +107 -0
  74. package/ccw/dist/commands/issue.js.map +1 -1
  75. package/ccw/dist/commands/upgrade.js +1 -1
  76. package/ccw/dist/commands/upgrade.js.map +1 -1
  77. package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
  78. package/ccw/dist/config/litellm-api-config-manager.js +3 -2
  79. package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
  80. package/ccw/dist/core/memory-embedder-bridge.d.ts.map +1 -1
  81. package/ccw/dist/core/memory-embedder-bridge.js +2 -5
  82. package/ccw/dist/core/memory-embedder-bridge.js.map +1 -1
  83. package/ccw/dist/core/routes/cli-routes.js.map +1 -1
  84. package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -1
  85. package/ccw/dist/core/routes/codexlens/config-handlers.js +7 -6
  86. package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -1
  87. package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts.map +1 -1
  88. package/ccw/dist/core/routes/codexlens/semantic-handlers.js +2 -2
  89. package/ccw/dist/core/routes/codexlens/semantic-handlers.js.map +1 -1
  90. package/ccw/dist/core/routes/graph-routes.d.ts.map +1 -1
  91. package/ccw/dist/core/routes/graph-routes.js +17 -2
  92. package/ccw/dist/core/routes/graph-routes.js.map +1 -1
  93. package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
  94. package/ccw/dist/core/routes/issue-routes.js +280 -33
  95. package/ccw/dist/core/routes/issue-routes.js.map +1 -1
  96. package/ccw/dist/core/routes/loop-v2-routes.d.ts +9 -0
  97. package/ccw/dist/core/routes/loop-v2-routes.d.ts.map +1 -1
  98. package/ccw/dist/core/routes/loop-v2-routes.js +56 -4
  99. package/ccw/dist/core/routes/loop-v2-routes.js.map +1 -1
  100. package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
  101. package/ccw/dist/core/routes/system-routes.js +3 -2
  102. package/ccw/dist/core/routes/system-routes.js.map +1 -1
  103. package/ccw/dist/core/server.d.ts.map +1 -1
  104. package/ccw/dist/core/server.js +5 -3
  105. package/ccw/dist/core/server.js.map +1 -1
  106. package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
  107. package/ccw/dist/tools/claude-cli-tools.js +4 -3
  108. package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
  109. package/ccw/dist/tools/cli-config-manager.d.ts +1 -0
  110. package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
  111. package/ccw/dist/tools/cli-config-manager.js +2 -1
  112. package/ccw/dist/tools/cli-config-manager.js.map +1 -1
  113. package/ccw/dist/tools/codex-lens-lsp.d.ts.map +1 -1
  114. package/ccw/dist/tools/codex-lens-lsp.js +2 -5
  115. package/ccw/dist/tools/codex-lens-lsp.js.map +1 -1
  116. package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
  117. package/ccw/dist/tools/codex-lens.js +22 -32
  118. package/ccw/dist/tools/codex-lens.js.map +1 -1
  119. package/ccw/dist/tools/litellm-client.d.ts +6 -0
  120. package/ccw/dist/tools/litellm-client.d.ts.map +1 -1
  121. package/ccw/dist/tools/litellm-client.js +15 -2
  122. package/ccw/dist/tools/litellm-client.js.map +1 -1
  123. package/ccw/dist/tools/loop-task-manager.d.ts +13 -2
  124. package/ccw/dist/tools/loop-task-manager.d.ts.map +1 -1
  125. package/ccw/dist/tools/loop-task-manager.js.map +1 -1
  126. package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -1
  127. package/ccw/dist/tools/native-session-discovery.js +35 -7
  128. package/ccw/dist/tools/native-session-discovery.js.map +1 -1
  129. package/ccw/dist/utils/codexlens-path.d.ts +36 -0
  130. package/ccw/dist/utils/codexlens-path.d.ts.map +1 -0
  131. package/ccw/dist/utils/codexlens-path.js +56 -0
  132. package/ccw/dist/utils/codexlens-path.js.map +1 -0
  133. package/ccw/dist/utils/uv-manager.d.ts.map +1 -1
  134. package/ccw/dist/utils/uv-manager.js +3 -2
  135. package/ccw/dist/utils/uv-manager.js.map +1 -1
  136. package/ccw/src/cli.ts +4 -0
  137. package/ccw/src/commands/install.ts +51 -8
  138. package/ccw/src/commands/issue.ts +119 -0
  139. package/ccw/src/commands/upgrade.ts +1 -1
  140. package/ccw/src/config/litellm-api-config-manager.ts +3 -2
  141. package/ccw/src/core/memory-embedder-bridge.ts +2 -6
  142. package/ccw/src/core/routes/cli-routes.ts +1 -1
  143. package/ccw/src/core/routes/codexlens/config-handlers.ts +7 -6
  144. package/ccw/src/core/routes/codexlens/semantic-handlers.ts +2 -2
  145. package/ccw/src/core/routes/graph-routes.ts +18 -2
  146. package/ccw/src/core/routes/issue-routes.ts +308 -33
  147. package/ccw/src/core/routes/loop-v2-routes.ts +64 -6
  148. package/ccw/src/core/routes/system-routes.ts +3 -2
  149. package/ccw/src/core/server.ts +6 -3
  150. package/ccw/src/templates/dashboard-css/02-session.css +2 -0
  151. package/ccw/src/templates/dashboard-css/04-lite-tasks.css +103 -1
  152. package/ccw/src/templates/dashboard-css/32-issue-manager.css +32 -0
  153. package/ccw/src/templates/dashboard-js/components/cli-history.js +48 -48
  154. package/ccw/src/templates/dashboard-js/components/navigation.js +6 -0
  155. package/ccw/src/templates/dashboard-js/components/notifications.js +6 -0
  156. package/ccw/src/templates/dashboard-js/components/version-check.js +38 -0
  157. package/ccw/src/templates/dashboard-js/i18n.js +126 -0
  158. package/ccw/src/templates/dashboard-js/state.js +2 -0
  159. package/ccw/src/templates/dashboard-js/views/cli-manager.js +1 -1
  160. package/ccw/src/templates/dashboard-js/views/issue-manager.js +183 -1
  161. package/ccw/src/templates/dashboard-js/views/lite-tasks.js +55 -11
  162. package/ccw/src/templates/dashboard-js/views/loop-monitor.js +112 -11
  163. package/ccw/src/templates/dashboard.html +48 -2
  164. package/ccw/src/tools/claude-cli-tools.ts +4 -3
  165. package/ccw/src/tools/cli-config-manager.ts +3 -1
  166. package/ccw/src/tools/codex-lens-lsp.ts +2 -5
  167. package/ccw/src/tools/codex-lens.ts +27 -38
  168. package/ccw/src/tools/litellm-client.ts +16 -2
  169. package/ccw/src/tools/loop-task-manager.ts +13 -2
  170. package/ccw/src/tools/native-session-discovery.ts +38 -7
  171. package/ccw/src/utils/codexlens-path.ts +60 -0
  172. package/ccw/src/utils/uv-manager.ts +3 -2
  173. package/package.json +1 -1
@@ -0,0 +1,285 @@
1
+ ---
2
+ description: Create structured issue from GitHub URL or text description
3
+ argument-hint: "<github-url | text-description> [--priority 1-5]"
4
+ ---
5
+
6
+ # Issue New (Codex Version)
7
+
8
+ ## Goal
9
+
10
+ Create a new issue from a GitHub URL or text description. Detect input clarity and ask clarifying questions only when necessary. Register the issue for planning.
11
+
12
+ **Core Principle**: Requirement Clarity Detection → Ask only when needed
13
+
14
+ ```
15
+ Clear Input (GitHub URL, structured text) → Direct creation
16
+ Unclear Input (vague description) → Minimal clarifying questions
17
+ ```
18
+
19
+ ## Issue Structure
20
+
21
+ ```typescript
22
+ interface Issue {
23
+ id: string; // GH-123 or ISS-YYYYMMDD-HHMMSS
24
+ title: string;
25
+ status: 'registered' | 'planned' | 'queued' | 'in_progress' | 'completed' | 'failed';
26
+ priority: number; // 1 (critical) to 5 (low)
27
+ context: string; // Problem description
28
+ source: 'github' | 'text' | 'discovery';
29
+ source_url?: string;
30
+ labels?: string[];
31
+
32
+ // GitHub binding (for non-GitHub sources that publish to GitHub)
33
+ github_url?: string;
34
+ github_number?: number;
35
+
36
+ // Optional structured fields
37
+ expected_behavior?: string;
38
+ actual_behavior?: string;
39
+ affected_components?: string[];
40
+
41
+ // Solution binding
42
+ bound_solution_id: string | null;
43
+
44
+ // Timestamps
45
+ created_at: string;
46
+ updated_at: string;
47
+ }
48
+ ```
49
+
50
+ ## Inputs
51
+
52
+ - **GitHub URL**: `https://github.com/owner/repo/issues/123` or `#123`
53
+ - **Text description**: Natural language description
54
+ - **Priority flag**: `--priority 1-5` (optional, default: 3)
55
+
56
+ ## Output Requirements
57
+
58
+ **Create Issue via CLI** (preferred method):
59
+ ```bash
60
+ # Pipe input (recommended for complex JSON)
61
+ echo '{"title":"...", "context":"...", "priority":3}' | ccw issue create
62
+
63
+ # Returns created issue JSON
64
+ {"id":"ISS-20251229-001","title":"...","status":"registered",...}
65
+ ```
66
+
67
+ **Return Summary:**
68
+ ```json
69
+ {
70
+ "created": true,
71
+ "id": "ISS-20251229-001",
72
+ "title": "Login fails with special chars",
73
+ "source": "text",
74
+ "github_published": false,
75
+ "next_step": "/issue:plan ISS-20251229-001"
76
+ }
77
+ ```
78
+
79
+ ## Workflow
80
+
81
+ ### Step 1: Analyze Input Clarity
82
+
83
+ Parse and detect input type:
84
+
85
+ ```javascript
86
+ // Detection patterns
87
+ const isGitHubUrl = input.match(/github\.com\/[\w-]+\/[\w-]+\/issues\/\d+/);
88
+ const isGitHubShort = input.match(/^#(\d+)$/);
89
+ const hasStructure = input.match(/(expected|actual|affects|steps):/i);
90
+
91
+ // Clarity score: 0-3
92
+ let clarityScore = 0;
93
+ if (isGitHubUrl || isGitHubShort) clarityScore = 3; // GitHub = fully clear
94
+ else if (hasStructure) clarityScore = 2; // Structured text = clear
95
+ else if (input.length > 50) clarityScore = 1; // Long text = somewhat clear
96
+ else clarityScore = 0; // Vague
97
+ ```
98
+
99
+ ### Step 2: Extract Issue Data
100
+
101
+ **For GitHub URL/Short:**
102
+
103
+ ```bash
104
+ # Fetch issue details via gh CLI
105
+ gh issue view <issue-ref> --json number,title,body,labels,url
106
+
107
+ # Parse response
108
+ {
109
+ "id": "GH-123",
110
+ "title": "...",
111
+ "source": "github",
112
+ "source_url": "https://github.com/...",
113
+ "labels": ["bug", "priority:high"],
114
+ "context": "..."
115
+ }
116
+ ```
117
+
118
+ **For Text Description:**
119
+
120
+ ```javascript
121
+ // Generate issue ID
122
+ const id = `ISS-${new Date().toISOString().replace(/[-:T]/g, '').slice(0, 14)}`;
123
+
124
+ // Parse structured fields if present
125
+ const expected = text.match(/expected:?\s*([^.]+)/i);
126
+ const actual = text.match(/actual:?\s*([^.]+)/i);
127
+ const affects = text.match(/affects?:?\s*([^.]+)/i);
128
+
129
+ // Build issue data
130
+ {
131
+ "id": id,
132
+ "title": text.split(/[.\n]/)[0].substring(0, 60),
133
+ "source": "text",
134
+ "context": text.substring(0, 500),
135
+ "expected_behavior": expected?.[1]?.trim(),
136
+ "actual_behavior": actual?.[1]?.trim()
137
+ }
138
+ ```
139
+
140
+ ### Step 3: Context Hint (Conditional)
141
+
142
+ For medium clarity (score 1-2) without affected components:
143
+
144
+ ```bash
145
+ # Use rg to find potentially related files
146
+ rg -l "<keyword>" --type ts | head -5
147
+ ```
148
+
149
+ Add discovered files to `affected_components` (max 3 files).
150
+
151
+ **Note**: Skip this for GitHub issues (already have context) and vague inputs (needs clarification first).
152
+
153
+ ### Step 4: Clarification (Only if Unclear)
154
+
155
+ **Only for clarity score < 2:**
156
+
157
+ Present a prompt asking for more details:
158
+
159
+ ```
160
+ Input unclear. Please describe:
161
+ - What is the issue about?
162
+ - Where does it occur?
163
+ - What is the expected behavior?
164
+ ```
165
+
166
+ Wait for user response, then update issue data.
167
+
168
+ ### Step 5: GitHub Publishing Decision
169
+
170
+ For non-GitHub sources, determine if user wants to publish to GitHub:
171
+
172
+ ```
173
+ Would you like to publish this issue to GitHub?
174
+ 1. Yes, publish to GitHub (create issue and link it)
175
+ 2. No, keep local only (store without GitHub sync)
176
+ ```
177
+
178
+ ### Step 6: Create Issue
179
+
180
+ **Create via CLI:**
181
+
182
+ ```bash
183
+ # Build issue JSON
184
+ ISSUE_JSON='{"title":"...","context":"...","priority":3,"source":"text"}'
185
+
186
+ # Create issue (auto-generates ID)
187
+ echo "${ISSUE_JSON}" | ccw issue create
188
+ ```
189
+
190
+ **If publishing to GitHub:**
191
+
192
+ ```bash
193
+ # Create on GitHub first
194
+ GH_URL=$(gh issue create --title "..." --body "..." | grep -oE 'https://github.com/[^ ]+')
195
+ GH_NUMBER=$(echo $GH_URL | grep -oE '/issues/([0-9]+)$' | grep -oE '[0-9]+')
196
+
197
+ # Update local issue with binding
198
+ ccw issue update ${ISSUE_ID} --github-url "${GH_URL}" --github-number ${GH_NUMBER}
199
+ ```
200
+
201
+ ### Step 7: Output Result
202
+
203
+ ```markdown
204
+ ## Issue Created
205
+
206
+ **ID**: ISS-20251229-001
207
+ **Title**: Login fails with special chars
208
+ **Source**: text
209
+ **Priority**: 2 (High)
210
+
211
+ **Context**:
212
+ 500 error when password contains quotes
213
+
214
+ **Affected Components**:
215
+ - src/auth/login.ts
216
+ - src/utils/validation.ts
217
+
218
+ **GitHub**: Not published (local only)
219
+
220
+ **Next Step**: `/issue:plan ISS-20251229-001`
221
+ ```
222
+
223
+ ## Quality Checklist
224
+
225
+ Before completing, verify:
226
+
227
+ - [ ] Issue ID generated correctly (GH-xxx or ISS-YYYYMMDD-HHMMSS)
228
+ - [ ] Title extracted (max 60 chars)
229
+ - [ ] Context captured (problem description)
230
+ - [ ] Priority assigned (1-5)
231
+ - [ ] Status set to `registered`
232
+ - [ ] Created via `ccw issue create` CLI command
233
+
234
+ ## Error Handling
235
+
236
+ | Situation | Action |
237
+ |-----------|--------|
238
+ | GitHub URL not accessible | Report error, suggest text input |
239
+ | gh CLI not available | Fall back to text-based creation |
240
+ | Empty input | Prompt for description |
241
+ | Very vague input | Ask clarifying questions |
242
+ | Issue already exists | Report duplicate, show existing |
243
+
244
+ ## Examples
245
+
246
+ ### Clear Input (No Questions)
247
+
248
+ ```bash
249
+ # GitHub URL
250
+ codex -p "@.codex/prompts/issue-new.md https://github.com/org/repo/issues/42"
251
+ # → Fetches, parses, creates immediately
252
+
253
+ # Structured text
254
+ codex -p "@.codex/prompts/issue-new.md 'Login fails with special chars. Expected: success. Actual: 500'"
255
+ # → Parses structure, creates immediately
256
+ ```
257
+
258
+ ### Vague Input (Clarification)
259
+
260
+ ```bash
261
+ codex -p "@.codex/prompts/issue-new.md 'auth broken'"
262
+ # → Asks: "Please describe the issue in more detail"
263
+ # → User provides details
264
+ # → Creates issue
265
+ ```
266
+
267
+ ## Start Execution
268
+
269
+ Parse input and detect clarity:
270
+
271
+ ```bash
272
+ # Get input from arguments
273
+ INPUT="${1}"
274
+
275
+ # Detect if GitHub URL
276
+ if echo "${INPUT}" | grep -qE 'github\.com/.*/issues/[0-9]+'; then
277
+ echo "GitHub URL detected - fetching issue..."
278
+ gh issue view "${INPUT}" --json number,title,body,labels,url
279
+ else
280
+ echo "Text input detected - analyzing clarity..."
281
+ # Continue with text parsing
282
+ fi
283
+ ```
284
+
285
+ Then follow the workflow based on detected input type.
@@ -1,6 +1,6 @@
1
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]"
2
+ description: Plan issue(s) into bound solutions using subagent pattern (explore + plan closed-loop)
3
+ argument-hint: "<issue-id>[,<issue-id>,...] [--all-pending] [--batch-size 4]"
4
4
  ---
5
5
 
6
6
  # Issue Plan (Codex Version)
@@ -9,7 +9,7 @@ argument-hint: "<issue-id>[,<issue-id>,...] [--all-pending] [--batch-size 3]"
9
9
 
10
10
  Create executable solution(s) for issue(s) and bind the selected solution to each issue using `ccw issue bind`.
11
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`).
12
+ This workflow uses **subagent pattern** for parallel batch processing: spawn planning agents per batch, wait for results, handle multi-solution selection.
13
13
 
14
14
  ## Core Guidelines
15
15
 
@@ -17,29 +17,25 @@ This workflow is **planning + registration** (no implementation): it explores th
17
17
 
18
18
  | Operation | Correct | Incorrect |
19
19
  |-----------|---------|-----------|
20
- | List issues (brief) | `ccw issue list --status pending --brief` | `Read('issues.jsonl')` |
21
- | Read issue details | `ccw issue status <id> --json` | `Read('issues.jsonl')` |
20
+ | List issues (brief) | `ccw issue list --status pending --brief` | Read issues.jsonl |
21
+ | Read issue details | `ccw issue status <id> --json` | Read issues.jsonl |
22
22
  | Update status | `ccw issue update <id> --status ...` | Direct file edit |
23
23
  | Bind solution | `ccw issue bind <id> <sol-id>` | Direct file edit |
24
24
 
25
- **Output Options**:
26
- - `--brief`: JSON with minimal fields (id, title, status, priority, tags)
27
- - `--json`: Full JSON (for detailed processing)
28
-
29
25
  **ALWAYS** use CLI commands for CRUD operations. **NEVER** read entire `issues.jsonl` or `solutions/*.jsonl` directly.
30
26
 
31
27
  ## Inputs
32
28
 
33
29
  - **Explicit issues**: comma-separated IDs, e.g. `ISS-123,ISS-124`
34
30
  - **All pending**: `--all-pending` → plan all issues in `registered` status
35
- - **Batch size**: `--batch-size N` (default `3`) → max issues per batch
31
+ - **Batch size**: `--batch-size N` (default `4`) → max issues per subagent batch
36
32
 
37
33
  ## Output Requirements
38
34
 
39
35
  For each issue:
40
- - 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`).
41
- - Ensure tasks conform to `.claude/workflows/cli-templates/schemas/solution-schema.json`.
42
- - Each task includes quantified `acceptance.criteria` and concrete `acceptance.verification`.
36
+ - Register at least one solution and bind one solution to the issue
37
+ - Ensure tasks conform to `~/.claude/workflows/cli-templates/schemas/solution-schema.json`
38
+ - Each task includes quantified `acceptance.criteria` and concrete `acceptance.verification`
43
39
 
44
40
  Return a final summary JSON:
45
41
  ```json
@@ -52,73 +48,166 @@ Return a final summary JSON:
52
48
 
53
49
  ## Workflow
54
50
 
55
- ### Step 1: Resolve issue list
51
+ ### Step 1: Resolve Issue List
56
52
 
57
- - If `--all-pending`:
58
- - Run `ccw issue list --status registered --json` and plan all returned issues.
59
- - Else:
60
- - Parse IDs from user input (split by `,`), and ensure each issue exists:
61
- - `ccw issue init <issue-id> --title "Issue <issue-id>"` (safe if already exists)
53
+ **If `--all-pending`:**
54
+ ```bash
55
+ ccw issue list --status registered --json
56
+ ```
62
57
 
63
- ### Step 2: Load issue details
58
+ **Else (explicit IDs):**
59
+ ```bash
60
+ # For each ID, ensure exists
61
+ ccw issue init <issue-id> --title "Issue <issue-id>" 2>/dev/null || true
62
+ ccw issue status <issue-id> --json
63
+ ```
64
64
 
65
- For each issue ID:
66
- - `ccw issue status <issue-id> --json`
67
- - Extract the issue title/context/labels and any discovery hints (affected files, snippets, etc. if present).
65
+ ### Step 2: Group Issues by Similarity
68
66
 
69
- ### Step 3: Minimal exploration (evidence-based)
67
+ Group issues for batch processing (max 4 per batch):
70
68
 
71
- - If issue context names specific files or symbols: open them first.
72
- - Otherwise:
73
- - Use `rg` to locate relevant code paths by keywords from the title/context.
74
- - Read 3+ similar patterns before proposing refactors or API changes.
69
+ ```bash
70
+ # Extract issue metadata for grouping
71
+ ccw issue list --status registered --brief --json
72
+ ```
75
73
 
76
- ### Step 4: Draft solutions and tasks (schema-driven)
74
+ Group by:
75
+ - Shared tags
76
+ - Similar keywords in title
77
+ - Related components
77
78
 
78
- Default to **one** solution per issue unless there are genuinely different approaches.
79
+ ### Step 3: Spawn Planning Subagents (Parallel)
79
80
 
80
- Task rules (from schema):
81
- - `id`: `T1`, `T2`, ...
82
- - `action`: one of `Create|Update|Implement|Refactor|Add|Delete|Configure|Test|Fix`
83
- - `implementation`: step-by-step, executable instructions
84
- - `test.commands`: include at least one command per task when feasible
85
- - `acceptance.criteria`: testable statements
86
- - `acceptance.verification`: concrete steps/commands mapping to criteria
87
- - Prefer small, independently testable tasks; encode dependencies in `depends_on`.
81
+ For each batch, spawn a planning subagent:
88
82
 
89
- ### Step 5: Register & bind solutions via CLI
83
+ ```javascript
84
+ // Subagent message structure
85
+ spawn_agent({
86
+ message: `
87
+ ## TASK ASSIGNMENT
90
88
 
91
- **Create solution** (via CLI endpoint):
92
- ```bash
93
- ccw issue solution <issue-id> --data '{"description":"...", "approach":"...", "tasks":[...]}'
94
- # Output: {"id":"SOL-{issue-id}-1", ...}
89
+ ### MANDATORY FIRST STEPS (Agent Execute)
90
+ 1. **Read role definition**: ~/.codex/agents/issue-plan-agent.md (MUST read first)
91
+ 2. Read: .workflow/project-tech.json
92
+ 3. Read: .workflow/project-guidelines.json
93
+ 4. Read schema: ~/.claude/workflows/cli-templates/schemas/solution-schema.json
94
+
95
+ ---
96
+
97
+ Goal: Plan solutions for ${batch.length} issues with executable task breakdown
98
+
99
+ Scope:
100
+ - CAN DO: Explore codebase, design solutions, create tasks
101
+ - CANNOT DO: Execute solutions, modify production code
102
+ - Directory: ${process.cwd()}
103
+
104
+ Context:
105
+ - Issues: ${batch.map(i => `${i.id}: ${i.title}`).join('\n')}
106
+ - Fetch full details: ccw issue status <id> --json
107
+
108
+ Deliverables:
109
+ - For each issue: Write solution to .workflow/issues/solutions/{issue-id}.jsonl
110
+ - Single solution → auto-bind via ccw issue bind
111
+ - Multiple solutions → return in pending_selection
112
+
113
+ Quality bar:
114
+ - Tasks have quantified acceptance.criteria
115
+ - Each task includes test.commands
116
+ - Solution follows schema exactly
117
+ `
118
+ })
95
119
  ```
96
120
 
97
- **CLI Features:**
98
- | Feature | Description |
99
- |---------|-------------|
100
- | Auto-increment ID | `SOL-{issue-id}-{seq}` (e.g., `SOL-GH-123-1`) |
101
- | Multi-solution | Appends to existing JSONL, supports multiple per issue |
102
- | Trailing newline | Proper JSONL format, no corruption |
121
+ **Batch execution (parallel):**
122
+ ```javascript
123
+ // Launch all batches in parallel
124
+ const agentIds = batches.map(batch => spawn_agent({ message: buildPrompt(batch) }))
125
+
126
+ // Wait for all agents to complete
127
+ const results = wait({ ids: agentIds, timeout_ms: 900000 }) // 15 min
128
+
129
+ // Collect results
130
+ const allBound = []
131
+ const allPendingSelection = []
132
+ const allConflicts = []
133
+
134
+ for (const id of agentIds) {
135
+ if (results.status[id].completed) {
136
+ const result = JSON.parse(results.status[id].completed)
137
+ allBound.push(...(result.bound || []))
138
+ allPendingSelection.push(...(result.pending_selection || []))
139
+ allConflicts.push(...(result.conflicts || []))
140
+ }
141
+ }
142
+
143
+ // Close all agents
144
+ agentIds.forEach(id => close_agent({ id }))
145
+ ```
103
146
 
104
- **Binding:**
105
- - **Single solution**: Auto-bind: `ccw issue bind <issue-id> <solution-id>`
106
- - **Multiple solutions**: Present alternatives in `pending_selection`, wait for user choice
147
+ ### Step 4: Handle Multi-Solution Selection
107
148
 
108
- ### Step 6: Detect cross-issue file conflicts (best-effort)
149
+ If `pending_selection` is non-empty, present options:
109
150
 
110
- Across the issues planned in this run:
111
- - Build a set of touched files from each solution's `modification_points.file` (and/or task `scope` when explicit files are missing).
112
- - If the same file appears in multiple issues, add it to `conflicts` with all involved issue IDs.
113
- - Recommend a safe execution order (sequential) when conflicts exist.
151
+ ```
152
+ Issue ISS-001 has multiple solutions:
153
+ 1. SOL-ISS-001-1: Refactor with adapter pattern (3 tasks)
154
+ 2. SOL-ISS-001-2: Direct implementation (2 tasks)
114
155
 
115
- ### Step 7: Update issue status
156
+ Select solution (1-2):
157
+ ```
116
158
 
117
- After binding, update issue status to `planned`:
159
+ Bind selected solution:
160
+ ```bash
161
+ ccw issue bind ISS-001 SOL-ISS-001-1
162
+ ```
163
+
164
+ ### Step 5: Handle Conflicts
165
+
166
+ If conflicts detected:
167
+ - Low/Medium severity: Auto-resolve with recommended order
168
+ - High severity: Present to user for decision
169
+
170
+ ### Step 6: Update Issue Status
171
+
172
+ After binding, update status:
118
173
  ```bash
119
174
  ccw issue update <issue-id> --status planned
120
175
  ```
121
176
 
177
+ ### Step 7: Output Summary
178
+
179
+ ```markdown
180
+ ## Planning Complete
181
+
182
+ **Planned**: 5 issues
183
+ **Bound Solutions**: 4
184
+ **Pending Selection**: 1
185
+
186
+ ### Bound Solutions
187
+ | Issue | Solution | Tasks |
188
+ |-------|----------|-------|
189
+ | ISS-001 | SOL-ISS-001-1 | 3 |
190
+ | ISS-002 | SOL-ISS-002-1 | 2 |
191
+
192
+ ### Pending Selection
193
+ - ISS-003: 2 solutions available (user selection required)
194
+
195
+ ### Conflicts Detected
196
+ - src/auth.ts touched by ISS-001, ISS-002 (resolved: sequential)
197
+
198
+ **Next Step**: `/issue:queue`
199
+ ```
200
+
201
+ ## Subagent Role Reference
202
+
203
+ Planning subagent uses role file at: `~/.codex/agents/issue-plan-agent.md`
204
+
205
+ Role capabilities:
206
+ - Codebase exploration (rg, file reading)
207
+ - Solution design with task breakdown
208
+ - Schema validation
209
+ - Solution registration via CLI
210
+
122
211
  ## Quality Checklist
123
212
 
124
213
  Before completing, verify:
@@ -130,19 +219,28 @@ Before completing, verify:
130
219
  - [ ] Task acceptance criteria are quantified (not vague)
131
220
  - [ ] Conflicts detected and reported (if multiple issues touch same files)
132
221
  - [ ] Issue status updated to `planned` after binding
222
+ - [ ] All subagents closed after completion
133
223
 
134
224
  ## Error Handling
135
225
 
136
226
  | Error | Resolution |
137
227
  |-------|------------|
138
228
  | Issue not found | Auto-create via `ccw issue init` |
229
+ | Subagent timeout | Retry with increased timeout or smaller batch |
139
230
  | No solutions generated | Display error, suggest manual planning |
140
231
  | User cancels selection | Skip issue, continue with others |
141
232
  | File conflicts | Detect and suggest resolution order |
142
233
 
143
- ## Done Criteria
234
+ ## Start Execution
235
+
236
+ Begin by resolving issue list:
144
237
 
145
- - A bound solution exists for each issue unless explicitly deferred for user selection.
146
- - All tasks validate against the solution schema fields (especially acceptance criteria + verification).
147
- - The final summary JSON matches the required shape.
238
+ ```bash
239
+ # Default to all pending
240
+ ccw issue list --status registered --brief --json
241
+
242
+ # Or with explicit IDs
243
+ ccw issue status ISS-001 --json
244
+ ```
148
245
 
246
+ Then group issues and spawn planning subagents.