claude-code-workflow 6.3.13 → 6.3.15

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 (69) hide show
  1. package/.claude/agents/issue-plan-agent.md +57 -103
  2. package/.claude/agents/issue-queue-agent.md +69 -120
  3. package/.claude/commands/issue/new.md +217 -473
  4. package/.claude/commands/issue/plan.md +76 -154
  5. package/.claude/commands/issue/queue.md +208 -259
  6. package/.claude/skills/issue-manage/SKILL.md +63 -22
  7. package/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json +3 -3
  8. package/.claude/workflows/cli-templates/schemas/issues-jsonl-schema.json +3 -3
  9. package/.claude/workflows/cli-templates/schemas/queue-schema.json +0 -5
  10. package/.codex/prompts/issue-plan.md +16 -19
  11. package/.codex/prompts/issue-queue.md +0 -1
  12. package/README.md +1 -0
  13. package/ccw/dist/cli.d.ts.map +1 -1
  14. package/ccw/dist/cli.js +3 -1
  15. package/ccw/dist/cli.js.map +1 -1
  16. package/ccw/dist/commands/cli.d.ts.map +1 -1
  17. package/ccw/dist/commands/cli.js +45 -3
  18. package/ccw/dist/commands/cli.js.map +1 -1
  19. package/ccw/dist/commands/issue.d.ts +3 -1
  20. package/ccw/dist/commands/issue.d.ts.map +1 -1
  21. package/ccw/dist/commands/issue.js +383 -30
  22. package/ccw/dist/commands/issue.js.map +1 -1
  23. package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
  24. package/ccw/dist/core/routes/issue-routes.js +77 -16
  25. package/ccw/dist/core/routes/issue-routes.js.map +1 -1
  26. package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
  27. package/ccw/dist/tools/cli-executor.js +117 -4
  28. package/ccw/dist/tools/cli-executor.js.map +1 -1
  29. package/ccw/dist/tools/litellm-executor.d.ts +4 -0
  30. package/ccw/dist/tools/litellm-executor.d.ts.map +1 -1
  31. package/ccw/dist/tools/litellm-executor.js +54 -1
  32. package/ccw/dist/tools/litellm-executor.js.map +1 -1
  33. package/ccw/dist/tools/ui-generate-preview.d.ts +18 -0
  34. package/ccw/dist/tools/ui-generate-preview.d.ts.map +1 -1
  35. package/ccw/dist/tools/ui-generate-preview.js +26 -10
  36. package/ccw/dist/tools/ui-generate-preview.js.map +1 -1
  37. package/ccw/src/cli.ts +3 -1
  38. package/ccw/src/commands/cli.ts +47 -3
  39. package/ccw/src/commands/issue.ts +442 -34
  40. package/ccw/src/core/routes/issue-routes.ts +82 -16
  41. package/ccw/src/tools/cli-executor.ts +125 -4
  42. package/ccw/src/tools/litellm-executor.ts +107 -24
  43. package/ccw/src/tools/ui-generate-preview.js +60 -37
  44. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  45. package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
  46. package/codex-lens/src/codexlens/config.py +25 -2
  47. package/codex-lens/src/codexlens/entities.py +5 -1
  48. package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
  49. package/codex-lens/src/codexlens/indexing/symbol_extractor.py +243 -243
  50. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
  51. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
  52. package/codex-lens/src/codexlens/parsers/factory.py +256 -256
  53. package/codex-lens/src/codexlens/parsers/treesitter_parser.py +335 -335
  54. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  55. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  56. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  57. package/codex-lens/src/codexlens/search/chain_search.py +30 -1
  58. package/codex-lens/src/codexlens/semantic/__pycache__/__init__.cpython-313.pyc +0 -0
  59. package/codex-lens/src/codexlens/semantic/__pycache__/embedder.cpython-313.pyc +0 -0
  60. package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
  61. package/codex-lens/src/codexlens/semantic/__pycache__/vector_store.cpython-313.pyc +0 -0
  62. package/codex-lens/src/codexlens/semantic/embedder.py +6 -9
  63. package/codex-lens/src/codexlens/semantic/vector_store.py +271 -200
  64. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  65. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
  66. package/codex-lens/src/codexlens/storage/__pycache__/sqlite_store.cpython-313.pyc +0 -0
  67. package/codex-lens/src/codexlens/storage/sqlite_store.py +184 -108
  68. package/package.json +6 -1
  69. package/.claude/commands/issue/manage.md +0 -113
