@kood/claude-code 0.4.1 → 0.5.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 (149) hide show
  1. package/dist/index.js +69 -12
  2. package/package.json +2 -1
  3. package/templates/.claude/PARALLEL_AGENTS.md +737 -0
  4. package/templates/.claude/agents/analyst.md +416 -0
  5. package/templates/.claude/agents/architect.md +569 -0
  6. package/templates/.claude/agents/code-reviewer.md +132 -133
  7. package/templates/.claude/agents/dependency-manager.md +93 -94
  8. package/templates/.claude/agents/deployment-validator.md +64 -65
  9. package/templates/.claude/agents/designer.md +655 -0
  10. package/templates/.claude/agents/document-writer.md +500 -0
  11. package/templates/.claude/agents/explore.md +499 -0
  12. package/templates/.claude/agents/git-operator.md +74 -75
  13. package/templates/.claude/agents/implementation-executor.md +138 -109
  14. package/templates/.claude/agents/ko-to-en-translator.md +18 -22
  15. package/templates/.claude/agents/lint-fixer.md +250 -93
  16. package/templates/.claude/agents/planner.md +356 -0
  17. package/templates/.claude/agents/refactor-advisor.md +135 -136
  18. package/templates/.claude/commands/bug-fix.md +296 -207
  19. package/templates/.claude/commands/git-all.md +199 -46
  20. package/templates/.claude/commands/git-session.md +113 -57
  21. package/templates/.claude/commands/lint-fix.md +219 -153
  22. package/templates/.claude/commands/lint-init.md +113 -76
  23. package/templates/.claude/commands/pre-deploy.md +190 -124
  24. package/templates/.claude/commands/refactor.md +407 -162
  25. package/templates/.claude/commands/version-update.md +138 -37
  26. package/templates/.claude/instructions/context-engineering/ANTHROPIC_CONTEXT_ENGINEERING.md +178 -0
  27. package/templates/.claude/instructions/context-engineering/references/claude-4x.md +215 -0
  28. package/templates/.claude/instructions/context-engineering/references/core-principles.md +137 -0
  29. package/templates/.claude/instructions/context-engineering/references/examples.md +351 -0
  30. package/templates/.claude/instructions/context-engineering/references/techniques.md +162 -0
  31. package/templates/.claude/instructions/parallel-agent-execution.md +874 -0
  32. package/templates/.claude/skills/docs-creator/AGENTS.md +238 -0
  33. package/templates/.claude/{commands/docs-creator.md → skills/docs-creator/SKILL.md} +61 -75
  34. package/templates/.claude/skills/docs-refactor/AGENTS.md +270 -0
  35. package/templates/.claude/{commands/docs-refactor.md → skills/docs-refactor/SKILL.md} +30 -44
  36. package/templates/.claude/skills/execute/SKILL.md +451 -0
  37. package/templates/.claude/skills/figma-to-code/AGENTS.md +287 -0
  38. package/templates/.claude/skills/figma-to-code/SKILL.md +225 -225
  39. package/templates/.claude/skills/figma-to-code/references/design-tokens.md +75 -73
  40. package/templates/.claude/skills/figma-to-code/references/figma-mcp-tools.md +73 -73
  41. package/templates/.claude/skills/figma-to-code/references/layout-mapping.md +104 -104
  42. package/templates/.claude/skills/figma-to-code/references/responsive-design.md +99 -99
  43. package/templates/.claude/skills/figma-to-code/references/verification.md +91 -91
  44. package/templates/.claude/skills/global-uiux-design/AGENTS.md +317 -0
  45. package/templates/.claude/skills/global-uiux-design/SKILL.md +738 -0
  46. package/templates/.claude/skills/global-uiux-design/references/accessibility.md +401 -0
  47. package/templates/.claude/skills/global-uiux-design/references/color-system.md +275 -0
  48. package/templates/.claude/skills/global-uiux-design/references/design-philosophy.md +206 -0
  49. package/templates/.claude/skills/global-uiux-design/references/design-systems.md +446 -0
  50. package/templates/.claude/skills/korea-uiux-design/AGENTS.md +307 -0
  51. package/templates/.claude/skills/korea-uiux-design/SKILL.md +170 -0
  52. package/templates/.claude/skills/nextjs-react-best-practices/AGENTS.md +95 -116
  53. package/templates/.claude/skills/nextjs-react-best-practices/SKILL.md +134 -152
  54. package/templates/.claude/skills/nextjs-react-best-practices/rules/advanced-event-handler-refs.md +6 -6
  55. package/templates/.claude/skills/nextjs-react-best-practices/rules/advanced-use-latest.md +5 -5
  56. package/templates/.claude/skills/nextjs-react-best-practices/rules/async-api-routes.md +5 -5
  57. package/templates/.claude/skills/nextjs-react-best-practices/rules/async-defer-await.md +22 -22
  58. package/templates/.claude/skills/nextjs-react-best-practices/rules/async-dependencies.md +5 -5
  59. package/templates/.claude/skills/nextjs-react-best-practices/rules/async-parallel.md +4 -4
  60. package/templates/.claude/skills/nextjs-react-best-practices/rules/async-suspense-boundaries.md +21 -21
  61. package/templates/.claude/skills/nextjs-react-best-practices/rules/bundle-barrel-imports.md +18 -18
  62. package/templates/.claude/skills/nextjs-react-best-practices/rules/bundle-conditional.md +4 -4
  63. package/templates/.claude/skills/nextjs-react-best-practices/rules/bundle-defer-third-party.md +4 -4
  64. package/templates/.claude/skills/nextjs-react-best-practices/rules/bundle-dynamic-imports.md +4 -4
  65. package/templates/.claude/skills/nextjs-react-best-practices/rules/bundle-preload.md +5 -5
  66. package/templates/.claude/skills/nextjs-react-best-practices/rules/client-event-listeners.md +9 -9
  67. package/templates/.claude/skills/nextjs-react-best-practices/rules/client-swr-dedup.md +7 -7
  68. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-batch-dom-css.md +13 -13
  69. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-cache-function-results.md +14 -14
  70. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-cache-property-access.md +4 -4
  71. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-cache-storage.md +10 -10
  72. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-combine-iterations.md +4 -4
  73. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-early-exit.md +7 -7
  74. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-hoist-regexp.md +6 -6
  75. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-index-maps.md +6 -6
  76. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-length-check-first.md +14 -14
  77. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-min-max-loop.md +16 -16
  78. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-set-map-lookups.md +4 -4
  79. package/templates/.claude/skills/nextjs-react-best-practices/rules/js-tosorted-immutable.md +17 -17
  80. package/templates/.claude/skills/nextjs-react-best-practices/rules/rendering-activity.md +4 -4
  81. package/templates/.claude/skills/nextjs-react-best-practices/rules/rendering-animate-svg-wrapper.md +11 -11
  82. package/templates/.claude/skills/nextjs-react-best-practices/rules/rendering-conditional-render.md +8 -8
  83. package/templates/.claude/skills/nextjs-react-best-practices/rules/rendering-content-visibility.md +4 -4
  84. package/templates/.claude/skills/nextjs-react-best-practices/rules/rendering-hoist-jsx.md +6 -6
  85. package/templates/.claude/skills/nextjs-react-best-practices/rules/rendering-hydration-no-flicker.md +14 -14
  86. package/templates/.claude/skills/nextjs-react-best-practices/rules/rendering-svg-precision.md +5 -5
  87. package/templates/.claude/skills/nextjs-react-best-practices/rules/rerender-defer-reads.md +4 -4
  88. package/templates/.claude/skills/nextjs-react-best-practices/rules/rerender-dependencies.md +7 -7
  89. package/templates/.claude/skills/nextjs-react-best-practices/rules/rerender-derived-state.md +5 -5
  90. package/templates/.claude/skills/nextjs-react-best-practices/rules/rerender-functional-setstate.md +34 -34
  91. package/templates/.claude/skills/nextjs-react-best-practices/rules/rerender-lazy-state-init.md +15 -15
  92. package/templates/.claude/skills/nextjs-react-best-practices/rules/rerender-memo.md +5 -5
  93. package/templates/.claude/skills/nextjs-react-best-practices/rules/rerender-transitions.md +4 -4
  94. package/templates/.claude/skills/nextjs-react-best-practices/rules/server-after-nonblocking.md +24 -24
  95. package/templates/.claude/skills/nextjs-react-best-practices/rules/server-cache-lru.md +10 -10
  96. package/templates/.claude/skills/nextjs-react-best-practices/rules/server-cache-react.md +4 -4
  97. package/templates/.claude/skills/nextjs-react-best-practices/rules/server-parallel-fetching.md +5 -5
  98. package/templates/.claude/skills/nextjs-react-best-practices/rules/server-serialization.md +6 -6
  99. package/templates/.claude/skills/plan/SKILL.md +594 -0
  100. package/templates/.claude/skills/prd/SKILL.md +496 -0
  101. package/templates/.claude/skills/ralph/AGENTS.md +393 -0
  102. package/templates/.claude/skills/ralph/SKILL.md +1035 -0
  103. package/templates/.claude/skills/tanstack-start-react-best-practices/AGENTS.md +100 -121
  104. package/templates/.claude/skills/tanstack-start-react-best-practices/SKILL.md +139 -157
  105. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/async-defer-await.md +22 -22
  106. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/async-dependencies.md +5 -5
  107. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/async-loader.md +7 -7
  108. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/async-parallel.md +4 -4
  109. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/bundle-barrel-imports.md +18 -18
  110. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/bundle-conditional.md +4 -4
  111. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/bundle-defer-third-party.md +4 -4
  112. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/bundle-lazy-routes.md +12 -12
  113. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/bundle-preload.md +5 -5
  114. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/client-event-listeners.md +9 -9
  115. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/client-tanstack-query.md +12 -12
  116. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-batch-dom-css.md +13 -13
  117. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-cache-function-results.md +14 -14
  118. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-cache-property-access.md +4 -4
  119. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-cache-storage.md +10 -10
  120. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-combine-iterations.md +4 -4
  121. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-early-exit.md +7 -7
  122. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-hoist-regexp.md +6 -6
  123. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-index-maps.md +6 -6
  124. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-length-check-first.md +14 -14
  125. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-min-max-loop.md +16 -16
  126. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-set-map-lookups.md +4 -4
  127. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/js-tosorted-immutable.md +17 -17
  128. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rendering-animate-svg-wrapper.md +11 -11
  129. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rendering-conditional-render.md +8 -8
  130. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rendering-content-visibility.md +4 -4
  131. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rendering-hoist-jsx.md +6 -6
  132. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rendering-svg-precision.md +5 -5
  133. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rerender-defer-reads.md +4 -4
  134. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rerender-dependencies.md +7 -7
  135. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rerender-derived-state.md +5 -5
  136. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rerender-functional-setstate.md +34 -34
  137. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rerender-lazy-state-init.md +15 -15
  138. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rerender-memo.md +5 -5
  139. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/rerender-transitions.md +4 -4
  140. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/server-cache-lru.md +12 -12
  141. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/server-deferred-data.md +14 -14
  142. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/server-parallel-fetching.md +9 -9
  143. package/templates/.claude/skills/tanstack-start-react-best-practices/rules/server-serialization.md +6 -6
  144. package/templates/.claude/commands/agent-creator.md +0 -370
  145. package/templates/.claude/commands/command-creator.md +0 -524
  146. package/templates/.claude/commands/execute.md +0 -469
  147. package/templates/.claude/commands/git.md +0 -98
  148. package/templates/.claude/commands/plan.md +0 -526
  149. package/templates/.claude/commands/prd.md +0 -629
