claude-symphony 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/README.md +374 -0
  2. package/bin/create.js +250 -0
  3. package/package.json +43 -0
  4. package/template/.claude/commands/benchmark.md +103 -0
  5. package/template/.claude/commands/brainstorm.md +67 -0
  6. package/template/.claude/commands/checkpoint.md +93 -0
  7. package/template/.claude/commands/codex.md +107 -0
  8. package/template/.claude/commands/collaborate.md +85 -0
  9. package/template/.claude/commands/context.md +154 -0
  10. package/template/.claude/commands/deploy.md +102 -0
  11. package/template/.claude/commands/fork.md +142 -0
  12. package/template/.claude/commands/gemini.md +84 -0
  13. package/template/.claude/commands/handoff.md +80 -0
  14. package/template/.claude/commands/implement.md +82 -0
  15. package/template/.claude/commands/init-project.md +49 -0
  16. package/template/.claude/commands/next.md +125 -0
  17. package/template/.claude/commands/planning.md +69 -0
  18. package/template/.claude/commands/qa.md +81 -0
  19. package/template/.claude/commands/refactor.md +95 -0
  20. package/template/.claude/commands/research.md +60 -0
  21. package/template/.claude/commands/restore.md +113 -0
  22. package/template/.claude/commands/run-stage.md +78 -0
  23. package/template/.claude/commands/stages.md +109 -0
  24. package/template/.claude/commands/status.md +73 -0
  25. package/template/.claude/commands/tasks.md +80 -0
  26. package/template/.claude/commands/test.md +93 -0
  27. package/template/.claude/commands/ui-ux.md +61 -0
  28. package/template/.claude/commands/validate.md +174 -0
  29. package/template/.claude/hooks/ai-selector.sh +223 -0
  30. package/template/.claude/hooks/auto-checkpoint.sh +187 -0
  31. package/template/.claude/hooks/output-validator.sh +289 -0
  32. package/template/.claude/hooks/post-stage.sh +123 -0
  33. package/template/.claude/hooks/pre-stage.sh +186 -0
  34. package/template/.claude/hooks/session-start.sh +90 -0
  35. package/template/.claude/hooks/statusline.sh +115 -0
  36. package/template/.claude/hooks/stop.sh +104 -0
  37. package/template/.claude/settings.json +149 -0
  38. package/template/.claude/skills/ai-collaboration/README.md +61 -0
  39. package/template/.claude/skills/ai-collaboration/debate.md +148 -0
  40. package/template/.claude/skills/ai-collaboration/parallel.md +96 -0
  41. package/template/.claude/skills/ai-collaboration/prompts/CLAUDE.md +107 -0
  42. package/template/.claude/skills/auto-checkpoint/README.md +77 -0
  43. package/template/.claude/skills/auto-checkpoint/prompts/CLAUDE.md +113 -0
  44. package/template/.claude/skills/auto-checkpoint/rollback.md +152 -0
  45. package/template/.claude/skills/auto-checkpoint/trigger.md +122 -0
  46. package/template/.claude/skills/context-compression/README.md +121 -0
  47. package/template/.claude/skills/context-compression/analyze.md +114 -0
  48. package/template/.claude/skills/context-compression/compress.md +175 -0
  49. package/template/.claude/skills/context-compression/prompts/compression.md +172 -0
  50. package/template/.claude/skills/output-validator/README.md +86 -0
  51. package/template/.claude/skills/output-validator/prompts/CLAUDE.md +119 -0
  52. package/template/.claude/skills/output-validator/validate.md +182 -0
  53. package/template/.claude/skills/smart-handoff/README.md +59 -0
  54. package/template/.claude/skills/smart-handoff/extract.md +76 -0
  55. package/template/.claude/skills/smart-handoff/prompts/CLAUDE.md +86 -0
  56. package/template/.claude/skills/smart-handoff/summarize.md +94 -0
  57. package/template/.claude/skills/stage-transition/README.md +84 -0
  58. package/template/.claude/skills/stage-transition/handoff-gen.md +160 -0
  59. package/template/.claude/skills/stage-transition/prompts/transition.md +145 -0
  60. package/template/.claude/skills/stage-transition/validate.md +108 -0
  61. package/template/CLAUDE.md +528 -0
  62. package/template/config/ai_benchmarking.yaml +184 -0
  63. package/template/config/ai_collaboration.yaml +159 -0
  64. package/template/config/ai_logging.yaml +129 -0
  65. package/template/config/auto_checkpoint.yaml +189 -0
  66. package/template/config/context.yaml +78 -0
  67. package/template/config/git.yaml +161 -0
  68. package/template/config/handoff_intelligence.yaml +229 -0
  69. package/template/config/implementation.yaml.template +181 -0
  70. package/template/config/mcp_fallbacks.yaml +252 -0
  71. package/template/config/memory_integration.yaml +200 -0
  72. package/template/config/model_enforcement.yaml +141 -0
  73. package/template/config/models.yaml +242 -0
  74. package/template/config/output_validation.yaml +352 -0
  75. package/template/config/pipeline.yaml +357 -0
  76. package/template/config/pipeline_forking.yaml +236 -0
  77. package/template/config/qa_logging.yaml +166 -0
  78. package/template/config/smart_rollback.yaml +209 -0
  79. package/template/config/stage_personas.yaml +354 -0
  80. package/template/config/workflow.yaml +54 -0
  81. package/template/scripts/ai-benchmark.sh +272 -0
  82. package/template/scripts/codex-wrapper.sh +97 -0
  83. package/template/scripts/context-manager.sh +528 -0
  84. package/template/scripts/create-checkpoint.sh +116 -0
  85. package/template/scripts/gemini-wrapper.sh +96 -0
  86. package/template/scripts/init-project.sh +109 -0
  87. package/template/scripts/list-stages.sh +245 -0
  88. package/template/scripts/next-stage.sh +228 -0
  89. package/template/scripts/output-validate.sh +12 -0
  90. package/template/scripts/pipeline-fork.sh +293 -0
  91. package/template/scripts/pre-run-check.sh +361 -0
  92. package/template/scripts/restore-checkpoint.sh +247 -0
  93. package/template/scripts/run-stage.sh +139 -0
  94. package/template/scripts/show-status.sh +185 -0
  95. package/template/scripts/smart-handoff.sh +254 -0
  96. package/template/stages/01-brainstorm/CLAUDE.md +103 -0
  97. package/template/stages/01-brainstorm/HANDOFF.md.template +112 -0
  98. package/template/stages/01-brainstorm/README.md +97 -0
  99. package/template/stages/01-brainstorm/config.yaml +92 -0
  100. package/template/stages/01-brainstorm/inputs/.gitkeep +0 -0
  101. package/template/stages/01-brainstorm/outputs/.gitkeep +0 -0
  102. package/template/stages/01-brainstorm/prompts/collaboration.md +46 -0
  103. package/template/stages/01-brainstorm/prompts/ideation.md +62 -0
  104. package/template/stages/01-brainstorm/prompts/persona.md +73 -0
  105. package/template/stages/01-brainstorm/prompts/requirements.md +73 -0
  106. package/template/stages/01-brainstorm/prompts/validation.md +50 -0
  107. package/template/stages/01-brainstorm/templates/ideas.md +91 -0
  108. package/template/stages/01-brainstorm/templates/requirements_analysis.md +129 -0
  109. package/template/stages/02-research/CLAUDE.md +101 -0
  110. package/template/stages/02-research/HANDOFF.md.template +102 -0
  111. package/template/stages/02-research/config.yaml +68 -0
  112. package/template/stages/02-research/inputs/.gitkeep +0 -0
  113. package/template/stages/02-research/outputs/.gitkeep +0 -0
  114. package/template/stages/02-research/prompts/collaboration.md +51 -0
  115. package/template/stages/02-research/prompts/feasibility.md +73 -0
  116. package/template/stages/02-research/prompts/market_analysis.md +58 -0
  117. package/template/stages/02-research/prompts/tech_stack.md +60 -0
  118. package/template/stages/02-research/prompts/validation.md +51 -0
  119. package/template/stages/02-research/templates/.gitkeep +0 -0
  120. package/template/stages/03-planning/CLAUDE.md +98 -0
  121. package/template/stages/03-planning/HANDOFF.md.template +91 -0
  122. package/template/stages/03-planning/config.yaml +64 -0
  123. package/template/stages/03-planning/inputs/.gitkeep +0 -0
  124. package/template/stages/03-planning/outputs/.gitkeep +0 -0
  125. package/template/stages/03-planning/prompts/architecture.md +62 -0
  126. package/template/stages/03-planning/prompts/collaboration.md +57 -0
  127. package/template/stages/03-planning/prompts/validation.md +59 -0
  128. package/template/stages/03-planning/templates/.gitkeep +0 -0
  129. package/template/stages/04-ui-ux/CLAUDE.md +88 -0
  130. package/template/stages/04-ui-ux/HANDOFF.md.template +92 -0
  131. package/template/stages/04-ui-ux/config.yaml +57 -0
  132. package/template/stages/04-ui-ux/inputs/.gitkeep +0 -0
  133. package/template/stages/04-ui-ux/outputs/.gitkeep +0 -0
  134. package/template/stages/04-ui-ux/prompts/.gitkeep +0 -0
  135. package/template/stages/04-ui-ux/prompts/collaboration.md +56 -0
  136. package/template/stages/04-ui-ux/prompts/validation.md +54 -0
  137. package/template/stages/04-ui-ux/templates/.gitkeep +0 -0
  138. package/template/stages/05-task-management/CLAUDE.md +105 -0
  139. package/template/stages/05-task-management/HANDOFF.md.template +97 -0
  140. package/template/stages/05-task-management/config.yaml +81 -0
  141. package/template/stages/05-task-management/inputs/.gitkeep +0 -0
  142. package/template/stages/05-task-management/outputs/.gitkeep +0 -0
  143. package/template/stages/05-task-management/prompts/.gitkeep +0 -0
  144. package/template/stages/05-task-management/prompts/collaboration.md +54 -0
  145. package/template/stages/05-task-management/prompts/validation.md +66 -0
  146. package/template/stages/05-task-management/templates/notion_integration.md +176 -0
  147. package/template/stages/05-task-management/templates/parallel_groups.yaml +153 -0
  148. package/template/stages/05-task-management/templates/task_schema.yaml +154 -0
  149. package/template/stages/06-implementation/CLAUDE.md +163 -0
  150. package/template/stages/06-implementation/HANDOFF.md.template +192 -0
  151. package/template/stages/06-implementation/config.yaml +62 -0
  152. package/template/stages/06-implementation/inputs/.gitkeep +0 -0
  153. package/template/stages/06-implementation/outputs/.gitkeep +0 -0
  154. package/template/stages/06-implementation/prompts/.gitkeep +0 -0
  155. package/template/stages/06-implementation/prompts/collaboration.md +64 -0
  156. package/template/stages/06-implementation/prompts/validation.md +65 -0
  157. package/template/stages/06-implementation/templates/.gitkeep +0 -0
  158. package/template/stages/07-refactoring/CLAUDE.md +180 -0
  159. package/template/stages/07-refactoring/HANDOFF.md.template +97 -0
  160. package/template/stages/07-refactoring/config.yaml +68 -0
  161. package/template/stages/07-refactoring/inputs/.gitkeep +0 -0
  162. package/template/stages/07-refactoring/outputs/.gitkeep +0 -0
  163. package/template/stages/07-refactoring/prompts/.gitkeep +0 -0
  164. package/template/stages/07-refactoring/prompts/collaboration.md +71 -0
  165. package/template/stages/07-refactoring/prompts/validation.md +76 -0
  166. package/template/stages/07-refactoring/templates/.gitkeep +0 -0
  167. package/template/stages/08-qa/CLAUDE.md +93 -0
  168. package/template/stages/08-qa/HANDOFF.md.template +96 -0
  169. package/template/stages/08-qa/config.yaml +56 -0
  170. package/template/stages/08-qa/inputs/.gitkeep +0 -0
  171. package/template/stages/08-qa/outputs/.gitkeep +0 -0
  172. package/template/stages/08-qa/prompts/.gitkeep +0 -0
  173. package/template/stages/08-qa/prompts/collaboration.md +65 -0
  174. package/template/stages/08-qa/prompts/validation.md +71 -0
  175. package/template/stages/08-qa/templates/.gitkeep +0 -0
  176. package/template/stages/09-testing/CLAUDE.md +124 -0
  177. package/template/stages/09-testing/HANDOFF.md.template +113 -0
  178. package/template/stages/09-testing/config.yaml +65 -0
  179. package/template/stages/09-testing/inputs/.gitkeep +0 -0
  180. package/template/stages/09-testing/outputs/.gitkeep +0 -0
  181. package/template/stages/09-testing/prompts/.gitkeep +0 -0
  182. package/template/stages/09-testing/prompts/collaboration.md +77 -0
  183. package/template/stages/09-testing/prompts/validation.md +83 -0
  184. package/template/stages/09-testing/templates/.gitkeep +0 -0
  185. package/template/stages/10-deployment/CLAUDE.md +117 -0
  186. package/template/stages/10-deployment/HANDOFF.md.template +148 -0
  187. package/template/stages/10-deployment/config.yaml +61 -0
  188. package/template/stages/10-deployment/inputs/.gitkeep +0 -0
  189. package/template/stages/10-deployment/outputs/.gitkeep +0 -0
  190. package/template/stages/10-deployment/prompts/.gitkeep +0 -0
  191. package/template/stages/10-deployment/prompts/collaboration.md +80 -0
  192. package/template/stages/10-deployment/prompts/validation.md +93 -0
  193. package/template/stages/10-deployment/templates/github-actions-cd.yaml +118 -0
  194. package/template/stages/10-deployment/templates/github-actions-ci.yaml +136 -0
  195. package/template/state/progress.json.template +111 -0
  196. package/template/state/templates/handoff_base.md.template +187 -0
  197. package/template/state/templates/phase_state.md.template +97 -0
