claude-code-workflow 6.3.16 → 6.3.17

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 (59) hide show
  1. package/.claude/CLAUDE.md +2 -2
  2. package/.claude/agents/action-planning-agent.md +3 -0
  3. package/.claude/agents/cli-execution-agent.md +2 -0
  4. package/.claude/agents/cli-explore-agent.md +3 -0
  5. package/.claude/agents/cli-lite-planning-agent.md +3 -0
  6. package/.claude/agents/cli-planning-agent.md +3 -0
  7. package/.claude/agents/code-developer.md +3 -0
  8. package/.claude/agents/context-search-agent.md +3 -0
  9. package/.claude/agents/doc-generator.md +3 -0
  10. package/.claude/agents/issue-plan-agent.md +3 -0
  11. package/.claude/agents/issue-queue-agent.md +3 -0
  12. package/.claude/agents/universal-executor.md +3 -0
  13. package/.claude/commands/issue/new.md +323 -309
  14. package/.codex/AGENTS.md +6 -0
  15. package/ccw/dist/commands/cli.d.ts.map +1 -1
  16. package/ccw/dist/commands/cli.js +106 -14
  17. package/ccw/dist/commands/cli.js.map +1 -1
  18. package/ccw/dist/commands/issue.d.ts.map +1 -1
  19. package/ccw/dist/commands/issue.js +29 -4
  20. package/ccw/dist/commands/issue.js.map +1 -1
  21. package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
  22. package/ccw/dist/core/routes/litellm-api-routes.js +8 -3
  23. package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
  24. package/ccw/dist/tools/cli-executor.d.ts +5 -0
  25. package/ccw/dist/tools/cli-executor.d.ts.map +1 -1
  26. package/ccw/dist/tools/cli-executor.js +24 -0
  27. package/ccw/dist/tools/cli-executor.js.map +1 -1
  28. package/ccw/dist/tools/codex-lens.d.ts.map +1 -1
  29. package/ccw/dist/tools/codex-lens.js +2 -19
  30. package/ccw/dist/tools/codex-lens.js.map +1 -1
  31. package/ccw/dist/utils/python-utils.d.ts +36 -0
  32. package/ccw/dist/utils/python-utils.d.ts.map +1 -0
  33. package/ccw/dist/utils/python-utils.js +115 -0
  34. package/ccw/dist/utils/python-utils.js.map +1 -0
  35. package/ccw/src/commands/cli.ts +120 -14
  36. package/ccw/src/commands/issue.ts +31 -4
  37. package/ccw/src/core/routes/litellm-api-routes.ts +10 -3
  38. package/ccw/src/templates/dashboard-css/33-cli-stream-viewer.css +8 -12
  39. package/ccw/src/tools/cli-executor.ts +28 -0
  40. package/ccw/src/tools/codex-lens.ts +2 -19
  41. package/ccw/src/utils/python-utils.ts +121 -0
  42. package/codex-lens/src/codexlens/__pycache__/config.cpython-313.pyc +0 -0
  43. package/codex-lens/src/codexlens/__pycache__/entities.cpython-313.pyc +0 -0
  44. package/codex-lens/src/codexlens/indexing/__pycache__/symbol_extractor.cpython-313.pyc +0 -0
  45. package/codex-lens/src/codexlens/parsers/__pycache__/factory.cpython-313.pyc +0 -0
  46. package/codex-lens/src/codexlens/parsers/__pycache__/treesitter_parser.cpython-313.pyc +0 -0
  47. package/codex-lens/src/codexlens/search/__pycache__/chain_search.cpython-313.pyc +0 -0
  48. package/codex-lens/src/codexlens/search/__pycache__/enrichment.cpython-313.pyc +0 -0
  49. package/codex-lens/src/codexlens/search/__pycache__/graph_expander.cpython-313.pyc +0 -0
  50. package/codex-lens/src/codexlens/search/__pycache__/hybrid_search.cpython-313.pyc +0 -0
  51. package/codex-lens/src/codexlens/search/__pycache__/ranking.cpython-313.pyc +0 -0
  52. package/codex-lens/src/codexlens/search/enrichment.py +150 -150
  53. package/codex-lens/src/codexlens/semantic/__pycache__/reranker.cpython-313.pyc +0 -0
  54. package/codex-lens/src/codexlens/storage/__pycache__/dir_index.cpython-313.pyc +0 -0
  55. package/codex-lens/src/codexlens/storage/__pycache__/index_tree.cpython-313.pyc +0 -0
  56. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_006_enhance_relationships.cpython-313.pyc +0 -0
  57. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_007_add_graph_neighbors.cpython-313.pyc +0 -0
  58. package/codex-lens/src/codexlens/storage/migrations/__pycache__/migration_008_add_merkle_hashes.cpython-313.pyc +0 -0
  59. package/package.json +1 -1
