claude-symphony 0.2.6 → 0.2.7
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/dist/cli/index.js +36 -2
- package/package.json +1 -1
- package/template/.claude/commands/brainstorm.md +101 -6
- package/template/.claude/commands/goto.md +103 -0
- package/template/.claude/commands/planning.md +84 -4
- package/template/.claude/commands/refactor.md +88 -17
- package/template/.claude/commands/test.md +88 -5
- package/template/.claude/commands/ui-ux.md +87 -4
- package/template/.claude/skills/stage-routing/README.md +162 -0
- package/template/.claude/skills/stage-routing/prompts/analyze.md +135 -0
- package/template/CLAUDE.md +2 -0
- package/template/config/stage_routing.jsonc +94 -0
package/dist/cli/index.js
CHANGED
|
@@ -129,6 +129,16 @@ async function readFile(filePath) {
|
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
+
async function writeFile(filePath, content) {
|
|
133
|
+
try {
|
|
134
|
+
await ensureDirAsync(path.dirname(filePath));
|
|
135
|
+
await fs.writeFile(filePath, content, "utf8");
|
|
136
|
+
return true;
|
|
137
|
+
} catch (error) {
|
|
138
|
+
console.error(`Failed to write file ${filePath}:`, error);
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
132
142
|
async function readJson(filePath) {
|
|
133
143
|
try {
|
|
134
144
|
const content = await fs.readFile(filePath, "utf8");
|
|
@@ -1458,13 +1468,37 @@ async function gotoStage(projectRoot, targetStage, options = {}) {
|
|
|
1458
1468
|
console.log(` To: ${targetStage} (${getStageName(targetStage)})`);
|
|
1459
1469
|
const historyPath = path4.join(projectRoot, "state", "loopback_history.json");
|
|
1460
1470
|
let history = await readJson(historyPath) ?? [];
|
|
1471
|
+
const timestamp = getTimestamp();
|
|
1461
1472
|
history.push({
|
|
1462
1473
|
from: currentStage,
|
|
1463
1474
|
to: targetStage,
|
|
1464
|
-
timestamp
|
|
1475
|
+
timestamp,
|
|
1476
|
+
reason: options.reason
|
|
1465
1477
|
});
|
|
1466
1478
|
await ensureDirAsync(path4.join(projectRoot, "state"));
|
|
1467
1479
|
await writeJson(historyPath, history);
|
|
1480
|
+
const handoffPath = path4.join(projectRoot, "stages", currentStage, "HANDOFF.md");
|
|
1481
|
+
if (existsSync2(handoffPath)) {
|
|
1482
|
+
const handoffContent = await readFile(handoffPath);
|
|
1483
|
+
if (handoffContent) {
|
|
1484
|
+
const loopbackRecord = `
|
|
1485
|
+
|
|
1486
|
+
## Loop-Back Record
|
|
1487
|
+
|
|
1488
|
+
| Field | Value |
|
|
1489
|
+
|-------|-------|
|
|
1490
|
+
| **From** | ${currentStage} |
|
|
1491
|
+
| **To** | ${targetStage} |
|
|
1492
|
+
| **Time** | ${timestamp} |
|
|
1493
|
+
| **Reason** | ${options.reason ?? "(not specified)"} |
|
|
1494
|
+
|
|
1495
|
+
---
|
|
1496
|
+
`;
|
|
1497
|
+
await writeFile(handoffPath, handoffContent + loopbackRecord);
|
|
1498
|
+
console.log("\n[HANDOFF Updated]");
|
|
1499
|
+
logSuccess(`Loop-back recorded in stages/${currentStage}/HANDOFF.md`);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1468
1502
|
await runStage(projectRoot, targetStage);
|
|
1469
1503
|
return true;
|
|
1470
1504
|
}
|
|
@@ -3222,7 +3256,7 @@ program.command("next").description("Transition to next stage (or next sprint)")
|
|
|
3222
3256
|
});
|
|
3223
3257
|
process.exit(success ? 0 : 1);
|
|
3224
3258
|
});
|
|
3225
|
-
program.command("goto [stage-id]").description("Jump to a previous stage (loop-back)").option("--list", "List available stages").option("--history", "Show loop-back history").action(async (stageId, options) => {
|
|
3259
|
+
program.command("goto [stage-id]").description("Jump to a previous stage (loop-back)").option("--list", "List available stages").option("--history", "Show loop-back history").option("-r, --reason <text>", "Record reason for stage transition").action(async (stageId, options) => {
|
|
3226
3260
|
const projectRoot = process.cwd();
|
|
3227
3261
|
const success = await gotoStage(projectRoot, stageId, options);
|
|
3228
3262
|
process.exit(success ? 0 : 1);
|
package/package.json
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Start the 01-brainstorm stage directly.
|
|
4
4
|
|
|
5
|
+
## CRITICAL: Parallel Execution Required
|
|
6
|
+
|
|
7
|
+
> **This stage MUST use Gemini + ClaudeCode parallel execution.**
|
|
8
|
+
>
|
|
9
|
+
> Gemini CLI provides creative, divergent thinking while ClaudeCode provides technical review.
|
|
10
|
+
> Skipping Gemini CLI significantly degrades idea quality and creativity.
|
|
11
|
+
|
|
12
|
+
**Mandatory Steps:**
|
|
13
|
+
1. Call `/gemini` with ideation prompt (Primary - Creative Ideas)
|
|
14
|
+
2. ClaudeCode technical review (Secondary - Technical Validation)
|
|
15
|
+
3. Synthesize both outputs into final `ideas.md`
|
|
16
|
+
|
|
5
17
|
## Usage
|
|
6
18
|
```
|
|
7
19
|
/brainstorm [topic]
|
|
@@ -12,21 +24,87 @@ Start the 01-brainstorm stage directly.
|
|
|
12
24
|
| Item | Value |
|
|
13
25
|
|------|-------|
|
|
14
26
|
| Stage | 01-brainstorm |
|
|
15
|
-
| AI Model | Gemini + ClaudeCode |
|
|
27
|
+
| AI Model | **Gemini + ClaudeCode (Parallel)** |
|
|
16
28
|
| Execution Mode | YOLO (Container) |
|
|
17
29
|
| Checkpoint | Optional |
|
|
18
30
|
|
|
31
|
+
## Parallel Execution Protocol
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
┌─────────────────────────────────────────────────┐
|
|
35
|
+
│ 01-brainstorm Stage │
|
|
36
|
+
├─────────────────────────────────────────────────┤
|
|
37
|
+
│ │
|
|
38
|
+
│ ┌─────────────┐ ┌─────────────┐ │
|
|
39
|
+
│ │ Gemini │ │ ClaudeCode │ │
|
|
40
|
+
│ │ (Primary) │ │ (Secondary) │ │
|
|
41
|
+
│ │ Creative │ │ Technical │ │
|
|
42
|
+
│ └──────┬──────┘ └──────┬──────┘ │
|
|
43
|
+
│ │ │ │
|
|
44
|
+
│ │ Parallel │ │
|
|
45
|
+
│ │ Execution │ │
|
|
46
|
+
│ ▼ ▼ │
|
|
47
|
+
│ output_gemini.md output_claudecode.md │
|
|
48
|
+
│ │ │ │
|
|
49
|
+
│ └─────────┬─────────┘ │
|
|
50
|
+
│ ▼ │
|
|
51
|
+
│ ┌─────────────────┐ │
|
|
52
|
+
│ │ Synthesizer │ │
|
|
53
|
+
│ │ (ClaudeCode) │ │
|
|
54
|
+
│ └────────┬────────┘ │
|
|
55
|
+
│ ▼ │
|
|
56
|
+
│ ideas.md │
|
|
57
|
+
└─────────────────────────────────────────────────┘
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Execution Steps
|
|
61
|
+
|
|
62
|
+
### Step 1: Gemini CLI Call (Primary - Creative Ideas)
|
|
63
|
+
|
|
64
|
+
**MUST execute Gemini CLI for creative ideation:**
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
/gemini "Read stages/01-brainstorm/prompts/ideation.md and generate creative ideas for: $TOPIC"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- **Input**: `stages/01-brainstorm/prompts/ideation.md`
|
|
71
|
+
- **Output**: `stages/01-brainstorm/outputs/output_gemini.md`
|
|
72
|
+
- **Focus**: Divergent thinking, unconstrained exploration, novel approaches
|
|
73
|
+
|
|
74
|
+
### Step 2: ClaudeCode Technical Review (Secondary)
|
|
75
|
+
|
|
76
|
+
After Gemini output is generated, ClaudeCode performs technical review:
|
|
77
|
+
|
|
78
|
+
- **Input**: Gemini output + project context
|
|
79
|
+
- **Output**: `stages/01-brainstorm/outputs/output_claudecode.md`
|
|
80
|
+
- **Focus**: Technical feasibility, implementation complexity, risk assessment
|
|
81
|
+
|
|
82
|
+
### Step 3: Synthesis (ClaudeCode as Synthesizer)
|
|
83
|
+
|
|
84
|
+
Combine both outputs into final deliverables:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
/synthesize
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- **Inputs**: `output_gemini.md` + `output_claudecode.md`
|
|
91
|
+
- **Output**: `stages/01-brainstorm/outputs/ideas.md`
|
|
92
|
+
- **Criteria**:
|
|
93
|
+
- Prioritize ideas both models agree on (HIGH CONFIDENCE)
|
|
94
|
+
- Evaluate unique contributions from each
|
|
95
|
+
- Filter low-quality or infeasible ideas
|
|
96
|
+
|
|
19
97
|
## Actions
|
|
20
98
|
|
|
21
99
|
1. **Prerequisite Check**
|
|
22
100
|
- Project initialization status (progress.json)
|
|
23
101
|
|
|
24
102
|
2. **Stage Start**
|
|
25
|
-
- Gemini CLI call (creative ideas)
|
|
103
|
+
- Gemini CLI call (creative ideas) - **REQUIRED**
|
|
26
104
|
- ClaudeCode parallel execution (technical review)
|
|
27
105
|
|
|
28
106
|
3. **Output Generation**
|
|
29
|
-
- ideas.md -
|
|
107
|
+
- ideas.md - Synthesized brainstorming ideas
|
|
30
108
|
- decisions.md - Key decisions
|
|
31
109
|
|
|
32
110
|
## Execution
|
|
@@ -40,28 +118,45 @@ scripts/run-stage.sh 01-brainstorm "$ARGUMENTS"
|
|
|
40
118
|
|
|
41
119
|
```
|
|
42
120
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
43
|
-
|
|
121
|
+
Stage 01: Brainstorm
|
|
44
122
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
45
123
|
AI: Gemini + ClaudeCode (parallel)
|
|
46
124
|
Mode: YOLO (Container)
|
|
47
125
|
|
|
48
126
|
Topic: $ARGUMENTS
|
|
49
127
|
|
|
50
|
-
[
|
|
51
|
-
|
|
128
|
+
[Step 1] Gemini CLI - Generating creative ideas...
|
|
129
|
+
Output: outputs/output_gemini.md
|
|
130
|
+
|
|
131
|
+
[Step 2] ClaudeCode - Technical review in progress...
|
|
132
|
+
Output: outputs/output_claudecode.md
|
|
133
|
+
|
|
134
|
+
[Step 3] Synthesizing outputs...
|
|
135
|
+
Final: outputs/ideas.md
|
|
52
136
|
|
|
53
137
|
After completion: /next or /research
|
|
54
138
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
55
139
|
```
|
|
56
140
|
|
|
141
|
+
## Output Files
|
|
142
|
+
|
|
143
|
+
| File | Description |
|
|
144
|
+
|------|-------------|
|
|
145
|
+
| `outputs/output_gemini.md` | Gemini creative ideas |
|
|
146
|
+
| `outputs/output_claudecode.md` | ClaudeCode technical review |
|
|
147
|
+
| `outputs/ideas.md` | Final synthesized ideas |
|
|
148
|
+
| `outputs/decisions.md` | Key decisions |
|
|
149
|
+
|
|
57
150
|
## Related Commands
|
|
58
151
|
|
|
59
152
|
- `/run-stage 01` - Start after prerequisite check
|
|
60
153
|
- `/next` - Next stage (02-research)
|
|
61
154
|
- `/gemini` - Direct Gemini CLI call
|
|
155
|
+
- `/synthesize` - Consolidate parallel outputs
|
|
62
156
|
|
|
63
157
|
## Tips
|
|
64
158
|
|
|
65
159
|
- YOLO mode: Failure is okay, creativity first
|
|
66
160
|
- Freely explore multiple ideas
|
|
161
|
+
- **Always call Gemini CLI first** for maximum creativity
|
|
67
162
|
- Record final selections in decisions.md
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# /goto - Stage Navigation (Loop-back)
|
|
2
|
+
|
|
3
|
+
Jump to a specific stage in the pipeline.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/goto <stage-id> # Move to specific stage
|
|
9
|
+
/goto --list # Show available stages
|
|
10
|
+
/goto --history # Show loop-back history
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Options
|
|
14
|
+
|
|
15
|
+
| Option | Description |
|
|
16
|
+
|--------|-------------|
|
|
17
|
+
| `--list` | Display all available stages with status |
|
|
18
|
+
| `--history` | Show history of previous loop-backs |
|
|
19
|
+
| `--reason <text>` | Record reason for stage transition |
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
### Basic Navigation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Go to planning stage
|
|
27
|
+
/goto 03-planning
|
|
28
|
+
|
|
29
|
+
# Return to brainstorming for new ideas
|
|
30
|
+
/goto 01-brainstorm
|
|
31
|
+
|
|
32
|
+
# Jump to QA for bug fixes
|
|
33
|
+
/goto 08-qa
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### With Reason (Recommended)
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Document why you're transitioning
|
|
40
|
+
/goto 03-planning --reason "architecture redesign needed"
|
|
41
|
+
/goto 08-qa --reason "critical bug discovered in authentication"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### View Options
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# List all stages
|
|
48
|
+
/goto --list
|
|
49
|
+
|
|
50
|
+
# Check previous transitions
|
|
51
|
+
/goto --history
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Stage List
|
|
55
|
+
|
|
56
|
+
| Stage ID | Name |
|
|
57
|
+
|----------|------|
|
|
58
|
+
| `01-brainstorm` | Brainstorming |
|
|
59
|
+
| `02-research` | Research |
|
|
60
|
+
| `03-planning` | Planning |
|
|
61
|
+
| `04-ui-ux` | UI/UX Planning |
|
|
62
|
+
| `05-task-management` | Task Management |
|
|
63
|
+
| `06-implementation` | Implementation |
|
|
64
|
+
| `07-refactoring` | Refactoring |
|
|
65
|
+
| `08-qa` | QA |
|
|
66
|
+
| `09-testing` | Testing & E2E |
|
|
67
|
+
| `10-deployment` | CI/CD & Deployment |
|
|
68
|
+
|
|
69
|
+
## Output Example
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
73
|
+
Stage Loop-back
|
|
74
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
75
|
+
From: 06-implementation (Implementation)
|
|
76
|
+
To: 03-planning (Planning)
|
|
77
|
+
|
|
78
|
+
[HANDOFF Updated]
|
|
79
|
+
✓ Loop-back recorded in stages/06-implementation/HANDOFF.md
|
|
80
|
+
|
|
81
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
82
|
+
🚀 Stage Execution: 03-planning
|
|
83
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Execution Script
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
claude-symphony goto <stage-id> [options]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Notes
|
|
93
|
+
|
|
94
|
+
- Loop-back history is stored in `state/loopback_history.json`
|
|
95
|
+
- Current stage's HANDOFF.md is updated with transition record
|
|
96
|
+
- Use `/goto --list` to see current stage status before navigating
|
|
97
|
+
|
|
98
|
+
## Related Commands
|
|
99
|
+
|
|
100
|
+
- `/next` - Proceed to next sequential stage
|
|
101
|
+
- `/status` - Check current pipeline status
|
|
102
|
+
- `/stages` - View all stages with status
|
|
103
|
+
- `/handoff` - Generate HANDOFF.md before transitioning
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Start the 03-planning stage directly.
|
|
4
4
|
|
|
5
|
+
## CRITICAL: Parallel Execution Required
|
|
6
|
+
|
|
7
|
+
> **This stage MUST use Gemini + ClaudeCode parallel execution.**
|
|
8
|
+
>
|
|
9
|
+
> Gemini provides strategic architectural vision while ClaudeCode provides detailed technical planning.
|
|
10
|
+
> Both perspectives are essential for robust architecture design.
|
|
11
|
+
|
|
12
|
+
**Mandatory Steps:**
|
|
13
|
+
1. Call `/gemini` with architecture prompt (Primary - Strategic Vision)
|
|
14
|
+
2. ClaudeCode detailed planning (Secondary - Technical Specification)
|
|
15
|
+
3. Synthesize both outputs into final architecture documents
|
|
16
|
+
|
|
5
17
|
## Usage
|
|
6
18
|
```
|
|
7
19
|
/planning
|
|
@@ -12,10 +24,72 @@ Start the 03-planning stage directly.
|
|
|
12
24
|
| Item | Value |
|
|
13
25
|
|------|-------|
|
|
14
26
|
| Stage | 03-planning |
|
|
15
|
-
| AI Model | Gemini |
|
|
27
|
+
| AI Model | **Gemini + ClaudeCode (Parallel)** |
|
|
16
28
|
| Execution Mode | Plan Mode |
|
|
17
29
|
| Checkpoint | Optional |
|
|
18
30
|
|
|
31
|
+
## Parallel Execution Protocol
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
┌─────────────────────────────────────────────────┐
|
|
35
|
+
│ 03-planning Stage │
|
|
36
|
+
├─────────────────────────────────────────────────┤
|
|
37
|
+
│ │
|
|
38
|
+
│ ┌─────────────┐ ┌─────────────┐ │
|
|
39
|
+
│ │ Gemini │ │ ClaudeCode │ │
|
|
40
|
+
│ │ (Primary) │ │ (Secondary) │ │
|
|
41
|
+
│ │ Strategic │ │ Technical │ │
|
|
42
|
+
│ └──────┬──────┘ └──────┬──────┘ │
|
|
43
|
+
│ │ │ │
|
|
44
|
+
│ │ Parallel │ │
|
|
45
|
+
│ │ Execution │ │
|
|
46
|
+
│ ▼ ▼ │
|
|
47
|
+
│ output_gemini.md output_claudecode.md │
|
|
48
|
+
│ │ │ │
|
|
49
|
+
│ └─────────┬─────────┘ │
|
|
50
|
+
│ ▼ │
|
|
51
|
+
│ ┌─────────────────┐ │
|
|
52
|
+
│ │ Synthesizer │ │
|
|
53
|
+
│ │ (ClaudeCode) │ │
|
|
54
|
+
│ └────────┬────────┘ │
|
|
55
|
+
│ ▼ │
|
|
56
|
+
│ PRD.md + architecture.md │
|
|
57
|
+
└─────────────────────────────────────────────────┘
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Execution Steps
|
|
61
|
+
|
|
62
|
+
### Step 1: Gemini CLI Call (Primary - Strategic Vision)
|
|
63
|
+
|
|
64
|
+
**MUST execute Gemini CLI for strategic planning:**
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
/gemini "Read stages/03-planning/prompts/architecture.md and research output to create strategic architecture vision"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- **Input**: `stages/02-research/outputs/research.md`, `tech-stack.md`
|
|
71
|
+
- **Output**: `stages/03-planning/outputs/output_gemini.md`
|
|
72
|
+
- **Focus**: High-level architecture, strategic decisions, scalability vision
|
|
73
|
+
|
|
74
|
+
### Step 2: ClaudeCode Technical Planning (Secondary)
|
|
75
|
+
|
|
76
|
+
After Gemini output is generated, ClaudeCode performs detailed planning:
|
|
77
|
+
|
|
78
|
+
- **Input**: Gemini output + research results
|
|
79
|
+
- **Output**: `stages/03-planning/outputs/output_claudecode.md`
|
|
80
|
+
- **Focus**: Technical specifications, implementation details, risk mitigation
|
|
81
|
+
|
|
82
|
+
### Step 3: Synthesis (ClaudeCode as Synthesizer)
|
|
83
|
+
|
|
84
|
+
Combine both outputs into final deliverables:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
/synthesize
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- **Inputs**: `output_gemini.md` + `output_claudecode.md`
|
|
91
|
+
- **Output**: `stages/03-planning/outputs/PRD.md`, `architecture.md`
|
|
92
|
+
|
|
19
93
|
## Actions
|
|
20
94
|
|
|
21
95
|
1. **Prerequisite Check**
|
|
@@ -23,9 +97,10 @@ Start the 03-planning stage directly.
|
|
|
23
97
|
- research.md, tech-stack.md exist
|
|
24
98
|
|
|
25
99
|
2. **Execute Planning**
|
|
100
|
+
- Gemini CLI call (strategic vision) - **REQUIRED**
|
|
101
|
+
- ClaudeCode parallel execution (technical details)
|
|
26
102
|
- PRD (Product Requirements Document) writing
|
|
27
103
|
- Architecture design
|
|
28
|
-
- Technical specification
|
|
29
104
|
|
|
30
105
|
3. **Output Generation**
|
|
31
106
|
- PRD.md - Product Requirements Document
|
|
@@ -44,8 +119,12 @@ scripts/run-stage.sh 03-planning "$ARGUMENTS"
|
|
|
44
119
|
|
|
45
120
|
## Output Files
|
|
46
121
|
|
|
47
|
-
|
|
48
|
-
|
|
122
|
+
| File | Description |
|
|
123
|
+
|------|-------------|
|
|
124
|
+
| `outputs/output_gemini.md` | Gemini strategic vision |
|
|
125
|
+
| `outputs/output_claudecode.md` | ClaudeCode technical spec |
|
|
126
|
+
| `outputs/PRD.md` | Product Requirements Document |
|
|
127
|
+
| `outputs/architecture.md` | Architecture design |
|
|
49
128
|
|
|
50
129
|
## Related Commands
|
|
51
130
|
|
|
@@ -53,6 +132,7 @@ scripts/run-stage.sh 03-planning "$ARGUMENTS"
|
|
|
53
132
|
- `/next` - Next stage (04-ui-ux)
|
|
54
133
|
- `/research` - Previous stage
|
|
55
134
|
- `/gemini` - Direct Gemini CLI call
|
|
135
|
+
- `/synthesize` - Consolidate parallel outputs
|
|
56
136
|
|
|
57
137
|
## PRD Structure
|
|
58
138
|
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Start the 07-refactoring stage directly.
|
|
4
4
|
|
|
5
|
+
## CRITICAL: Parallel Execution Required
|
|
6
|
+
|
|
7
|
+
> **This stage MUST use Codex + ClaudeCode parallel execution.**
|
|
8
|
+
>
|
|
9
|
+
> Codex provides deep code analysis and optimization suggestions while ClaudeCode provides implementation and verification.
|
|
10
|
+
> Both perspectives ensure thorough refactoring with proper validation.
|
|
11
|
+
|
|
12
|
+
**Mandatory Steps:**
|
|
13
|
+
1. Call `/codex` with analysis prompt (Primary - Deep Analysis)
|
|
14
|
+
2. ClaudeCode implementation review (Secondary - Apply & Verify)
|
|
15
|
+
3. Synthesize both outputs into final refactoring report
|
|
16
|
+
|
|
5
17
|
## Usage
|
|
6
18
|
```
|
|
7
19
|
/refactor [focus-area]
|
|
@@ -12,10 +24,74 @@ Start the 07-refactoring stage directly.
|
|
|
12
24
|
| Item | Value |
|
|
13
25
|
|------|-------|
|
|
14
26
|
| Stage | 07-refactoring |
|
|
15
|
-
| AI Model | Codex
|
|
27
|
+
| AI Model | **Codex + ClaudeCode (Parallel)** |
|
|
16
28
|
| Execution Mode | Deep Dive |
|
|
17
29
|
| Checkpoint | **Required** |
|
|
18
30
|
|
|
31
|
+
## Parallel Execution Protocol
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
┌─────────────────────────────────────────────────┐
|
|
35
|
+
│ 07-refactoring Stage │
|
|
36
|
+
├─────────────────────────────────────────────────┤
|
|
37
|
+
│ │
|
|
38
|
+
│ ┌─────────────┐ ┌─────────────┐ │
|
|
39
|
+
│ │ Codex │ │ ClaudeCode │ │
|
|
40
|
+
│ │ (Primary) │ │ (Secondary) │ │
|
|
41
|
+
│ │ Deep │ │ Apply & │ │
|
|
42
|
+
│ │ Analysis │ │ Verify │ │
|
|
43
|
+
│ └──────┬──────┘ └──────┬──────┘ │
|
|
44
|
+
│ │ │ │
|
|
45
|
+
│ │ Parallel │ │
|
|
46
|
+
│ │ Execution │ │
|
|
47
|
+
│ ▼ ▼ │
|
|
48
|
+
│ output_codex.md output_claudecode.md │
|
|
49
|
+
│ │ │ │
|
|
50
|
+
│ └─────────┬─────────┘ │
|
|
51
|
+
│ ▼ │
|
|
52
|
+
│ ┌─────────────────┐ │
|
|
53
|
+
│ │ Synthesizer │ │
|
|
54
|
+
│ │ (ClaudeCode) │ │
|
|
55
|
+
│ └────────┬────────┘ │
|
|
56
|
+
│ ▼ │
|
|
57
|
+
│ refactoring-report.md + improved src/ │
|
|
58
|
+
└─────────────────────────────────────────────────┘
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Execution Steps
|
|
62
|
+
|
|
63
|
+
### Step 1: Codex CLI Call (Primary - Deep Analysis)
|
|
64
|
+
|
|
65
|
+
**MUST execute Codex CLI for deep code analysis:**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
/codex "Analyze stages/06-implementation/outputs/src/ for refactoring opportunities: $FOCUS_AREA"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- **Input**: `stages/06-implementation/outputs/src/`, `tests/`
|
|
72
|
+
- **Output**: `stages/07-refactoring/outputs/output_codex.md`
|
|
73
|
+
- **Focus**: Code smells, optimization opportunities, architectural improvements
|
|
74
|
+
|
|
75
|
+
### Step 2: ClaudeCode Implementation Review (Secondary)
|
|
76
|
+
|
|
77
|
+
After Codex output is generated, ClaudeCode performs implementation review:
|
|
78
|
+
|
|
79
|
+
- **Input**: Codex analysis + source code
|
|
80
|
+
- **Output**: `stages/07-refactoring/outputs/output_claudecode.md`
|
|
81
|
+
- **Focus**: Implementation feasibility, test impact, backward compatibility
|
|
82
|
+
|
|
83
|
+
### Step 3: Synthesis & Apply (ClaudeCode as Synthesizer)
|
|
84
|
+
|
|
85
|
+
Combine both outputs and apply refactoring:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
/synthesize
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- **Inputs**: `output_codex.md` + `output_claudecode.md`
|
|
92
|
+
- **Output**: `refactoring-report.md` + improved `src/`
|
|
93
|
+
- **Verification**: Run tests after each refactoring
|
|
94
|
+
|
|
19
95
|
## Actions
|
|
20
96
|
|
|
21
97
|
1. **Prerequisite Check**
|
|
@@ -24,8 +100,9 @@ Start the 07-refactoring stage directly.
|
|
|
24
100
|
- 06 checkpoint exists
|
|
25
101
|
|
|
26
102
|
2. **Execute Refactoring**
|
|
27
|
-
- Codex
|
|
28
|
-
- ClaudeCode
|
|
103
|
+
- Codex CLI call (deep analysis) - **REQUIRED**
|
|
104
|
+
- ClaudeCode parallel execution (apply & verify)
|
|
105
|
+
- Apply refactoring changes
|
|
29
106
|
|
|
30
107
|
3. **Output Generation**
|
|
31
108
|
- (Improved) src/
|
|
@@ -37,18 +114,6 @@ Start the 07-refactoring stage directly.
|
|
|
37
114
|
scripts/run-stage.sh 07-refactoring "$ARGUMENTS"
|
|
38
115
|
```
|
|
39
116
|
|
|
40
|
-
## Workflow
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
Codex (Analysis)
|
|
44
|
-
↓
|
|
45
|
-
Identify Improvements
|
|
46
|
-
↓
|
|
47
|
-
ClaudeCode (Apply)
|
|
48
|
-
↓
|
|
49
|
-
Test Verification
|
|
50
|
-
```
|
|
51
|
-
|
|
52
117
|
## Input Files
|
|
53
118
|
|
|
54
119
|
- `stages/06-implementation/outputs/src/`
|
|
@@ -56,8 +121,12 @@ Test Verification
|
|
|
56
121
|
|
|
57
122
|
## Output Files
|
|
58
123
|
|
|
59
|
-
|
|
60
|
-
|
|
124
|
+
| File | Description |
|
|
125
|
+
|------|-------------|
|
|
126
|
+
| `outputs/output_codex.md` | Codex deep analysis |
|
|
127
|
+
| `outputs/output_claudecode.md` | ClaudeCode review |
|
|
128
|
+
| `outputs/refactoring-report.md` | Final refactoring report |
|
|
129
|
+
| (Modified) `src/` | Improved source code |
|
|
61
130
|
|
|
62
131
|
## Checkpoint Required!
|
|
63
132
|
|
|
@@ -87,9 +156,11 @@ Test Verification
|
|
|
87
156
|
- `/codex` - Direct Codex CLI call
|
|
88
157
|
- `/checkpoint` - Create checkpoint
|
|
89
158
|
- `/restore` - Rollback
|
|
159
|
+
- `/synthesize` - Consolidate parallel outputs
|
|
90
160
|
|
|
91
161
|
## Tips
|
|
92
162
|
|
|
93
163
|
- Always checkpoint before refactoring
|
|
164
|
+
- **Always call Codex CLI first** for thorough analysis
|
|
94
165
|
- Incremental improvements in small units
|
|
95
166
|
- Commit after test pass verification
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Start the 09-testing stage directly.
|
|
4
4
|
|
|
5
|
+
## CRITICAL: Parallel Execution Required
|
|
6
|
+
|
|
7
|
+
> **This stage MUST use Codex + ClaudeCode parallel execution.**
|
|
8
|
+
>
|
|
9
|
+
> Codex provides comprehensive test generation while ClaudeCode provides E2E testing with Playwright.
|
|
10
|
+
> Both perspectives ensure thorough test coverage across all test types.
|
|
11
|
+
|
|
12
|
+
**Mandatory Steps:**
|
|
13
|
+
1. Call `/codex` with testing prompt (Primary - Test Generation)
|
|
14
|
+
2. ClaudeCode E2E testing (Secondary - Playwright Integration)
|
|
15
|
+
3. Synthesize both outputs into final test results
|
|
16
|
+
|
|
5
17
|
## Usage
|
|
6
18
|
```
|
|
7
19
|
/test [test-type]
|
|
@@ -12,10 +24,73 @@ Start the 09-testing stage directly.
|
|
|
12
24
|
| Item | Value |
|
|
13
25
|
|------|-------|
|
|
14
26
|
| Stage | 09-testing |
|
|
15
|
-
| AI Model | Codex |
|
|
27
|
+
| AI Model | **Codex + ClaudeCode (Parallel)** |
|
|
16
28
|
| Execution Mode | Sandbox + Playwright MCP |
|
|
17
29
|
| Checkpoint | Optional |
|
|
18
30
|
|
|
31
|
+
## Parallel Execution Protocol
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
┌─────────────────────────────────────────────────┐
|
|
35
|
+
│ 09-testing Stage │
|
|
36
|
+
├─────────────────────────────────────────────────┤
|
|
37
|
+
│ │
|
|
38
|
+
│ ┌─────────────┐ ┌─────────────┐ │
|
|
39
|
+
│ │ Codex │ │ ClaudeCode │ │
|
|
40
|
+
│ │ (Primary) │ │ (Secondary) │ │
|
|
41
|
+
│ │ Test │ │ E2E & │ │
|
|
42
|
+
│ │ Generation │ │ Playwright │ │
|
|
43
|
+
│ └──────┬──────┘ └──────┬──────┘ │
|
|
44
|
+
│ │ │ │
|
|
45
|
+
│ │ Parallel │ │
|
|
46
|
+
│ │ Execution │ │
|
|
47
|
+
│ ▼ ▼ │
|
|
48
|
+
│ output_codex.md output_claudecode.md │
|
|
49
|
+
│ │ │ │
|
|
50
|
+
│ └─────────┬─────────┘ │
|
|
51
|
+
│ ▼ │
|
|
52
|
+
│ ┌─────────────────┐ │
|
|
53
|
+
│ │ Synthesizer │ │
|
|
54
|
+
│ │ (ClaudeCode) │ │
|
|
55
|
+
│ └────────┬────────┘ │
|
|
56
|
+
│ ▼ │
|
|
57
|
+
│ test-results.md + coverage-report.html │
|
|
58
|
+
└─────────────────────────────────────────────────┘
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Execution Steps
|
|
62
|
+
|
|
63
|
+
### Step 1: Codex CLI Call (Primary - Test Generation)
|
|
64
|
+
|
|
65
|
+
**MUST execute Codex CLI for comprehensive test generation:**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
/codex "Analyze stages/06-implementation/outputs/src/ and generate comprehensive tests: $TEST_TYPE"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- **Input**: `stages/06-implementation/outputs/src/`, `tests/`, `qa-report.md`
|
|
72
|
+
- **Output**: `stages/09-testing/outputs/output_codex.md`
|
|
73
|
+
- **Focus**: Unit tests, integration tests, edge cases, regression tests
|
|
74
|
+
|
|
75
|
+
### Step 2: ClaudeCode E2E Testing (Secondary)
|
|
76
|
+
|
|
77
|
+
After Codex output is generated, ClaudeCode performs E2E testing:
|
|
78
|
+
|
|
79
|
+
- **Input**: Codex analysis + application
|
|
80
|
+
- **Output**: `stages/09-testing/outputs/output_claudecode.md`
|
|
81
|
+
- **Focus**: E2E flows, Playwright automation, visual testing
|
|
82
|
+
|
|
83
|
+
### Step 3: Synthesis (ClaudeCode as Synthesizer)
|
|
84
|
+
|
|
85
|
+
Combine both outputs into final test suite:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
/synthesize
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- **Inputs**: `output_codex.md` + `output_claudecode.md`
|
|
92
|
+
- **Output**: `test-results.md`, `e2e-results/`, `coverage/`
|
|
93
|
+
|
|
19
94
|
## Actions
|
|
20
95
|
|
|
21
96
|
1. **Prerequisite Check**
|
|
@@ -23,8 +98,9 @@ Start the 09-testing stage directly.
|
|
|
23
98
|
- qa-report.md exists
|
|
24
99
|
|
|
25
100
|
2. **Execute Testing**
|
|
101
|
+
- Codex CLI call (test generation) - **REQUIRED**
|
|
102
|
+
- ClaudeCode parallel execution (E2E with Playwright)
|
|
26
103
|
- Integration tests
|
|
27
|
-
- E2E tests (Playwright)
|
|
28
104
|
- Regression tests
|
|
29
105
|
|
|
30
106
|
3. **Output Generation**
|
|
@@ -45,9 +121,13 @@ scripts/run-stage.sh 09-testing "$ARGUMENTS"
|
|
|
45
121
|
|
|
46
122
|
## Output Files
|
|
47
123
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
124
|
+
| File | Description |
|
|
125
|
+
|------|-------------|
|
|
126
|
+
| `outputs/output_codex.md` | Codex test generation |
|
|
127
|
+
| `outputs/output_claudecode.md` | ClaudeCode E2E results |
|
|
128
|
+
| `outputs/test-results.md` | Final test results |
|
|
129
|
+
| `outputs/e2e-results/` | E2E test results |
|
|
130
|
+
| `outputs/coverage/` | Coverage reports |
|
|
51
131
|
|
|
52
132
|
## Test Types
|
|
53
133
|
|
|
@@ -77,6 +157,8 @@ mcp__playwright__browser_fill_form
|
|
|
77
157
|
- `/next` - Next stage (10-deployment)
|
|
78
158
|
- `/qa` - Previous stage
|
|
79
159
|
- `/deploy` - Start deployment directly
|
|
160
|
+
- `/codex` - Direct Codex CLI call
|
|
161
|
+
- `/synthesize` - Consolidate parallel outputs
|
|
80
162
|
|
|
81
163
|
## Coverage Targets
|
|
82
164
|
|
|
@@ -88,6 +170,7 @@ mcp__playwright__browser_fill_form
|
|
|
88
170
|
|
|
89
171
|
## Tips
|
|
90
172
|
|
|
173
|
+
- **Always call Codex CLI first** for comprehensive test generation
|
|
91
174
|
- E2E focuses on critical flows
|
|
92
175
|
- Auto-save screenshots on failure
|
|
93
176
|
- Run headless mode in CI
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Start the 04-ui-ux stage directly.
|
|
4
4
|
|
|
5
|
+
## CRITICAL: Parallel Execution Required
|
|
6
|
+
|
|
7
|
+
> **This stage MUST use Gemini + ClaudeCode parallel execution.**
|
|
8
|
+
>
|
|
9
|
+
> Gemini provides creative design exploration while ClaudeCode provides technical component specification.
|
|
10
|
+
> Both perspectives ensure designs are both innovative and implementable.
|
|
11
|
+
|
|
12
|
+
**Mandatory Steps:**
|
|
13
|
+
1. Call `/gemini` with design prompt (Primary - Creative Design)
|
|
14
|
+
2. ClaudeCode component specification (Secondary - Technical Spec)
|
|
15
|
+
3. Synthesize both outputs into final design documents
|
|
16
|
+
|
|
5
17
|
## Usage
|
|
6
18
|
```
|
|
7
19
|
/ui-ux
|
|
@@ -12,10 +24,73 @@ Start the 04-ui-ux stage directly.
|
|
|
12
24
|
| Item | Value |
|
|
13
25
|
|------|-------|
|
|
14
26
|
| Stage | 04-ui-ux |
|
|
15
|
-
| AI Model | Gemini |
|
|
27
|
+
| AI Model | **Gemini + ClaudeCode (Parallel)** |
|
|
16
28
|
| Execution Mode | Plan Mode |
|
|
17
29
|
| Checkpoint | Optional |
|
|
18
30
|
|
|
31
|
+
## Parallel Execution Protocol
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
┌─────────────────────────────────────────────────┐
|
|
35
|
+
│ 04-ui-ux Stage │
|
|
36
|
+
├─────────────────────────────────────────────────┤
|
|
37
|
+
│ │
|
|
38
|
+
│ ┌─────────────┐ ┌─────────────┐ │
|
|
39
|
+
│ │ Gemini │ │ ClaudeCode │ │
|
|
40
|
+
│ │ (Primary) │ │ (Secondary) │ │
|
|
41
|
+
│ │ Creative │ │ Technical │ │
|
|
42
|
+
│ │ Design │ │ Spec │ │
|
|
43
|
+
│ └──────┬──────┘ └──────┬──────┘ │
|
|
44
|
+
│ │ │ │
|
|
45
|
+
│ │ Parallel │ │
|
|
46
|
+
│ │ Execution │ │
|
|
47
|
+
│ ▼ ▼ │
|
|
48
|
+
│ output_gemini.md output_claudecode.md │
|
|
49
|
+
│ │ │ │
|
|
50
|
+
│ └─────────┬─────────┘ │
|
|
51
|
+
│ ▼ │
|
|
52
|
+
│ ┌─────────────────┐ │
|
|
53
|
+
│ │ Synthesizer │ │
|
|
54
|
+
│ │ (ClaudeCode) │ │
|
|
55
|
+
│ └────────┬────────┘ │
|
|
56
|
+
│ ▼ │
|
|
57
|
+
│ wireframes/ + component-spec.md │
|
|
58
|
+
└─────────────────────────────────────────────────┘
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Execution Steps
|
|
62
|
+
|
|
63
|
+
### Step 1: Gemini CLI Call (Primary - Creative Design)
|
|
64
|
+
|
|
65
|
+
**MUST execute Gemini CLI for creative design exploration:**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
/gemini "Read stages/04-ui-ux/prompts/design.md and PRD to create innovative UI/UX designs"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- **Input**: `stages/03-planning/outputs/PRD.md`, `architecture.md`
|
|
72
|
+
- **Output**: `stages/04-ui-ux/outputs/output_gemini.md`
|
|
73
|
+
- **Focus**: Creative layouts, user flow innovation, visual concepts
|
|
74
|
+
|
|
75
|
+
### Step 2: ClaudeCode Technical Specification (Secondary)
|
|
76
|
+
|
|
77
|
+
After Gemini output is generated, ClaudeCode performs technical specification:
|
|
78
|
+
|
|
79
|
+
- **Input**: Gemini output + PRD + architecture
|
|
80
|
+
- **Output**: `stages/04-ui-ux/outputs/output_claudecode.md`
|
|
81
|
+
- **Focus**: Component structure, state management, implementation feasibility
|
|
82
|
+
|
|
83
|
+
### Step 3: Synthesis (ClaudeCode as Synthesizer)
|
|
84
|
+
|
|
85
|
+
Combine both outputs into final deliverables:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
/synthesize
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- **Inputs**: `output_gemini.md` + `output_claudecode.md`
|
|
92
|
+
- **Output**: `wireframes/`, `component-spec.md`, `design-system.md`
|
|
93
|
+
|
|
19
94
|
## Actions
|
|
20
95
|
|
|
21
96
|
1. **Prerequisite Check**
|
|
@@ -23,6 +98,8 @@ Start the 04-ui-ux stage directly.
|
|
|
23
98
|
- PRD.md exists
|
|
24
99
|
|
|
25
100
|
2. **UI/UX Design**
|
|
101
|
+
- Gemini CLI call (creative design) - **REQUIRED**
|
|
102
|
+
- ClaudeCode parallel execution (technical spec)
|
|
26
103
|
- Wireframe design
|
|
27
104
|
- Component specification
|
|
28
105
|
- Design system
|
|
@@ -45,15 +122,21 @@ scripts/run-stage.sh 04-ui-ux "$ARGUMENTS"
|
|
|
45
122
|
|
|
46
123
|
## Output Files
|
|
47
124
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
125
|
+
| File | Description |
|
|
126
|
+
|------|-------------|
|
|
127
|
+
| `outputs/output_gemini.md` | Gemini creative designs |
|
|
128
|
+
| `outputs/output_claudecode.md` | ClaudeCode technical spec |
|
|
129
|
+
| `outputs/wireframes/` | Wireframe files |
|
|
130
|
+
| `outputs/component-spec.md` | Component specification |
|
|
131
|
+
| `outputs/design-system.md` | Design system |
|
|
51
132
|
|
|
52
133
|
## Related Commands
|
|
53
134
|
|
|
54
135
|
- `/run-stage 04` - Start after prerequisite check
|
|
55
136
|
- `/next` - Next stage (05-task-management)
|
|
56
137
|
- `/planning` - Previous stage
|
|
138
|
+
- `/gemini` - Direct Gemini CLI call
|
|
139
|
+
- `/synthesize` - Consolidate parallel outputs
|
|
57
140
|
|
|
58
141
|
## Tool Utilization
|
|
59
142
|
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# Stage Routing Skill
|
|
2
|
+
|
|
3
|
+
Automatically analyze user prompts and recommend appropriate pipeline stages.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This skill detects keywords and patterns in user requests to determine if a different stage would be more appropriate for the requested work.
|
|
8
|
+
|
|
9
|
+
## Auto-Trigger Conditions
|
|
10
|
+
|
|
11
|
+
The skill activates when user prompts contain:
|
|
12
|
+
|
|
13
|
+
1. **Work type indicators**
|
|
14
|
+
- Feature requests → 06-implementation
|
|
15
|
+
- Bug reports → 08-qa
|
|
16
|
+
- Test requests → 09-testing
|
|
17
|
+
- Design changes → 04-ui-ux
|
|
18
|
+
|
|
19
|
+
2. **Action keywords**
|
|
20
|
+
- "구현해", "만들어" → Implementation
|
|
21
|
+
- "버그", "오류", "수정" → QA/Debugging
|
|
22
|
+
- "테스트", "검증" → Testing
|
|
23
|
+
- "설계", "아키텍처" → Planning
|
|
24
|
+
|
|
25
|
+
3. **Scale indicators**
|
|
26
|
+
- Architecture-level changes → 03-planning
|
|
27
|
+
- Multi-module changes → Consider planning first
|
|
28
|
+
|
|
29
|
+
## Configuration
|
|
30
|
+
|
|
31
|
+
Located at: `config/stage_routing.jsonc`
|
|
32
|
+
|
|
33
|
+
### Key Settings
|
|
34
|
+
|
|
35
|
+
| Setting | Default | Description |
|
|
36
|
+
|---------|---------|-------------|
|
|
37
|
+
| `confidence_threshold` | 0.6 | Minimum confidence for recommendation |
|
|
38
|
+
| `auto_transition` | false | Auto-transition without confirmation |
|
|
39
|
+
| `require_user_confirmation` | true | Always ask before transitioning |
|
|
40
|
+
| `min_keyword_matches` | 2 | Minimum keyword matches required |
|
|
41
|
+
|
|
42
|
+
## Detection Logic
|
|
43
|
+
|
|
44
|
+
### 1. Keyword Matching
|
|
45
|
+
|
|
46
|
+
Each stage has defined keywords that indicate relevance:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
06-implementation: ["구현", "개발", "코드", "기능", "만들어"]
|
|
50
|
+
08-qa: ["버그", "오류", "수정", "fix", "에러"]
|
|
51
|
+
09-testing: ["테스트", "coverage", "검증"]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 2. Confidence Calculation
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
confidence = (matched_keywords + trigger_matches) / total_indicators
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 3. Scale Detection
|
|
61
|
+
|
|
62
|
+
| Scale | Criteria | Action |
|
|
63
|
+
|-------|----------|--------|
|
|
64
|
+
| Small | ≤3 files | Stay in current stage |
|
|
65
|
+
| Medium | 4-10 files | Consider related stage |
|
|
66
|
+
| Large | >10 files or architecture keywords | Recommend 03-planning |
|
|
67
|
+
|
|
68
|
+
## Output Format (Simplified)
|
|
69
|
+
|
|
70
|
+
**Important**: Internal logic (keywords, confidence scores, intents) is NOT shown to users.
|
|
71
|
+
Only display a simple, friendly question.
|
|
72
|
+
|
|
73
|
+
### When a different stage is recommended:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
🔄 08 QA 스테이지로 이동해서 버그를 수정할까요?
|
|
77
|
+
[Y] 이동 [N] 현재 스테이지 유지
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### For large-scale changes:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
🔄 이 작업은 큰 변경이 필요해 보여요.
|
|
84
|
+
03 Planning 스테이지에서 설계를 먼저 검토할까요?
|
|
85
|
+
[Y] 이동 [N] 현재 스테이지 유지
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### When current stage is appropriate:
|
|
89
|
+
|
|
90
|
+
No output - work continues silently.
|
|
91
|
+
|
|
92
|
+
## Skill Files
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
stage-routing/
|
|
96
|
+
├── README.md # This file
|
|
97
|
+
└── prompts/
|
|
98
|
+
└── analyze.md # Analysis prompt template
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Usage Scenarios
|
|
102
|
+
|
|
103
|
+
### Scenario 1: Bug Found During Implementation
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Current: 06-implementation
|
|
107
|
+
User: "이 코드에서 버그가 발생해. 수정해줘"
|
|
108
|
+
|
|
109
|
+
AI Output:
|
|
110
|
+
🔄 08 QA 스테이지로 이동해서 버그를 수정할까요?
|
|
111
|
+
[Y] 이동 [N] 현재 스테이지 유지
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Scenario 2: Stay in Current Stage
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Current: 06-implementation
|
|
118
|
+
User: "버튼 컴포넌트 구현해줘"
|
|
119
|
+
|
|
120
|
+
→ No stage change suggestion, work proceeds directly
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Scenario 3: Large-Scale Change Detected
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Current: 06-implementation
|
|
127
|
+
User: "전체 아키텍처를 마이크로서비스로 변경하고 싶어"
|
|
128
|
+
|
|
129
|
+
AI Output:
|
|
130
|
+
🔄 이 작업은 큰 변경이 필요해 보여요.
|
|
131
|
+
03 Planning 스테이지에서 설계를 먼저 검토할까요?
|
|
132
|
+
[Y] 이동 [N] 현재 스테이지 유지
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Scenario 4: Design Change Request
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Current: 06-implementation
|
|
139
|
+
User: "이 부분 디자인을 다시해볼래?"
|
|
140
|
+
|
|
141
|
+
AI Output:
|
|
142
|
+
🔄 04 UI/UX 스테이지로 되돌아가서 다시 진행할까요?
|
|
143
|
+
[Y] 이동 [N] 현재 스테이지 유지
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Integration Points
|
|
147
|
+
|
|
148
|
+
- **HANDOFF.md**: Loop-back transitions are recorded
|
|
149
|
+
- **progress.json**: Stage changes update progress state
|
|
150
|
+
- **loopback_history.json**: Full transition history maintained
|
|
151
|
+
|
|
152
|
+
## Related Commands
|
|
153
|
+
|
|
154
|
+
- `/goto <stage>` - Execute stage transition
|
|
155
|
+
- `/goto --list` - View available stages
|
|
156
|
+
- `/goto --history` - View transition history
|
|
157
|
+
- `/status` - Check current stage
|
|
158
|
+
|
|
159
|
+
## Related Skills
|
|
160
|
+
|
|
161
|
+
- `stage-transition` - Handles forward progression
|
|
162
|
+
- `smart-handoff` - Generates HANDOFF.md on transition
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Stage Routing Analysis Prompt
|
|
2
|
+
|
|
3
|
+
Analyze the current user request and determine the optimal pipeline stage.
|
|
4
|
+
|
|
5
|
+
## Analysis Context
|
|
6
|
+
|
|
7
|
+
- **Current Stage**: {{CURRENT_STAGE}}
|
|
8
|
+
- **User Request**: {{USER_PROMPT}}
|
|
9
|
+
- **Configuration**: Read from `config/stage_routing.jsonc`
|
|
10
|
+
|
|
11
|
+
## Analysis Steps
|
|
12
|
+
|
|
13
|
+
### Step 1: Extract Keywords
|
|
14
|
+
|
|
15
|
+
Scan the user prompt for keywords defined in `stage_routing.jsonc`:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
Matched keywords by stage:
|
|
19
|
+
{{#each MATCHED_STAGES}}
|
|
20
|
+
- {{stage_id}}: [{{matched_keywords}}]
|
|
21
|
+
{{/each}}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Step 2: Detect Intent
|
|
25
|
+
|
|
26
|
+
Based on keyword matches, classify the work type:
|
|
27
|
+
|
|
28
|
+
| Intent | Description |
|
|
29
|
+
|--------|-------------|
|
|
30
|
+
| `ideation` | Creative exploration, new ideas |
|
|
31
|
+
| `research` | Technical investigation, comparison |
|
|
32
|
+
| `planning` | Architecture design, system structure |
|
|
33
|
+
| `design` | UI/UX, wireframes, visual design |
|
|
34
|
+
| `task_breakdown` | Sprint planning, task decomposition |
|
|
35
|
+
| `implementation` | Feature development, coding |
|
|
36
|
+
| `refactoring` | Code improvement, optimization |
|
|
37
|
+
| `debugging` | Bug fixes, error resolution |
|
|
38
|
+
| `testing` | Test creation, coverage |
|
|
39
|
+
| `deployment` | CI/CD, release |
|
|
40
|
+
|
|
41
|
+
### Step 3: Calculate Confidence
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
keyword_score = matched_keywords.length / stage.keywords.length
|
|
45
|
+
trigger_score = matched_triggers.length / stage.triggers.length
|
|
46
|
+
confidence = (keyword_score * 0.6) + (trigger_score * 0.4)
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Step 4: Detect Scale
|
|
50
|
+
|
|
51
|
+
Check for large-scale change indicators:
|
|
52
|
+
|
|
53
|
+
- Architecture keywords: "아키텍처", "시스템", "전체", "마이크로서비스"
|
|
54
|
+
- Multi-module mentions
|
|
55
|
+
- Migration or redesign language
|
|
56
|
+
|
|
57
|
+
**If scale is LARGE** → Force recommendation: `03-planning`
|
|
58
|
+
|
|
59
|
+
### Step 5: Make Recommendation
|
|
60
|
+
|
|
61
|
+
**IMPORTANT: Do NOT expose internal analysis to users. Use simplified, friendly output.**
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
{{#if SHOULD_TRANSITION}}
|
|
65
|
+
|
|
66
|
+
{{#if IS_LARGE_SCALE}}
|
|
67
|
+
🔄 이 작업은 큰 변경이 필요해 보여요.
|
|
68
|
+
{{RECOMMENDED_STAGE_NAME}} 스테이지에서 설계를 먼저 검토할까요?
|
|
69
|
+
[Y] 이동 [N] 현재 스테이지 유지
|
|
70
|
+
{{else}}
|
|
71
|
+
🔄 {{RECOMMENDED_STAGE_NAME}} 스테이지로 이동해서 {{TASK_DESCRIPTION}}할까요?
|
|
72
|
+
[Y] 이동 [N] 현재 스테이지 유지
|
|
73
|
+
{{/if}}
|
|
74
|
+
|
|
75
|
+
{{else}}
|
|
76
|
+
|
|
77
|
+
(No output - proceed with work in current stage)
|
|
78
|
+
|
|
79
|
+
{{/if}}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Stage Name Mappings (for friendly output)
|
|
83
|
+
|
|
84
|
+
| Stage ID | Display Name | Task Description |
|
|
85
|
+
|----------|--------------|------------------|
|
|
86
|
+
| 01-brainstorm | 01 Brainstorm | 아이디어를 탐색 |
|
|
87
|
+
| 02-research | 02 Research | 조사를 진행 |
|
|
88
|
+
| 03-planning | 03 Planning | 설계를 검토 |
|
|
89
|
+
| 04-ui-ux | 04 UI/UX | 디자인을 수정 |
|
|
90
|
+
| 05-task-management | 05 Task | 작업을 분해 |
|
|
91
|
+
| 06-implementation | 06 Implementation | 기능을 구현 |
|
|
92
|
+
| 07-refactoring | 07 Refactoring | 코드를 개선 |
|
|
93
|
+
| 08-qa | 08 QA | 버그를 수정 |
|
|
94
|
+
| 09-testing | 09 Testing | 테스트를 작성 |
|
|
95
|
+
| 10-deployment | 10 Deployment | 배포를 진행 |
|
|
96
|
+
|
|
97
|
+
## Decision Matrix
|
|
98
|
+
|
|
99
|
+
| Current Stage | Request Type | Recommendation |
|
|
100
|
+
|---------------|--------------|----------------|
|
|
101
|
+
| Any | Bug fix | → 08-qa |
|
|
102
|
+
| Any | Test creation | → 09-testing |
|
|
103
|
+
| Any | Architecture change | → 03-planning |
|
|
104
|
+
| 06-impl | Small bug | Stay (fix inline) |
|
|
105
|
+
| 06-impl | Feature request | Stay |
|
|
106
|
+
| 08-qa | New feature | → 06-implementation |
|
|
107
|
+
|
|
108
|
+
## Scale-Based Routing
|
|
109
|
+
|
|
110
|
+
### Small Scale (Stay)
|
|
111
|
+
- Single file change
|
|
112
|
+
- No new dependencies
|
|
113
|
+
- No structural changes
|
|
114
|
+
|
|
115
|
+
### Medium Scale (Consider)
|
|
116
|
+
- 4-10 files affected
|
|
117
|
+
- Single module change
|
|
118
|
+
- 1-2 new dependencies
|
|
119
|
+
|
|
120
|
+
### Large Scale (Force Planning)
|
|
121
|
+
- 10+ files affected
|
|
122
|
+
- Architecture change
|
|
123
|
+
- Core dependency changes
|
|
124
|
+
- System-wide impact
|
|
125
|
+
|
|
126
|
+
## Output Variables
|
|
127
|
+
|
|
128
|
+
| Variable | Description |
|
|
129
|
+
|----------|-------------|
|
|
130
|
+
| `SHOULD_TRANSITION` | Boolean: recommend stage change |
|
|
131
|
+
| `RECOMMENDED_STAGE` | Target stage ID |
|
|
132
|
+
| `CONFIDENCE` | Match confidence (0-100%) |
|
|
133
|
+
| `DETECTED_INTENT` | Classified work type |
|
|
134
|
+
| `MATCHED_KEYWORDS` | Keywords that matched |
|
|
135
|
+
| `REASONING` | Explanation for recommendation |
|
package/template/CLAUDE.md
CHANGED
|
@@ -174,6 +174,7 @@ Visualizes context usage, tool activity, and todo progress in the statusline.
|
|
|
174
174
|
| `/goto <stage>` | Jump to previous stage (intentional loop-back) |
|
|
175
175
|
| `/goto --list` | Show available stages for loop-back |
|
|
176
176
|
| `/goto --history` | Show loop-back history |
|
|
177
|
+
| `/goto <stage> --reason <text>` | Loop-back with recorded reason |
|
|
177
178
|
|
|
178
179
|
### Configuration Commands
|
|
179
180
|
| Command | Description |
|
|
@@ -218,6 +219,7 @@ Visualizes context usage, tool activity, and todo progress in the statusline.
|
|
|
218
219
|
| Skill | Trigger | Description |
|
|
219
220
|
|-------|---------|-------------|
|
|
220
221
|
| `stage-transition` | "completed", "/next" | Stage completion detection and transition automation |
|
|
222
|
+
| `stage-routing` | Work type keywords detected | Automatic stage recommendation based on prompt analysis |
|
|
221
223
|
| `context-compression` | Token 50k+ | Context compression and state save |
|
|
222
224
|
| `smart-handoff` | Stage completion | Smart context extraction and HANDOFF generation |
|
|
223
225
|
| `ai-collaboration` | `/collaborate` | Multi-AI collaboration orchestration |
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../schemas/stage-routing.schema.json",
|
|
3
|
+
"description": "Stage routing configuration for automatic prompt analysis and stage recommendation",
|
|
4
|
+
|
|
5
|
+
"routing": {
|
|
6
|
+
"01-brainstorm": {
|
|
7
|
+
"keywords": ["아이디어", "idea", "concept", "탐색", "explore", "브레인스토밍", "brainstorm", "가능성", "제안", "창의", "발상"],
|
|
8
|
+
"triggers": ["~하면 어떨까", "what if", "어떤 방법", "새로운 기능 아이디어", "다른 접근", "아이디어 필요"],
|
|
9
|
+
"intent": "ideation",
|
|
10
|
+
"description": "Creative exploration and idea generation"
|
|
11
|
+
},
|
|
12
|
+
"02-research": {
|
|
13
|
+
"keywords": ["조사", "research", "분석", "analyze", "기술 스택", "라이브러리", "library", "API", "비교", "compare", "평가"],
|
|
14
|
+
"triggers": ["알아봐", "investigate", "비교해", "찾아봐", "어떤 기술", "조사해", "검토해"],
|
|
15
|
+
"intent": "research",
|
|
16
|
+
"description": "Technical research and analysis"
|
|
17
|
+
},
|
|
18
|
+
"03-planning": {
|
|
19
|
+
"keywords": ["설계", "architecture", "구조", "plan", "아키텍처", "모듈", "시스템", "구성", "design", "청사진"],
|
|
20
|
+
"triggers": ["설계해", "구조를", "어떻게 구성", "아키텍처 변경", "재설계", "구조 잡아", "시스템 설계"],
|
|
21
|
+
"intent": "planning",
|
|
22
|
+
"description": "Architecture and system design"
|
|
23
|
+
},
|
|
24
|
+
"04-ui-ux": {
|
|
25
|
+
"keywords": ["UI", "UX", "디자인", "화면", "wireframe", "인터페이스", "레이아웃", "스타일", "컴포넌트", "사용자 경험"],
|
|
26
|
+
"triggers": ["화면 만들어", "디자인", "UI 변경", "레이아웃 수정", "인터페이스", "와이어프레임"],
|
|
27
|
+
"intent": "design",
|
|
28
|
+
"description": "UI/UX design and wireframing"
|
|
29
|
+
},
|
|
30
|
+
"05-task-management": {
|
|
31
|
+
"keywords": ["태스크", "task", "작업 분해", "우선순위", "스프린트", "sprint", "일정", "계획", "업무", "할 일"],
|
|
32
|
+
"triggers": ["작업을 나눠", "우선순위 정해", "스프린트 계획", "일정 조정", "태스크 생성", "작업 분해"],
|
|
33
|
+
"intent": "task_breakdown",
|
|
34
|
+
"description": "Task breakdown and sprint planning"
|
|
35
|
+
},
|
|
36
|
+
"06-implementation": {
|
|
37
|
+
"keywords": ["구현", "implement", "개발", "코드", "build", "기능", "만들어", "추가해", "작성", "코딩"],
|
|
38
|
+
"triggers": ["구현해", "개발해", "코드 작성", "기능 추가", "만들어줘", "build", "개발 시작"],
|
|
39
|
+
"intent": "implementation",
|
|
40
|
+
"description": "Feature implementation and coding"
|
|
41
|
+
},
|
|
42
|
+
"07-refactoring": {
|
|
43
|
+
"keywords": ["리팩토링", "refactor", "개선", "최적화", "optimize", "클린", "정리", "성능", "performance"],
|
|
44
|
+
"triggers": ["리팩토링해", "코드 개선", "성능 최적화", "정리해", "클린업", "개선해"],
|
|
45
|
+
"intent": "refactoring",
|
|
46
|
+
"description": "Code refactoring and optimization"
|
|
47
|
+
},
|
|
48
|
+
"08-qa": {
|
|
49
|
+
"keywords": ["버그", "bug", "수정", "fix", "오류", "error", "문제", "안됨", "에러", "이슈", "장애"],
|
|
50
|
+
"triggers": ["버그 수정", "문제 해결", "오류 나", "고쳐", "안 돼", "fix", "에러 발생", "작동 안함"],
|
|
51
|
+
"intent": "debugging",
|
|
52
|
+
"description": "Bug fixing and quality assurance"
|
|
53
|
+
},
|
|
54
|
+
"09-testing": {
|
|
55
|
+
"keywords": ["테스트", "test", "검증", "coverage", "E2E", "단위", "unit", "통합", "integration", "TDD"],
|
|
56
|
+
"triggers": ["테스트 작성", "테스트 추가", "커버리지", "검증해", "E2E 테스트", "테스트 코드"],
|
|
57
|
+
"intent": "testing",
|
|
58
|
+
"description": "Testing and test coverage"
|
|
59
|
+
},
|
|
60
|
+
"10-deployment": {
|
|
61
|
+
"keywords": ["배포", "deploy", "CI/CD", "릴리스", "release", "production", "출시", "publish", "운영"],
|
|
62
|
+
"triggers": ["배포해", "릴리스", "프로덕션", "출시해", "배포 설정", "CI/CD 구성"],
|
|
63
|
+
"intent": "deployment",
|
|
64
|
+
"description": "Deployment and CI/CD configuration"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
"analysis": {
|
|
69
|
+
"confidence_threshold": 0.6,
|
|
70
|
+
"auto_transition": false,
|
|
71
|
+
"require_user_confirmation": true,
|
|
72
|
+
"min_keyword_matches": 2
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
"scale_detection": {
|
|
76
|
+
"small": {
|
|
77
|
+
"file_count_max": 3,
|
|
78
|
+
"description": "Minor changes, stay in current stage"
|
|
79
|
+
},
|
|
80
|
+
"medium": {
|
|
81
|
+
"file_count_max": 10,
|
|
82
|
+
"description": "Module-level changes, consider related stage"
|
|
83
|
+
},
|
|
84
|
+
"large": {
|
|
85
|
+
"file_count_min": 10,
|
|
86
|
+
"description": "Architecture changes, recommend 03-planning"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
"indicators": {
|
|
91
|
+
"large_scale_keywords": ["전체", "아키텍처", "architecture", "시스템", "대규모", "전면", "마이크로서비스", "모놀리스"],
|
|
92
|
+
"force_planning_triggers": ["전체 재설계", "아키텍처 변경", "시스템 구조", "마이그레이션"]
|
|
93
|
+
}
|
|
94
|
+
}
|