claude-code-workflow 6.3.49 → 6.3.50
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/issue/new.md +1 -2
- package/.codex/prompts/analyze-with-file.md +5 -2
- package/.codex/prompts/brainstorm-to-cycle.md +4 -3
- package/.codex/prompts/brainstorm-with-file.md +6 -2
- package/.codex/prompts/clean.md +7 -2
- package/.codex/prompts/compact.md +5 -3
- package/.codex/prompts/debug-with-file.md +6 -2
- package/.codex/prompts/execute.md +6 -2
- package/.codex/prompts/issue-execute.md +10 -2
- package/.codex/prompts/issue-new.md +390 -285
- package/.codex/prompts/lite-execute.md +8 -7
- package/.codex/prompts/lite-fix.md +6 -2
- package/.codex/prompts/lite-plan-a.md +6 -2
- package/.codex/prompts/lite-plan-b.md +6 -2
- package/.codex/prompts/lite-plan-c.md +6 -2
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +1 -0
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/cli.d.ts +1 -0
- package/ccw/dist/commands/cli.d.ts.map +1 -1
- package/ccw/dist/commands/cli.js +51 -4
- package/ccw/dist/commands/cli.js.map +1 -1
- package/ccw/dist/core/routes/cli-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/cli-routes.js +16 -1
- package/ccw/dist/core/routes/cli-routes.js.map +1 -1
- package/ccw/src/cli.ts +1 -0
- package/ccw/src/commands/cli.ts +51 -4
- package/ccw/src/core/routes/cli-routes.ts +16 -1
- package/package.json +1 -1
|
@@ -1,285 +1,390 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Create structured issue from GitHub URL or text description
|
|
3
|
-
argument-hint: "<
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Issue New
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
**
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
Clear Input (GitHub URL, structured text)
|
|
16
|
-
Unclear Input (vague description)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
#
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
```javascript
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Create structured issue from GitHub URL or text description. Auto mode with --yes flag.
|
|
3
|
+
argument-hint: "[--yes|-y] <GITHUB_URL | TEXT_DESCRIPTION> [--priority PRIORITY] [--labels LABELS]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Issue New Command
|
|
7
|
+
|
|
8
|
+
## Core Principles
|
|
9
|
+
|
|
10
|
+
**Requirement Clarity Detection** → Ask only when needed
|
|
11
|
+
**Flexible Parameter Input** → Support multiple formats and flags
|
|
12
|
+
**Auto Mode Support** → `--yes`/`-y` skips confirmation questions
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
Clear Input (GitHub URL, structured text) → Direct creation (no questions)
|
|
16
|
+
Unclear Input (vague description) → Clarifying questions (unless --yes)
|
|
17
|
+
Auto Mode (--yes or -y flag) → Skip all questions, use inference
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameter Formats
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# GitHub URL (auto-detected)
|
|
24
|
+
/prompts:issue-new https://github.com/owner/repo/issues/123
|
|
25
|
+
/prompts:issue-new GH-123
|
|
26
|
+
|
|
27
|
+
# Text description with priority
|
|
28
|
+
/prompts:issue-new "Login fails with special chars" --priority 1
|
|
29
|
+
|
|
30
|
+
# Auto mode - skip all questions
|
|
31
|
+
/prompts:issue-new --yes "something broken"
|
|
32
|
+
/prompts:issue-new -y https://github.com/owner/repo/issues/456
|
|
33
|
+
|
|
34
|
+
# With labels
|
|
35
|
+
/prompts:issue-new "Database migration needed" --priority 2 --labels "enhancement,database"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Issue Structure
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
interface Issue {
|
|
42
|
+
id: string; // GH-123 or ISS-YYYYMMDD-HHMMSS
|
|
43
|
+
title: string;
|
|
44
|
+
status: 'registered' | 'planned' | 'queued' | 'in_progress' | 'completed' | 'failed';
|
|
45
|
+
priority: number; // 1 (critical) to 5 (low)
|
|
46
|
+
context: string; // Problem description
|
|
47
|
+
source: 'github' | 'text' | 'discovery';
|
|
48
|
+
source_url?: string;
|
|
49
|
+
labels?: string[];
|
|
50
|
+
|
|
51
|
+
// GitHub binding (for non-GitHub sources that publish to GitHub)
|
|
52
|
+
github_url?: string;
|
|
53
|
+
github_number?: number;
|
|
54
|
+
|
|
55
|
+
// Optional structured fields
|
|
56
|
+
expected_behavior?: string;
|
|
57
|
+
actual_behavior?: string;
|
|
58
|
+
affected_components?: string[];
|
|
59
|
+
|
|
60
|
+
// Solution binding
|
|
61
|
+
bound_solution_id: string | null;
|
|
62
|
+
|
|
63
|
+
// Timestamps
|
|
64
|
+
created_at: string;
|
|
65
|
+
updated_at: string;
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Inputs
|
|
70
|
+
|
|
71
|
+
- **GitHub URL**: `https://github.com/owner/repo/issues/123` or `#123`
|
|
72
|
+
- **Text description**: Natural language description
|
|
73
|
+
- **Priority flag**: `--priority 1-5` (optional, default: 3)
|
|
74
|
+
|
|
75
|
+
## Output Requirements
|
|
76
|
+
|
|
77
|
+
**Create Issue via CLI** (preferred method):
|
|
78
|
+
```bash
|
|
79
|
+
# Pipe input (recommended for complex JSON)
|
|
80
|
+
echo '{"title":"...", "context":"...", "priority":3}' | ccw issue create
|
|
81
|
+
|
|
82
|
+
# Returns created issue JSON
|
|
83
|
+
{"id":"ISS-20251229-001","title":"...","status":"registered",...}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Return Summary:**
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"created": true,
|
|
90
|
+
"id": "ISS-20251229-001",
|
|
91
|
+
"title": "Login fails with special chars",
|
|
92
|
+
"source": "text",
|
|
93
|
+
"github_published": false,
|
|
94
|
+
"next_step": "/issue:plan ISS-20251229-001"
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Workflow
|
|
99
|
+
|
|
100
|
+
### Phase 0: Parse Arguments & Flags
|
|
101
|
+
|
|
102
|
+
Extract parameters from user input:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Input examples (Codex placeholders)
|
|
106
|
+
INPUT="$1" # GitHub URL or text description
|
|
107
|
+
AUTO_MODE="$2" # Check for --yes or -y flag
|
|
108
|
+
|
|
109
|
+
# Parse flags (comma-separated in single argument)
|
|
110
|
+
PRIORITY=$(echo "$INPUT" | grep -oP '(?<=--priority\s)\d+' || echo "3")
|
|
111
|
+
LABELS=$(echo "$INPUT" | grep -oP '(?<=--labels\s)\K[^-]*' | xargs)
|
|
112
|
+
AUTO_YES=$(echo "$INPUT" | grep -qE '--yes|-y' && echo "true" || echo "false")
|
|
113
|
+
|
|
114
|
+
# Extract main input (URL or text) - remove all flags
|
|
115
|
+
MAIN_INPUT=$(echo "$INPUT" | sed 's/\s*--priority\s*\d*//; s/\s*--labels\s*[^-]*//; s/\s*--yes\s*//; s/\s*-y\s*//' | xargs)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Phase 1: Analyze Input & Clarity Detection
|
|
119
|
+
|
|
120
|
+
```javascript
|
|
121
|
+
const mainInput = userInput.trim();
|
|
122
|
+
|
|
123
|
+
// Detect input type and clarity
|
|
124
|
+
const isGitHubUrl = mainInput.match(/github\.com\/[\w-]+\/[\w-]+\/issues\/\d+/);
|
|
125
|
+
const isGitHubShort = mainInput.match(/^GH-?\d+$/);
|
|
126
|
+
const hasStructure = mainInput.match(/(expected|actual|affects|steps):/i);
|
|
127
|
+
|
|
128
|
+
// Clarity score: 0-3
|
|
129
|
+
let clarityScore = 0;
|
|
130
|
+
if (isGitHubUrl || isGitHubShort) clarityScore = 3; // GitHub = fully clear
|
|
131
|
+
else if (hasStructure) clarityScore = 2; // Structured text = clear
|
|
132
|
+
else if (mainInput.length > 50) clarityScore = 1; // Long text = somewhat clear
|
|
133
|
+
else clarityScore = 0; // Vague
|
|
134
|
+
|
|
135
|
+
// Auto mode override: if --yes/-y flag, skip all questions
|
|
136
|
+
const skipQuestions = process.env.AUTO_YES === 'true';
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Phase 2: Extract Issue Data & Priority
|
|
140
|
+
|
|
141
|
+
**For GitHub URL/Short:**
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Fetch issue details via gh CLI
|
|
145
|
+
gh issue view <issue-ref> --json number,title,body,labels,url
|
|
146
|
+
|
|
147
|
+
# Parse response with priority override
|
|
148
|
+
{
|
|
149
|
+
"id": "GH-123",
|
|
150
|
+
"title": "...",
|
|
151
|
+
"priority": $PRIORITY || 3, # Use --priority flag if provided
|
|
152
|
+
"source": "github",
|
|
153
|
+
"source_url": "https://github.com/...",
|
|
154
|
+
"labels": $LABELS || [...existing labels],
|
|
155
|
+
"context": "..."
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**For Text Description:**
|
|
160
|
+
|
|
161
|
+
```javascript
|
|
162
|
+
// Generate issue ID
|
|
163
|
+
const id = `ISS-${new Date().toISOString().replace(/[-:T]/g, '').slice(0, 14)}`;
|
|
164
|
+
|
|
165
|
+
// Parse structured fields if present
|
|
166
|
+
const expected = text.match(/expected:?\s*([^.]+)/i);
|
|
167
|
+
const actual = text.match(/actual:?\s*([^.]+)/i);
|
|
168
|
+
const affects = text.match(/affects?:?\s*([^.]+)/i);
|
|
169
|
+
|
|
170
|
+
// Build issue data with flags
|
|
171
|
+
{
|
|
172
|
+
"id": id,
|
|
173
|
+
"title": text.split(/[.\n]/)[0].substring(0, 60),
|
|
174
|
+
"priority": $PRIORITY || 3, # From --priority flag
|
|
175
|
+
"labels": $LABELS?.split(',') || [], # From --labels flag
|
|
176
|
+
"source": "text",
|
|
177
|
+
"context": text.substring(0, 500),
|
|
178
|
+
"expected_behavior": expected?.[1]?.trim(),
|
|
179
|
+
"actual_behavior": actual?.[1]?.trim()
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Phase 3: Context Hint (Conditional)
|
|
184
|
+
|
|
185
|
+
For medium clarity (score 1-2) without affected components:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Use rg to find potentially related files
|
|
189
|
+
rg -l "<keyword>" --type ts | head -5
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Add discovered files to `affected_components` (max 3 files).
|
|
193
|
+
|
|
194
|
+
**Note**: Skip this for GitHub issues (already have context) and vague inputs (needs clarification first).
|
|
195
|
+
|
|
196
|
+
### Phase 4: Conditional Clarification (Skip if Auto Mode)
|
|
197
|
+
|
|
198
|
+
**Only ask if**: clarity < 2 AND NOT in auto mode (skipQuestions = false)
|
|
199
|
+
|
|
200
|
+
If auto mode (`--yes`/`-y`), proceed directly to creation with inferred details.
|
|
201
|
+
|
|
202
|
+
Otherwise, present minimal clarification:
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
Input unclear. Please describe:
|
|
206
|
+
- What is the issue about?
|
|
207
|
+
- Where does it occur?
|
|
208
|
+
- What is the expected behavior?
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Wait for user response, then update issue data.
|
|
212
|
+
|
|
213
|
+
### Phase 5: GitHub Publishing Decision (Skip if Already GitHub)
|
|
214
|
+
|
|
215
|
+
For non-GitHub sources, determine if user wants to publish to GitHub:
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
For non-GitHub sources AND NOT auto mode, ask:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
Would you like to publish this issue to GitHub?
|
|
223
|
+
1. Yes, publish to GitHub (create issue and link it)
|
|
224
|
+
2. No, keep local only (store without GitHub sync)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
In auto mode: Default to NO (keep local only, unless explicitly requested with --publish flag).
|
|
228
|
+
|
|
229
|
+
### Phase 6: Create Issue
|
|
230
|
+
|
|
231
|
+
**Create via CLI:**
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Build issue JSON
|
|
235
|
+
ISSUE_JSON='{"title":"...","context":"...","priority":3,"source":"text"}'
|
|
236
|
+
|
|
237
|
+
# Create issue (auto-generates ID)
|
|
238
|
+
echo "${ISSUE_JSON}" | ccw issue create
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**If publishing to GitHub:**
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Create on GitHub first
|
|
245
|
+
GH_URL=$(gh issue create --title "..." --body "..." | grep -oE 'https://github.com/[^ ]+')
|
|
246
|
+
GH_NUMBER=$(echo $GH_URL | grep -oE '/issues/([0-9]+)$' | grep -oE '[0-9]+')
|
|
247
|
+
|
|
248
|
+
# Update local issue with binding
|
|
249
|
+
ccw issue update ${ISSUE_ID} --github-url "${GH_URL}" --github-number ${GH_NUMBER}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Phase 7: Output Result
|
|
253
|
+
|
|
254
|
+
```markdown
|
|
255
|
+
## Issue Created
|
|
256
|
+
|
|
257
|
+
**ID**: ISS-20251229-001
|
|
258
|
+
**Title**: Login fails with special chars
|
|
259
|
+
**Source**: text
|
|
260
|
+
**Priority**: 2 (High)
|
|
261
|
+
|
|
262
|
+
**Context**:
|
|
263
|
+
500 error when password contains quotes
|
|
264
|
+
|
|
265
|
+
**Affected Components**:
|
|
266
|
+
- src/auth/login.ts
|
|
267
|
+
- src/utils/validation.ts
|
|
268
|
+
|
|
269
|
+
**GitHub**: Not published (local only)
|
|
270
|
+
|
|
271
|
+
**Next Step**: `/issue:plan ISS-20251229-001`
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Quality Checklist
|
|
275
|
+
|
|
276
|
+
Before completing, verify:
|
|
277
|
+
|
|
278
|
+
- [ ] Issue ID generated correctly (GH-xxx or ISS-YYYYMMDD-HHMMSS)
|
|
279
|
+
- [ ] Title extracted (max 60 chars)
|
|
280
|
+
- [ ] Context captured (problem description)
|
|
281
|
+
- [ ] Priority assigned (1-5)
|
|
282
|
+
- [ ] Status set to `registered`
|
|
283
|
+
- [ ] Created via `ccw issue create` CLI command
|
|
284
|
+
|
|
285
|
+
## Error Handling
|
|
286
|
+
|
|
287
|
+
| Situation | Action |
|
|
288
|
+
|-----------|--------|
|
|
289
|
+
| GitHub URL not accessible | Report error, suggest text input |
|
|
290
|
+
| gh CLI not available | Fall back to text-based creation |
|
|
291
|
+
| Empty input | Prompt for description |
|
|
292
|
+
| Very vague input | Ask clarifying questions |
|
|
293
|
+
| Issue already exists | Report duplicate, show existing |
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
## Start Execution
|
|
297
|
+
|
|
298
|
+
### Parameter Parsing (Phase 0)
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Codex passes full input as $1
|
|
302
|
+
INPUT="$1"
|
|
303
|
+
|
|
304
|
+
# Extract flags
|
|
305
|
+
AUTO_YES=false
|
|
306
|
+
PRIORITY=3
|
|
307
|
+
LABELS=""
|
|
308
|
+
|
|
309
|
+
# Parse using parameter expansion
|
|
310
|
+
while [[ $INPUT == -* ]]; do
|
|
311
|
+
case $INPUT in
|
|
312
|
+
-y|--yes)
|
|
313
|
+
AUTO_YES=true
|
|
314
|
+
INPUT="${INPUT#* }" # Remove flag and space
|
|
315
|
+
;;
|
|
316
|
+
--priority)
|
|
317
|
+
PRIORITY="${INPUT#* }"
|
|
318
|
+
PRIORITY="${PRIORITY%% *}" # Extract next word
|
|
319
|
+
INPUT="${INPUT#*--priority $PRIORITY }"
|
|
320
|
+
;;
|
|
321
|
+
--labels)
|
|
322
|
+
LABELS="${INPUT#* }"
|
|
323
|
+
LABELS="${LABELS%% --*}" # Extract until next flag
|
|
324
|
+
INPUT="${INPUT#*--labels $LABELS }"
|
|
325
|
+
;;
|
|
326
|
+
*)
|
|
327
|
+
INPUT="${INPUT#* }"
|
|
328
|
+
;;
|
|
329
|
+
esac
|
|
330
|
+
done
|
|
331
|
+
|
|
332
|
+
# Remaining text is the main input (GitHub URL or description)
|
|
333
|
+
MAIN_INPUT="$INPUT"
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Execution Flow (All Phases)
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
1. Parse Arguments (Phase 0)
|
|
340
|
+
└─ Extract: AUTO_YES, PRIORITY, LABELS, MAIN_INPUT
|
|
341
|
+
|
|
342
|
+
2. Detect Input Type & Clarity (Phase 1)
|
|
343
|
+
├─ GitHub URL/Short? → Score 3 (clear)
|
|
344
|
+
├─ Structured text? → Score 2 (somewhat clear)
|
|
345
|
+
├─ Long text? → Score 1 (vague)
|
|
346
|
+
└─ Short text? → Score 0 (very vague)
|
|
347
|
+
|
|
348
|
+
3. Extract Issue Data (Phase 2)
|
|
349
|
+
├─ If GitHub: gh CLI fetch + parse
|
|
350
|
+
└─ If text: Parse structure + apply PRIORITY/LABELS flags
|
|
351
|
+
|
|
352
|
+
4. Context Hint (Phase 3, conditional)
|
|
353
|
+
└─ Only for clarity 1-2 AND no components → ACE search (max 3 files)
|
|
354
|
+
|
|
355
|
+
5. Clarification (Phase 4, conditional)
|
|
356
|
+
└─ If clarity < 2 AND NOT auto mode → Ask for details
|
|
357
|
+
└─ If auto mode (AUTO_YES=true) → Skip, use inferred data
|
|
358
|
+
|
|
359
|
+
6. GitHub Publishing (Phase 5, conditional)
|
|
360
|
+
├─ If source = github → Skip (already from GitHub)
|
|
361
|
+
└─ If source != github:
|
|
362
|
+
├─ If auto mode → Default NO (keep local)
|
|
363
|
+
└─ If manual → Ask user preference
|
|
364
|
+
|
|
365
|
+
7. Create Issue (Phase 6)
|
|
366
|
+
├─ Create local issue via ccw CLI
|
|
367
|
+
└─ If publishToGitHub → gh issue create → link
|
|
368
|
+
|
|
369
|
+
8. Output Result (Phase 7)
|
|
370
|
+
└─ Display: ID, title, source, GitHub status, next step
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
## Quick Examples
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# Auto mode - GitHub issue (no questions)
|
|
377
|
+
/prompts:issue-new -y https://github.com/org/repo/issues/42
|
|
378
|
+
|
|
379
|
+
# Standard mode - text with priority
|
|
380
|
+
/prompts:issue-new "Database connection timeout" --priority 1
|
|
381
|
+
|
|
382
|
+
# Auto mode - text with priority and labels
|
|
383
|
+
/prompts:issue-new --yes "Add caching layer" --priority 2 --labels "enhancement,performance"
|
|
384
|
+
|
|
385
|
+
# GitHub short format
|
|
386
|
+
/prompts:issue-new GH-123
|
|
387
|
+
|
|
388
|
+
# Complex text description
|
|
389
|
+
/prompts:issue-new "User login fails. Expected: redirect to dashboard. Actual: 500 error"
|
|
390
|
+
```
|