claude-symphony 0.0.1 → 0.0.3
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/README.md +16 -12
- package/assets/claude_symphony.webp +0 -0
- package/assets/claude_symphony_ascii.txt +8 -0
- package/bin/create.js +80 -69
- package/package.json +3 -2
- package/template/.claude/commands/benchmark.md +32 -32
- package/template/.claude/commands/brainstorm.md +33 -33
- package/template/.claude/commands/checkpoint.md +42 -42
- package/template/.claude/commands/codex.md +52 -52
- package/template/.claude/commands/collaborate.md +47 -47
- package/template/.claude/commands/context.md +77 -77
- package/template/.claude/commands/deploy.md +50 -50
- package/template/.claude/commands/fork.md +46 -46
- package/template/.claude/commands/gemini.md +43 -43
- package/template/.claude/commands/handoff.md +42 -42
- package/template/.claude/commands/implement.md +42 -42
- package/template/.claude/commands/init-project.md +25 -25
- package/template/.claude/commands/next.md +67 -67
- package/template/.claude/commands/planning.md +38 -38
- package/template/.claude/commands/qa.md +47 -47
- package/template/.claude/commands/refactor.md +50 -50
- package/template/.claude/commands/research.md +31 -31
- package/template/.claude/commands/restore.md +53 -53
- package/template/.claude/commands/run-stage.md +45 -45
- package/template/.claude/commands/stages.md +49 -49
- package/template/.claude/commands/status.md +41 -41
- package/template/.claude/commands/tasks.md +33 -33
- package/template/.claude/commands/test.md +45 -45
- package/template/.claude/commands/ui-ux.md +31 -31
- package/template/.claude/commands/validate.md +81 -81
- package/template/.claude/hooks/ai-selector.sh +39 -39
- package/template/.claude/hooks/auto-checkpoint.sh +30 -30
- package/template/.claude/hooks/output-validator.sh +45 -45
- package/template/.claude/hooks/post-stage.sh +28 -28
- package/template/.claude/hooks/pre-stage.sh +47 -47
- package/template/.claude/hooks/session-start.sh +27 -27
- package/template/.claude/hooks/statusline.sh +24 -24
- package/template/.claude/hooks/stop.sh +26 -26
- package/template/.claude/settings.json +32 -32
- package/template/.claude/skills/ai-collaboration/README.md +31 -31
- package/template/.claude/skills/ai-collaboration/debate.md +66 -66
- package/template/.claude/skills/ai-collaboration/parallel.md +34 -34
- package/template/.claude/skills/ai-collaboration/prompts/CLAUDE.md +59 -63
- package/template/.claude/skills/auto-checkpoint/README.md +46 -46
- package/template/.claude/skills/auto-checkpoint/prompts/CLAUDE.md +68 -72
- package/template/.claude/skills/auto-checkpoint/rollback.md +95 -95
- package/template/.claude/skills/auto-checkpoint/trigger.md +37 -37
- package/template/.claude/skills/context-compression/README.md +69 -69
- package/template/.claude/skills/context-compression/analyze.md +74 -74
- package/template/.claude/skills/context-compression/compress.md +103 -103
- package/template/.claude/skills/context-compression/prompts/compression.md +78 -78
- package/template/.claude/skills/output-validator/README.md +33 -33
- package/template/.claude/skills/output-validator/prompts/CLAUDE.md +74 -78
- package/template/.claude/skills/output-validator/validate.md +76 -76
- package/template/.claude/skills/smart-handoff/README.md +35 -35
- package/template/.claude/skills/smart-handoff/extract.md +42 -42
- package/template/.claude/skills/smart-handoff/prompts/CLAUDE.md +52 -54
- package/template/.claude/skills/smart-handoff/summarize.md +55 -55
- package/template/.claude/skills/stage-transition/README.md +50 -50
- package/template/.claude/skills/stage-transition/handoff-gen.md +89 -89
- package/template/.claude/skills/stage-transition/prompts/transition.md +74 -74
- package/template/.claude/skills/stage-transition/validate.md +41 -41
- package/template/CLAUDE.md +334 -335
- package/template/config/ai_benchmarking.yaml +22 -22
- package/template/config/ai_collaboration.yaml +18 -18
- package/template/config/ai_logging.yaml +50 -50
- package/template/config/auto_checkpoint.yaml +32 -32
- package/template/config/context.yaml +20 -20
- package/template/config/git.yaml +51 -51
- package/template/config/handoff_intelligence.yaml +23 -23
- package/template/config/mcp_fallbacks.yaml +71 -71
- package/template/config/memory_integration.yaml +23 -23
- package/template/config/model_enforcement.yaml +53 -53
- package/template/config/models.yaml +24 -24
- package/template/config/output_validation.yaml +44 -44
- package/template/config/pipeline.yaml +25 -25
- package/template/config/pipeline_forking.yaml +40 -40
- package/template/config/qa_logging.yaml +67 -67
- package/template/config/smart_rollback.yaml +48 -48
- package/template/config/stage_personas.yaml +154 -154
- package/template/config/workflow.yaml +16 -16
- package/template/scripts/ai-benchmark.sh +41 -41
- package/template/scripts/codex-wrapper.sh +32 -32
- package/template/scripts/context-manager.sh +136 -136
- package/template/scripts/create-checkpoint.sh +34 -34
- package/template/scripts/gemini-wrapper.sh +31 -31
- package/template/scripts/init-project.sh +40 -40
- package/template/scripts/list-stages.sh +30 -30
- package/template/scripts/next-stage.sh +67 -67
- package/template/scripts/output-validate.sh +2 -2
- package/template/scripts/pipeline-fork.sh +68 -68
- package/template/scripts/pre-run-check.sh +84 -84
- package/template/scripts/restore-checkpoint.sh +50 -50
- package/template/scripts/run-stage.sh +44 -44
- package/template/scripts/show-status.sh +30 -30
- package/template/scripts/smart-handoff.sh +70 -70
- package/template/stages/01-brainstorm/CLAUDE.md +70 -74
- package/template/stages/01-brainstorm/README.md +54 -54
- package/template/stages/01-brainstorm/config.yaml +18 -18
- package/template/stages/01-brainstorm/prompts/collaboration.md +24 -24
- package/template/stages/01-brainstorm/prompts/ideation.md +41 -41
- package/template/stages/01-brainstorm/prompts/persona.md +50 -50
- package/template/stages/01-brainstorm/prompts/requirements.md +55 -55
- package/template/stages/01-brainstorm/prompts/validation.md +28 -28
- package/template/stages/01-brainstorm/templates/ideas.md +47 -47
- package/template/stages/01-brainstorm/templates/requirements_analysis.md +61 -61
- package/template/stages/02-research/CLAUDE.md +72 -76
- package/template/stages/02-research/config.yaml +12 -12
- package/template/stages/02-research/prompts/collaboration.md +29 -29
- package/template/stages/02-research/prompts/feasibility.md +38 -38
- package/template/stages/02-research/prompts/market_analysis.md +29 -29
- package/template/stages/02-research/prompts/tech_stack.md +34 -34
- package/template/stages/02-research/prompts/validation.md +29 -29
- package/template/stages/03-planning/CLAUDE.md +88 -92
- package/template/stages/03-planning/config.yaml +10 -10
- package/template/stages/03-planning/prompts/architecture.md +43 -43
- package/template/stages/03-planning/prompts/collaboration.md +34 -34
- package/template/stages/03-planning/prompts/validation.md +34 -34
- package/template/stages/04-ui-ux/CLAUDE.md +68 -72
- package/template/stages/04-ui-ux/config.yaml +5 -5
- package/template/stages/04-ui-ux/prompts/collaboration.md +35 -35
- package/template/stages/04-ui-ux/prompts/validation.md +30 -30
- package/template/stages/05-task-management/CLAUDE.md +81 -85
- package/template/stages/05-task-management/config.yaml +17 -17
- package/template/stages/05-task-management/prompts/collaboration.md +30 -30
- package/template/stages/05-task-management/prompts/validation.md +33 -33
- package/template/stages/05-task-management/templates/notion_integration.md +70 -70
- package/template/stages/05-task-management/templates/parallel_groups.yaml +64 -64
- package/template/stages/05-task-management/templates/task_schema.yaml +33 -33
- package/template/stages/06-implementation/CLAUDE.md +117 -121
- package/template/stages/06-implementation/config.yaml +10 -10
- package/template/stages/06-implementation/prompts/collaboration.md +29 -29
- package/template/stages/06-implementation/prompts/validation.md +36 -36
- package/template/stages/07-refactoring/CLAUDE.md +120 -124
- package/template/stages/07-refactoring/config.yaml +11 -11
- package/template/stages/07-refactoring/prompts/collaboration.md +36 -36
- package/template/stages/07-refactoring/prompts/validation.md +40 -40
- package/template/stages/08-qa/CLAUDE.md +80 -84
- package/template/stages/08-qa/config.yaml +7 -7
- package/template/stages/08-qa/prompts/collaboration.md +34 -34
- package/template/stages/08-qa/prompts/validation.md +41 -41
- package/template/stages/09-testing/CLAUDE.md +86 -90
- package/template/stages/09-testing/config.yaml +10 -10
- package/template/stages/09-testing/prompts/collaboration.md +38 -38
- package/template/stages/09-testing/prompts/validation.md +41 -41
- package/template/stages/10-deployment/CLAUDE.md +86 -90
- package/template/stages/10-deployment/config.yaml +11 -11
- package/template/stages/10-deployment/prompts/collaboration.md +37 -37
- package/template/stages/10-deployment/prompts/validation.md +54 -54
- package/template/stages/10-deployment/templates/github-actions-cd.yaml +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
stage:
|
|
4
4
|
id: "06-implementation"
|
|
5
5
|
name: "Implementation"
|
|
6
|
-
description: "
|
|
6
|
+
description: "Core feature implementation"
|
|
7
7
|
|
|
8
8
|
models:
|
|
9
9
|
primary: "claudecode"
|
|
@@ -21,7 +21,7 @@ inputs:
|
|
|
21
21
|
- name: "../05-task-management/outputs/tasks.md"
|
|
22
22
|
- name: "../03-planning/outputs/architecture.md"
|
|
23
23
|
- name: "../03-planning/outputs/implementation.yaml"
|
|
24
|
-
description: "
|
|
24
|
+
description: "Implementation rules (Issue #10)"
|
|
25
25
|
- name: "../05-task-management/HANDOFF.md"
|
|
26
26
|
optional:
|
|
27
27
|
- name: "../04-ui-ux/outputs/design_system.md"
|
|
@@ -30,9 +30,9 @@ inputs:
|
|
|
30
30
|
outputs:
|
|
31
31
|
required:
|
|
32
32
|
- name: "source_code/"
|
|
33
|
-
description: "
|
|
33
|
+
description: "Implemented source code"
|
|
34
34
|
- name: "implementation_log.md"
|
|
35
|
-
description: "
|
|
35
|
+
description: "Implementation log"
|
|
36
36
|
- name: "HANDOFF.md"
|
|
37
37
|
|
|
38
38
|
prompts:
|
|
@@ -48,15 +48,15 @@ prompts:
|
|
|
48
48
|
|
|
49
49
|
completion:
|
|
50
50
|
checklist:
|
|
51
|
-
- "
|
|
52
|
-
- "
|
|
53
|
-
- "
|
|
54
|
-
- "API
|
|
55
|
-
- "
|
|
51
|
+
- "Project scaffolding complete"
|
|
52
|
+
- "Common components implemented"
|
|
53
|
+
- "Core features implemented"
|
|
54
|
+
- "API endpoints implemented"
|
|
55
|
+
- "Checkpoint created"
|
|
56
56
|
|
|
57
57
|
transition:
|
|
58
58
|
next_stage: "07-refactoring"
|
|
59
59
|
prerequisites:
|
|
60
60
|
- "05-task-management"
|
|
61
61
|
handoff_required: true
|
|
62
|
-
checkpoint_required: true #
|
|
62
|
+
checkpoint_required: true # Required!
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
# AI
|
|
1
|
+
# AI Collaboration Prompt - Implementation
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Collaboration Mode: Sequential Handoff
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This stage uses **sequential handoff** mode to run the implement → review → improve cycle.
|
|
6
6
|
|
|
7
|
-
###
|
|
8
|
-
- **ClaudeCode**:
|
|
7
|
+
### Participating Models
|
|
8
|
+
- **ClaudeCode**: Code generation, implementation
|
|
9
9
|
|
|
10
|
-
###
|
|
10
|
+
### Collaboration Prompt
|
|
11
11
|
|
|
12
12
|
```
|
|
13
|
-
#
|
|
13
|
+
# Implement → Self Review → Improve
|
|
14
14
|
/collaborate --mode sequential --chain "claudecode:implement -> claudecode:review -> claudecode:improve"
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
### AI
|
|
17
|
+
### AI Benchmarking (Optional)
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
For complex algorithm implementation:
|
|
20
20
|
```
|
|
21
21
|
/benchmark --task "sorting_algorithm" --models "claude,codex"
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
###
|
|
24
|
+
### Workflow
|
|
25
25
|
|
|
26
|
-
1.
|
|
27
|
-
2.
|
|
28
|
-
3.
|
|
29
|
-
4.
|
|
26
|
+
1. **Scaffolding**: Project initialization
|
|
27
|
+
2. **Common Components**: Based on design system
|
|
28
|
+
3. **Feature Implementation**: Sequential implementation of sprint tasks
|
|
29
|
+
4. **Integration**: API/DB integration
|
|
30
30
|
|
|
31
|
-
###
|
|
31
|
+
### Checkpoint Triggers
|
|
32
32
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
- 100
|
|
33
|
+
- On sprint completion
|
|
34
|
+
- On major feature completion
|
|
35
|
+
- On 100+ lines changed
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
/checkpoint --reason "
|
|
38
|
+
/checkpoint --reason "Sprint 1 complete"
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
### implementation.yaml
|
|
41
|
+
### Follow implementation.yaml
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Check before implementation:
|
|
44
44
|
```yaml
|
|
45
|
-
#
|
|
45
|
+
# Example rules
|
|
46
46
|
component_type: functional
|
|
47
47
|
styling: tailwind
|
|
48
48
|
state_management: zustand
|
|
49
49
|
naming: camelCase
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
###
|
|
52
|
+
### Output Format
|
|
53
53
|
|
|
54
54
|
```markdown
|
|
55
|
-
##
|
|
55
|
+
## Implementation Log
|
|
56
56
|
|
|
57
|
-
### [
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
57
|
+
### [Date] - [Task]
|
|
58
|
+
- Implementation details
|
|
59
|
+
- Modified files
|
|
60
|
+
- Test results
|
|
61
61
|
|
|
62
|
-
###
|
|
62
|
+
### Checkpoint
|
|
63
63
|
- checkpoint_YYYYMMDD_HHMMSS
|
|
64
64
|
```
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Output Validation Prompt - Implementation
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Validation Targets
|
|
4
4
|
|
|
5
|
-
|
|
|
6
|
-
|
|
7
|
-
| `source_code/` | Lint
|
|
8
|
-
| `source_code/` | Type
|
|
9
|
-
| `implementation_log.md` |
|
|
10
|
-
| `HANDOFF.md` |
|
|
5
|
+
| Output | Required Condition | Validation Method |
|
|
6
|
+
|--------|-------------------|-------------------|
|
|
7
|
+
| `source_code/` | Lint pass | `npm run lint` |
|
|
8
|
+
| `source_code/` | Type check pass | `npm run typecheck` |
|
|
9
|
+
| `implementation_log.md` | Change records | Structure verification |
|
|
10
|
+
| `HANDOFF.md` | Checkpoint reference | Item verification |
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Validation Command
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
/validate --stage 06-implementation
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Quality Criteria
|
|
19
19
|
|
|
20
20
|
### source_code/
|
|
21
|
-
- [ ] ESLint
|
|
22
|
-
- [ ] TypeScript
|
|
23
|
-
- [ ]
|
|
24
|
-
- [ ]
|
|
25
|
-
- [ ]
|
|
21
|
+
- [ ] No ESLint errors
|
|
22
|
+
- [ ] No TypeScript type errors
|
|
23
|
+
- [ ] Folder structure compliance (implementation.yaml)
|
|
24
|
+
- [ ] Naming convention compliance
|
|
25
|
+
- [ ] Code formatting applied
|
|
26
26
|
|
|
27
27
|
### implementation_log.md
|
|
28
|
-
- [ ]
|
|
29
|
-
- [ ]
|
|
30
|
-
- [ ]
|
|
28
|
+
- [ ] List of implemented tasks
|
|
29
|
+
- [ ] List of modified files
|
|
30
|
+
- [ ] Known issues/technical debt
|
|
31
31
|
|
|
32
32
|
### HANDOFF.md
|
|
33
|
-
- [ ]
|
|
34
|
-
- [ ]
|
|
35
|
-
- [ ]
|
|
33
|
+
- [ ] Completed features checklist
|
|
34
|
+
- [ ] Checkpoint reference
|
|
35
|
+
- [ ] Items needing refactoring
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Auto Validation Script
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
# Lint
|
|
40
|
+
# Lint check
|
|
41
41
|
npm run lint
|
|
42
42
|
|
|
43
|
-
# Type
|
|
43
|
+
# Type check
|
|
44
44
|
npm run typecheck
|
|
45
45
|
|
|
46
|
-
#
|
|
46
|
+
# Build verification
|
|
47
47
|
npm run build
|
|
48
48
|
|
|
49
|
-
#
|
|
49
|
+
# Basic tests
|
|
50
50
|
npm run test -- --passWithNoTests
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## Code Quality Metrics
|
|
54
54
|
|
|
55
|
-
|
|
|
56
|
-
|
|
57
|
-
| Lint
|
|
58
|
-
| Type
|
|
59
|
-
|
|
|
55
|
+
| Metric | Criteria | Command |
|
|
56
|
+
|--------|----------|---------|
|
|
57
|
+
| Lint errors | 0 | `npm run lint` |
|
|
58
|
+
| Type errors | 0 | `npm run typecheck` |
|
|
59
|
+
| Build success | Yes | `npm run build` |
|
|
60
60
|
|
|
61
|
-
##
|
|
61
|
+
## Actions on Failure
|
|
62
62
|
|
|
63
|
-
1. Lint
|
|
64
|
-
2. Type
|
|
65
|
-
3.
|
|
63
|
+
1. Lint errors → `npm run lint --fix`
|
|
64
|
+
2. Type errors → Fix types
|
|
65
|
+
3. Build failure → Analyze error log and fix
|
|
@@ -1,180 +1,176 @@
|
|
|
1
1
|
# Stage 07: Refactoring
|
|
2
2
|
|
|
3
|
-
> ⚠️
|
|
4
|
-
>
|
|
5
|
-
> ClaudeCode
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
>
|
|
12
|
-
>
|
|
13
|
-
>
|
|
14
|
-
|
|
15
|
-
###
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
###
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
###
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
### AI
|
|
33
|
-
- **Temperature**: 0.5 (
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
##
|
|
37
|
-
- **Primary**: Codex (
|
|
38
|
-
- **Secondary**: ClaudeCode (
|
|
39
|
-
- **Mode**: Deep Dive -
|
|
40
|
-
|
|
41
|
-
##
|
|
42
|
-
1.
|
|
43
|
-
2.
|
|
44
|
-
3.
|
|
45
|
-
4.
|
|
46
|
-
|
|
47
|
-
##
|
|
3
|
+
> ⚠️ **Required AI Model: Codex**
|
|
4
|
+
> The core tasks of this stage (code analysis, refactoring, optimization) should be performed using the `/codex` command.
|
|
5
|
+
> ClaudeCode is only used for simple file operations and running builds/tests.
|
|
6
|
+
|
|
7
|
+
Code quality improvement and optimization stage
|
|
8
|
+
|
|
9
|
+
## Persona: Code Surgeon
|
|
10
|
+
|
|
11
|
+
> You are a Code Surgeon.
|
|
12
|
+
> Improve code quality while maintaining its essence.
|
|
13
|
+
> Optimize performance, readability, and maintainability in balance.
|
|
14
|
+
|
|
15
|
+
### Characteristics
|
|
16
|
+
- Deep analysis
|
|
17
|
+
- Performance optimization
|
|
18
|
+
- Technical debt resolution
|
|
19
|
+
- Pattern application
|
|
20
|
+
|
|
21
|
+
### Recommended Actions
|
|
22
|
+
- Reduce code complexity
|
|
23
|
+
- Resolve performance bottlenecks
|
|
24
|
+
- Apply design patterns
|
|
25
|
+
- Remove duplication
|
|
26
|
+
|
|
27
|
+
### Actions to Avoid
|
|
28
|
+
- Unnecessary changes
|
|
29
|
+
- Excessive abstraction
|
|
30
|
+
- Behavior changes
|
|
31
|
+
|
|
32
|
+
### AI Settings
|
|
33
|
+
- **Temperature**: 0.5 (balanced analysis)
|
|
34
|
+
- **Analysis Depth**: Deep
|
|
35
|
+
|
|
36
|
+
## Execution Model
|
|
37
|
+
- **Primary**: Codex (code analysis and optimization)
|
|
38
|
+
- **Secondary**: ClaudeCode (complex refactoring)
|
|
39
|
+
- **Mode**: Deep Dive - in-depth code analysis
|
|
40
|
+
|
|
41
|
+
## Goals
|
|
42
|
+
1. Code quality improvement
|
|
43
|
+
2. Duplication removal
|
|
44
|
+
3. Performance optimization
|
|
45
|
+
4. Architecture improvement
|
|
46
|
+
|
|
47
|
+
## Input Files
|
|
48
48
|
- `../06-implementation/outputs/source_code/`
|
|
49
49
|
- `../06-implementation/outputs/implementation_log.md`
|
|
50
50
|
- `../06-implementation/HANDOFF.md`
|
|
51
51
|
|
|
52
|
-
##
|
|
53
|
-
- `outputs/refactored_code/` -
|
|
54
|
-
- `outputs/refactoring_report.md` -
|
|
55
|
-
- `HANDOFF.md` -
|
|
52
|
+
## Output Files
|
|
53
|
+
- `outputs/refactored_code/` - Refactored code
|
|
54
|
+
- `outputs/refactoring_report.md` - Refactoring report
|
|
55
|
+
- `HANDOFF.md` - Handoff document for next stage
|
|
56
56
|
|
|
57
|
-
## Codex CLI
|
|
57
|
+
## Codex CLI Usage
|
|
58
58
|
|
|
59
|
-
###
|
|
59
|
+
### Code Analysis
|
|
60
60
|
```bash
|
|
61
|
-
/codex "
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
61
|
+
/codex "Analyze the following code for improvements:
|
|
62
|
+
- Duplicate code
|
|
63
|
+
- Performance bottlenecks
|
|
64
|
+
- Design pattern violations
|
|
65
|
+
- Type safety issues"
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
###
|
|
68
|
+
### Refactoring Execution
|
|
69
69
|
```bash
|
|
70
|
-
/codex "
|
|
71
|
-
[
|
|
72
|
-
|
|
70
|
+
/codex "Refactor the following function:
|
|
71
|
+
[code block]
|
|
72
|
+
Goals: Improve readability, optimize performance"
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
##
|
|
75
|
+
## Workflow
|
|
76
76
|
|
|
77
|
-
### 1.
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
77
|
+
### 1. Code Analysis
|
|
78
|
+
- Run static analysis (ESLint, TypeScript)
|
|
79
|
+
- Complexity analysis (Cyclomatic complexity)
|
|
80
|
+
- Dependency analysis
|
|
81
81
|
|
|
82
|
-
### 2.
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
82
|
+
### 2. Refactoring Plan
|
|
83
|
+
- Identify improvement areas
|
|
84
|
+
- Determine priorities
|
|
85
|
+
- Evaluate impact scope
|
|
86
86
|
|
|
87
|
-
### 3.
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
87
|
+
### 3. Refactoring Execution
|
|
88
|
+
- Perform in small units
|
|
89
|
+
- Test after each change
|
|
90
|
+
- Record changes in commit messages
|
|
91
91
|
|
|
92
|
-
### 4.
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
- API
|
|
92
|
+
### 4. Optimization
|
|
93
|
+
- Bundle size optimization
|
|
94
|
+
- Rendering optimization
|
|
95
|
+
- API call optimization
|
|
96
96
|
|
|
97
|
-
##
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
97
|
+
## Checkpoint Rules
|
|
98
|
+
- **Required**: Checkpoints are mandatory for this stage
|
|
99
|
+
- Create checkpoint before major refactoring
|
|
100
|
+
- Maintain rollback-ready state
|
|
101
101
|
|
|
102
102
|
---
|
|
103
103
|
|
|
104
|
-
## ⚠️ AI
|
|
104
|
+
## ⚠️ AI Usage Recording (Required)
|
|
105
105
|
|
|
106
|
-
>
|
|
107
|
-
> Codex
|
|
106
|
+
> **Important**: This stage requires Codex CLI.
|
|
107
|
+
> If Codex call fails, it falls back to ClaudeCode, and this must be recorded in HANDOFF.md.
|
|
108
108
|
|
|
109
|
-
### Codex
|
|
109
|
+
### Pre-Codex Call Verification
|
|
110
110
|
```bash
|
|
111
|
-
# 1. Codex CLI
|
|
111
|
+
# 1. Verify Codex CLI installation
|
|
112
112
|
which codex
|
|
113
113
|
|
|
114
|
-
# 2. tmux
|
|
114
|
+
# 2. Check tmux session
|
|
115
115
|
tmux ls
|
|
116
116
|
|
|
117
|
-
# 3.
|
|
117
|
+
# 3. Pre-run check (recommended)
|
|
118
118
|
./scripts/pre-run-check.sh
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
-
###
|
|
122
|
-
Codex CLI
|
|
121
|
+
### HANDOFF.md Recording on Codex Fallback
|
|
122
|
+
When Codex CLI is unavailable and falls back to ClaudeCode:
|
|
123
123
|
|
|
124
124
|
```markdown
|
|
125
|
-
###
|
|
125
|
+
### Fallback Record
|
|
126
126
|
|
|
127
|
-
|
|
|
128
|
-
|
|
129
|
-
| Codex | HH:MM | [
|
|
127
|
+
| Attempted AI | Failure Time | Error | Fallback AI | Result |
|
|
128
|
+
|--------------|--------------|-------|-------------|--------|
|
|
129
|
+
| Codex | HH:MM | [Error content] | ClaudeCode | Success/Failure |
|
|
130
130
|
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
**Fallback Reason**: [Detailed reason]
|
|
132
|
+
**Impact**: Deep analysis from Codex not utilized
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
---
|
|
136
136
|
|
|
137
|
-
## ⚠️ Test-First
|
|
137
|
+
## ⚠️ Test-First Flow (Required)
|
|
138
138
|
|
|
139
|
-
>
|
|
139
|
+
> **Important**: Run regression tests after refactoring to ensure existing functionality is not broken.
|
|
140
140
|
|
|
141
|
-
###
|
|
141
|
+
### Required Tests After Refactoring
|
|
142
142
|
|
|
143
143
|
```bash
|
|
144
|
-
# 1.
|
|
144
|
+
# 1. Run existing tests (regression prevention)
|
|
145
145
|
npm run test
|
|
146
146
|
|
|
147
|
-
# 2.
|
|
147
|
+
# 2. Static analysis
|
|
148
148
|
npm run lint
|
|
149
149
|
|
|
150
|
-
# 3.
|
|
150
|
+
# 3. Type check
|
|
151
151
|
npm run typecheck
|
|
152
152
|
|
|
153
|
-
# 4.
|
|
153
|
+
# 4. Verify dev server runs
|
|
154
154
|
npm run dev
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
###
|
|
158
|
-
1.
|
|
159
|
-
2. **lint
|
|
160
|
-
3. **typecheck
|
|
161
|
-
4.
|
|
157
|
+
### Actions on Test Failure
|
|
158
|
+
1. **Regression test failure**: Rollback refactoring or fix
|
|
159
|
+
2. **lint errors**: Fix refactored code
|
|
160
|
+
3. **typecheck errors**: Fix type definitions
|
|
161
|
+
4. **Behavior change detected**: Verify if intentional, otherwise rollback
|
|
162
162
|
|
|
163
163
|
---
|
|
164
164
|
|
|
165
|
-
##
|
|
166
|
-
- [ ]
|
|
167
|
-
- [ ]
|
|
168
|
-
- [ ]
|
|
169
|
-
- [ ]
|
|
170
|
-
- [ ] **lint/typecheck
|
|
171
|
-
- [ ]
|
|
172
|
-
- [ ]
|
|
173
|
-
- [ ] HANDOFF.md
|
|
174
|
-
|
|
175
|
-
##
|
|
176
|
-
→ **08-qa**:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
165
|
+
## Completion Criteria
|
|
166
|
+
- [ ] Code quality analysis complete
|
|
167
|
+
- [ ] Duplicate code removed
|
|
168
|
+
- [ ] Performance optimization applied
|
|
169
|
+
- [ ] **Regression tests executed** (Test-First)
|
|
170
|
+
- [ ] **lint/typecheck passed**
|
|
171
|
+
- [ ] Refactoring report written
|
|
172
|
+
- [ ] Checkpoint created
|
|
173
|
+
- [ ] HANDOFF.md generated (including AI usage/fallback records)
|
|
174
|
+
|
|
175
|
+
## Next Stage
|
|
176
|
+
→ **08-qa**: Quality assurance and code review
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
stage:
|
|
4
4
|
id: "07-refactoring"
|
|
5
5
|
name: "Refactoring"
|
|
6
|
-
description: "
|
|
6
|
+
description: "Code quality improvement and optimization"
|
|
7
7
|
|
|
8
8
|
models:
|
|
9
9
|
primary: "codex"
|
|
10
10
|
secondary: "claudecode"
|
|
11
11
|
collaboration: "sequential"
|
|
12
12
|
|
|
13
|
-
# AI
|
|
13
|
+
# AI auto-invoke settings (Issue #12, #14 resolution)
|
|
14
14
|
auto_invoke:
|
|
15
15
|
enabled: true
|
|
16
16
|
model: "codex"
|
|
@@ -19,7 +19,7 @@ auto_invoke:
|
|
|
19
19
|
wrapper: "scripts/codex-wrapper.sh"
|
|
20
20
|
flags: "--full-auto"
|
|
21
21
|
required: true
|
|
22
|
-
message: "🤖 Codex
|
|
22
|
+
message: "🤖 Codex auto-invoke: Starting code analysis and refactoring"
|
|
23
23
|
|
|
24
24
|
execution:
|
|
25
25
|
mode: "deep_dive"
|
|
@@ -36,9 +36,9 @@ inputs:
|
|
|
36
36
|
outputs:
|
|
37
37
|
required:
|
|
38
38
|
- name: "refactored_code/"
|
|
39
|
-
description: "
|
|
39
|
+
description: "Refactored code"
|
|
40
40
|
- name: "refactoring_report.md"
|
|
41
|
-
description: "
|
|
41
|
+
description: "Refactoring report"
|
|
42
42
|
- name: "HANDOFF.md"
|
|
43
43
|
|
|
44
44
|
prompts:
|
|
@@ -54,15 +54,15 @@ prompts:
|
|
|
54
54
|
|
|
55
55
|
completion:
|
|
56
56
|
checklist:
|
|
57
|
-
- "
|
|
58
|
-
- "
|
|
59
|
-
- "
|
|
60
|
-
- "
|
|
61
|
-
- "
|
|
57
|
+
- "Code quality analysis complete"
|
|
58
|
+
- "Duplicate code removed"
|
|
59
|
+
- "Performance optimization applied"
|
|
60
|
+
- "Refactoring report written"
|
|
61
|
+
- "Checkpoint created"
|
|
62
62
|
|
|
63
63
|
transition:
|
|
64
64
|
next_stage: "08-qa"
|
|
65
65
|
prerequisites:
|
|
66
66
|
- "06-implementation"
|
|
67
67
|
handoff_required: true
|
|
68
|
-
checkpoint_required: true #
|
|
68
|
+
checkpoint_required: true # Required!
|