@@ -1,309 +1,323 @@
1
- ---
2
- name: new
3
- description: Create structured issue from GitHub URL or text description
4
- argument-hint: "<github-url | text-description> [--priority 1-5]"
5
- allowed-tools: TodoWrite(*), Bash(*), Read(*), AskUserQuestion(*), mcp__ace-tool__search_context(*)
6
- ---
7
-
8
- # Issue New Command (/issue:new)
9
-
10
- ## Core Principle
11
-
12
- **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 (single source of truth)
28
- source: 'github' | 'text' | 'discovery';
29
- source_url?: string;
30
- labels?: string[];
31
-
32
- // Optional structured fields
33
- expected_behavior?: string;
34
- actual_behavior?: string;
35
- affected_components?: string[];
36
-
37
- // Feedback history (failures + human clarifications)
38
- feedback?: {
39
- type: 'failure' | 'clarification' | 'rejection';
40
- stage: string; // new/plan/execute
41
- content: string;
42
- created_at: string;
43
- }[];
44
-
45
- // Solution binding
46
- bound_solution_id: string | null;
47
-
48
- // Timestamps
49
- created_at: string;
50
- updated_at: string;
51
- }
52
- ```
53
-
54
- ## Quick Reference
55
-
56
- ```bash
57
- # Clear inputs - direct creation
58
- /issue:new https://github.com/owner/repo/issues/123
59
- /issue:new "Login fails with special chars. Expected: success. Actual: 500 error"
60
-
61
- # Vague input - will ask clarifying questions
62
- /issue:new "something wrong with auth"
63
- ```
64
-
65
- ## Implementation
66
-
67
- ### Phase 1: Input Analysis & Clarity Detection
68
-
69
- ```javascript
70
- const input = userInput.trim();
71
- const flags = parseFlags(userInput); // --priority
72
-
73
- // Detect input type and clarity
74
- const isGitHubUrl = input.match(/github\.com\/[\w-]+\/[\w-]+\/issues\/\d+/);
75
- const isGitHubShort = input.match(/^#(\d+)$/);
76
- const hasStructure = input.match(/(expected|actual|affects|steps):/i);
77
-
78
- // Clarity score: 0-3
79
- let clarityScore = 0;
80
- if (isGitHubUrl || isGitHubShort) clarityScore = 3; // GitHub = fully clear
81
- else if (hasStructure) clarityScore = 2; // Structured text = clear
82
- else if (input.length > 50) clarityScore = 1; // Long text = somewhat clear
83
- else clarityScore = 0; // Vague
84
-
85
- let issueData = {};
86
- ```
87
-
88
- ### Phase 2: Data Extraction (GitHub or Text)
89
-
90
- ```javascript
91
- if (isGitHubUrl || isGitHubShort) {
92
- // GitHub - fetch via gh CLI
93
- const result = Bash(`gh issue view ${extractIssueRef(input)} --json number,title,body,labels,url`);
94
- const gh = JSON.parse(result);
95
- issueData = {
96
- id: `GH-${gh.number}`,
97
- title: gh.title,
98
- source: 'github',
99
- source_url: gh.url,
100
- labels: gh.labels.map(l => l.name),
101
- context: gh.body?.substring(0, 500) || gh.title,
102
- ...parseMarkdownBody(gh.body)
103
- };
104
- } else {
105
- // Text description
106
- issueData = {
107
- id: `ISS-${new Date().toISOString().replace(/[-:T]/g, '').slice(0, 14)}`,
108
- source: 'text',
109
- ...parseTextDescription(input)
110
- };
111
- }
112
- ```
113
-
114
- ### Phase 3: Lightweight Context Hint (Conditional)
115
-
116
- ```javascript
117
- // ACE search ONLY for medium clarity (1-2) AND missing components
118
- // Skip for: GitHub (has context), vague (needs clarification first)
119
- // Note: Deep exploration happens in /issue:plan, this is just a quick hint
120
-
121
- if (clarityScore >= 1 && clarityScore <= 2 && !issueData.affected_components?.length) {
122
- const keywords = extractKeywords(issueData.context);
123
-
124
- if (keywords.length >= 2) {
125
- try {
126
- const aceResult = mcp__ace-tool__search_context({
127
- project_root_path: process.cwd(),
128
- query: keywords.slice(0, 3).join(' ')
129
- });
130
- issueData.affected_components = aceResult.files?.slice(0, 3) || [];
131
- } catch {
132
- // ACE failure is non-blocking
133
- }
134
- }
135
- }
136
- ```
137
-
138
- ### Phase 4: Conditional Clarification (Only if Unclear)
139
-
140
- ```javascript
141
- // ONLY ask questions if clarity is low - simple open-ended prompt
142
- if (clarityScore < 2 && (!issueData.context || issueData.context.length < 20)) {
143
- const answer = AskUserQuestion({
144
- questions: [{
145
- question: 'Please describe the issue in more detail:',
146
- header: 'Clarify',
147
- multiSelect: false,
148
- options: [
149
- { label: 'Provide details', description: 'Describe what, where, and expected behavior' }
150
- ]
151
- }]
152
- });
153
-
154
- // Use custom text input (via "Other")
155
- if (answer.customText) {
156
- issueData.context = answer.customText;
157
- issueData.title = answer.customText.split(/[.\n]/)[0].substring(0, 60);
158
- issueData.feedback = [{
159
- type: 'clarification',
160
- stage: 'new',
161
- content: answer.customText,
162
- created_at: new Date().toISOString()
163
- }];
164
- }
165
- }
166
- ```
167
-
168
- ### Phase 5: Create Issue
169
-
170
- **Summary Display:**
171
- - Show ID, title, source, affected files (if any)
172
-
173
- **Confirmation** (only for vague inputs, clarityScore < 2):
174
- - Use `AskUserQuestion` to confirm before creation
175
-
176
- **Issue Creation** (via CLI endpoint):
177
- ```bash
178
- ccw issue create --data '{"title":"...", "context":"...", "priority":3, ...}'
179
- ```
180
-
181
- **CLI Endpoint Features:**
182
- | Feature | Description |
183
- |---------|-------------|
184
- | Auto-increment ID | `ISS-YYYYMMDD-NNN` (e.g., `ISS-20251229-001`) |
185
- | Trailing newline | Proper JSONL format, no corruption |
186
- | JSON output | Returns created issue with all fields |
187
-
188
- **Example:**
189
- ```bash
190
- # Create issue via CLI
191
- ccw issue create --data '{
192
- "title": "Login fails with special chars",
193
- "context": "500 error when password contains quotes",
194
- "priority": 2,
195
- "source": "text",
196
- "expected_behavior": "Login succeeds",
197
- "actual_behavior": "500 Internal Server Error"
198
- }'
199
-
200
- # Output (JSON)
201
- {
202
- "id": "ISS-20251229-001",
203
- "title": "Login fails with special chars",
204
- "status": "registered",
205
- ...
206
- }
207
- ```
208
-
209
- **Completion:**
210
- - Display created issue ID
211
- - Show next step: `/issue:plan <id>`
212
-
213
- ## Execution Flow
214
-
215
- ```
216
- Phase 1: Input Analysis
217
- └─ Detect clarity score (GitHub URL? Structured text? Keywords?)
218
-
219
- Phase 2: Data Extraction (branched by clarity)
220
- ┌────────────┬─────────────────┬──────────────┐
221
- │ Score 3 │ Score 1-2 │ Score 0 │
222
- │ GitHub │ Text + ACE │ Vague │
223
- ├────────────┼─────────────────┼──────────────┤
224
- │ gh CLI │ Parse struct │ AskQuestion │
225
- │ → parse │ + quick hint │ (1 question) │
226
- │ │ (3 files max) │ → feedback │
227
- └────────────┴─────────────────┴──────────────┘
228
-
229
- Phase 3: Create Issue
230
- ├─ Score ≥ 2: Direct creation
231
- └─ Score < 2: Confirm first Create
232
-
233
- Note: Deep exploration & lifecycle deferred to /issue:plan
234
- ```
235
-
236
- ## Helper Functions
237
-
238
- ```javascript
239
- function extractKeywords(text) {
240
- const stopWords = new Set(['the', 'a', 'an', 'is', 'are', 'was', 'were', 'not', 'with']);
241
- return text
242
- .toLowerCase()
243
- .split(/\W+/)
244
- .filter(w => w.length > 3 && !stopWords.has(w))
245
- .slice(0, 5);
246
- }
247
-
248
- function parseTextDescription(text) {
249
- const result = { title: '', context: '' };
250
- const sentences = text.split(/\.(?=\s|$)/);
251
-
252
- result.title = sentences[0]?.trim().substring(0, 60) || 'Untitled';
253
- result.context = text.substring(0, 500);
254
-
255
- // Extract structured fields if present
256
- const expected = text.match(/expected:?\s*([^.]+)/i);
257
- const actual = text.match(/actual:?\s*([^.]+)/i);
258
- const affects = text.match(/affects?:?\s*([^.]+)/i);
259
-
260
- if (expected) result.expected_behavior = expected[1].trim();
261
- if (actual) result.actual_behavior = actual[1].trim();
262
- if (affects) {
263
- result.affected_components = affects[1].split(/[,\s]+/).filter(c => c.includes('/') || c.includes('.'));
264
- }
265
-
266
- return result;
267
- }
268
-
269
- function parseMarkdownBody(body) {
270
- if (!body) return {};
271
- const result = {};
272
-
273
- const problem = body.match(/##?\s*(problem|description)[:\s]*([\s\S]*?)(?=##|$)/i);
274
- const expected = body.match(/##?\s*expected[:\s]*([\s\S]*?)(?=##|$)/i);
275
- const actual = body.match(/##?\s*actual[:\s]*([\s\S]*?)(?=##|$)/i);
276
-
277
- if (problem) result.context = problem[2].trim().substring(0, 500);
278
- if (expected) result.expected_behavior = expected[2].trim();
279
- if (actual) result.actual_behavior = actual[2].trim();
280
-
281
- return result;
282
- }
283
- ```
284
-
285
- ## Examples
286
-
287
- ### Clear Input (No Questions)
288
-
289
- ```bash
290
- /issue:new https://github.com/org/repo/issues/42
291
- # Fetches, parses, creates immediately
292
-
293
- /issue:new "Login fails with special chars. Expected: success. Actual: 500"
294
- # → Parses structure, creates immediately
295
- ```
296
-
297
- ### Vague Input (1 Question)
298
-
299
- ```bash
300
- /issue:new "auth broken"
301
- # Asks: "Input unclear. What is the issue about?"
302
- # → User provides details → saved to feedback[]
303
- # → Creates issue
304
- ```
305
-
306
- ## Related Commands
307
-
308
- - `/issue:plan` - Plan solution for issue
309
- - `/issue:manage` - Interactive issue management
1
+ ---
2
+ name: new
3
+ description: Create structured issue from GitHub URL or text description
4
+ argument-hint: "<github-url | text-description> [--priority 1-5]"
5
+ allowed-tools: TodoWrite(*), Bash(*), Read(*), AskUserQuestion(*), mcp__ace-tool__search_context(*)
6
+ ---
7
+
8
+ # Issue New Command (/issue:new)
9
+
10
+ ## Core Principle
11
+
12
+ **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 (single source of truth)
28
+ source: 'github' | 'text' | 'discovery';
29
+ source_url?: string;
30
+ labels?: string[];
31
+
32
+ // Optional structured fields
33
+ expected_behavior?: string;
34
+ actual_behavior?: string;
35
+ affected_components?: string[];
36
+
37
+ // Feedback history (failures + human clarifications)
38
+ feedback?: {
39
+ type: 'failure' | 'clarification' | 'rejection';
40
+ stage: string; // new/plan/execute
41
+ content: string;
42
+ created_at: string;
43
+ }[];
44
+
45
+ // Solution binding
46
+ bound_solution_id: string | null;
47
+
48
+ // Timestamps
49
+ created_at: string;
50
+ updated_at: string;
51
+ }
52
+ ```
53
+
54
+ ## Quick Reference
55
+
56
+ ```bash
57
+ # Clear inputs - direct creation
58
+ /issue:new https://github.com/owner/repo/issues/123
59
+ /issue:new "Login fails with special chars. Expected: success. Actual: 500 error"
60
+
61
+ # Vague input - will ask clarifying questions
62
+ /issue:new "something wrong with auth"
63
+ ```
64
+
65
+ ## Implementation
66
+
67
+ ### Phase 1: Input Analysis & Clarity Detection
68
+
69
+ ```javascript
70
+ const input = userInput.trim();
71
+ const flags = parseFlags(userInput); // --priority
72
+
73
+ // Detect input type and clarity
74
+ const isGitHubUrl = input.match(/github\.com\/[\w-]+\/[\w-]+\/issues\/\d+/);
75
+ const isGitHubShort = input.match(/^#(\d+)$/);
76
+ const hasStructure = input.match(/(expected|actual|affects|steps):/i);
77
+
78
+ // Clarity score: 0-3
79
+ let clarityScore = 0;
80
+ if (isGitHubUrl || isGitHubShort) clarityScore = 3; // GitHub = fully clear
81
+ else if (hasStructure) clarityScore = 2; // Structured text = clear
82
+ else if (input.length > 50) clarityScore = 1; // Long text = somewhat clear
83
+ else clarityScore = 0; // Vague
84
+
85
+ let issueData = {};
86
+ ```
87
+
88
+ ### Phase 2: Data Extraction (GitHub or Text)
89
+
90
+ ```javascript
91
+ if (isGitHubUrl || isGitHubShort) {
92
+ // GitHub - fetch via gh CLI
93
+ const result = Bash(`gh issue view ${extractIssueRef(input)} --json number,title,body,labels,url`);
94
+ const gh = JSON.parse(result);
95
+ issueData = {
96
+ id: `GH-${gh.number}`,
97
+ title: gh.title,
98
+ source: 'github',
99
+ source_url: gh.url,
100
+ labels: gh.labels.map(l => l.name),
101
+ context: gh.body?.substring(0, 500) || gh.title,
102
+ ...parseMarkdownBody(gh.body)
103
+ };
104
+ } else {
105
+ // Text description
106
+ issueData = {
107
+ id: `ISS-${new Date().toISOString().replace(/[-:T]/g, '').slice(0, 14)}`,
108
+ source: 'text',
109
+ ...parseTextDescription(input)
110
+ };
111
+ }
112
+ ```
113
+
114
+ ### Phase 3: Lightweight Context Hint (Conditional)
115
+
116
+ ```javascript
117
+ // ACE search ONLY for medium clarity (1-2) AND missing components
118
+ // Skip for: GitHub (has context), vague (needs clarification first)
119
+ // Note: Deep exploration happens in /issue:plan, this is just a quick hint
120
+
121
+ if (clarityScore >= 1 && clarityScore <= 2 && !issueData.affected_components?.length) {
122
+ const keywords = extractKeywords(issueData.context);
123
+
124
+ if (keywords.length >= 2) {
125
+ try {
126
+ const aceResult = mcp__ace-tool__search_context({
127
+ project_root_path: process.cwd(),
128
+ query: keywords.slice(0, 3).join(' ')
129
+ });
130
+ issueData.affected_components = aceResult.files?.slice(0, 3) || [];
131
+ } catch {
132
+ // ACE failure is non-blocking
133
+ }
134
+ }
135
+ }
136
+ ```
137
+
138
+ ### Phase 4: Conditional Clarification (Only if Unclear)
139
+
140
+ ```javascript
141
+ // ONLY ask questions if clarity is low - simple open-ended prompt
142
+ if (clarityScore < 2 && (!issueData.context || issueData.context.length < 20)) {
143
+ const answer = AskUserQuestion({
144
+ questions: [{
145
+ question: 'Please describe the issue in more detail:',
146
+ header: 'Clarify',
147
+ multiSelect: false,
148
+ options: [
149
+ { label: 'Provide details', description: 'Describe what, where, and expected behavior' }
150
+ ]
151
+ }]
152
+ });
153
+
154
+ // Use custom text input (via "Other")
155
+ if (answer.customText) {
156
+ issueData.context = answer.customText;
157
+ issueData.title = answer.customText.split(/[.\n]/)[0].substring(0, 60);
158
+ issueData.feedback = [{
159
+ type: 'clarification',
160
+ stage: 'new',
161
+ content: answer.customText,
162
+ created_at: new Date().toISOString()
163
+ }];
164
+ }
165
+ }
166
+ ```
167
+
168
+ ### Phase 5: Create Issue
169
+
170
+ **Summary Display:**
171
+ - Show ID, title, source, affected files (if any)
172
+
173
+ **Confirmation** (only for vague inputs, clarityScore < 2):
174
+ - Use `AskUserQuestion` to confirm before creation
175
+
176
+ **Issue Creation** (via CLI endpoint):
177
+ ```bash
178
+ # Option 1: Pipe input (recommended for complex JSON - avoids shell escaping)
179
+ echo '{"title":"...", "context":"...", "priority":3}' | ccw issue create
180
+
181
+ # Option 2: Heredoc (for multi-line JSON)
182
+ ccw issue create << 'EOF'
183
+ {"title":"...", "context":"含\"引号\"的内容", "priority":3}
184
+ EOF
185
+
186
+ # Option 3: --data parameter (simple cases only)
187
+ ccw issue create --data '{"title":"...", "priority":3}'
188
+ ```
189
+
190
+ **CLI Endpoint Features:**
191
+ | Feature | Description |
192
+ |---------|-------------|
193
+ | Auto-increment ID | `ISS-YYYYMMDD-NNN` (e.g., `ISS-20251229-001`) |
194
+ | Trailing newline | Proper JSONL format, no corruption |
195
+ | JSON output | Returns created issue with all fields |
196
+
197
+ **Example:**
198
+ ```bash
199
+ # Create issue via pipe (recommended)
200
+ echo '{"title": "Login fails with special chars", "context": "500 error when password contains quotes", "priority": 2}' | ccw issue create
201
+
202
+ # Or with heredoc for complex JSON
203
+ ccw issue create << 'EOF'
204
+ {
205
+ "title": "Login fails with special chars",
206
+ "context": "500 error when password contains \"quotes\"",
207
+ "priority": 2,
208
+ "source": "text",
209
+ "expected_behavior": "Login succeeds",
210
+ "actual_behavior": "500 Internal Server Error"
211
+ }
212
+ EOF
213
+
214
+ # Output (JSON)
215
+ {
216
+ "id": "ISS-20251229-001",
217
+ "title": "Login fails with special chars",
218
+ "status": "registered",
219
+ ...
220
+ }
221
+ ```
222
+
223
+ **Completion:**
224
+ - Display created issue ID
225
+ - Show next step: `/issue:plan <id>`
226
+
227
+ ## Execution Flow
228
+
229
+ ```
230
+ Phase 1: Input Analysis
231
+ └─ Detect clarity score (GitHub URL? Structured text? Keywords?)
232
+
233
+ Phase 2: Data Extraction (branched by clarity)
234
+ ┌────────────┬─────────────────┬──────────────┐
235
+ │ Score 3 │ Score 1-2 │ Score 0 │
236
+ │ GitHub │ Text + ACE │ Vague │
237
+ ├────────────┼─────────────────┼──────────────┤
238
+ │ gh CLI │ Parse struct │ AskQuestion │
239
+ │ → parse │ + quick hint │ (1 question)
240
+ │ │ (3 files max) │ → feedback │
241
+ └────────────┴─────────────────┴──────────────┘
242
+
243
+ Phase 3: Create Issue
244
+ ├─ Score 2: Direct creation
245
+ └─ Score < 2: Confirm first → Create
246
+
247
+ Note: Deep exploration & lifecycle deferred to /issue:plan
248
+ ```
249
+
250
+ ## Helper Functions
251
+
252
+ ```javascript
253
+ function extractKeywords(text) {
254
+ const stopWords = new Set(['the', 'a', 'an', 'is', 'are', 'was', 'were', 'not', 'with']);
255
+ return text
256
+ .toLowerCase()
257
+ .split(/\W+/)
258
+ .filter(w => w.length > 3 && !stopWords.has(w))
259
+ .slice(0, 5);
260
+ }
261
+
262
+ function parseTextDescription(text) {
263
+ const result = { title: '', context: '' };
264
+ const sentences = text.split(/\.(?=\s|$)/);
265
+
266
+ result.title = sentences[0]?.trim().substring(0, 60) || 'Untitled';
267
+ result.context = text.substring(0, 500);
268
+
269
+ // Extract structured fields if present
270
+ const expected = text.match(/expected:?\s*([^.]+)/i);
271
+ const actual = text.match(/actual:?\s*([^.]+)/i);
272
+ const affects = text.match(/affects?:?\s*([^.]+)/i);
273
+
274
+ if (expected) result.expected_behavior = expected[1].trim();
275
+ if (actual) result.actual_behavior = actual[1].trim();
276
+ if (affects) {
277
+ result.affected_components = affects[1].split(/[,\s]+/).filter(c => c.includes('/') || c.includes('.'));
278
+ }
279
+
280
+ return result;
281
+ }
282
+
283
+ function parseMarkdownBody(body) {
284
+ if (!body) return {};
285
+ const result = {};
286
+
287
+ const problem = body.match(/##?\s*(problem|description)[:\s]*([\s\S]*?)(?=##|$)/i);
288
+ const expected = body.match(/##?\s*expected[:\s]*([\s\S]*?)(?=##|$)/i);
289
+ const actual = body.match(/##?\s*actual[:\s]*([\s\S]*?)(?=##|$)/i);
290
+
291
+ if (problem) result.context = problem[2].trim().substring(0, 500);
292
+ if (expected) result.expected_behavior = expected[2].trim();
293
+ if (actual) result.actual_behavior = actual[2].trim();
294
+
295
+ return result;
296
+ }
297
+ ```
298
+
299
+ ## Examples
300
+
301
+ ### Clear Input (No Questions)
302
+
303
+ ```bash
304
+ /issue:new https://github.com/org/repo/issues/42
305
+ # → Fetches, parses, creates immediately
306
+
307
+ /issue:new "Login fails with special chars. Expected: success. Actual: 500"
308
+ # Parses structure, creates immediately
309
+ ```
310
+
311
+ ### Vague Input (1 Question)
312
+
313
+ ```bash
314
+ /issue:new "auth broken"
315
+ # → Asks: "Input unclear. What is the issue about?"
316
+ # → User provides details → saved to feedback[]
317
+ # → Creates issue
318
+ ```
319
+
320
+ ## Related Commands
321
+
322
+ - `/issue:plan` - Plan solution for issue
323
+ - `/issue:manage` - Interactive issue management
package/.codex/AGENTS.md CHANGED
@@ -46,6 +46,12 @@
46
46
  - Maintain established patterns
47
47
  - Test integration between subtasks
48
48
 
49
+ **Git Operations** (Parallel Task Safety):
50
+ - Only stage/commit files directly produced by current task
51
+ - Never touch unrelated changes or other task outputs
52
+ - Use `git add <specific-files>` instead of `git add .`
53
+ - Verify staged files before commit to avoid cross-task conflicts
54
+
49
55
 
50
56
  ## System Optimization
51
57
 
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/commands/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiEH,UAAU,cAAc;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CA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