@@ -0,0 +1,1035 @@
1
+ ---
2
+ name: ralph
3
+ description: 작업 완료까지 자기참조 루프. 플래너 검증 기반 완료 판단. 복잡한 작업의 완전한 구현과 검증이 필요한 경우 사용.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Ralph Skill
8
+
9
+ **[RALPH MODE ON - 반복 {{ITERATION}}/{{MAX}}]**
10
+
11
+ 작업 미완료 시 자동으로 재실행되는 반복 루프. 이전 시도에서 완료 약속(`<promise>`)을 출력하지 않았으므로 작업을 계속 진행하세요.
12
+
13
+ > 💡 **상태 메시지:** 실행 시작, 반복, 완료 시점마다 한국어 상태 메시지 출력
14
+
15
+ ---
16
+
17
+ <when_to_use>
18
+
19
+ ## 사용 시점
20
+
21
+ | 상황 | 설명 |
22
+ |------|------|
23
+ | **복잡한 구현** | 여러 단계의 작업이 필요한 기능 구현 |
24
+ | **완전성 필요** | 부분 구현이 아닌 100% 완성이 필요한 작업 |
25
+ | **검증 필수** | 테스트, 빌드, 린트 검증이 반드시 필요한 경우 |
26
+ | **멀티 에이전트** | 여러 전문 에이전트의 협업이 필요한 작업 |
27
+ | **병렬 실행** | 독립적인 작업을 동시에 처리해야 하는 경우 |
28
+
29
+ </when_to_use>
30
+
31
+ ---
32
+
33
+ <completion_protocol>
34
+
35
+ ## 완료 프로토콜 (절대 규칙)
36
+
37
+ **`<promise>{{PROMISE}}</promise>`를 출력하는 유일한 조건:**
38
+
39
+ | # | 단계 | 검증 방법 | 통과 기준 |
40
+ |---|------|----------|----------|
41
+ | 1 | 작업 완료 확인 | 원본 요구사항 체크리스트 | 100% 충족 |
42
+ | 2 | 코드 검증 | `/pre-deploy` 스킬 실행 | typecheck/lint/build 모두 통과 |
43
+ | 3 | TODO 확인 | TaskList 조회 | pending/in_progress = 0 |
44
+ | 4 | 플래너 검증 | Planner 에이전트 호출 + 승인 대기 | "승인" 응답 |
45
+
46
+ **모든 4단계 통과 후에만 `<promise>` 출력. 하나라도 실패 시 작업 계속.**
47
+
48
+ </completion_protocol>
49
+
50
+ ---
51
+
52
+ <forbidden>
53
+
54
+ ## 금지 사항 (조기 탈출 방지)
55
+
56
+ | 조기 탈출 패턴 | 설명 | 대신 할 것 |
57
+ |---------------|------|-----------|
58
+ | ❌ **추측 기반 완료** | "아마 완료된 것 같다" | `/pre-deploy` 실행 |
59
+ | ❌ **부분 검증** | `/pre-deploy` 스킵 | 4단계 모두 실행 |
60
+ | ❌ **플래너 스킵** | 검증 없이 `<promise>` 출력 | Planner 호출 필수 |
61
+ | ❌ **만족감 표현** | "잘 작동하네요" | 증거 기반 검증 |
62
+ | ❌ **범위 축소** | "이 정도면 충분" | 원본 요구사항 100% |
63
+ | ❌ **테스트 삭제/수정** | 실패 테스트 제거 | 코드 수정으로 통과 |
64
+ | ❌ **에이전트 미활용** | 모든 작업 혼자 수행 | 적극적으로 에이전트 위임 |
65
+
66
+ **STOP 조건:** 다음 표현 사용 시 즉시 중단하고 검증 실행
67
+
68
+ ```text
69
+ ❌ "~해야 한다" "probably" "should" "seems to"
70
+ ❌ "아마도" "~것 같다" "대부분" "거의"
71
+ ❌ "이 정도면" "충분히" "~만 하면 됨"
72
+ ```
73
+
74
+ **대신 사용:**
75
+
76
+ ```text
77
+ ✅ "Skill('pre-deploy') 실행"
78
+ ✅ "/pre-deploy 결과 확인"
79
+ ✅ "Planner 검증 요청"
80
+ ✅ "Task(subagent_type='executor', ...) 실행"
81
+ ✅ "여러 에이전트 병렬 호출"
82
+ ```
83
+
84
+ </forbidden>
85
+
86
+ ---
87
+
88
+ <required>
89
+
90
+ ## 필수 검증 단계
91
+
92
+ ### 1. 작업 완료 확인
93
+
94
+ 원본 작업의 모든 요구사항을 체크리스트로 작성하고 하나씩 확인:
95
+
96
+ ```markdown
97
+ - [ ] 요구사항 1: [구체적 설명]
98
+ - [ ] 요구사항 2: [구체적 설명]
99
+ - [ ] 요구사항 3: [구체적 설명]
100
+ ```
101
+
102
+ **모든 항목 체크 완료 후 다음 단계 진행.**
103
+
104
+ ### 2. 코드 검증
105
+
106
+ `/pre-deploy` 스킬을 사용하여 전체 검증 실행:
107
+
108
+ ```typescript
109
+ Skill("pre-deploy")
110
+ ```
111
+
112
+ **`/pre-deploy` 스킬은 다음을 자동으로 수행:**
113
+ - typecheck (tsc --noEmit 또는 해당 언어 타입 체크)
114
+ - lint (eslint, prettier 등)
115
+ - build (프로젝트 빌드)
116
+ - 모든 단계에서 에러 발견 시 자동 수정 시도
117
+
118
+ ### 3. 검증 결과 확인
119
+
120
+ `/pre-deploy` 실행 결과를 읽고 기록:
121
+
122
+ ```text
123
+ ✅ Typecheck: 통과
124
+ ✅ Lint: 에러 0개
125
+ ✅ Build: 성공
126
+ ```
127
+
128
+ **추측 금지. `/pre-deploy` 실제 출력만 기록. 모든 단계가 통과해야 다음 진행.**
129
+
130
+ ### 3. TODO 확인
131
+
132
+ ```typescript
133
+ TaskList() // pending/in_progress 작업 확인
134
+ ```
135
+
136
+ **모든 작업이 completed 상태여야 다음 단계 진행.**
137
+
138
+ ### 4. 플래너 검증
139
+
140
+ ```typescript
141
+ Task(
142
+ subagent_type="planner",
143
+ model="opus",
144
+ prompt=`다음 구현이 완료되었는지 검증:
145
+
146
+ 원본 작업:
147
+ {{PROMPT}}
148
+
149
+ 수행한 작업:
150
+ [구체적으로 무엇을 했는지]
151
+
152
+ 검증 결과:
153
+ - /pre-deploy: ✅ 통과
154
+ - TODO: ✅ 0개
155
+ [기타 검증 결과]
156
+
157
+ 완료 여부를 판단해주세요.`
158
+ )
159
+ ```
160
+
161
+ **Planner의 "승인" 응답을 받은 후에만 `<promise>` 출력.**
162
+
163
+ ### 5. 문서화 (각 단계마다)
164
+
165
+ 각 Phase 완료 시 상태 문서 업데이트:
166
+
167
+ | Phase | 업데이트 파일 | 업데이트 내용 |
168
+ |-------|--------------|--------------|
169
+ | 1 | TASKS.md | 체크박스 체크, 완료율 업데이트 |
170
+ | 1 | PROCESS.md | Phase 1 완료 항목 기록, Phase 2 시작 표시 |
171
+ | 2 | VERIFICATION.md | `/pre-deploy` 결과, TODO 개수 기록 |
172
+ | 2 | PROCESS.md | Phase 2 완료, Phase 3 시작 |
173
+ | 3 | VERIFICATION.md | Planner 응답 기록 |
174
+ | 3 | PROCESS.md | Phase 3 완료, Phase 4 시작 |
175
+ | 4 | PROCESS.md | 완료 시각, 총 소요 시간 |
176
+
177
+ **문서 업데이트 시점:**
178
+ - Phase 전환 시 즉시 업데이트
179
+ - 주요 의사결정 시 NOTES.md 기록
180
+ - 블로커 발견 시 PROCESS.md에 기록
181
+
182
+ **Context compaction 대비:**
183
+ - 최소 10분마다 문서 업데이트
184
+ - 복잡한 작업 완료 시 즉시 기록
185
+ - 의사결정은 PROCESS.md에 이유와 함께 기록
186
+
187
+ </required>
188
+
189
+ ---
190
+
191
+ <ultrawork_mode>
192
+
193
+ ## ULTRAWORK MODE (자동 활성화)
194
+
195
+ ### 병렬 실행 규칙
196
+
197
+ | 원칙 | 실행 방법 |
198
+ |------|----------|
199
+ | **PARALLEL** | 독립 작업은 단일 메시지에서 동시 Tool 호출 |
200
+ | **BACKGROUND** | 10개 이상 동시 작업 시 `run_in_background=true` |
201
+ | **DELEGATE** | 전문 에이전트에게 즉시 위임 |
202
+
203
+ ### Smart Model Routing
204
+
205
+ | 복잡도 | 모델 | 작업 예시 |
206
+ |--------|------|----------|
207
+ | LOW | haiku | 함수 찾기, 정의 조회, 파일 읽기 |
208
+ | MEDIUM | sonnet | 기능 구현, 버그 수정, 리팩토링 |
209
+ | HIGH | opus | 아키텍처 설계, 복잡한 디버깅, 보안 분석 |
210
+
211
+ **에이전트 호출 시 항상 `model` 파라미터 명시:**
212
+
213
+ ```typescript
214
+ Task(subagent_type="implementation-executor", model="sonnet", ...)
215
+ Task(subagent_type="planner", model="opus", ...)
216
+ ```
217
+
218
+ ### 티어별 에이전트
219
+
220
+ | 도메인 | 에이전트 | 권장 모델 | 용도 |
221
+ |--------|---------|----------|------|
222
+ | 계획/분석 | planner | opus | 아키텍처 설계, 검증 |
223
+ | 요구사항 분석 | analyst | sonnet | 계획 전 요구사항 분석, 가정 검증, 엣지 케이스 |
224
+ | 아키텍처 | architect | sonnet/opus | 아키텍처 분석, 디버깅 (READ-ONLY) |
225
+ | 실행 | implementation-executor | sonnet | 기능 구현, 버그 수정 |
226
+ | 탐색 | explore | haiku | 코드베이스 탐색 |
227
+ | 프론트엔드 | designer | sonnet/opus | UI/UX 구현 |
228
+ | 문서 작성 | document-writer | haiku/sonnet | 기술 문서, 상태 문서 관리 |
229
+ | 배포 검증 | deployment-validator | sonnet | typecheck/lint/build |
230
+ | 코드 리뷰 | code-reviewer | opus | 품질 검토 |
231
+ | 린트 수정 | lint-fixer | sonnet | tsc/eslint 오류 수정 |
232
+ | 리팩토링 | refactor-advisor | sonnet | 구조 개선 조언 |
233
+ | Git 작업 | git-operator | haiku | Git 커밋/푸시 |
234
+ | 의존성 관리 | dependency-manager | sonnet | 의존성 분석, 업데이트, 보안 스캔 |
235
+ | 번역 | ko-to-en-translator | haiku | 한글→영어 번역 |
236
+
237
+ ### 백그라운드 실행
238
+
239
+ | 작업 유형 | 실행 모드 |
240
+ |----------|----------|
241
+ | 패키지 설치 (`npm install`, `pip install`) | Background |
242
+ | 빌드 (`npm run build`, `tsc`, `make`) | Background |
243
+ | 테스트 스위트 (`npm test`, `pytest`) | Background |
244
+ | Docker 작업 (`docker build`, `docker pull`) | Background |
245
+ | 파일 읽기/쓰기 | Foreground |
246
+ | 간단한 명령어 (`git status`, `ls`) | Foreground |
247
+
248
+ ### Agent Delegation (적극 활용)
249
+
250
+ **에이전트에게 위임하는 조건:**
251
+
252
+ | 조건 | 예시 | 위임할 에이전트 |
253
+ |------|------|----------------|
254
+ | 요구사항 불명확 | 가정 검증, 엣지 케이스 분석 | analyst |
255
+ | 아키텍처 조언 필요 | 설계 검토, 패턴 분석 | architect |
256
+ | 독립적인 작업 | 코드 분석 + 리뷰 동시 | implementation-executor + code-reviewer |
257
+ | 새 컨텍스트 필요 | 대규모 코드베이스 탐색 | explore |
258
+ | 전문 지식 필요 | 린트/타입 오류 수정 | lint-fixer |
259
+ | 장기 실행 작업 | 배포 전 전체 검증 | deployment-validator |
260
+ | 병렬 처리 가능 | 여러 파일 동시 수정 | implementation-executor (여러 개) |
261
+ | Git 작업 필요 | 논리적 단위 커밋/푸시 | git-operator |
262
+ | 의존성 문제 | 패키지 업데이트, 보안 스캔 | dependency-manager |
263
+ | 번역 필요 | 한글→영어 문서/코드 번역 | ko-to-en-translator |
264
+
265
+ **에이전트 위임 원칙:**
266
+
267
+ ```text
268
+ ✅ 독립적인 작업 → 즉시 위임 (병렬 실행)
269
+ ✅ 컨텍스트 분리 필요 → 위임
270
+ ✅ 전문성 필요 → 해당 도메인 에이전트
271
+ ✅ 10분 이상 예상 → 백그라운드 + 에이전트
272
+
273
+ ❌ 간단한 파일 읽기 → 직접 실행
274
+ ❌ 순차 의존성 → 직접 실행 후 다음 에이전트
275
+ ```
276
+
277
+ ### Phase별 에이전트 활용
278
+
279
+ | Phase | 작업 | 에이전트 | 모델 | 병렬 실행 |
280
+ |-------|------|---------|------|----------|
281
+ | **1** | 요구사항 분석 | analyst | sonnet | ✅ (독립 분석) |
282
+ | **1** | 아키텍처 분석 | architect | sonnet/opus | ✅ (READ-ONLY) |
283
+ | **1** | 상태 문서 생성 | document-writer | haiku | ✅ (여러 문서) |
284
+ | **1** | 코드베이스 탐색 | explore | haiku | ✅ (여러 영역) |
285
+ | **1** | 기능 구현 | implementation-executor | sonnet | ✅ (독립 기능) |
286
+ | **1** | UI 구현 | designer | sonnet/opus | ✅ (여러 컴포넌트) |
287
+ | **1** | 리팩토링 조언 | refactor-advisor | sonnet | ✅ (READ-ONLY) |
288
+ | **1-4** | 문서 업데이트 | document-writer | haiku | ✅ (Phase 전환 시) |
289
+ | **1-4** | 문서 번역 | ko-to-en-translator | haiku | ✅ (독립 작업) |
290
+ | **2** | 배포 검증 | deployment-validator | sonnet | ❌ (순차) |
291
+ | **2** | 린트 수정 | lint-fixer | sonnet | ❌ (순차) |
292
+ | **2** | 의존성 업데이트 | dependency-manager | sonnet | ❌ (순차) |
293
+ | **3** | 아키텍처 검증 | planner | opus | ❌ (필수) |
294
+ | **3** | 코드 리뷰 | code-reviewer | opus | ✅ (파일별) |
295
+ | **4** | Git 커밋/푸시 | git-operator | haiku | ❌ (순차) |
296
+
297
+ ### 병렬 에이전트 실행 패턴
298
+
299
+ **패턴 1: 독립 작업 동시 처리**
300
+
301
+ ```typescript
302
+ // ❌ 순차 실행 (느림)
303
+ Task(subagent_type="implementation-executor", model="sonnet", prompt="기능 A 구현")
304
+ // 대기...
305
+ Task(subagent_type="implementation-executor", model="sonnet", prompt="기능 B 구현")
306
+
307
+ // ✅ 병렬 실행 (빠름)
308
+ // 단일 메시지에서 두 Task 호출
309
+ Task(subagent_type="implementation-executor", model="sonnet", prompt="기능 A 구현")
310
+ Task(subagent_type="implementation-executor", model="sonnet", prompt="기능 B 구현")
311
+ ```
312
+
313
+ **패턴 2: 도메인별 전문가 활용**
314
+
315
+ ```typescript
316
+ // 동시에 실행
317
+ Task(subagent_type="implementation-executor", model="sonnet",
318
+ prompt="API 엔드포인트 구현")
319
+ Task(subagent_type="designer", model="sonnet",
320
+ prompt="UI 컴포넌트 구현")
321
+ Task(subagent_type="code-reviewer", model="opus",
322
+ prompt="코드 리뷰 및 개선사항 도출")
323
+ ```
324
+
325
+ **패턴 3: 탐색 + 구현 분리**
326
+
327
+ ```typescript
328
+ // Phase 1 시작 시
329
+ Task(subagent_type="explore", model="haiku",
330
+ prompt="프로젝트 구조 및 기존 패턴 분석")
331
+
332
+ // 탐색 결과 기반으로 구현
333
+ Task(subagent_type="implementation-executor", model="sonnet",
334
+ prompt="분석된 패턴에 따라 [기능] 구현")
335
+ ```
336
+
337
+ **패턴 4: 문서 병렬 작성 (Ralph 특화)**
338
+
339
+ ```typescript
340
+ // Phase 시작/전환 시 여러 문서 동시 업데이트
341
+ Task(subagent_type="document-writer", model="haiku",
342
+ prompt="TASKS.md 업데이트: 요구사항 1, 2 완료 체크")
343
+ Task(subagent_type="document-writer", model="haiku",
344
+ prompt="PROCESS.md 업데이트: Phase 1 → Phase 2 전환 기록")
345
+ Task(subagent_type="document-writer", model="haiku",
346
+ prompt="VERIFICATION.md 업데이트: /pre-deploy 결과 기록")
347
+ ```
348
+
349
+ ### 에이전트 호출 체크리스트
350
+
351
+ 작업 시작 전 확인:
352
+
353
+ - [ ] 이 작업은 독립적인가? → 병렬 에이전트 고려
354
+ - [ ] 새 컨텍스트가 필요한가? → 에이전트 위임
355
+ - [ ] 전문 지식이 필요한가? → 도메인 에이전트 선택
356
+ - [ ] 10분 이상 소요될까? → 백그라운드 + 에이전트
357
+ - [ ] 여러 파일/영역 동시 작업? → 여러 executor 병렬 실행
358
+
359
+ **적극적으로 에이전트 활용. 혼자 하지 말 것.**
360
+
361
+ ### 병렬 에이전트 실전 시나리오
362
+
363
+ **시나리오 1: 풀스택 기능 구현**
364
+
365
+ ```typescript
366
+ // 사용자 관리 기능 구현 (API + UI + 문서)
367
+ Task(subagent_type="implementation-executor", model="sonnet",
368
+ prompt="User API CRUD 엔드포인트 구현 (src/functions/user.ts)")
369
+ Task(subagent_type="designer", model="sonnet",
370
+ prompt="User Profile UI 컴포넌트 구현 (src/routes/profile/)")
371
+ Task(subagent_type="document-writer", model="haiku",
372
+ prompt="User API 문서 작성 (docs/api/user.md)")
373
+ ```
374
+
375
+ **시나리오 2: 여러 독립 기능 동시 구현**
376
+
377
+ ```typescript
378
+ // 3개의 독립적인 API 엔드포인트
379
+ Task(subagent_type="implementation-executor", model="sonnet",
380
+ prompt="/api/posts CRUD 구현")
381
+ Task(subagent_type="implementation-executor", model="sonnet",
382
+ prompt="/api/comments CRUD 구현")
383
+ Task(subagent_type="implementation-executor", model="sonnet",
384
+ prompt="/api/likes 구현")
385
+ ```
386
+
387
+ **시나리오 3: 코드베이스 다중 영역 탐색**
388
+
389
+ ```typescript
390
+ // 프로젝트 초기 분석 시
391
+ Task(subagent_type="explore", model="haiku",
392
+ prompt="인증 구조 분석 (middleware, auth)")
393
+ Task(subagent_type="explore", model="haiku",
394
+ prompt="데이터베이스 스키마 분석 (prisma)")
395
+ Task(subagent_type="explore", model="haiku",
396
+ prompt="라우팅 구조 분석 (routes)")
397
+ ```
398
+
399
+ **시나리오 4: 다중 검증**
400
+
401
+ ```typescript
402
+ // 코드 완성 후 여러 관점에서 동시 검토
403
+ Task(subagent_type="code-reviewer", model="opus",
404
+ prompt="보안 검토: SQL Injection, XSS, CSRF 취약점")
405
+ Task(subagent_type="code-reviewer", model="opus",
406
+ prompt="성능 검토: N+1 쿼리, 불필요한 리렌더")
407
+ Task(subagent_type="code-reviewer", model="opus",
408
+ prompt="접근성 검토: ARIA, 키보드 네비게이션")
409
+ ```
410
+
411
+ **시나리오 5: 문서 병렬 업데이트 (Ralph 특화)**
412
+
413
+ ```typescript
414
+ // Phase 전환 시 여러 문서 동시 업데이트
415
+ Task(subagent_type="document-writer", model="haiku",
416
+ prompt="TASKS.md: 요구사항 1-3 완료 체크")
417
+ Task(subagent_type="document-writer", model="haiku",
418
+ prompt="PROCESS.md: Phase 1 완료 → Phase 2 시작 기록")
419
+ Task(subagent_type="document-writer", model="haiku",
420
+ prompt="VERIFICATION.md: 준비 상태로 초기화")
421
+ ```
422
+
423
+ **시나리오 6: 계획 수립 전 분석 (analyst + architect)**
424
+
425
+ ```typescript
426
+ // 복잡한 기능 구현 전 요구사항 및 아키텍처 분석
427
+ Task(subagent_type="analyst", model="sonnet",
428
+ prompt="사용자 인증 기능 요구사항 분석: 가정 검증, 엣지 케이스 도출")
429
+ Task(subagent_type="architect", model="opus",
430
+ prompt="현재 인증 아키텍처 분석 및 개선 방향 제시")
431
+ Task(subagent_type="explore", model="haiku",
432
+ prompt="기존 인증 구현 코드 탐색 (middleware, session)")
433
+ ```
434
+
435
+ **시나리오 7: 프로젝트 유지보수 (dependency + git + translation)**
436
+
437
+ ```typescript
438
+ // 프로젝트 전체 유지보수 작업
439
+ Task(subagent_type="dependency-manager", model="sonnet",
440
+ prompt="의존성 분석 및 보안 취약점 스캔 후 업데이트 제안")
441
+ Task(subagent_type="refactor-advisor", model="sonnet",
442
+ prompt="코드베이스 리팩토링 우선순위 분석")
443
+ Task(subagent_type="ko-to-en-translator", model="haiku",
444
+ prompt="한글 주석 및 문서를 영어로 번역 (README.md, CLAUDE.md)")
445
+ ```
446
+
447
+ </ultrawork_mode>
448
+
449
+ ---
450
+
451
+ <state_management>
452
+
453
+ ## 상태 관리 (Context Compaction 대비)
454
+
455
+ ### 문서화 폴더 구조
456
+
457
+ 세션 시작 시 `.claude/ralph/{timestamp}/` 폴더 생성:
458
+
459
+ ```
460
+ .claude/ralph/2026-01-23_14-30/
461
+ ├── TASKS.md # 작업 체크리스트
462
+ ├── PROCESS.md # 진행 단계 및 의사결정
463
+ ├── VERIFICATION.md # 검증 결과 기록
464
+ └── NOTES.md # 추가 메모
465
+ ```
466
+
467
+ **폴더명 형식:** `YYYY-MM-DD_HH-MM`
468
+
469
+ ### 문서 역할
470
+
471
+ | 파일 | 내용 | 업데이트 시점 |
472
+ |------|------|--------------|
473
+ | **TASKS.md** | 요구사항 체크리스트, 진행 상태 | 요구사항 추가/완료 시 |
474
+ | **PROCESS.md** | 현재 Phase, 다음 단계, 의사결정 기록 | Phase 전환 시 |
475
+ | **VERIFICATION.md** | `/pre-deploy` 결과, Planner 응답 | 검증 실행 시 |
476
+ | **NOTES.md** | 기술적 결정, 블로커, 해결책 | 필요 시 |
477
+
478
+ ### 문서 작성/수정
479
+
480
+ **우선순위: document-writer 에이전트 사용 (병렬 실행 가능)**
481
+
482
+ | 작업 | 방법 | 사용 시점 |
483
+ |------|------|----------|
484
+ | 새 문서 작성 | `Task(subagent_type="document-writer", model="haiku", ...)` | 초기 TASKS.md, PROCESS.md 생성 |
485
+ | 문서 업데이트 | `Task(subagent_type="document-writer", model="haiku", ...)` | Phase 전환, 검증 결과 기록 |
486
+ | 복잡한 문서 | `Task(subagent_type="document-writer", model="sonnet", ...)` | 아키텍처 문서, 상세 가이드 |
487
+
488
+ **대안: 스킬 사용 (순차 실행)**
489
+ - 새 문서: `Skill("docs-creator")`
490
+ - 문서 수정: `Skill("docs-refactor")`
491
+
492
+ **병렬 실행 패턴:**
493
+
494
+ ```typescript
495
+ // ✅ 여러 문서 동시 작성 (빠름)
496
+ Task(subagent_type="document-writer", model="haiku",
497
+ prompt="TASKS.md 생성: 요구사항 체크리스트 작성")
498
+ Task(subagent_type="document-writer", model="haiku",
499
+ prompt="PROCESS.md 생성: Phase 1 시작 기록")
500
+ Task(subagent_type="document-writer", model="haiku",
501
+ prompt="VERIFICATION.md 생성: 초기 상태")
502
+
503
+ // ❌ 순차 실행 (느림)
504
+ Skill("docs-creator") // 대기...
505
+ Skill("docs-refactor") // 대기...
506
+ ```
507
+
508
+ ### 문서 템플릿
509
+
510
+ #### TASKS.md
511
+
512
+ ```markdown
513
+ # Tasks - {{PROMPT}}
514
+
515
+ 생성: {{TIMESTAMP}}
516
+ 상태: Phase {{CURRENT_PHASE}}/4
517
+
518
+ ## 요구사항 체크리스트
519
+
520
+ - [ ] 요구사항 1: [설명]
521
+ - [ ] 요구사항 2: [설명]
522
+ - [ ] 요구사항 3: [설명]
523
+
524
+ ## 완료 상태
525
+
526
+ - 완료: 0 / 총 3
527
+ - 진행률: 0%
528
+ ```
529
+
530
+ #### PROCESS.md
531
+
532
+ ```markdown
533
+ # Process Log
534
+
535
+ ## 현재 상태
536
+
537
+ - Phase: 1 (작업 실행)
538
+ - 진행 중: [현재 작업]
539
+ - 다음: [다음 작업]
540
+
541
+ ## Phase 1: 작업 실행
542
+
543
+ **시작:** {{TIMESTAMP}}
544
+
545
+ ### 완료 항목
546
+ - 항목 1
547
+
548
+ ### 진행 중
549
+ - 항목 2
550
+
551
+ ### 의사결정
552
+ - 결정 1: [이유]
553
+
554
+ ## Phase 2: 검증
555
+
556
+ **대기 중**
557
+
558
+ ## Phase 3: Planner 검증
559
+
560
+ **대기 중**
561
+
562
+ ## Phase 4: 완료
563
+
564
+ **대기 중**
565
+ ```
566
+
567
+ #### VERIFICATION.md
568
+
569
+ ```markdown
570
+ # Verification Results
571
+
572
+ ## /pre-deploy 검증
573
+
574
+ **실행 시각:** 미실행
575
+
576
+ **결과:**
577
+ - Typecheck: 대기
578
+ - Lint: 대기
579
+ - Build: 대기
580
+
581
+ ## TODO 확인
582
+
583
+ **실행 시각:** 미실행
584
+
585
+ **결과:** pending/in_progress = ?
586
+
587
+ ## Planner 검증
588
+
589
+ **실행 시각:** 미실행
590
+
591
+ **응답:** 대기 중
592
+ ```
593
+
594
+ ### Context Recovery Protocol
595
+
596
+ Context compaction 후 세션 재개 시:
597
+
598
+ ```text
599
+ 1. pwd 실행 → 작업 디렉토리 확인
600
+ 2. ls .claude/ralph/ → 최신 세션 폴더 식별
601
+ 3. TASKS.md 읽기 → 요구사항 및 진행 상태 파악
602
+ 4. PROCESS.md 읽기 → 현재 Phase 및 다음 단계 확인
603
+ 5. VERIFICATION.md 읽기 → 검증 결과 확인
604
+ 6. git log --oneline -10 → 최근 커밋 확인
605
+ 7. 중단된 지점부터 작업 재개
606
+ ```
607
+
608
+ </state_management>
609
+
610
+ ---
611
+
612
+ <verification_workflow>
613
+
614
+ ## 검증 워크플로우 (단계별 체크포인트)
615
+
616
+ ### Phase 1: 작업 실행
617
+
618
+ ```text
619
+ 1. 원본 작업 요구사항 분석
620
+ 2. .claude/ralph/{timestamp}/ 폴더 생성
621
+ 3. TASKS.md 작성 (체크리스트)
622
+ 4. PROCESS.md 작성 (Phase 1 시작 기록)
623
+ 5. 구현 실행 (병렬/백그라운드 활용)
624
+ 6. 각 요구사항 완료 시 TASKS.md 업데이트
625
+ 7. 주요 의사결정 시 PROCESS.md 기록
626
+ ```
627
+
628
+ **병렬 에이전트 활용 예시:**
629
+
630
+ ```typescript
631
+ // 문서 초기화 (동시 실행)
632
+ Task(subagent_type="document-writer", model="haiku",
633
+ prompt="TASKS.md 생성: 요구사항 체크리스트")
634
+ Task(subagent_type="document-writer", model="haiku",
635
+ prompt="PROCESS.md 생성: Phase 1 시작 기록")
636
+
637
+ // 독립적인 기능 병렬 구현
638
+ Task(subagent_type="implementation-executor", model="sonnet",
639
+ prompt="백엔드 API 구현")
640
+ Task(subagent_type="designer", model="sonnet",
641
+ prompt="프론트엔드 UI 구현")
642
+ Task(subagent_type="document-writer", model="haiku",
643
+ prompt="기술 문서 작성")
644
+ ```
645
+
646
+ **Phase 1 완료 조건:** 모든 체크리스트 항목 완료 + 문서 업데이트
647
+
648
+ ### Phase 2: 자동 검증
649
+
650
+ ```text
651
+ 1. PROCESS.md 업데이트 (Phase 2 시작)
652
+ 2. Skill("pre-deploy") 실행 → typecheck/lint/build 검증
653
+ 3. VERIFICATION.md 업데이트 (/pre-deploy 결과)
654
+ 4. TaskList 조회 → pending/in_progress 확인
655
+ 5. VERIFICATION.md 업데이트 (TODO 개수)
656
+ 6. PROCESS.md 업데이트 (Phase 2 완료)
657
+ ```
658
+
659
+ **병렬 에이전트 활용 예시:**
660
+
661
+ ```typescript
662
+ // /pre-deploy 통과 후 다양한 관점에서 병렬 검토
663
+ Task(subagent_type="code-reviewer", model="opus",
664
+ prompt="보안 검토: 인증/인가, 입력 검증, SQL Injection")
665
+ Task(subagent_type="code-reviewer", model="opus",
666
+ prompt="성능 검토: DB 쿼리 최적화, 불필요한 리렌더")
667
+ Task(subagent_type="code-reviewer", model="opus",
668
+ prompt="접근성 검토: ARIA 속성, 키보드 네비게이션, 색상 대비")
669
+
670
+ // 문서 업데이트 (병렬)
671
+ Task(subagent_type="document-writer", model="haiku",
672
+ prompt="VERIFICATION.md: /pre-deploy 결과 + TODO 개수 기록")
673
+ Task(subagent_type="document-writer", model="haiku",
674
+ prompt="PROCESS.md: Phase 2 완료 → Phase 3 시작 기록")
675
+ ```
676
+
677
+ **Phase 2 완료 조건:** `/pre-deploy` 전체 통과 + TODO 0개 + 문서 업데이트
678
+
679
+ ### Phase 3: 플래너 검증
680
+
681
+ ```text
682
+ 1. PROCESS.md 업데이트 (Phase 3 시작)
683
+ 2. Planner 에이전트 생성 (model="opus")
684
+ 3. 검증 요청 전송 (작업 내용 + 검증 결과 포함)
685
+ 4. Planner 응답 대기
686
+ 5. VERIFICATION.md 업데이트 (Planner 응답)
687
+ 6. 승인/거절 확인
688
+ 7. PROCESS.md 업데이트 (Phase 3 완료 또는 재작업)
689
+ ```
690
+
691
+ **Phase 3 완료 조건:** Planner "승인" 응답 + 문서 업데이트
692
+
693
+ ### Phase 4: 완료 출력
694
+
695
+ ```text
696
+ 1. PROCESS.md 업데이트 (완료 시각, 총 소요 시간)
697
+ 2. TASKS.md 최종 확인 (모든 체크박스 체크)
698
+ 3. <promise>{{PROMISE}}</promise> 출력
699
+ ```
700
+
701
+ **Phase 4 조건:** Phase 1, 2, 3 순차적 완료 + 최종 문서 업데이트
702
+
703
+ ### 실패 시 처리
704
+
705
+ | 실패 Phase | 조치 |
706
+ |-----------|------|
707
+ | Phase 1 | 미완료 항목 계속 구현 |
708
+ | Phase 2 | 에러 수정 후 재검증 |
709
+ | Phase 3 | Planner 피드백 반영 후 Phase 2부터 재실행 |
710
+
711
+ **절대 건너뛰지 말 것. 실패 시 수정 → 재검증 반복.**
712
+
713
+ </verification_workflow>
714
+
715
+ ---
716
+
717
+ <architect_verification>
718
+
719
+ ## 플래너 검증 (우회 불가)
720
+
721
+ ### 호출 시점
722
+
723
+ Phase 1, 2 완료 후에만 호출:
724
+
725
+ ```text
726
+ ✅ 모든 요구사항 체크
727
+ ✅ /pre-deploy 통과 (typecheck/lint/build)
728
+ ✅ TODO 리스트 0개
729
+ → 이제 Planner 호출
730
+ ```
731
+
732
+ ### 호출 방법
733
+
734
+ ```typescript
735
+ Task(
736
+ subagent_type="planner",
737
+ model="opus",
738
+ prompt=`구현 완료 검증 요청
739
+
740
+ 【원본 작업】
741
+ {{PROMPT}}
742
+
743
+ 【수행 내용】
744
+ - 요구사항 1: 완료 (구체적 설명)
745
+ - 요구사항 2: 완료 (구체적 설명)
746
+ - ...
747
+
748
+ 【검증 결과】
749
+ - /pre-deploy: ✅ 통과 (typecheck/lint/build)
750
+ - TODO: ✅ 0개
751
+
752
+ 완료 여부를 판단하고, 미흡한 점이 있다면 구체적으로 지적해주세요.`
753
+ )
754
+ ```
755
+
756
+ ### 응답 처리
757
+
758
+ | Planner 응답 | 조치 |
759
+ |---------------|------|
760
+ | "승인", "완료", "문제없음" | `<promise>` 출력 |
761
+ | "수정 필요", "미흡", "추가 작업" | 피드백 반영 → Phase 2부터 재실행 |
762
+
763
+ **Planner 검증 없이 `<promise>` 출력 시 즉시 작업 실패 처리.**
764
+
765
+ </architect_verification>
766
+
767
+ ---
768
+
769
+ <multi_agent_examples>
770
+
771
+ ## 멀티 에이전트 실전 예시
772
+
773
+ ### Phase 1: 병렬 구현
774
+
775
+ **예시 1: 사용자 인증 기능 구현**
776
+
777
+ ```typescript
778
+ // 백엔드 + 프론트엔드 + 문서를 동시에 구현
779
+ Task(subagent_type="implementation-executor", model="sonnet",
780
+ prompt=`User 인증 API 구현:
781
+ - src/functions/auth.ts: login, logout, signup Server Functions
782
+ - inputValidator로 Zod 스키마 검증
783
+ - middleware로 세션 체크`)
784
+
785
+ Task(subagent_type="designer", model="sonnet",
786
+ prompt=`로그인/회원가입 UI 구현:
787
+ - src/routes/login/-components/LoginForm.tsx
788
+ - src/routes/signup/-components/SignupForm.tsx
789
+ - TanStack Query로 Server Function 호출`)
790
+
791
+ Task(subagent_type="document-writer", model="haiku",
792
+ prompt=`인증 API 문서 작성:
793
+ - docs/api/auth.md
794
+ - 엔드포인트, 파라미터, 응답 형식 기록`)
795
+ ```
796
+
797
+ **예시 2: 여러 독립 기능 동시 구현**
798
+
799
+ ```typescript
800
+ // Posts, Comments, Likes 기능을 각각 다른 executor에게
801
+ Task(subagent_type="implementation-executor", model="sonnet",
802
+ prompt="Posts CRUD Server Functions 구현 (src/functions/posts.ts)")
803
+
804
+ Task(subagent_type="implementation-executor", model="sonnet",
805
+ prompt="Comments CRUD Server Functions 구현 (src/functions/comments.ts)")
806
+
807
+ Task(subagent_type="implementation-executor", model="sonnet",
808
+ prompt="Likes 토글 Server Function 구현 (src/functions/likes.ts)")
809
+
810
+ Task(subagent_type="designer", model="sonnet",
811
+ prompt="Post 목록/상세 UI 구현 (src/routes/posts/)")
812
+ ```
813
+
814
+ **예시 3: 코드베이스 탐색 + 구현 병렬**
815
+
816
+ ```typescript
817
+ // 기존 구조 파악과 동시에 문서 작업 시작
818
+ Task(subagent_type="explore", model="haiku",
819
+ prompt="기존 인증 구조 분석: middleware, session, auth 관련 파일")
820
+
821
+ Task(subagent_type="explore", model="haiku",
822
+ prompt="Prisma 스키마 분석: User, Session 모델 확인")
823
+
824
+ Task(subagent_type="document-writer", model="haiku",
825
+ prompt="TASKS.md 초기화: 요구사항 체크리스트 작성")
826
+
827
+ Task(subagent_type="document-writer", model="haiku",
828
+ prompt="PROCESS.md 초기화: Phase 1 시작 기록")
829
+ ```
830
+
831
+ **예시 4: 계획 수립 전 분석 (analyst + architect + explore)**
832
+
833
+ ```typescript
834
+ // 복잡한 기능 구현 전 요구사항과 아키텍처를 먼저 분석
835
+ Task(subagent_type="analyst", model="sonnet",
836
+ prompt=`결제 시스템 요구사항 분석:
837
+ - 놓친 엣지 케이스 식별
838
+ - 가정 검증 (환불, 부분 결제, 구독 등)
839
+ - 범위 확장 위험 방지`)
840
+
841
+ Task(subagent_type="architect", model="opus",
842
+ prompt=`결제 아키텍처 분석 및 제안:
843
+ - 현재 시스템 한계점
844
+ - 트랜잭션 처리 패턴
845
+ - 확장성 고려사항`)
846
+
847
+ Task(subagent_type="explore", model="haiku",
848
+ prompt="기존 결제 관련 코드 탐색 및 의존성 파악")
849
+ ```
850
+
851
+ ### Phase 2: 병렬 검증
852
+
853
+ **예시 1: 다중 관점 코드 리뷰**
854
+
855
+ ```typescript
856
+ // /pre-deploy 통과 후 여러 측면에서 동시 검토
857
+ Task(subagent_type="code-reviewer", model="opus",
858
+ prompt=`보안 검토:
859
+ - SQL Injection 취약점
860
+ - XSS 취약점
861
+ - CSRF 보호 확인
862
+ - 인증/인가 로직 검증
863
+ - 민감 정보 노출 체크`)
864
+
865
+ Task(subagent_type="code-reviewer", model="opus",
866
+ prompt=`성능 검토:
867
+ - N+1 쿼리 문제
868
+ - 불필요한 리렌더
869
+ - 메모이제이션 누락
870
+ - 번들 크기 최적화`)
871
+
872
+ Task(subagent_type="code-reviewer", model="opus",
873
+ prompt=`접근성 검토:
874
+ - ARIA 속성 적절성
875
+ - 키보드 네비게이션
876
+ - 색상 대비 (WCAG AA)
877
+ - 스크린 리더 호환성`)
878
+ ```
879
+
880
+ **예시 2: 검증 + 문서화 병렬**
881
+
882
+ ```typescript
883
+ // 코드 리뷰와 동시에 검증 결과 문서화
884
+ Task(subagent_type="code-reviewer", model="opus",
885
+ prompt="전체 코드 품질 검토")
886
+
887
+ Task(subagent_type="document-writer", model="haiku",
888
+ prompt="VERIFICATION.md 업데이트: /pre-deploy 결과 기록")
889
+
890
+ Task(subagent_type="document-writer", model="haiku",
891
+ prompt="PROCESS.md 업데이트: Phase 2 진행 상황 기록")
892
+ ```
893
+
894
+ **예시 3: 특화 검증**
895
+
896
+ ```typescript
897
+ // 특정 영역별 전문 검토
898
+ Task(subagent_type="code-reviewer", model="opus",
899
+ prompt="Prisma 스키마 및 쿼리 최적화 검토")
900
+
901
+ Task(subagent_type="code-reviewer", model="opus",
902
+ prompt="TanStack Query 사용 패턴 검토 (캐싱, invalidation)")
903
+
904
+ Task(subagent_type="code-reviewer", model="opus",
905
+ prompt="TypeScript 타입 안정성 검토 (any 사용, 타입 가드)")
906
+ ```
907
+
908
+ ### 멀티 에이전트 전략
909
+
910
+ **언제 병렬 실행하는가:**
911
+
912
+ | 조건 | 병렬 실행 | 순차 실행 |
913
+ |------|----------|----------|
914
+ | 작업 독립성 | ✅ 독립적 | ❌ 의존성 있음 |
915
+ | 컨텍스트 | ✅ 분리 가능 | ❌ 공유 필요 |
916
+ | 결과 활용 | ✅ 개별 활용 | ❌ 다음 작업 입력 |
917
+
918
+ **병렬 실행 원칙:**
919
+
920
+ ```text
921
+ ✅ DO:
922
+ - API + UI + 문서 동시 구현
923
+ - 여러 파일/모듈 독립 작업
924
+ - 다양한 관점의 코드 리뷰
925
+ - 여러 문서 동시 업데이트
926
+ - 코드베이스 다중 영역 탐색
927
+
928
+ ❌ DON'T:
929
+ - 순차 의존성 있는 작업
930
+ - 같은 파일 동시 수정
931
+ - 결과가 다음 작업 입력인 경우
932
+ ```
933
+
934
+ **모델 선택 전략:**
935
+
936
+ ```typescript
937
+ // 간단한 작업 → haiku (빠르고 저렴)
938
+ Task(subagent_type="explore", model="haiku", ...)
939
+ Task(subagent_type="document-writer", model="haiku", ...)
940
+
941
+ // 일반 구현 → sonnet (균형)
942
+ Task(subagent_type="implementation-executor", model="sonnet", ...)
943
+ Task(subagent_type="designer", model="sonnet", ...)
944
+
945
+ // 복잡한 분석/설계 → opus (고품질)
946
+ Task(subagent_type="planner", model="opus", ...)
947
+ Task(subagent_type="code-reviewer", model="opus", ...)
948
+ ```
949
+
950
+ </multi_agent_examples>
951
+
952
+ ---
953
+
954
+ <instructions>
955
+
956
+ ## 작업 지침
957
+
958
+ ### 시작 시
959
+
960
+ **첫 실행:**
961
+ ```
962
+ [RALPH MODE ON - 작업 시작]
963
+ ```
964
+ 1. 원본 작업(`{{PROMPT}}`) 읽기
965
+ 2. `.claude/ralph/{YYYY-MM-DD_HH-MM}/` 폴더 생성
966
+ 3. TASKS.md, PROCESS.md, VERIFICATION.md 초기화
967
+ 4. 요구사항 분석 후 TASKS.md에 체크리스트 작성
968
+
969
+ **Context Compaction 후 재개:**
970
+ ```
971
+ [RALPH MODE ON - 작업 재개]
972
+ ```
973
+ 1. `pwd` → 작업 디렉토리 확인
974
+ 2. `ls .claude/ralph/` → 최신 세션 폴더 찾기
975
+ 3. TASKS.md 읽기 → 요구사항 및 완료 상태
976
+ 4. PROCESS.md 읽기 → 현재 Phase 및 다음 단계
977
+ 5. VERIFICATION.md 읽기 → 검증 결과
978
+ 6. `git log --oneline -10` → 최근 작업 확인
979
+ 7. 중단 지점부터 계속
980
+
981
+ ### 실행 중
982
+
983
+ **작업 실행:**
984
+ 1. 병렬 실행 최대 활용 (독립 작업 동시 처리)
985
+ 2. 백그라운드 실행 적극 사용 (빌드/테스트)
986
+ 3. **에이전트 적극 위임 (혼자 하지 말 것)**
987
+ - 독립 작업 → 즉시 에이전트 위임
988
+ - 전문 지식 필요 → 도메인 에이전트 활용
989
+ - 여러 작업 동시 → 병렬 에이전트 실행
990
+ - 복잡도에 맞는 모델 선택 (haiku/sonnet/opus)
991
+
992
+ **문서화 (필수):**
993
+ 1. 요구사항 완료 시 → TASKS.md 체크박스 업데이트
994
+ 2. Phase 전환 시 → PROCESS.md 업데이트
995
+ 3. 검증 실행 시 → VERIFICATION.md 업데이트
996
+ 4. 주요 의사결정 시 → PROCESS.md 또는 NOTES.md 기록
997
+ 5. 블로커 발견 시 → NOTES.md에 상황 및 해결책 기록
998
+
999
+ **문서 작성/수정 스킬:**
1000
+ - 새 문서 작성: `Skill("docs-creator")`
1001
+ - 기존 문서 개선: `Skill("docs-refactor")`
1002
+
1003
+ ### 완료 판단
1004
+
1005
+ 1. **Phase 1:** 모든 요구사항 완료 확인 + TASKS.md/PROCESS.md 업데이트
1006
+ 2. **Phase 2:** `/pre-deploy` 검증 + TODO 확인 + VERIFICATION.md 업데이트
1007
+ 3. **Phase 3:** Planner 검증 + VERIFICATION.md 업데이트
1008
+ 4. **Phase 4:** 최종 문서 업데이트 + **"[RALPH MODE - 작업 완료]"** 출력 + `<promise>{{PROMISE}}</promise>` 출력
1009
+
1010
+ **4단계 순차 진행. 건너뛰기 절대 금지.**
1011
+
1012
+ **완료 시 메시지:**
1013
+ ```
1014
+ [RALPH MODE - 작업 완료]
1015
+ <promise>{{PROMISE}}</promise>
1016
+ ```
1017
+
1018
+ ### 실패 시
1019
+
1020
+ ```
1021
+ [RALPH MODE ON - 검증 실패, 재시도]
1022
+ ```
1023
+ 1. 검증 실패 → NOTES.md에 원인 기록
1024
+ 2. 수정 작업 → PROCESS.md에 수정 내용 기록
1025
+ 3. 재검증 → VERIFICATION.md 업데이트
1026
+ 4. 작업이 진정으로 완료될 때까지 중단하지 말 것
1027
+
1028
+ **반복 루프 진입 시 자동으로 "[RALPH MODE ON - 반복 {{ITERATION}}/{{MAX}}]" 메시지 출력**
1029
+
1030
+ </instructions>
1031
+
1032
+ ---
1033
+
1034
+ **원본 작업:**
1035
+ {{PROMPT}}