@@ -11,55 +11,42 @@ allowed-tools: TodoWrite(*), Task(*), SlashCommand(*), AskUserQuestion(*), Bash(
11
11
 
12
12
  Unified planning command using **issue-plan-agent** that combines exploration and planning into a single closed-loop workflow.
13
13
 
14
- ## Output Requirements
14
+ **Behavior:**
15
+ - Single solution per issue → auto-bind
16
+ - Multiple solutions → return for user selection
17
+ - Agent handles file generation
15
18
 
16
- **Generate Files:**
17
- 1. `.workflow/issues/solutions/{issue-id}.jsonl` - Solution with tasks for each issue
19
+ ## Core Guidelines
18
20
 
19
- **Return Summary:**
20
- ```json
21
- {
22
- "bound": [{ "issue_id": "...", "solution_id": "...", "task_count": N }],
23
- "pending_selection": [{ "issue_id": "...", "solutions": [...] }],
24
- "conflicts": [{ "file": "...", "issues": [...] }]
25
- }
26
- ```
21
+ **⚠️ Data Access Principle**: Issues and solutions files can grow very large. To avoid context overflow:
27
22
 
28
- **Completion Criteria:**
29
- - [ ] Solution file generated for each issue
30
- - [ ] Single solution auto-bound via `ccw issue bind`
31
- - [ ] Multiple solutions returned for user selection
32
- - [ ] Tasks conform to schema: `cat .claude/workflows/cli-templates/schemas/solution-schema.json`
33
- - [ ] Each task has quantified `acceptance.criteria`
23
+ | Operation | Correct | Incorrect |
24
+ |-----------|---------|-----------|
25
+ | List issues (brief) | `ccw issue list --status pending --brief` | `Read('issues.jsonl')` |
26
+ | Read issue details | `ccw issue status <id> --json` | `Read('issues.jsonl')` |
27
+ | Update status | `ccw issue update <id> --status ...` | Direct file edit |
28
+ | Bind solution | `ccw issue bind <id> <sol-id>` | Direct file edit |
34
29
 
35
- ## Core Capabilities
30
+ **Output Options**:
31
+ - `--brief`: JSON with minimal fields (id, title, status, priority, tags)
32
+ - `--json`: Full JSON (agent use only)
36
33
 
37
- - **Closed-loop agent**: issue-plan-agent combines explore + plan
38
- - Batch processing: 1 agent processes 1-3 issues
39
- - ACE semantic search integrated into planning
40
- - Solution with executable tasks and delivery criteria
41
- - Automatic solution registration and binding
34
+ **Orchestration vs Execution**:
35
+ - **Command (orchestrator)**: Use `--brief` for minimal context
36
+ - **Agent (executor)**: Fetch full details → `ccw issue status <id> --json`
42
37
 
43
- ## Storage Structure (Flat JSONL)
44
-
45
- ```
46
- .workflow/issues/
47
- ├── issues.jsonl # All issues (one per line)
48
- ├── queue.json # Execution queue
49
- └── solutions/
50
- ├── {issue-id}.jsonl # Solutions for issue (one per line)
51
- └── ...
52
- ```
38
+ **ALWAYS** use CLI commands for CRUD operations. **NEVER** read entire `issues.jsonl` or `solutions/*.jsonl` directly.
53
39
 
54
40
  ## Usage
55
41
 
56
42
  ```bash
57
- /issue:plan <issue-id>[,<issue-id>,...] [FLAGS]
43
+ /issue:plan [<issue-id>[,<issue-id>,...]] [FLAGS]
58
44
 
59
45
  # Examples
46
+ /issue:plan # Default: --all-pending
60
47
  /issue:plan GH-123 # Single issue
61
48
  /issue:plan GH-123,GH-124,GH-125 # Batch (up to 3)
62
- /issue:plan --all-pending # All pending issues
49
+ /issue:plan --all-pending # All pending issues (explicit)
63
50
 
64
51
  # Flags
65
52
  --batch-size <n> Max issues per agent batch (default: 3)
@@ -97,14 +84,17 @@ Phase 4: Summary
97
84
 
98
85
  ## Implementation
99
86
 
100
- ### Phase 1: Issue Loading (ID + Title + Tags)
87
+ ### Phase 1: Issue Loading (Brief Info Only)
101
88
 
102
89
  ```javascript
103
90
  const batchSize = flags.batchSize || 3;
104
- let issues = []; // {id, title, tags}
91
+ let issues = []; // {id, title, tags} - brief info for grouping only
92
+
93
+ // Default to --all-pending if no input provided
94
+ const useAllPending = flags.allPending || !userInput || userInput.trim() === '';
105
95
 
106
- if (flags.allPending) {
107
- // Get pending issues with metadata via CLI (JSON output)
96
+ if (useAllPending) {
97
+ // Get pending issues with brief metadata via CLI
108
98
  const result = Bash(`ccw issue list --status pending,registered --json`).trim();
109
99
  const parsed = result ? JSON.parse(result) : [];
110
100
  issues = parsed.map(i => ({ id: i.id, title: i.title || '', tags: i.tags || [] }));
@@ -115,7 +105,7 @@ if (flags.allPending) {
115
105
  }
116
106
  console.log(`Found ${issues.length} pending issues`);
117
107
  } else {
118
- // Parse comma-separated issue IDs, fetch metadata
108
+ // Parse comma-separated issue IDs, fetch brief metadata
119
109
  const ids = userInput.includes(',')
120
110
  ? userInput.split(',').map(s => s.trim())
121
111
  : [userInput.trim()];
@@ -127,20 +117,21 @@ if (flags.allPending) {
127
117
  issues.push({ id, title: parsed.title || '', tags: parsed.tags || [] });
128
118
  }
129
119
  }
120
+ // Note: Agent fetches full issue content via `ccw issue status <id> --json`
130
121
 
131
- // Semantic grouping via Gemini CLI (max 6 issues per group)
122
+ // Semantic grouping via Gemini CLI (max 4 issues per group)
132
123
  async function groupBySimilarityGemini(issues) {
133
124
  const issueSummaries = issues.map(i => ({
134
125
  id: i.id, title: i.title, tags: i.tags
135
126
  }));
136
127
 
137
128
  const prompt = `
138
- PURPOSE: Group similar issues by semantic similarity for batch processing; maximize within-group coherence; max 6 issues per group
129
+ PURPOSE: Group similar issues by semantic similarity for batch processing; maximize within-group coherence; max 4 issues per group
139
130
  TASK: • Analyze issue titles/tags semantically • Identify functional/architectural clusters • Assign each issue to one group
140
131
  MODE: analysis
141
132
  CONTEXT: Issue metadata only
142
- EXPECTED: JSON with groups array, each containing max 6 issue_ids, theme, rationale
143
- RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Each issue in exactly one group | Max 6 issues per group | Balance group sizes
133
+ EXPECTED: JSON with groups array, each containing max 4 issue_ids, theme, rationale
134
+ RULES: $(cat ~/.claude/workflows/cli-templates/protocols/analysis-protocol.md) | Each issue in exactly one group | Max 4 issues per group | Balance group sizes
144
135
 
145
136
  INPUT:
146
137
  ${JSON.stringify(issueSummaries, null, 2)}
@@ -167,7 +158,7 @@ OUTPUT FORMAT:
167
158
  }
168
159
 
169
160
  const batches = await groupBySimilarityGemini(issues);
170
- console.log(`Processing ${issues.length} issues in ${batches.length} batch(es) (Gemini semantic grouping, max 6 issues/agent)`);
161
+ console.log(`Processing ${issues.length} issues in ${batches.length} batch(es) (max 4 issues/agent)`);
171
162
 
172
163
  TodoWrite({
173
164
  todos: batches.map((_, i) => ({
@@ -198,42 +189,26 @@ ${issueList}
198
189
 
199
190
  **Project Root**: ${process.cwd()}
200
191
 
201
- ### Project Context (MANDATORY - Read Both Files First)
202
- 1. Read: .workflow/project-tech.json (technology stack, architecture, key components)
203
- 2. Read: .workflow/project-guidelines.json (user-defined constraints and conventions)
204
-
205
- **CRITICAL**: All solution tasks MUST comply with constraints in project-guidelines.json
206
-
207
- ### Steps
208
- 1. Fetch: \`ccw issue status <id> --json\`
209
- 2. Load project context (project-tech.json + project-guidelines.json)
210
- 3. **If extended_context exists**: Use extended_context (location, suggested_fix, notes) as planning hints
211
- 4. Explore (ACE) → Plan solution (respecting guidelines)
212
- 5. Register & bind: \`ccw issue bind <id> --solution <file>\`
192
+ ### Project Context (MANDATORY)
193
+ 1. Read: .workflow/project-tech.json (technology stack, architecture)
194
+ 2. Read: .workflow/project-guidelines.json (constraints and conventions)
213
195
 
214
- ### Generate Files
215
- \`.workflow/issues/solutions/{issue-id}.jsonl\` - Solution with tasks (schema: cat .claude/workflows/cli-templates/schemas/solution-schema.json)
196
+ ### Workflow
197
+ 1. Fetch issue details: ccw issue status <id> --json
198
+ 2. Load project context files
199
+ 3. Explore codebase (ACE semantic search)
200
+ 4. Plan solution with tasks (schema: solution-schema.json)
201
+ 5. Write solution to: .workflow/issues/solutions/{issue-id}.jsonl
202
+ 6. Single solution → auto-bind; Multiple → return for selection
216
203
 
217
- **Solution ID Format**: \`SOL-{issue-id}-{seq}\` (e.g., \`SOL-GH-123-1\`, \`SOL-ISS-20251229-1\`)
218
-
219
- ### Binding Rules
220
- - **Single solution**: Auto-bind via \`ccw issue bind <id> --solution <file>\`
221
- - **Multiple solutions**: Register only, return for user selection
204
+ ### Rules
205
+ - Solution ID format: SOL-{issue-id}-{seq}
206
+ - Single solution per issue → auto-bind via ccw issue bind
207
+ - Multiple solutions register only, return pending_selection
208
+ - Tasks must have quantified acceptance.criteria
222
209
 
223
210
  ### Return Summary
224
- \`\`\`json
225
- {
226
- "bound": [{ "issue_id": "...", "solution_id": "...", "task_count": N }],
227
- "pending_selection": [{ "issue_id": "...", "solutions": [{ "id": "...", "description": "...", "task_count": N }] }],
228
- "conflicts": [{
229
- "type": "file_conflict|api_conflict|data_conflict|dependency_conflict|architecture_conflict",
230
- "severity": "high|medium|low",
231
- "summary": "brief description",
232
- "recommended_resolution": "auto-resolution for low/medium",
233
- "resolution_options": [{ "strategy": "...", "rationale": "..." }]
234
- }]
235
- }
236
- \`\`\`
211
+ {"bound":[{"issue_id":"...","solution_id":"...","task_count":N}],"pending_selection":[{"issue_id":"...","solutions":[{"id":"...","description":"...","task_count":N}]}]}
237
212
  `;
238
213
 
239
214
  return { batchIndex, batchIds, issuePrompt, batch };
@@ -293,89 +268,24 @@ for (let i = 0; i < agentTasks.length; i += MAX_PARALLEL) {
293
268
 
294
269
  ### Phase 3: Conflict Resolution & Solution Selection
295
270
 
296
- ```javascript
297
- // Helper: Extract selected solution ID from AskUserQuestion answer
298
- function extractSelectedSolutionId(answer, issueId) {
299
- // answer format: { [header]: selectedLabel } or { answers: { [question]: label } }
300
- const key = Object.keys(answer).find(k => k.includes(issueId));
301
- if (!key) return null;
302
- const selected = answer[key];
303
- // Label format: "SOL-xxx (N tasks)" - extract solution ID
304
- const match = selected.match(/^(SOL-[^\s]+)/);
305
- return match ? match[1] : null;
306
- }
307
-
308
- // Phase 3a: Aggregate and resolve conflicts from all agents
309
- const allConflicts = [];
310
- for (const result of agentResults) {
311
- if (result.conflicts?.length > 0) {
312
- allConflicts.push(...result.conflicts);
313
- }
314
- }
315
-
316
- if (allConflicts.length > 0) {
317
- console.log(`\n## Resolving ${allConflicts.length} conflict(s) detected by agents\n`);
271
+ **Conflict Handling:**
272
+ - Collect `conflicts` from all agent results
273
+ - Low/Medium severity → auto-resolve with `recommended_resolution`
274
+ - High severity use `AskUserQuestion` to let user choose resolution
318
275
 
319
- // ALWAYS confirm high-severity conflicts (per user preference)
320
- const highSeverity = allConflicts.filter(c => c.severity === 'high');
321
- const lowMedium = allConflicts.filter(c => c.severity !== 'high');
322
-
323
- // Auto-resolve low/medium severity
324
- for (const conflict of lowMedium) {
325
- console.log(` Auto-resolved: ${conflict.summary} → ${conflict.recommended_resolution}`);
326
- }
327
-
328
- // ALWAYS require user confirmation for high severity
329
- if (highSeverity.length > 0) {
330
- const conflictAnswer = AskUserQuestion({
331
- questions: highSeverity.slice(0, 4).map(conflict => ({
332
- question: `${conflict.type}: ${conflict.summary}. How to resolve?`,
333
- header: conflict.type.replace('_conflict', ''),
334
- multiSelect: false,
335
- options: conflict.resolution_options.map(opt => ({
336
- label: opt.strategy,
337
- description: opt.rationale
338
- }))
339
- }))
340
- });
341
- // Apply user-selected resolutions
342
- console.log('Applied user-selected conflict resolutions');
343
- }
344
- }
345
-
346
- // Phase 3b: Multi-Solution Selection (MANDATORY when pendingSelections > 0)
347
- if (pendingSelections.length > 0) {
348
- console.log(`\n## User Selection Required: ${pendingSelections.length} issue(s) have multiple solutions\n`);
349
-
350
- const answer = AskUserQuestion({
351
- questions: pendingSelections.map(({ issue_id, solutions }) => ({
352
- question: `Select solution for ${issue_id}:`,
353
- header: issue_id,
354
- multiSelect: false,
355
- options: solutions.map(s => ({
356
- label: `${s.id} (${s.task_count} tasks)`,
357
- description: s.description
358
- }))
359
- }))
360
- });
361
-
362
- // Bind user-selected solutions
363
- for (const { issue_id } of pendingSelections) {
364
- const selectedId = extractSelectedSolutionId(answer, issue_id);
365
- if (selectedId) {
366
- Bash(`ccw issue bind ${issue_id} ${selectedId}`);
367
- console.log(`✓ ${issue_id}: ${selectedId} bound`);
368
- }
369
- }
370
- }
371
- ```
276
+ **Multi-Solution Selection:**
277
+ - If `pending_selection` contains issues with multiple solutions:
278
+ - Use `AskUserQuestion` to present options (solution ID + task count + description)
279
+ - Extract selected solution ID from user response
280
+ - Verify solution file exists, recover from payload if missing
281
+ - Bind selected solution via `ccw issue bind <issue-id> <solution-id>`
372
282
 
373
283
  ### Phase 4: Summary
374
284
 
375
285
  ```javascript
376
286
  // Count planned issues via CLI
377
- const plannedIds = Bash(`ccw issue list --status planned --ids`).trim();
378
- const plannedCount = plannedIds ? plannedIds.split('\n').length : 0;
287
+ const planned = JSON.parse(Bash(`ccw issue list --status planned --brief`) || '[]');
288
+ const plannedCount = planned.length;
379
289
 
380
290
  console.log(`
381
291
  ## Done: ${issues.length} issues → ${plannedCount} planned
@@ -394,6 +304,18 @@ Next: \`/issue:queue\` → \`/issue:execute\`
394
304
  | User cancels selection | Skip issue, continue with others |
395
305
  | File conflicts | Agent detects and suggests resolution order |
396
306
 
307
+ ## Quality Checklist
308
+
309
+ Before completing, verify:
310
+
311
+ - [ ] All input issues have solutions in `solutions/{issue-id}.jsonl`
312
+ - [ ] Single solution issues are auto-bound (`bound_solution_id` set)
313
+ - [ ] Multi-solution issues returned in `pending_selection` for user choice
314
+ - [ ] Each solution has executable tasks with `modification_points`
315
+ - [ ] Task acceptance criteria are quantified (not vague)
316
+ - [ ] Conflicts detected and reported (if multiple issues touch same files)
317
+ - [ ] Issue status updated to `planned` after binding
318
+
397
319
  ## Related Commands
398
320
 
399
321
  - `/issue:queue` - Form execution queue from bound solutions