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.
- package/.claude/commands/workflow/lite-execute.md +2 -0
- package/.codex/agents/action-planning-agent.md +885 -0
- package/.codex/agents/ccw-loop-b-complete.md +227 -0
- package/.codex/agents/ccw-loop-b-debug.md +172 -0
- package/.codex/agents/ccw-loop-b-develop.md +147 -0
- package/.codex/agents/ccw-loop-b-init.md +82 -0
- package/.codex/agents/ccw-loop-b-validate.md +204 -0
- package/.codex/agents/ccw-loop-executor.md +260 -0
- package/.codex/agents/cli-discuss-agent.md +391 -0
- package/.codex/agents/cli-execution-agent.md +333 -0
- package/.codex/agents/cli-explore-agent.md +186 -0
- package/.codex/agents/cli-lite-planning-agent.md +736 -0
- package/.codex/agents/cli-planning-agent.md +562 -0
- package/.codex/agents/code-developer.md +408 -0
- package/.codex/agents/conceptual-planning-agent.md +321 -0
- package/.codex/agents/context-search-agent.md +585 -0
- package/.codex/agents/debug-explore-agent.md +436 -0
- package/.codex/agents/doc-generator.md +334 -0
- package/.codex/agents/issue-plan-agent.md +417 -0
- package/.codex/agents/issue-queue-agent.md +311 -0
- package/.codex/agents/memory-bridge.md +96 -0
- package/.codex/agents/test-context-search-agent.md +402 -0
- package/.codex/agents/test-fix-agent.md +359 -0
- package/.codex/agents/ui-design-agent.md +595 -0
- package/.codex/agents/universal-executor.md +135 -0
- package/.codex/prompts/clean.md +409 -0
- package/.codex/prompts/issue-discover-by-prompt.md +364 -0
- package/.codex/prompts/issue-discover.md +261 -0
- package/.codex/prompts/issue-execute.md +10 -0
- package/.codex/prompts/issue-new.md +285 -0
- package/.codex/prompts/issue-plan.md +161 -63
- package/.codex/prompts/issue-queue.md +298 -288
- package/.codex/prompts/lite-execute.md +627 -133
- package/.codex/prompts/lite-fix.md +670 -0
- package/.codex/prompts/lite-plan-a.md +337 -0
- package/.codex/prompts/lite-plan-b.md +485 -0
- package/.codex/prompts/{lite-plan.md → lite-plan-c.md} +601 -469
- package/.codex/skills/ccw-loop/README.md +171 -0
- package/.codex/skills/ccw-loop/SKILL.md +349 -0
- package/.codex/skills/ccw-loop/phases/actions/action-complete.md +269 -0
- package/.codex/skills/ccw-loop/phases/actions/action-debug.md +286 -0
- package/.codex/skills/ccw-loop/phases/actions/action-develop.md +183 -0
- package/.codex/skills/ccw-loop/phases/actions/action-init.md +164 -0
- package/.codex/skills/ccw-loop/phases/actions/action-menu.md +205 -0
- package/.codex/skills/ccw-loop/phases/actions/action-validate.md +250 -0
- package/.codex/skills/ccw-loop/phases/orchestrator.md +416 -0
- package/.codex/skills/ccw-loop/phases/state-schema.md +388 -0
- package/.codex/skills/ccw-loop/specs/action-catalog.md +182 -0
- package/.codex/skills/ccw-loop-b/README.md +301 -0
- package/.codex/skills/ccw-loop-b/SKILL.md +322 -0
- package/.codex/skills/ccw-loop-b/phases/orchestrator.md +257 -0
- package/.codex/skills/ccw-loop-b/phases/state-schema.md +181 -0
- package/.codex/skills/ccw-loop-b/specs/action-catalog.md +383 -0
- package/.codex/skills/parallel-dev-cycle/README.md +382 -0
- package/.codex/skills/parallel-dev-cycle/SKILL.md +512 -0
- package/.codex/skills/parallel-dev-cycle/phases/agents/code-developer.md +242 -0
- package/.codex/skills/parallel-dev-cycle/phases/agents/exploration-planner.md +285 -0
- package/.codex/skills/parallel-dev-cycle/phases/agents/requirements-analyst.md +285 -0
- package/.codex/skills/parallel-dev-cycle/phases/agents/validation-archivist.md +381 -0
- package/.codex/skills/parallel-dev-cycle/phases/orchestrator.md +696 -0
- package/.codex/skills/parallel-dev-cycle/phases/state-schema.md +436 -0
- package/.codex/skills/parallel-dev-cycle/specs/communication-optimization.md +423 -0
- package/.codex/skills/parallel-dev-cycle/specs/coordination-protocol.md +391 -0
- package/.codex/skills/parallel-dev-cycle/specs/versioning-strategy.md +330 -0
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +4 -0
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +39 -8
- package/ccw/dist/commands/install.js.map +1 -1
- package/ccw/dist/commands/issue.d.ts +3 -0
- package/ccw/dist/commands/issue.d.ts.map +1 -1
- package/ccw/dist/commands/issue.js +107 -0
- package/ccw/dist/commands/issue.js.map +1 -1
- package/ccw/dist/commands/upgrade.js +1 -1
- package/ccw/dist/commands/upgrade.js.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.d.ts.map +1 -1
- package/ccw/dist/config/litellm-api-config-manager.js +3 -2
- package/ccw/dist/config/litellm-api-config-manager.js.map +1 -1
- package/ccw/dist/core/memory-embedder-bridge.d.ts.map +1 -1
- package/ccw/dist/core/memory-embedder-bridge.js +2 -5
- package/ccw/dist/core/memory-embedder-bridge.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/config-handlers.js +7 -6
- package/ccw/dist/core/routes/codexlens/config-handlers.js.map +1 -1
- package/ccw/dist/core/routes/codexlens/semantic-handlers.d.ts.map +1 -1
- package/ccw/dist/core/routes/codexlens/semantic-handlers.js +2 -2
- package/ccw/dist/core/routes/codexlens/semantic-handlers.js.map +1 -1
- package/ccw/dist/core/routes/graph-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/graph-routes.js +17 -2
- package/ccw/dist/core/routes/graph-routes.js.map +1 -1
- package/ccw/dist/core/routes/issue-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/issue-routes.js +280 -33
- package/ccw/dist/core/routes/issue-routes.js.map +1 -1
- package/ccw/dist/core/routes/loop-v2-routes.d.ts +9 -0
- package/ccw/dist/core/routes/loop-v2-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/loop-v2-routes.js +56 -4
- package/ccw/dist/core/routes/loop-v2-routes.js.map +1 -1
- package/ccw/dist/core/routes/system-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/system-routes.js +3 -2
- package/ccw/dist/core/routes/system-routes.js.map +1 -1
- package/ccw/dist/core/server.d.ts.map +1 -1
- package/ccw/dist/core/server.js +5 -3
- package/ccw/dist/core/server.js.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.d.ts.map +1 -1
- package/ccw/dist/tools/claude-cli-tools.js +4 -3
- package/ccw/dist/tools/claude-cli-tools.js.map +1 -1
- package/ccw/dist/tools/cli-config-manager.d.ts +1 -0
- package/ccw/dist/tools/cli-config-manager.d.ts.map +1 -1
- package/ccw/dist/tools/cli-config-manager.js +2 -1
- package/ccw/dist/tools/cli-config-manager.js.map +1 -1
- package/ccw/dist/tools/codex-lens-lsp.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens-lsp.js +2 -5
- package/ccw/dist/tools/codex-lens-lsp.js.map +1 -1
- package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
- package/ccw/dist/tools/codex-lens.js +22 -32
- package/ccw/dist/tools/codex-lens.js.map +1 -1
- package/ccw/dist/tools/litellm-client.d.ts +6 -0
- package/ccw/dist/tools/litellm-client.d.ts.map +1 -1
- package/ccw/dist/tools/litellm-client.js +15 -2
- package/ccw/dist/tools/litellm-client.js.map +1 -1
- package/ccw/dist/tools/loop-task-manager.d.ts +13 -2
- package/ccw/dist/tools/loop-task-manager.d.ts.map +1 -1
- package/ccw/dist/tools/loop-task-manager.js.map +1 -1
- package/ccw/dist/tools/native-session-discovery.d.ts.map +1 -1
- package/ccw/dist/tools/native-session-discovery.js +35 -7
- package/ccw/dist/tools/native-session-discovery.js.map +1 -1
- package/ccw/dist/utils/codexlens-path.d.ts +36 -0
- package/ccw/dist/utils/codexlens-path.d.ts.map +1 -0
- package/ccw/dist/utils/codexlens-path.js +56 -0
- package/ccw/dist/utils/codexlens-path.js.map +1 -0
- package/ccw/dist/utils/uv-manager.d.ts.map +1 -1
- package/ccw/dist/utils/uv-manager.js +3 -2
- package/ccw/dist/utils/uv-manager.js.map +1 -1
- package/ccw/src/cli.ts +4 -0
- package/ccw/src/commands/install.ts +51 -8
- package/ccw/src/commands/issue.ts +119 -0
- package/ccw/src/commands/upgrade.ts +1 -1
- package/ccw/src/config/litellm-api-config-manager.ts +3 -2
- package/ccw/src/core/memory-embedder-bridge.ts +2 -6
- package/ccw/src/core/routes/cli-routes.ts +1 -1
- package/ccw/src/core/routes/codexlens/config-handlers.ts +7 -6
- package/ccw/src/core/routes/codexlens/semantic-handlers.ts +2 -2
- package/ccw/src/core/routes/graph-routes.ts +18 -2
- package/ccw/src/core/routes/issue-routes.ts +308 -33
- package/ccw/src/core/routes/loop-v2-routes.ts +64 -6
- package/ccw/src/core/routes/system-routes.ts +3 -2
- package/ccw/src/core/server.ts +6 -3
- package/ccw/src/templates/dashboard-css/02-session.css +2 -0
- package/ccw/src/templates/dashboard-css/04-lite-tasks.css +103 -1
- package/ccw/src/templates/dashboard-css/32-issue-manager.css +32 -0
- package/ccw/src/templates/dashboard-js/components/cli-history.js +48 -48
- package/ccw/src/templates/dashboard-js/components/navigation.js +6 -0
- package/ccw/src/templates/dashboard-js/components/notifications.js +6 -0
- package/ccw/src/templates/dashboard-js/components/version-check.js +38 -0
- package/ccw/src/templates/dashboard-js/i18n.js +126 -0
- package/ccw/src/templates/dashboard-js/state.js +2 -0
- package/ccw/src/templates/dashboard-js/views/cli-manager.js +1 -1
- package/ccw/src/templates/dashboard-js/views/issue-manager.js +183 -1
- package/ccw/src/templates/dashboard-js/views/lite-tasks.js +55 -11
- package/ccw/src/templates/dashboard-js/views/loop-monitor.js +112 -11
- package/ccw/src/templates/dashboard.html +48 -2
- package/ccw/src/tools/claude-cli-tools.ts +4 -3
- package/ccw/src/tools/cli-config-manager.ts +3 -1
- package/ccw/src/tools/codex-lens-lsp.ts +2 -5
- package/ccw/src/tools/codex-lens.ts +27 -38
- package/ccw/src/tools/litellm-client.ts +16 -2
- package/ccw/src/tools/loop-task-manager.ts +13 -2
- package/ccw/src/tools/native-session-discovery.ts +38 -7
- package/ccw/src/utils/codexlens-path.ts +60 -0
- package/ccw/src/utils/uv-manager.ts +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Discover issues from user prompt with iterative multi-agent exploration and cross-module comparison
|
|
3
|
+
argument-hint: "<prompt> [--scope=src/**] [--depth=standard|deep] [--max-iterations=5]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Issue Discovery by Prompt (Codex Version)
|
|
7
|
+
|
|
8
|
+
## Goal
|
|
9
|
+
|
|
10
|
+
Prompt-driven issue discovery with intelligent planning. Instead of fixed perspectives, this command:
|
|
11
|
+
|
|
12
|
+
1. **Analyzes user intent** to understand what to find
|
|
13
|
+
2. **Plans exploration strategy** dynamically based on codebase structure
|
|
14
|
+
3. **Executes iterative exploration** with feedback loops
|
|
15
|
+
4. **Performs cross-module comparison** when detecting comparison intent
|
|
16
|
+
|
|
17
|
+
**Core Difference from `issue-discover.md`**:
|
|
18
|
+
- `issue-discover`: Pre-defined perspectives (bug, security, etc.), parallel execution
|
|
19
|
+
- `issue-discover-by-prompt`: User-driven prompt, planned strategy, iterative exploration
|
|
20
|
+
|
|
21
|
+
## Inputs
|
|
22
|
+
|
|
23
|
+
- **Prompt**: Natural language description of what to find
|
|
24
|
+
- **Scope**: `--scope=src/**` - File pattern to explore (default: `**/*`)
|
|
25
|
+
- **Depth**: `--depth=standard|deep` - standard (3 iterations) or deep (5+ iterations)
|
|
26
|
+
- **Max Iterations**: `--max-iterations=N` (default: 5)
|
|
27
|
+
|
|
28
|
+
## Output Requirements
|
|
29
|
+
|
|
30
|
+
**Generate Files:**
|
|
31
|
+
1. `.workflow/issues/discoveries/{discovery-id}/discovery-state.json` - Session state with iteration tracking
|
|
32
|
+
2. `.workflow/issues/discoveries/{discovery-id}/iterations/{N}/{dimension}.json` - Per-iteration findings
|
|
33
|
+
3. `.workflow/issues/discoveries/{discovery-id}/comparison-analysis.json` - Cross-dimension comparison (if applicable)
|
|
34
|
+
4. `.workflow/issues/discoveries/{discovery-id}/discovery-issues.jsonl` - Generated issue candidates
|
|
35
|
+
|
|
36
|
+
**Return Summary:**
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"discovery_id": "DBP-YYYYMMDD-HHmmss",
|
|
40
|
+
"prompt": "Check if frontend API calls match backend implementations",
|
|
41
|
+
"intent_type": "comparison",
|
|
42
|
+
"dimensions": ["frontend-calls", "backend-handlers"],
|
|
43
|
+
"total_iterations": 3,
|
|
44
|
+
"total_findings": 24,
|
|
45
|
+
"issues_generated": 12,
|
|
46
|
+
"comparison_match_rate": 0.75
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Workflow
|
|
51
|
+
|
|
52
|
+
### Step 1: Initialize Discovery Session
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Generate discovery ID
|
|
56
|
+
DISCOVERY_ID="DBP-$(date -u +%Y%m%d-%H%M%S)"
|
|
57
|
+
OUTPUT_DIR=".workflow/issues/discoveries/${DISCOVERY_ID}"
|
|
58
|
+
|
|
59
|
+
# Create directory structure
|
|
60
|
+
mkdir -p "${OUTPUT_DIR}/iterations"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Detect intent type from prompt:
|
|
64
|
+
- `comparison`: Contains "match", "compare", "versus", "vs", "between"
|
|
65
|
+
- `search`: Contains "find", "locate", "where"
|
|
66
|
+
- `verification`: Contains "verify", "check", "ensure"
|
|
67
|
+
- `audit`: Contains "audit", "review", "analyze"
|
|
68
|
+
|
|
69
|
+
### Step 2: Gather Context
|
|
70
|
+
|
|
71
|
+
Use `rg` and file exploration to understand codebase structure:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Find relevant modules based on prompt keywords
|
|
75
|
+
rg -l "<keyword1>" --type ts | head -10
|
|
76
|
+
rg -l "<keyword2>" --type ts | head -10
|
|
77
|
+
|
|
78
|
+
# Understand project structure
|
|
79
|
+
ls -la src/
|
|
80
|
+
cat .workflow/project-tech.json 2>/dev/null || echo "No project-tech.json"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Build context package:
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"prompt_keywords": ["frontend", "API", "backend"],
|
|
87
|
+
"codebase_structure": { "modules": [...], "patterns": [...] },
|
|
88
|
+
"relevant_modules": ["src/api/", "src/services/"]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Step 3: Plan Exploration Strategy
|
|
93
|
+
|
|
94
|
+
Analyze the prompt and context to design exploration strategy.
|
|
95
|
+
|
|
96
|
+
**Output exploration plan:**
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"intent_analysis": {
|
|
100
|
+
"type": "comparison",
|
|
101
|
+
"primary_question": "Do frontend API calls match backend implementations?",
|
|
102
|
+
"sub_questions": ["Are endpoints aligned?", "Are payloads compatible?"]
|
|
103
|
+
},
|
|
104
|
+
"dimensions": [
|
|
105
|
+
{
|
|
106
|
+
"name": "frontend-calls",
|
|
107
|
+
"description": "Client-side API calls and error handling",
|
|
108
|
+
"search_targets": ["src/api/**", "src/hooks/**"],
|
|
109
|
+
"focus_areas": ["fetch calls", "error boundaries", "response parsing"]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "backend-handlers",
|
|
113
|
+
"description": "Server-side API implementations",
|
|
114
|
+
"search_targets": ["src/server/**", "src/routes/**"],
|
|
115
|
+
"focus_areas": ["endpoint handlers", "response schemas", "error responses"]
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"comparison_matrix": {
|
|
119
|
+
"dimension_a": "frontend-calls",
|
|
120
|
+
"dimension_b": "backend-handlers",
|
|
121
|
+
"comparison_points": [
|
|
122
|
+
{"aspect": "endpoints", "frontend_check": "fetch URLs", "backend_check": "route paths"},
|
|
123
|
+
{"aspect": "methods", "frontend_check": "HTTP methods used", "backend_check": "methods accepted"},
|
|
124
|
+
{"aspect": "payloads", "frontend_check": "request body structure", "backend_check": "expected schema"},
|
|
125
|
+
{"aspect": "responses", "frontend_check": "response parsing", "backend_check": "response format"}
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"estimated_iterations": 3,
|
|
129
|
+
"termination_conditions": ["All comparison points verified", "No new findings in last iteration"]
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Step 4: Iterative Exploration
|
|
134
|
+
|
|
135
|
+
Execute iterations until termination conditions are met:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
WHILE iteration < max_iterations AND shouldContinue:
|
|
139
|
+
1. Plan iteration focus based on previous findings
|
|
140
|
+
2. Explore each dimension
|
|
141
|
+
3. Collect and analyze findings
|
|
142
|
+
4. Cross-reference between dimensions
|
|
143
|
+
5. Check convergence
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**For each iteration:**
|
|
147
|
+
|
|
148
|
+
1. **Search for relevant code** using `rg`:
|
|
149
|
+
```bash
|
|
150
|
+
# Based on dimension focus areas
|
|
151
|
+
rg "fetch\s*\(" --type ts -C 3 | head -50
|
|
152
|
+
rg "app\.(get|post|put|delete)" --type ts -C 3 | head -50
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
2. **Analyze and record findings**:
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"dimension": "frontend-calls",
|
|
159
|
+
"iteration": 1,
|
|
160
|
+
"findings": [
|
|
161
|
+
{
|
|
162
|
+
"id": "F-001",
|
|
163
|
+
"title": "Undefined endpoint in UserService",
|
|
164
|
+
"category": "endpoint-mismatch",
|
|
165
|
+
"file": "src/api/userService.ts",
|
|
166
|
+
"line": 42,
|
|
167
|
+
"snippet": "fetch('/api/users/profile')",
|
|
168
|
+
"related_dimension": "backend-handlers",
|
|
169
|
+
"confidence": 0.85
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"coverage": {
|
|
173
|
+
"files_explored": 15,
|
|
174
|
+
"areas_covered": ["fetch calls", "axios instances"],
|
|
175
|
+
"areas_remaining": ["graphql queries"]
|
|
176
|
+
},
|
|
177
|
+
"leads": [
|
|
178
|
+
{"description": "Check GraphQL mutations", "suggested_search": "mutation.*User"}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
3. **Cross-reference findings** between dimensions:
|
|
184
|
+
```javascript
|
|
185
|
+
// For each finding in dimension A, look for related code in dimension B
|
|
186
|
+
if (finding.related_dimension) {
|
|
187
|
+
searchForRelatedCode(finding, otherDimension);
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
4. **Check convergence**:
|
|
192
|
+
```javascript
|
|
193
|
+
const convergence = {
|
|
194
|
+
newDiscoveries: newFindings.length,
|
|
195
|
+
confidence: calculateConfidence(cumulativeFindings),
|
|
196
|
+
converged: newFindings.length === 0 || confidence > 0.9
|
|
197
|
+
};
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Step 5: Cross-Analysis (for comparison intent)
|
|
201
|
+
|
|
202
|
+
If intent is comparison, analyze findings across dimensions:
|
|
203
|
+
|
|
204
|
+
```javascript
|
|
205
|
+
for (const point of comparisonMatrix.comparison_points) {
|
|
206
|
+
const aFindings = findings.filter(f =>
|
|
207
|
+
f.related_dimension === dimension_a && f.category.includes(point.aspect)
|
|
208
|
+
);
|
|
209
|
+
const bFindings = findings.filter(f =>
|
|
210
|
+
f.related_dimension === dimension_b && f.category.includes(point.aspect)
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
// Find discrepancies
|
|
214
|
+
const discrepancies = compareFindings(aFindings, bFindings, point);
|
|
215
|
+
|
|
216
|
+
// Calculate match rate
|
|
217
|
+
const matchRate = calculateMatchRate(aFindings, bFindings);
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Write to `comparison-analysis.json`:
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"matrix": { "dimension_a": "...", "dimension_b": "...", "comparison_points": [...] },
|
|
225
|
+
"results": [
|
|
226
|
+
{
|
|
227
|
+
"aspect": "endpoints",
|
|
228
|
+
"dimension_a_count": 15,
|
|
229
|
+
"dimension_b_count": 12,
|
|
230
|
+
"discrepancies": [
|
|
231
|
+
{"frontend": "/api/users/profile", "backend": "NOT_FOUND", "type": "missing_endpoint"}
|
|
232
|
+
],
|
|
233
|
+
"match_rate": 0.80
|
|
234
|
+
}
|
|
235
|
+
],
|
|
236
|
+
"summary": {
|
|
237
|
+
"total_discrepancies": 5,
|
|
238
|
+
"overall_match_rate": 0.75,
|
|
239
|
+
"critical_mismatches": ["endpoints", "payloads"]
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Step 6: Generate Issues
|
|
245
|
+
|
|
246
|
+
Convert high-confidence findings to issues:
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# For each finding with confidence >= 0.7 or priority critical/high
|
|
250
|
+
echo '{"id":"ISS-DBP-001","title":"Missing backend endpoint for /api/users/profile",...}' >> ${OUTPUT_DIR}/discovery-issues.jsonl
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Step 7: Update Final State
|
|
254
|
+
|
|
255
|
+
```json
|
|
256
|
+
{
|
|
257
|
+
"discovery_id": "DBP-...",
|
|
258
|
+
"type": "prompt-driven",
|
|
259
|
+
"prompt": "...",
|
|
260
|
+
"intent_type": "comparison",
|
|
261
|
+
"phase": "complete",
|
|
262
|
+
"created_at": "...",
|
|
263
|
+
"updated_at": "...",
|
|
264
|
+
"iterations": [
|
|
265
|
+
{"number": 1, "findings_count": 10, "new_discoveries": 10, "confidence": 0.6},
|
|
266
|
+
{"number": 2, "findings_count": 18, "new_discoveries": 8, "confidence": 0.75},
|
|
267
|
+
{"number": 3, "findings_count": 24, "new_discoveries": 6, "confidence": 0.85}
|
|
268
|
+
],
|
|
269
|
+
"results": {
|
|
270
|
+
"total_iterations": 3,
|
|
271
|
+
"total_findings": 24,
|
|
272
|
+
"issues_generated": 12,
|
|
273
|
+
"comparison_match_rate": 0.75
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Step 8: Output Summary
|
|
279
|
+
|
|
280
|
+
```markdown
|
|
281
|
+
## Discovery Complete: DBP-...
|
|
282
|
+
|
|
283
|
+
**Prompt**: Check if frontend API calls match backend implementations
|
|
284
|
+
**Intent**: comparison
|
|
285
|
+
**Dimensions**: frontend-calls, backend-handlers
|
|
286
|
+
|
|
287
|
+
### Iteration Summary
|
|
288
|
+
| # | Findings | New | Confidence |
|
|
289
|
+
|---|----------|-----|------------|
|
|
290
|
+
| 1 | 10 | 10 | 60% |
|
|
291
|
+
| 2 | 18 | 8 | 75% |
|
|
292
|
+
| 3 | 24 | 6 | 85% |
|
|
293
|
+
|
|
294
|
+
### Comparison Results
|
|
295
|
+
- **Overall Match Rate**: 75%
|
|
296
|
+
- **Total Discrepancies**: 5
|
|
297
|
+
- **Critical Mismatches**: endpoints, payloads
|
|
298
|
+
|
|
299
|
+
### Issues Generated: 12
|
|
300
|
+
- 2 Critical
|
|
301
|
+
- 4 High
|
|
302
|
+
- 6 Medium
|
|
303
|
+
|
|
304
|
+
### Next Steps
|
|
305
|
+
- `/issue:plan DBP-001,DBP-002,...` to plan solutions
|
|
306
|
+
- `ccw view` to review findings in dashboard
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Quality Checklist
|
|
310
|
+
|
|
311
|
+
Before completing, verify:
|
|
312
|
+
|
|
313
|
+
- [ ] Intent type correctly detected from prompt
|
|
314
|
+
- [ ] Dimensions dynamically generated based on prompt
|
|
315
|
+
- [ ] Iterations executed until convergence or max limit
|
|
316
|
+
- [ ] Cross-reference analysis performed (for comparison intent)
|
|
317
|
+
- [ ] High-confidence findings converted to issues
|
|
318
|
+
- [ ] Discovery state shows `phase: complete`
|
|
319
|
+
|
|
320
|
+
## Error Handling
|
|
321
|
+
|
|
322
|
+
| Situation | Action |
|
|
323
|
+
|-----------|--------|
|
|
324
|
+
| No relevant code found | Report empty result, suggest broader scope |
|
|
325
|
+
| Max iterations without convergence | Complete with current findings, note in summary |
|
|
326
|
+
| Comparison dimension mismatch | Report which dimension has fewer findings |
|
|
327
|
+
| No comparison points matched | Report as "No direct matches found" |
|
|
328
|
+
|
|
329
|
+
## Use Cases
|
|
330
|
+
|
|
331
|
+
| Scenario | Example Prompt |
|
|
332
|
+
|----------|----------------|
|
|
333
|
+
| API Contract | "Check if frontend calls match backend endpoints" |
|
|
334
|
+
| Error Handling | "Find inconsistent error handling patterns" |
|
|
335
|
+
| Migration Gap | "Compare old auth with new auth implementation" |
|
|
336
|
+
| Feature Parity | "Verify mobile has all web features" |
|
|
337
|
+
| Schema Drift | "Check if TypeScript types match API responses" |
|
|
338
|
+
| Integration | "Find mismatches between service A and service B" |
|
|
339
|
+
|
|
340
|
+
## Start Discovery
|
|
341
|
+
|
|
342
|
+
Parse prompt and detect intent:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
PROMPT="${1}"
|
|
346
|
+
SCOPE="${2:-**/*}"
|
|
347
|
+
DEPTH="${3:-standard}"
|
|
348
|
+
|
|
349
|
+
# Detect intent keywords
|
|
350
|
+
if echo "${PROMPT}" | grep -qiE '(match|compare|versus|vs|between)'; then
|
|
351
|
+
INTENT="comparison"
|
|
352
|
+
elif echo "${PROMPT}" | grep -qiE '(find|locate|where)'; then
|
|
353
|
+
INTENT="search"
|
|
354
|
+
elif echo "${PROMPT}" | grep -qiE '(verify|check|ensure)'; then
|
|
355
|
+
INTENT="verification"
|
|
356
|
+
else
|
|
357
|
+
INTENT="audit"
|
|
358
|
+
fi
|
|
359
|
+
|
|
360
|
+
echo "Intent detected: ${INTENT}"
|
|
361
|
+
echo "Starting discovery with scope: ${SCOPE}"
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
Then follow the workflow to explore and discover issues.
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Discover potential issues from multiple perspectives (bug, UX, test, quality, security, performance, maintainability, best-practices)
|
|
3
|
+
argument-hint: "<path-pattern> [--perspectives=bug,ux,...] [--external]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Issue Discovery (Codex Version)
|
|
7
|
+
|
|
8
|
+
## Goal
|
|
9
|
+
|
|
10
|
+
Multi-perspective issue discovery that explores code from different angles to identify potential bugs, UX improvements, test gaps, and other actionable items. Unlike code review (which assesses existing code quality), discovery focuses on **finding opportunities for improvement and potential problems**.
|
|
11
|
+
|
|
12
|
+
**Discovery Scope**: Specified modules/files only
|
|
13
|
+
**Output Directory**: `.workflow/issues/discoveries/{discovery-id}/`
|
|
14
|
+
**Available Perspectives**: bug, ux, test, quality, security, performance, maintainability, best-practices
|
|
15
|
+
|
|
16
|
+
## Inputs
|
|
17
|
+
|
|
18
|
+
- **Target Pattern**: File glob pattern (e.g., `src/auth/**`)
|
|
19
|
+
- **Perspectives**: Comma-separated list via `--perspectives` (or interactive selection)
|
|
20
|
+
- **External Research**: `--external` flag enables Exa research for security and best-practices
|
|
21
|
+
|
|
22
|
+
## Output Requirements
|
|
23
|
+
|
|
24
|
+
**Generate Files:**
|
|
25
|
+
1. `.workflow/issues/discoveries/{discovery-id}/discovery-state.json` - Session state
|
|
26
|
+
2. `.workflow/issues/discoveries/{discovery-id}/perspectives/{perspective}.json` - Per-perspective findings
|
|
27
|
+
3. `.workflow/issues/discoveries/{discovery-id}/discovery-issues.jsonl` - Generated issue candidates
|
|
28
|
+
4. `.workflow/issues/discoveries/{discovery-id}/summary.md` - Summary report
|
|
29
|
+
|
|
30
|
+
**Return Summary:**
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"discovery_id": "DSC-YYYYMMDD-HHmmss",
|
|
34
|
+
"target_pattern": "src/auth/**",
|
|
35
|
+
"perspectives_analyzed": ["bug", "security", "test"],
|
|
36
|
+
"total_findings": 15,
|
|
37
|
+
"issues_generated": 8,
|
|
38
|
+
"priority_distribution": { "critical": 1, "high": 3, "medium": 4 }
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Workflow
|
|
43
|
+
|
|
44
|
+
### Step 1: Initialize Discovery Session
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Generate discovery ID
|
|
48
|
+
DISCOVERY_ID="DSC-$(date -u +%Y%m%d-%H%M%S)"
|
|
49
|
+
OUTPUT_DIR=".workflow/issues/discoveries/${DISCOVERY_ID}"
|
|
50
|
+
|
|
51
|
+
# Create directory structure
|
|
52
|
+
mkdir -p "${OUTPUT_DIR}/perspectives"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Resolve target files:
|
|
56
|
+
```bash
|
|
57
|
+
# List files matching pattern
|
|
58
|
+
find <target-pattern> -type f -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If no files found, abort with error message.
|
|
62
|
+
|
|
63
|
+
### Step 2: Select Perspectives
|
|
64
|
+
|
|
65
|
+
**If `--perspectives` provided:**
|
|
66
|
+
- Parse comma-separated list
|
|
67
|
+
- Validate against available perspectives
|
|
68
|
+
|
|
69
|
+
**If not provided (interactive):**
|
|
70
|
+
- Present perspective groups:
|
|
71
|
+
- Quick scan: bug, test, quality
|
|
72
|
+
- Security audit: security, bug, quality
|
|
73
|
+
- Full analysis: all perspectives
|
|
74
|
+
- Use first group as default or wait for user input
|
|
75
|
+
|
|
76
|
+
### Step 3: Analyze Each Perspective
|
|
77
|
+
|
|
78
|
+
For each selected perspective, explore target files and identify issues.
|
|
79
|
+
|
|
80
|
+
**Perspective-Specific Focus:**
|
|
81
|
+
|
|
82
|
+
| Perspective | Focus Areas | Priority Guide |
|
|
83
|
+
|-------------|-------------|----------------|
|
|
84
|
+
| **bug** | Null checks, edge cases, resource leaks, race conditions, boundary conditions, exception handling | Critical=data corruption/crash, High=malfunction, Medium=edge case |
|
|
85
|
+
| **ux** | Error messages, loading states, feedback, accessibility, interaction patterns | Critical=inaccessible, High=confusing, Medium=inconsistent |
|
|
86
|
+
| **test** | Missing unit tests, edge case coverage, integration gaps, assertion quality | Critical=no security tests, High=no core logic tests |
|
|
87
|
+
| **quality** | Complexity, duplication, naming, documentation, code smells | Critical=unmaintainable, High=significant issues |
|
|
88
|
+
| **security** | Input validation, auth/authz, injection, XSS/CSRF, data exposure | Critical=auth bypass/injection, High=missing authz |
|
|
89
|
+
| **performance** | N+1 queries, memory leaks, caching, algorithm efficiency | Critical=memory leaks, High=N+1 queries |
|
|
90
|
+
| **maintainability** | Coupling, interface design, tech debt, extensibility | Critical=forced changes, High=unclear boundaries |
|
|
91
|
+
| **best-practices** | Framework conventions, language patterns, anti-patterns | Critical=bug-causing anti-patterns, High=convention violations |
|
|
92
|
+
|
|
93
|
+
**For each perspective:**
|
|
94
|
+
|
|
95
|
+
1. Read target files and analyze for perspective-specific concerns
|
|
96
|
+
2. Use `rg` to search for patterns indicating issues
|
|
97
|
+
3. Record findings with:
|
|
98
|
+
- `id`: Finding ID (e.g., `F-001`)
|
|
99
|
+
- `title`: Brief description
|
|
100
|
+
- `priority`: critical/high/medium/low
|
|
101
|
+
- `category`: Specific category within perspective
|
|
102
|
+
- `description`: Detailed explanation
|
|
103
|
+
- `file`: File path
|
|
104
|
+
- `line`: Line number
|
|
105
|
+
- `snippet`: Code snippet
|
|
106
|
+
- `suggested_issue`: Proposed issue text
|
|
107
|
+
- `confidence`: 0.0-1.0
|
|
108
|
+
|
|
109
|
+
4. Write to `{OUTPUT_DIR}/perspectives/{perspective}.json`:
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"perspective": "security",
|
|
113
|
+
"analyzed_at": "2025-01-22T...",
|
|
114
|
+
"files_analyzed": 15,
|
|
115
|
+
"findings": [
|
|
116
|
+
{
|
|
117
|
+
"id": "F-001",
|
|
118
|
+
"title": "Missing input validation",
|
|
119
|
+
"priority": "high",
|
|
120
|
+
"category": "input-validation",
|
|
121
|
+
"description": "User input is passed directly to database query",
|
|
122
|
+
"file": "src/auth/login.ts",
|
|
123
|
+
"line": 42,
|
|
124
|
+
"snippet": "db.query(`SELECT * FROM users WHERE name = '${input}'`)",
|
|
125
|
+
"suggested_issue": "Add input sanitization to prevent SQL injection",
|
|
126
|
+
"confidence": 0.95
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Step 4: External Research (if --external)
|
|
133
|
+
|
|
134
|
+
For security and best-practices perspectives, use Exa to search for:
|
|
135
|
+
- Industry best practices for the tech stack
|
|
136
|
+
- Known vulnerability patterns
|
|
137
|
+
- Framework-specific security guidelines
|
|
138
|
+
|
|
139
|
+
Write results to `{OUTPUT_DIR}/external-research.json`.
|
|
140
|
+
|
|
141
|
+
### Step 5: Aggregate and Prioritize
|
|
142
|
+
|
|
143
|
+
1. Load all perspective JSON files
|
|
144
|
+
2. Deduplicate findings by file+line
|
|
145
|
+
3. Calculate priority scores:
|
|
146
|
+
- critical: 1.0
|
|
147
|
+
- high: 0.8
|
|
148
|
+
- medium: 0.5
|
|
149
|
+
- low: 0.2
|
|
150
|
+
- Adjust by confidence
|
|
151
|
+
|
|
152
|
+
4. Sort by priority score descending
|
|
153
|
+
|
|
154
|
+
### Step 6: Generate Issues
|
|
155
|
+
|
|
156
|
+
Convert high-priority findings to issue format:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Append to discovery-issues.jsonl
|
|
160
|
+
echo '{"id":"ISS-DSC-001","title":"...","priority":"high",...}' >> ${OUTPUT_DIR}/discovery-issues.jsonl
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Issue criteria:
|
|
164
|
+
- `priority` is critical or high
|
|
165
|
+
- OR `priority_score >= 0.7`
|
|
166
|
+
- OR `confidence >= 0.9` with medium priority
|
|
167
|
+
|
|
168
|
+
### Step 7: Update Discovery State
|
|
169
|
+
|
|
170
|
+
Write final state to `{OUTPUT_DIR}/discovery-state.json`:
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"discovery_id": "DSC-...",
|
|
174
|
+
"target_pattern": "src/auth/**",
|
|
175
|
+
"phase": "complete",
|
|
176
|
+
"created_at": "...",
|
|
177
|
+
"updated_at": "...",
|
|
178
|
+
"perspectives": ["bug", "security", "test"],
|
|
179
|
+
"results": {
|
|
180
|
+
"total_findings": 15,
|
|
181
|
+
"issues_generated": 8,
|
|
182
|
+
"priority_distribution": {
|
|
183
|
+
"critical": 1,
|
|
184
|
+
"high": 3,
|
|
185
|
+
"medium": 4
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Step 8: Generate Summary
|
|
192
|
+
|
|
193
|
+
Write summary to `{OUTPUT_DIR}/summary.md`:
|
|
194
|
+
```markdown
|
|
195
|
+
# Discovery Summary: DSC-...
|
|
196
|
+
|
|
197
|
+
**Target**: src/auth/**
|
|
198
|
+
**Perspectives**: bug, security, test
|
|
199
|
+
**Total Findings**: 15
|
|
200
|
+
**Issues Generated**: 8
|
|
201
|
+
|
|
202
|
+
## Priority Breakdown
|
|
203
|
+
- Critical: 1
|
|
204
|
+
- High: 3
|
|
205
|
+
- Medium: 4
|
|
206
|
+
|
|
207
|
+
## Top Findings
|
|
208
|
+
|
|
209
|
+
1. **[Critical] SQL Injection in login.ts:42**
|
|
210
|
+
Category: security/input-validation
|
|
211
|
+
...
|
|
212
|
+
|
|
213
|
+
2. **[High] Missing null check in auth.ts:128**
|
|
214
|
+
Category: bug/null-check
|
|
215
|
+
...
|
|
216
|
+
|
|
217
|
+
## Next Steps
|
|
218
|
+
- Run `/issue:plan` to plan solutions for generated issues
|
|
219
|
+
- Use `ccw view` to review findings in dashboard
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Quality Checklist
|
|
223
|
+
|
|
224
|
+
Before completing, verify:
|
|
225
|
+
|
|
226
|
+
- [ ] All target files analyzed for selected perspectives
|
|
227
|
+
- [ ] Findings include file:line references
|
|
228
|
+
- [ ] Priority assigned to all findings
|
|
229
|
+
- [ ] Issues generated from high-priority findings
|
|
230
|
+
- [ ] Discovery state shows `phase: complete`
|
|
231
|
+
- [ ] Summary includes actionable next steps
|
|
232
|
+
|
|
233
|
+
## Error Handling
|
|
234
|
+
|
|
235
|
+
| Situation | Action |
|
|
236
|
+
|-----------|--------|
|
|
237
|
+
| No files match pattern | Abort with clear error message |
|
|
238
|
+
| Perspective analysis fails | Log error, continue with other perspectives |
|
|
239
|
+
| No findings | Report "No issues found" (not an error) |
|
|
240
|
+
| External research fails | Continue without external context |
|
|
241
|
+
|
|
242
|
+
## Schema References
|
|
243
|
+
|
|
244
|
+
| Schema | Path | Purpose |
|
|
245
|
+
|--------|------|---------|
|
|
246
|
+
| Discovery State | `~/.claude/workflows/cli-templates/schemas/discovery-state-schema.json` | Session state |
|
|
247
|
+
| Discovery Finding | `~/.claude/workflows/cli-templates/schemas/discovery-finding-schema.json` | Finding format |
|
|
248
|
+
|
|
249
|
+
## Start Discovery
|
|
250
|
+
|
|
251
|
+
Begin by resolving target files:
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# Parse target pattern from arguments
|
|
255
|
+
TARGET_PATTERN="${1:-src/**}"
|
|
256
|
+
|
|
257
|
+
# Count matching files
|
|
258
|
+
find ${TARGET_PATTERN} -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" \) | wc -l
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Then proceed with perspective selection and analysis.
|
|
@@ -9,6 +9,16 @@ argument-hint: "--queue <queue-id> [--worktree [<existing-path>]]"
|
|
|
9
9
|
|
|
10
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 → verify), then commit once per solution with formatted summary. Continue autonomously until queue is empty.
|
|
11
11
|
|
|
12
|
+
## Project Context (MANDATORY FIRST STEPS)
|
|
13
|
+
|
|
14
|
+
Before starting execution, load project context:
|
|
15
|
+
|
|
16
|
+
1. **Read project tech stack**: `.workflow/project-tech.json`
|
|
17
|
+
2. **Read project guidelines**: `.workflow/project-guidelines.json`
|
|
18
|
+
3. **Read solution schema**: `~/.claude/workflows/cli-templates/schemas/solution-schema.json`
|
|
19
|
+
|
|
20
|
+
This ensures execution follows project conventions and patterns.
|
|
21
|
+
|
|
12
22
|
## Queue ID Requirement (MANDATORY)
|
|
13
23
|
|
|
14
24
|
**`--queue <queue-id>` parameter is REQUIRED**
|