@@ -0,0 +1,62 @@
1
+ # Stage 06: Implementation Configuration
2
+
3
+ stage:
4
+ id: "06-implementation"
5
+ name: "Implementation"
6
+ description: "핵심 기능 구현"
7
+
8
+ models:
9
+ primary: "claudecode"
10
+ secondary: null
11
+ collaboration: null
12
+
13
+ execution:
14
+ mode: "plan_sandbox"
15
+ container: false
16
+ sandbox: true
17
+ timeout: 14400 # 4 hours
18
+
19
+ inputs:
20
+ required:
21
+ - name: "../05-task-management/outputs/tasks.md"
22
+ - name: "../03-planning/outputs/architecture.md"
23
+ - name: "../03-planning/outputs/implementation.yaml"
24
+ description: "구현 규칙 (Issue #10)"
25
+ - name: "../05-task-management/HANDOFF.md"
26
+ optional:
27
+ - name: "../04-ui-ux/outputs/design_system.md"
28
+ - name: "../03-planning/outputs/tech_stack.md"
29
+
30
+ outputs:
31
+ required:
32
+ - name: "source_code/"
33
+ description: "구현된 소스 코드"
34
+ - name: "implementation_log.md"
35
+ description: "구현 로그"
36
+ - name: "HANDOFF.md"
37
+
38
+ prompts:
39
+ - name: "scaffolding"
40
+ file: "prompts/scaffolding.md"
41
+ model: "claudecode"
42
+ - name: "component_impl"
43
+ file: "prompts/component_impl.md"
44
+ model: "claudecode"
45
+ - name: "api_impl"
46
+ file: "prompts/api_impl.md"
47
+ model: "claudecode"
48
+
49
+ completion:
50
+ checklist:
51
+ - "프로젝트 스캐폴딩 완료"
52
+ - "공통 컴포넌트 구현"
53
+ - "핵심 기능 구현"
54
+ - "API 엔드포인트 구현"
55
+ - "체크포인트 생성"
56
+
57
+ transition:
58
+ next_stage: "07-refactoring"
59
+ prerequisites:
60
+ - "05-task-management"
61
+ handoff_required: true
62
+ checkpoint_required: true # 필수!
@@ -0,0 +1,64 @@
1
+ # AI 협업 프롬프트 - Implementation
2
+
3
+ ## 협업 모드: Sequential Handoff
4
+
5
+ 이 스테이지에서는 **순차적 전달** 모드를 사용하여 구현 → 리뷰 → 개선 사이클을 진행합니다.
6
+
7
+ ### 참여 모델
8
+ - **ClaudeCode**: 코드 생성, 구현
9
+
10
+ ### 협업 프롬프트
11
+
12
+ ```
13
+ # 구현 → 셀프 리뷰 → 개선
14
+ /collaborate --mode sequential --chain "claudecode:implement -> claudecode:review -> claudecode:improve"
15
+ ```
16
+
17
+ ### AI 벤치마킹 (선택적)
18
+
19
+ 복잡한 알고리즘 구현 시:
20
+ ```
21
+ /benchmark --task "sorting_algorithm" --models "claude,codex"
22
+ ```
23
+
24
+ ### 작업 흐름
25
+
26
+ 1. **스캐폴딩**: 프로젝트 초기화
27
+ 2. **공통 컴포넌트**: 디자인 시스템 기반
28
+ 3. **기능 구현**: 스프린트 태스크 순차 구현
29
+ 4. **통합**: API/DB 연동
30
+
31
+ ### 체크포인트 트리거
32
+
33
+ - 스프린트 완료 시
34
+ - 주요 기능 완료 시
35
+ - 100줄 이상 변경 시
36
+
37
+ ```
38
+ /checkpoint --reason "스프린트 1 완료"
39
+ ```
40
+
41
+ ### implementation.yaml 준수
42
+
43
+ 구현 전 반드시 확인:
44
+ ```yaml
45
+ # 예시 규칙
46
+ component_type: functional
47
+ styling: tailwind
48
+ state_management: zustand
49
+ naming: camelCase
50
+ ```
51
+
52
+ ### 출력 형식
53
+
54
+ ```markdown
55
+ ## 구현 로그
56
+
57
+ ### [날짜] - [태스크]
58
+ - 구현 내용
59
+ - 변경된 파일
60
+ - 테스트 결과
61
+
62
+ ### 체크포인트
63
+ - checkpoint_YYYYMMDD_HHMMSS
64
+ ```
@@ -0,0 +1,65 @@
1
+ # 산출물 검증 프롬프트 - Implementation
2
+
3
+ ## 검증 대상
4
+
5
+ | 산출물 | 필수 조건 | 검증 방법 |
6
+ |--------|----------|----------|
7
+ | `source_code/` | Lint 통과 | `npm run lint` |
8
+ | `source_code/` | Type 체크 통과 | `npm run typecheck` |
9
+ | `implementation_log.md` | 변경 기록 | 구조 확인 |
10
+ | `HANDOFF.md` | 체크포인트 참조 | 항목 확인 |
11
+
12
+ ## 검증 명령
13
+
14
+ ```bash
15
+ /validate --stage 06-implementation
16
+ ```
17
+
18
+ ## 품질 기준
19
+
20
+ ### source_code/
21
+ - [ ] ESLint 에러 없음
22
+ - [ ] TypeScript 타입 에러 없음
23
+ - [ ] 폴더 구조 준수 (implementation.yaml)
24
+ - [ ] 네이밍 규칙 준수
25
+ - [ ] 코드 포맷팅 적용
26
+
27
+ ### implementation_log.md
28
+ - [ ] 구현된 태스크 목록
29
+ - [ ] 변경된 파일 목록
30
+ - [ ] 알려진 이슈/기술 부채
31
+
32
+ ### HANDOFF.md
33
+ - [ ] 완료된 기능 체크리스트
34
+ - [ ] 체크포인트 참조
35
+ - [ ] 리팩토링 필요 항목
36
+
37
+ ## 자동 검증 스크립트
38
+
39
+ ```bash
40
+ # Lint 검사
41
+ npm run lint
42
+
43
+ # Type 검사
44
+ npm run typecheck
45
+
46
+ # 빌드 검증
47
+ npm run build
48
+
49
+ # 기본 테스트
50
+ npm run test -- --passWithNoTests
51
+ ```
52
+
53
+ ## 코드 품질 메트릭
54
+
55
+ | 메트릭 | 기준 | 명령 |
56
+ |--------|------|------|
57
+ | Lint 에러 | 0 | `npm run lint` |
58
+ | Type 에러 | 0 | `npm run typecheck` |
59
+ | 빌드 성공 | Yes | `npm run build` |
60
+
61
+ ## 실패 시 조치
62
+
63
+ 1. Lint 에러 → `npm run lint --fix`
64
+ 2. Type 에러 → 타입 수정
65
+ 3. 빌드 실패 → 에러 로그 분석 후 수정
@@ -0,0 +1,180 @@
1
+ # Stage 07: Refactoring
2
+
3
+ > ⚠️ **필수 AI 모델: Codex**
4
+ > 이 스테이지의 핵심 작업(코드 분석, 리팩토링, 최적화)은 `/codex` 명령어로 수행하세요.
5
+ > ClaudeCode는 간단한 파일 조작 및 빌드/테스트 실행에만 사용합니다.
6
+
7
+ 코드 품질 개선 및 최적화 단계
8
+
9
+ ## 🎭 페르소나: Code Surgeon
10
+
11
+ > 당신은 Code Surgeon입니다.
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
+ - **분석 깊이**: Deep
35
+
36
+ ## 실행 모델
37
+ - **Primary**: Codex (코드 분석 및 최적화)
38
+ - **Secondary**: ClaudeCode (복잡한 리팩토링)
39
+ - **Mode**: Deep Dive - 심층 코드 분석
40
+
41
+ ## 목표
42
+ 1. 코드 품질 개선
43
+ 2. 중복 제거
44
+ 3. 성능 최적화
45
+ 4. 아키텍처 개선
46
+
47
+ ## 입력 파일
48
+ - `../06-implementation/outputs/source_code/`
49
+ - `../06-implementation/outputs/implementation_log.md`
50
+ - `../06-implementation/HANDOFF.md`
51
+
52
+ ## 출력 파일
53
+ - `outputs/refactored_code/` - 리팩토링된 코드
54
+ - `outputs/refactoring_report.md` - 리팩토링 보고서
55
+ - `HANDOFF.md` - 다음 스테이지 인계 문서
56
+
57
+ ## Codex CLI 활용
58
+
59
+ ### 코드 분석
60
+ ```bash
61
+ /codex "다음 코드의 개선점을 분석해주세요:
62
+ - 중복 코드
63
+ - 성능 병목
64
+ - 디자인 패턴 위반
65
+ - 타입 안전성 문제"
66
+ ```
67
+
68
+ ### 리팩토링 실행
69
+ ```bash
70
+ /codex "다음 함수를 리팩토링해주세요:
71
+ [코드 블록]
72
+ 목표: 가독성 향상, 성능 최적화"
73
+ ```
74
+
75
+ ## 워크플로우
76
+
77
+ ### 1. 코드 분석
78
+ - 정적 분석 실행 (ESLint, TypeScript)
79
+ - 복잡도 분석 (Cyclomatic complexity)
80
+ - 의존성 분석
81
+
82
+ ### 2. 리팩토링 계획
83
+ - 개선 영역 식별
84
+ - 우선순위 결정
85
+ - 영향 범위 평가
86
+
87
+ ### 3. 리팩토링 실행
88
+ - 작은 단위로 수행
89
+ - 각 변경 후 테스트
90
+ - 커밋 메시지에 변경 사항 기록
91
+
92
+ ### 4. 최적화
93
+ - 번들 사이즈 최적화
94
+ - 렌더링 최적화
95
+ - API 호출 최적화
96
+
97
+ ## 체크포인트 규칙
98
+ - **필수**: 이 스테이지는 체크포인트가 필수입니다
99
+ - 주요 리팩토링 전 체크포인트 생성
100
+ - 롤백 가능 상태 유지
101
+
102
+ ---
103
+
104
+ ## ⚠️ AI 사용 기록 (필수)
105
+
106
+ > **중요**: 이 스테이지는 Codex CLI를 사용해야 합니다.
107
+ > Codex 호출 실패 시 ClaudeCode로 폴백되며, 이 경우 HANDOFF.md에 반드시 기록해야 합니다.
108
+
109
+ ### Codex 호출 전 확인
110
+ ```bash
111
+ # 1. Codex CLI 설치 확인
112
+ which codex
113
+
114
+ # 2. tmux 세션 확인
115
+ tmux ls
116
+
117
+ # 3. 사전 점검 (권장)
118
+ ./scripts/pre-run-check.sh
119
+ ```
120
+
121
+ ### Codex 폴백 시 HANDOFF.md 기록
122
+ Codex CLI 사용이 불가능하여 ClaudeCode로 폴백한 경우:
123
+
124
+ ```markdown
125
+ ### 폴백 기록
126
+
127
+ | 시도한 AI | 실패 시간 | 오류 | 폴백 AI | 결과 |
128
+ |----------|----------|------|---------|------|
129
+ | Codex | HH:MM | [오류 내용] | ClaudeCode | 성공/실패 |
130
+
131
+ **폴백 사유**: [상세 사유]
132
+ **영향**: Codex의 깊이 있는 분석 미활용
133
+ ```
134
+
135
+ ---
136
+
137
+ ## ⚠️ Test-First 플로우 (필수)
138
+
139
+ > **중요**: 리팩토링 후 기존 기능이 깨지지 않았는지 반드시 회귀 테스트를 실행하세요.
140
+
141
+ ### 리팩토링 완료 후 필수 테스트
142
+
143
+ ```bash
144
+ # 1. 기존 테스트 실행 (회귀 방지)
145
+ npm run test
146
+
147
+ # 2. 정적 분석
148
+ npm run lint
149
+
150
+ # 3. 타입 체크
151
+ npm run typecheck
152
+
153
+ # 4. 개발 서버 실행 확인
154
+ npm run dev
155
+ ```
156
+
157
+ ### 테스트 실패 시 조치
158
+ 1. **회귀 테스트 실패**: 리팩토링 롤백 또는 수정
159
+ 2. **lint 오류**: 리팩토링된 코드 수정
160
+ 3. **typecheck 오류**: 타입 정의 수정
161
+ 4. **동작 변경 발견**: 의도적 변경인지 확인, 아니면 롤백
162
+
163
+ ---
164
+
165
+ ## 완료 조건
166
+ - [ ] 코드 품질 분석 완료
167
+ - [ ] 중복 코드 제거
168
+ - [ ] 성능 최적화 적용
169
+ - [ ] **회귀 테스트 실행** (Test-First)
170
+ - [ ] **lint/typecheck 통과**
171
+ - [ ] 리팩토링 보고서 작성
172
+ - [ ] 체크포인트 생성
173
+ - [ ] HANDOFF.md 생성 (AI 사용/폴백 기록 포함)
174
+
175
+ ## 다음 스테이지
176
+ → **08-qa**: 품질 보증 및 코드 리뷰
177
+
178
+
179
+
180
+
@@ -0,0 +1,97 @@
1
+ # Stage Handoff: 07-refactoring → 08-qa
2
+
3
+ **생성일**: {{TIMESTAMP}}
4
+ **생성자**: Codex
5
+ **소요 시간**: {{DURATION}}
6
+
7
+ ---
8
+
9
+ ## 완료된 작업
10
+
11
+ - [ ] 코드 품질 분석
12
+ - [ ] 중복 코드 제거 ({{DUP_REMOVED}}개)
13
+ - [ ] 성능 최적화
14
+ - [ ] 리팩토링 보고서 작성
15
+ - [ ] 체크포인트 생성
16
+ - [ ] HANDOFF.md 생성
17
+
18
+ ---
19
+
20
+ ## 다음 에이전트를 위한 컨텍스트
21
+
22
+ ### 리팩토링 요약
23
+
24
+ | 영역 | 이전 | 이후 | 개선율 |
25
+ |------|------|------|--------|
26
+ | 코드 중복 | {{DUP_BEFORE}} | {{DUP_AFTER}} | {{DUP_IMPROVE}}% |
27
+ | 번들 사이즈 | {{BUNDLE_BEFORE}} | {{BUNDLE_AFTER}} | {{BUNDLE_IMPROVE}}% |
28
+ | 복잡도 | {{COMPLEX_BEFORE}} | {{COMPLEX_AFTER}} | {{COMPLEX_IMPROVE}}% |
29
+
30
+ ### 주요 변경 사항
31
+ 1. {{CHANGE_1}}
32
+ 2. {{CHANGE_2}}
33
+ 3. {{CHANGE_3}}
34
+
35
+ ### 남은 기술 부채
36
+ - {{REMAINING_DEBT_1}}
37
+ - {{REMAINING_DEBT_2}}
38
+
39
+ ### QA 중점 확인 필요 영역
40
+ - {{QA_FOCUS_1}}: 리팩토링으로 인한 영향
41
+ - {{QA_FOCUS_2}}: 최적화로 인한 동작 변화
42
+
43
+ ---
44
+
45
+ ## 체크포인트 정보
46
+
47
+ | ID | 생성일 | 설명 |
48
+ |----|--------|------|
49
+ | {{CP_ID}} | {{CP_DATE}} | 리팩토링 완료 |
50
+
51
+ ---
52
+
53
+ ## 생성된 산출물
54
+
55
+ | 파일 | 설명 |
56
+ |------|------|
57
+ | refactored_code/ | 리팩토링된 코드 |
58
+ | refactoring_report.md | 리팩토링 보고서 |
59
+
60
+ ---
61
+
62
+ ## 08-qa 스테이지 가이드
63
+
64
+ ### 즉시 실행할 작업
65
+ 1. 리팩토링 영역 기능 테스트
66
+ 2. 회귀 테스트
67
+ 3. 성능 벤치마크
68
+
69
+ ### 테스트 우선순위
70
+ 1. {{TEST_PRIORITY_1}}
71
+ 2. {{TEST_PRIORITY_2}}
72
+ 3. {{TEST_PRIORITY_3}}
73
+
74
+ ---
75
+
76
+ ## AI 호출 기록
77
+
78
+ | AI | 호출 시간 | 프롬프트 | 결과 | 상태 |
79
+ |----|----------|---------|------|------|
80
+ | {{AI_1}} | {{TIME_1}} | {{PROMPT_1}} | {{OUTPUT_1}} | {{STATUS_1}} |
81
+ | {{AI_2}} | {{TIME_2}} | {{PROMPT_2}} | {{OUTPUT_2}} | {{STATUS_2}} |
82
+
83
+ > 설정: `config/ai_logging.yaml`
84
+
85
+ ---
86
+
87
+ ## 메타데이터
88
+
89
+ ```yaml
90
+ stage: "07-refactoring"
91
+ status: "completed"
92
+ next_stage: "08-qa"
93
+ models_used:
94
+ - codex
95
+ - claudecode
96
+ checkpoint_id: "{{CP_ID}}"
97
+ ```
@@ -0,0 +1,68 @@
1
+ # Stage 07: Refactoring Configuration
2
+
3
+ stage:
4
+ id: "07-refactoring"
5
+ name: "Refactoring"
6
+ description: "코드 품질 개선 및 최적화"
7
+
8
+ models:
9
+ primary: "codex"
10
+ secondary: "claudecode"
11
+ collaboration: "sequential"
12
+
13
+ # AI 자동 호출 설정 (Issue #12, #14 해결)
14
+ auto_invoke:
15
+ enabled: true
16
+ model: "codex"
17
+ trigger: "refactoring_start"
18
+ prompt_file: "prompts/code_analysis.md"
19
+ wrapper: "scripts/codex-wrapper.sh"
20
+ flags: "--full-auto"
21
+ required: true
22
+ message: "🤖 Codex 자동 호출: 코드 분석 및 리팩토링 시작"
23
+
24
+ execution:
25
+ mode: "deep_dive"
26
+ container: false
27
+ sandbox: false
28
+ timeout: 7200 # 2 hours
29
+
30
+ inputs:
31
+ required:
32
+ - name: "../06-implementation/outputs/source_code/"
33
+ - name: "../06-implementation/outputs/implementation_log.md"
34
+ - name: "../06-implementation/HANDOFF.md"
35
+
36
+ outputs:
37
+ required:
38
+ - name: "refactored_code/"
39
+ description: "리팩토링된 코드"
40
+ - name: "refactoring_report.md"
41
+ description: "리팩토링 보고서"
42
+ - name: "HANDOFF.md"
43
+
44
+ prompts:
45
+ - name: "code_analysis"
46
+ file: "prompts/code_analysis.md"
47
+ model: "codex"
48
+ - name: "refactoring"
49
+ file: "prompts/refactoring.md"
50
+ model: "codex"
51
+ - name: "optimization"
52
+ file: "prompts/optimization.md"
53
+ model: "codex"
54
+
55
+ completion:
56
+ checklist:
57
+ - "코드 품질 분석 완료"
58
+ - "중복 코드 제거"
59
+ - "성능 최적화 적용"
60
+ - "리팩토링 보고서 작성"
61
+ - "체크포인트 생성"
62
+
63
+ transition:
64
+ next_stage: "08-qa"
65
+ prerequisites:
66
+ - "06-implementation"
67
+ handoff_required: true
68
+ checkpoint_required: true # 필수!
File without changes
@@ -0,0 +1,71 @@
1
+ # AI 협업 프롬프트 - Refactoring
2
+
3
+ ## 협업 모드: Sequential Review Chain
4
+
5
+ 이 스테이지에서는 **순차적 리뷰 체인**을 사용하여 리팩토링 품질을 보장합니다.
6
+
7
+ ### 참여 모델
8
+ - **Codex**: 코드 분석, 최적화
9
+ - **ClaudeCode**: 복잡한 리팩토링, 검증
10
+
11
+ ### 협업 프롬프트
12
+
13
+ ```
14
+ # 리뷰 체인: Codex 분석 → Claude 검증
15
+ /collaborate --mode sequential --chain "codex:analyze -> claude:review -> codex:refactor"
16
+ ```
17
+
18
+ ### AI 벤치마킹
19
+
20
+ 성능 최적화 비교:
21
+ ```
22
+ /benchmark --task "performance_optimization" --models "codex,claude"
23
+ ```
24
+
25
+ ### 작업 흐름
26
+
27
+ 1. **분석**: 정적 분석, 복잡도 측정
28
+ 2. **계획**: 리팩토링 우선순위 결정
29
+ 3. **실행**: 작은 단위로 리팩토링
30
+ 4. **검증**: 테스트 통과 확인
31
+
32
+ ### 체크포인트 필수
33
+
34
+ ```bash
35
+ # 리팩토링 전 체크포인트
36
+ /checkpoint --reason "리팩토링 시작 전 상태"
37
+
38
+ # 주요 리팩토링 후
39
+ /checkpoint --reason "함수 X 리팩토링 완료"
40
+ ```
41
+
42
+ ### 롤백 준비
43
+
44
+ ```bash
45
+ # 롤백 가능 상태 확인
46
+ /restore --list
47
+
48
+ # 필요시 부분 롤백
49
+ /restore checkpoint_id --partial --files "src/utils/*"
50
+ ```
51
+
52
+ ### 출력 형식
53
+
54
+ ```markdown
55
+ ## AI 협업 결과
56
+
57
+ ### Codex 분석
58
+ - 복잡도 높은 함수 목록
59
+ - 중복 코드 위치
60
+ - 성능 병목
61
+
62
+ ### Claude 검증
63
+ - 리팩토링 영향 범위
64
+ - 테스트 필요 영역
65
+ - 위험 요소
66
+
67
+ ### 리팩토링 계획
68
+ 1. [우선순위 1 항목]
69
+ 2. [우선순위 2 항목]
70
+ ...
71
+ ```
@@ -0,0 +1,76 @@
1
+ # 산출물 검증 프롬프트 - Refactoring
2
+
3
+ ## 검증 대상
4
+
5
+ | 산출물 | 필수 조건 | 검증 방법 |
6
+ |--------|----------|----------|
7
+ | `refactored_code/` | 동작 유지 | 테스트 통과 |
8
+ | `refactored_code/` | 품질 개선 | 메트릭 비교 |
9
+ | `refactoring_report.md` | 변경 내역 | 구조 확인 |
10
+ | `HANDOFF.md` | 체크포인트 참조 | 항목 확인 |
11
+
12
+ ## 검증 명령
13
+
14
+ ```bash
15
+ /validate --stage 07-refactoring
16
+ ```
17
+
18
+ ## 품질 기준
19
+
20
+ ### refactored_code/
21
+ - [ ] 모든 기존 테스트 통과
22
+ - [ ] Lint 에러 없음
23
+ - [ ] 타입 에러 없음
24
+ - [ ] 복잡도 감소 (목표: 20%↓)
25
+ - [ ] 중복 코드 감소 (목표: 50%↓)
26
+
27
+ ### refactoring_report.md
28
+ - [ ] 리팩토링된 함수/클래스 목록
29
+ - [ ] 변경 전후 비교
30
+ - [ ] 성능 개선 측정값
31
+ - [ ] 남은 기술 부채
32
+
33
+ ### HANDOFF.md
34
+ - [ ] 완료된 리팩토링 목록
35
+ - [ ] 체크포인트 참조
36
+ - [ ] QA 필요 영역
37
+
38
+ ## 자동 검증 스크립트
39
+
40
+ ```bash
41
+ # 테스트 통과 확인
42
+ npm run test
43
+
44
+ # Lint 검사
45
+ npm run lint
46
+
47
+ # 번들 사이즈 비교
48
+ npm run build && du -sh dist/
49
+
50
+ # 복잡도 측정 (선택적)
51
+ npx complexity-report src/**/*.ts
52
+ ```
53
+
54
+ ## 품질 메트릭 비교
55
+
56
+ | 메트릭 | 이전 | 이후 | 개선율 |
57
+ |--------|------|------|--------|
58
+ | 평균 복잡도 | - | - | - |
59
+ | 중복 코드 | - | - | - |
60
+ | 번들 사이즈 | - | - | - |
61
+
62
+ ## 회귀 테스트
63
+
64
+ ```bash
65
+ # 전체 테스트 실행
66
+ npm run test
67
+
68
+ # E2E 테스트 실행 (있는 경우)
69
+ npm run test:e2e
70
+ ```
71
+
72
+ ## 실패 시 조치
73
+
74
+ 1. 테스트 실패 → 체크포인트로 롤백 후 재시도
75
+ 2. 성능 저하 → 변경 사항 검토 및 최적화
76
+ 3. 타입 에러 → 타입 수정 후 재검증