@kood/claude-code 0.5.1 → 0.5.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.
Files changed (66) hide show
  1. package/dist/index.js +163 -28
  2. package/package.json +1 -1
  3. package/templates/.claude/agents/analyst.md +6 -14
  4. package/templates/.claude/agents/architect.md +6 -14
  5. package/templates/.claude/agents/code-reviewer.md +8 -14
  6. package/templates/.claude/agents/dependency-manager.md +8 -14
  7. package/templates/.claude/agents/deployment-validator.md +8 -14
  8. package/templates/.claude/agents/designer.md +8 -0
  9. package/templates/.claude/agents/document-writer.md +6 -14
  10. package/templates/.claude/agents/explore.md +8 -3
  11. package/templates/.claude/agents/git-operator.md +63 -17
  12. package/templates/.claude/agents/implementation-executor.md +14 -37
  13. package/templates/.claude/agents/ko-to-en-translator.md +8 -13
  14. package/templates/.claude/agents/lint-fixer.md +8 -172
  15. package/templates/.claude/agents/planner.md +6 -14
  16. package/templates/.claude/agents/refactor-advisor.md +8 -14
  17. package/templates/.claude/commands/git-all.md +3 -167
  18. package/templates/.claude/commands/git-session.md +3 -71
  19. package/templates/.claude/commands/lint-fix.md +119 -82
  20. package/templates/.claude/commands/lint-init.md +2 -54
  21. package/templates/.claude/commands/pre-deploy.md +143 -82
  22. package/templates/.claude/commands/version-update.md +171 -66
  23. package/templates/.claude/instructions/agent-patterns/agent-coordination.md +208 -0
  24. package/templates/.claude/instructions/agent-patterns/index.md +264 -0
  25. package/templates/.claude/instructions/agent-patterns/model-routing.md +167 -0
  26. package/templates/.claude/instructions/agent-patterns/parallel-execution.md +91 -0
  27. package/templates/.claude/instructions/agent-patterns/read-parallelization.md +106 -0
  28. package/templates/.claude/instructions/index.md +350 -0
  29. package/templates/.claude/instructions/multi-agent/agent-roster.md +811 -0
  30. package/templates/.claude/{PARALLEL_AGENTS.md → instructions/multi-agent/coordination-guide.md} +27 -336
  31. package/templates/.claude/instructions/{parallel-agent-execution.md → multi-agent/execution-patterns.md} +127 -438
  32. package/templates/.claude/instructions/multi-agent/index.md +282 -0
  33. package/templates/.claude/instructions/multi-agent/performance-optimization.md +456 -0
  34. package/templates/.claude/instructions/tech-stack/design-standards.md +282 -0
  35. package/templates/.claude/instructions/tech-stack/index.md +70 -0
  36. package/templates/.claude/instructions/tech-stack/prisma-patterns.md +352 -0
  37. package/templates/.claude/instructions/tech-stack/tanstack-patterns.md +275 -0
  38. package/templates/.claude/instructions/validation/forbidden-patterns.md +281 -0
  39. package/templates/.claude/instructions/validation/index.md +32 -0
  40. package/templates/.claude/instructions/validation/required-behaviors.md +331 -0
  41. package/templates/.claude/instructions/validation/verification-checklist.md +318 -0
  42. package/templates/.claude/instructions/workflow-patterns/index.md +18 -0
  43. package/templates/.claude/instructions/workflow-patterns/phase-based-workflow.md +250 -0
  44. package/templates/.claude/instructions/workflow-patterns/sequential-thinking.md +217 -0
  45. package/templates/.claude/instructions/workflow-patterns/todowrite-pattern.md +215 -0
  46. package/templates/.claude/skills/bug-fix/SKILL.md +972 -0
  47. package/templates/.claude/skills/docs-creator/AGENTS.md +4 -1
  48. package/templates/.claude/skills/docs-creator/SKILL.md +258 -0
  49. package/templates/.claude/skills/docs-refactor/AGENTS.md +4 -1
  50. package/templates/.claude/skills/docs-refactor/SKILL.md +145 -0
  51. package/templates/.claude/skills/execute/SKILL.md +15 -242
  52. package/templates/.claude/skills/figma-to-code/AGENTS.md +4 -1
  53. package/templates/.claude/skills/figma-to-code/SKILL.md +306 -0
  54. package/templates/.claude/skills/global-uiux-design/AGENTS.md +4 -1
  55. package/templates/.claude/skills/global-uiux-design/SKILL.md +455 -125
  56. package/templates/.claude/skills/korea-uiux-design/AGENTS.md +4 -1
  57. package/templates/.claude/skills/korea-uiux-design/SKILL.md +461 -116
  58. package/templates/.claude/skills/nextjs-react-best-practices/SKILL.md +177 -0
  59. package/templates/.claude/skills/plan/SKILL.md +1102 -98
  60. package/templates/.claude/skills/prd/SKILL.md +367 -66
  61. package/templates/.claude/skills/ralph/AGENTS.md +4 -1
  62. package/templates/.claude/skills/ralph/SKILL.md +83 -0
  63. package/templates/.claude/skills/refactor/SKILL.md +1214 -0
  64. package/templates/.claude/skills/tanstack-start-react-best-practices/SKILL.md +149 -0
  65. package/templates/.claude/commands/bug-fix.md +0 -510
  66. package/templates/.claude/commands/refactor.md +0 -788
@@ -0,0 +1,972 @@
1
+ ---
2
+ name: bug-fix
3
+ description: 버그 원인 분석, 수정 옵션 제시, 구현까지 처리하는 스킬
4
+ user-invocable: true
5
+ ---
6
+
7
+ @../../instructions/workflow-patterns/sequential-thinking.md
8
+ @../../instructions/agent-patterns/parallel-execution.md
9
+ @../../instructions/agent-patterns/model-routing.md
10
+ @../../instructions/validation/forbidden-patterns.md
11
+ @../../instructions/validation/required-behaviors.md
12
+
13
+ # Bug Fix Skill
14
+
15
+ > 버그 원인 분석, 수정 옵션 제시, 구현까지 처리하는 스킬
16
+
17
+ ---
18
+
19
+ <when_to_use>
20
+
21
+ ## 사용 시점
22
+
23
+ | 상황 | 예시 |
24
+ |------|------|
25
+ | **타입 에러** | Property 'X' does not exist on type 'Y' |
26
+ | **런타임 에러** | Cannot read property of undefined, null reference |
27
+ | **논리 오류** | 중복 렌더링, 잘못된 계산, 상태 관리 이슈 |
28
+ | **API 에러** | 500 에러, 잘못된 응답, CORS 문제 |
29
+ | **간헐적 버그** | 특정 조건에서만 발생하는 오류 |
30
+
31
+ ## 호출 방법
32
+
33
+ ```bash
34
+ # 직접 처리
35
+ Skill: bug-fix <에러 메시지 또는 버그 설명>
36
+
37
+ # 병렬 수정 (여러 독립 버그)
38
+ Task({
39
+ subagent_type: 'implementation-executor',
40
+ model: 'sonnet',
41
+ prompt: '버그 1 수정: [설명]'
42
+ })
43
+ Task({
44
+ subagent_type: 'implementation-executor',
45
+ model: 'sonnet',
46
+ prompt: '버그 2 수정: [설명]'
47
+ })
48
+ ```
49
+
50
+ ## 결과물
51
+
52
+ - 버그 원인 분석
53
+ - 2-3개 수정 옵션 제시 (장단점, 리스크)
54
+ - 추천안 및 근거
55
+ - 선택 후 코드 수정 + 검증
56
+
57
+ </when_to_use>
58
+
59
+ ---
60
+
61
+ <argument_validation>
62
+
63
+ ## ARGUMENT 필수 확인
64
+
65
+ ```
66
+ $ARGUMENTS 없음 → 즉시 질문:
67
+
68
+ "어떤 버그를 수정해야 하나요? 구체적으로 알려주세요.
69
+
70
+ 예시:
71
+ - 에러 메시지 및 발생 위치
72
+ - 예상 동작 vs 실제 동작
73
+ - 재현 방법
74
+ - 관련 파일 경로"
75
+
76
+ $ARGUMENTS 있음 → 다음 단계 진행
77
+ ```
78
+
79
+ </argument_validation>
80
+
81
+ ---
82
+
83
+ <workflow>
84
+
85
+ ## 실행 흐름
86
+
87
+ | 단계 | 작업 | 도구 |
88
+ |------|------|------|
89
+ | 1. 입력 확인 | ARGUMENT 검증, 없으면 질문 | - |
90
+ | 2. 복잡도 판단 | Sequential Thinking으로 분석 범위 결정 | sequentialthinking (1단계) |
91
+ | 3. 버그 재현 | 에러 재현, 관련 파일 파악 | Read/Grep/Glob |
92
+ | 4. 원인 분석 | Task (Explore)로 관련 코드 탐색 | Task (Explore) |
93
+ | 5. 옵션 도출 | 수정 방법 2-3개 도출 | sequentialthinking (2-4단계) |
94
+ | 6. 옵션 제시 | 장단점, 영향 범위 제시 | - |
95
+ | 7. 사용자 선택 | 수정 방법 선택 대기 | - |
96
+ | 8. 구현 | 선택된 방법으로 코드 수정 | Edit |
97
+ | 9. 검증 | 테스트 실행, 빌드 확인 | Bash |
98
+
99
+ </workflow>
100
+
101
+ ---
102
+
103
+ <thinking_strategy>
104
+
105
+ ## Sequential Thinking 가이드
106
+
107
+ ### 복잡도 판단 (thought 1)
108
+
109
+ ```
110
+ thought 1: 복잡도 판단
111
+ - 에러 유형: syntax/runtime/logic/type
112
+ - 영향 범위: 단일 파일 vs 다중 파일
113
+ - 의존성: 외부 라이브러리, API 연동
114
+ - 재현 가능성: 항상 발생 vs 간헐적
115
+ ```
116
+
117
+ ### 복잡도별 전략
118
+
119
+ | 복잡도 | 사고 횟수 | 판단 기준 | 사고 패턴 |
120
+ |--------|----------|----------|------------|
121
+ | **간단** | 3 | 명확한 에러, 1-2 파일 | 복잡도 판단 → 원인 분석 → 수정 방법 |
122
+ | **보통** | 5 | 논리 오류, 3-5 파일 | 복잡도 판단 → 재현 → 원인 분석 → 옵션 비교 → 추천안 |
123
+ | **복잡** | 7+ | 간헐적 오류, 다중 모듈 | 복잡도 판단 → 재현 시도 → 심층 분석 → 옵션 탐색 → 비교 → 추천안 |
124
+
125
+ ### 보통 복잡도 패턴 (5단계)
126
+
127
+ ```
128
+ thought 1: 복잡도 판단 및 분석 범위
129
+ thought 2: 버그 재현 및 에러 메시지 분석
130
+ thought 3: 관련 코드 탐색 및 원인 파악
131
+ thought 4: 수정 방법 2-3개 비교 분석
132
+ thought 5: 최종 추천안 및 근거
133
+ ```
134
+
135
+ ### 핵심 원칙
136
+
137
+ ```text
138
+ ✅ 사고 과정을 출력해야 실제로 생각이 일어남
139
+ ✅ 복잡도가 불확실하면 높게 책정 (3→5로 확장 가능)
140
+ ✅ 각 thought에서 구체적 분석 필요 (추상적 설명 금지)
141
+ ✅ 필요 시 isRevision으로 이전 사고 수정
142
+ ```
143
+
144
+ </thinking_strategy>
145
+
146
+ ---
147
+
148
+ <exploration>
149
+
150
+ ## Task (Explore) 활용
151
+
152
+ ### 탐색 전략
153
+
154
+ | 버그 유형 | 탐색 대상 | prompt 예시 |
155
+ |----------|----------|-------------|
156
+ | **타입 에러** | 타입 정의, 사용처 | "타입 X 정의 위치 및 사용 파일 탐색" |
157
+ | **런타임 에러** | 함수 호출 체인 | "함수 Y 호출 경로 및 관련 파일" |
158
+ | **논리 오류** | 상태 관리, 데이터 흐름 | "상태 Z 변경 위치 및 영향 범위" |
159
+ | **API 에러** | 엔드포인트, 요청/응답 | "API /path 관련 코드 구조" |
160
+
161
+ ### Task 호출 패턴
162
+
163
+ **단일 탐색:**
164
+
165
+ ```typescript
166
+ Task({
167
+ subagent_type: 'Explore',
168
+ description: '에러 관련 코드 탐색',
169
+ prompt: `
170
+ 에러 발생 관련 코드 구조 파악:
171
+ - 에러가 발생하는 정확한 위치
172
+ - 관련 함수/컴포넌트
173
+ - 의존하는 모듈/라이브러리
174
+ - 최근 수정 이력 (git blame)
175
+ `
176
+ })
177
+ ```
178
+
179
+ **병렬 탐색 (복잡한 경우):**
180
+
181
+ ```typescript
182
+ // 단일 메시지에 다중 Task 호출
183
+ Task({
184
+ subagent_type: 'Explore',
185
+ prompt: '프론트엔드 에러 발생 컴포넌트 분석'
186
+ })
187
+
188
+ Task({
189
+ subagent_type: 'Explore',
190
+ prompt: '백엔드 API 엔드포인트 분석'
191
+ })
192
+
193
+ Task({
194
+ subagent_type: 'Explore',
195
+ prompt: '타입 정의 및 인터페이스 분석'
196
+ })
197
+
198
+ // → 결과 취합 후 원인 파악
199
+ ```
200
+
201
+ ### 탐색 체크리스트
202
+
203
+ ```text
204
+ ✅ 에러 발생 정확한 위치
205
+ ✅ 관련 함수/클래스/컴포넌트
206
+ ✅ 데이터 흐름 및 상태 변경
207
+ ✅ 외부 의존성 (라이브러리, API)
208
+ ✅ 최근 변경 사항 (git log/blame)
209
+ ```
210
+
211
+ </exploration>
212
+
213
+ ---
214
+
215
+ <option_presentation>
216
+
217
+ ## 옵션 제시 형식
218
+
219
+ ### 옵션 2-3개 제시
220
+
221
+ ```markdown
222
+ ## 버그 분석 결과
223
+
224
+ **원인:** [원인 설명]
225
+
226
+ **영향 범위:** [파일 및 모듈 목록]
227
+
228
+ ---
229
+
230
+ ### 옵션 1: [수정 방법] (추천)
231
+
232
+ **수정 내용:**
233
+ - 변경 사항 1
234
+ - 변경 사항 2
235
+
236
+ | 장점 | 단점 |
237
+ |------|------|
238
+ | 장점 1 | 단점 1 |
239
+ | 장점 2 | 단점 2 |
240
+
241
+ **수정 파일:**
242
+ - `src/file1.ts:line`
243
+ - `src/file2.ts:line`
244
+
245
+ **리스크:** 낮음
246
+
247
+ ---
248
+
249
+ ### 옵션 2: [수정 방법]
250
+
251
+ **수정 내용:**
252
+ ...
253
+
254
+ | 장점 | 단점 |
255
+ |------|------|
256
+ | ... | ... |
257
+
258
+ **수정 파일:**
259
+ ...
260
+
261
+ **리스크:** 중간
262
+
263
+ ---
264
+
265
+ ### 옵션 3: [수정 방법] (임시 해결)
266
+
267
+ **수정 내용:**
268
+ ...
269
+
270
+ **리스크:** 높음 (근본 해결 아님)
271
+
272
+ ---
273
+
274
+ ## 추천 및 근거
275
+
276
+ 옵션 1을 추천합니다.
277
+ - 근거 1
278
+ - 근거 2
279
+
280
+ 어떤 옵션으로 수정하시겠습니까? (1/2/3)
281
+ ```
282
+
283
+ </option_presentation>
284
+
285
+ ---
286
+
287
+ <implementation>
288
+
289
+ ## 구현 가이드
290
+
291
+ ### 수정 단계
292
+
293
+ ```
294
+ 1. 사용자 옵션 선택 대기
295
+ 2. Edit 도구로 코드 수정
296
+ 3. 수정 내용 설명
297
+ 4. 테스트/빌드 실행 (선택)
298
+ 5. 결과 확인
299
+ ```
300
+
301
+ ### 수정 후 검증
302
+
303
+ ```bash
304
+ # 타입 체크
305
+ npm run typecheck
306
+ # 또는
307
+ tsc --noEmit
308
+
309
+ # 테스트 실행
310
+ npm test
311
+ # 또는
312
+ npm test -- <관련 테스트 파일>
313
+
314
+ # 빌드 확인
315
+ npm run build
316
+ ```
317
+
318
+ ### 검증 체크리스트
319
+
320
+ ```text
321
+ ✅ 에러 해결 확인
322
+ ✅ 기존 기능 영향 없음
323
+ ✅ 타입 에러 없음
324
+ ✅ 테스트 통과
325
+ ✅ 빌드 성공
326
+ ```
327
+
328
+ </implementation>
329
+
330
+ ---
331
+
332
+ <parallel_agent_execution>
333
+
334
+ ## Parallel Agent Execution
335
+
336
+ ### Smart Model Routing
337
+
338
+ | 복잡도 | 버그 유형 | 모델 | 작업 예시 |
339
+ |--------|----------|------|----------|
340
+ | **LOW** | 단순 버그 | haiku | 오타, 명백한 로직 오류, 누락된 import |
341
+ | **MEDIUM** | 일반 버그 | sonnet | 기능 오작동, 상태 관리 이슈, API 에러 |
342
+ | **HIGH** | 복잡한 버그 | opus | 아키텍처 설계 결함, 성능 이슈, 보안 취약점 |
343
+
344
+ **에이전트 호출 시 항상 `model` 파라미터 명시:**
345
+
346
+ ```typescript
347
+ Task(subagent_type="implementation-executor", model="sonnet", ...)
348
+ Task(subagent_type="explore", model="haiku", ...)
349
+ Task(subagent_type="architect", model="opus", ...)
350
+ ```
351
+
352
+ ### Recommended Agents
353
+
354
+ | 도메인 | 에이전트 | 권장 모델 | 용도 |
355
+ |--------|---------|----------|------|
356
+ | 탐색 | explore | haiku | 버그 재현 경로, 관련 파일 탐색 |
357
+ | 아키텍처 | architect | sonnet/opus | 근본 원인 분석, 설계 논의 (READ-ONLY) |
358
+ | 구현 | implementation-executor | sonnet | 버그 수정 구현 |
359
+ | 검증 | code-reviewer | opus | 수정 후 코드 리뷰, 회귀 검증 |
360
+ | 린트 | lint-fixer | sonnet | tsc/eslint 오류 수정 |
361
+ | 문서 | document-writer | haiku/sonnet | 버그 리포트, 수정 내역 문서화 |
362
+
363
+ ### Bug Severity별 병렬 처리
364
+
365
+ | 심각도 | 특징 | 병렬 처리 전략 |
366
+ |--------|------|---------------|
367
+ | **CRITICAL** | 서비스 중단, 데이터 손실 | 즉시 수정 (순차) + 영향도 분석 (병렬) |
368
+ | **HIGH** | 주요 기능 오작동 | 독립 버그 동시 수정 (병렬) |
369
+ | **MEDIUM** | 사소한 오류 | 여러 버그 일괄 수정 (병렬) |
370
+
371
+ **CRITICAL 버그:**
372
+
373
+ ```typescript
374
+ // ❌ 병렬 실행 금지 - 즉시 수정
375
+ Task({
376
+ subagent_type: 'implementation-executor',
377
+ model: 'opus',
378
+ prompt: 'CRITICAL: 인증 우회 취약점 즉시 패치'
379
+ })
380
+
381
+ // ✅ 수정 완료 후 영향도 분석 병렬 실행
382
+ Task({
383
+ subagent_type: 'code-reviewer',
384
+ model: 'opus',
385
+ prompt: '유사 취약점 전체 코드베이스 스캔'
386
+ })
387
+ Task({
388
+ subagent_type: 'document-writer',
389
+ model: 'sonnet',
390
+ prompt: '보안 인시던트 리포트 작성'
391
+ })
392
+ ```
393
+
394
+ **HIGH/MEDIUM 버그:**
395
+
396
+ ```typescript
397
+ // ✅ 독립적인 버그 동시 수정
398
+ Task({
399
+ subagent_type: 'implementation-executor',
400
+ model: 'sonnet',
401
+ prompt: '로그인 토큰 만료 처리 버그 수정'
402
+ })
403
+ Task({
404
+ subagent_type: 'implementation-executor',
405
+ model: 'sonnet',
406
+ prompt: '결제 금액 계산 오류 수정'
407
+ })
408
+ Task({
409
+ subagent_type: 'implementation-executor',
410
+ model: 'sonnet',
411
+ prompt: '프로필 이미지 업로드 실패 수정'
412
+ })
413
+ ```
414
+
415
+ ### 영향도 분석 + 수정 동시 실행
416
+
417
+ 버그 발견 시 탐색과 수정을 병렬로 진행:
418
+
419
+ ```typescript
420
+ // ✅ 패턴: 수정 + 영향도 분석 병렬
421
+ Task({
422
+ subagent_type: 'implementation-executor',
423
+ model: 'sonnet',
424
+ prompt: '사용자 목록 중복 렌더링 버그 수정 (useEffect 의존성)'
425
+ })
426
+
427
+ Task({
428
+ subagent_type: 'explore',
429
+ model: 'haiku',
430
+ prompt: '동일한 useEffect 패턴 사용 컴포넌트 전체 탐색'
431
+ })
432
+
433
+ Task({
434
+ subagent_type: 'code-reviewer',
435
+ model: 'opus',
436
+ prompt: '유사 렌더링 버그 가능성 검토'
437
+ })
438
+
439
+ // → 수정과 동시에 다른 곳에 같은 버그가 없는지 확인
440
+ ```
441
+
442
+ ### 다중 파일 버그 병렬 수정
443
+
444
+ 여러 파일에 걸친 버그를 동시에 수정:
445
+
446
+ ```typescript
447
+ // ✅ 독립적인 파일 동시 수정
448
+ Task({
449
+ subagent_type: 'implementation-executor',
450
+ model: 'sonnet',
451
+ prompt: 'src/routes/posts/-components/PostList.tsx: key prop 누락 추가'
452
+ })
453
+
454
+ Task({
455
+ subagent_type: 'implementation-executor',
456
+ model: 'sonnet',
457
+ prompt: 'src/routes/comments/-components/CommentList.tsx: key prop 누락 추가'
458
+ })
459
+
460
+ Task({
461
+ subagent_type: 'implementation-executor',
462
+ model: 'sonnet',
463
+ prompt: 'src/routes/users/-components/UserList.tsx: key prop 누락 추가'
464
+ })
465
+
466
+ // → 3개 파일을 동시에 수정 (순차 대비 3배 빠름)
467
+ ```
468
+
469
+ ### 테스트 병렬 실행
470
+
471
+ 버그 수정 후 여러 종류의 테스트를 동시에 실행:
472
+
473
+ ```typescript
474
+ // ✅ 다양한 테스트 레벨 병렬 실행
475
+ Task({
476
+ subagent_type: 'implementation-executor',
477
+ model: 'haiku',
478
+ prompt: 'Unit 테스트 실행: npm test -- src/functions/auth.test.ts'
479
+ })
480
+
481
+ Task({
482
+ subagent_type: 'implementation-executor',
483
+ model: 'haiku',
484
+ prompt: 'Integration 테스트 실행: npm test -- tests/integration/auth.test.ts'
485
+ })
486
+
487
+ Task({
488
+ subagent_type: 'implementation-executor',
489
+ model: 'sonnet',
490
+ prompt: 'E2E 테스트 실행: npm run test:e2e -- auth.spec.ts'
491
+ })
492
+
493
+ // → 3가지 테스트 레벨을 동시에 검증
494
+ ```
495
+
496
+ ### Parallel Execution Patterns
497
+
498
+ ### Read 도구 병렬화
499
+
500
+ **프로젝트 분석 시 파일 병렬 읽기:**
501
+
502
+ ```typescript
503
+ // ❌ 순차 읽기 (느림)
504
+ Read({ file_path: "src/file1.ts" })
505
+ // 대기...
506
+ Read({ file_path: "src/file2.ts" })
507
+
508
+ // ✅ 병렬 읽기 (빠름)
509
+ Read({ file_path: "src/file1.ts" })
510
+ Read({ file_path: "src/file2.ts" })
511
+ Read({ file_path: "src/file3.ts" })
512
+ Read({ file_path: "docs/api.md" })
513
+ ```
514
+
515
+ **복잡한 탐색은 explore 에이전트 활용:**
516
+
517
+ ```typescript
518
+ // 여러 영역 동시 탐색
519
+ Task(subagent_type="explore", model="haiku",
520
+ prompt="영역 1 파일 구조 및 패턴 분석")
521
+ Task(subagent_type="explore", model="haiku",
522
+ prompt="영역 2 의존성 및 관계 분석")
523
+ ```
524
+
525
+ ---
526
+
527
+ #### 패턴 1: 탐색 + 분석 병렬
528
+
529
+ ```typescript
530
+ // ❌ 순차 실행 (느림)
531
+ Task({
532
+ subagent_type: 'explore',
533
+ model: 'haiku',
534
+ prompt: '간헐적 500 에러 재현 경로 탐색'
535
+ })
536
+ // 대기...
537
+ Task({
538
+ subagent_type: 'architect',
539
+ model: 'sonnet',
540
+ prompt: '500 에러 근본 원인 분석'
541
+ })
542
+
543
+ // ✅ 병렬 실행 (빠름)
544
+ Task({
545
+ subagent_type: 'explore',
546
+ model: 'haiku',
547
+ prompt: '간헐적 500 에러 재현 경로 탐색 및 재현 조건 파악'
548
+ })
549
+ Task({
550
+ subagent_type: 'architect',
551
+ model: 'sonnet',
552
+ prompt: '500 에러 패턴 분석 및 근본 원인 파악 (로그, 스택 트레이스 기반)'
553
+ })
554
+
555
+ // → 탐색 결과와 분석 결과를 종합하여 수정 방향 결정
556
+ ```
557
+
558
+ #### 패턴 2: 수정 + 문서화 병렬
559
+
560
+ ```typescript
561
+ // ✅ 코드 수정과 동시에 문서화
562
+ Task({
563
+ subagent_type: 'implementation-executor',
564
+ model: 'sonnet',
565
+ prompt: '인증 버그 수정: 토큰 재발급 로직 개선'
566
+ })
567
+ Task({
568
+ subagent_type: 'document-writer',
569
+ model: 'haiku',
570
+ prompt: '버그 리포트 작성: 원인, 수정 내용, 영향 범위'
571
+ })
572
+ Task({
573
+ subagent_type: 'document-writer',
574
+ model: 'haiku',
575
+ prompt: 'CHANGELOG.md 업데이트: 버그 수정 항목 추가'
576
+ })
577
+ ```
578
+
579
+ #### 패턴 3: 다중 검증 병렬
580
+
581
+ ```typescript
582
+ // ✅ 수정 후 여러 관점에서 동시 검토
583
+ Task({
584
+ subagent_type: 'code-reviewer',
585
+ model: 'opus',
586
+ prompt: '보안 검토: 수정으로 인한 새로운 취약점 확인'
587
+ })
588
+ Task({
589
+ subagent_type: 'code-reviewer',
590
+ model: 'opus',
591
+ prompt: '성능 검토: 수정이 성능에 미치는 영향 분석'
592
+ })
593
+ Task({
594
+ subagent_type: 'code-reviewer',
595
+ model: 'opus',
596
+ prompt: '회귀 검토: 다른 기능에 부작용 없는지 확인'
597
+ })
598
+ ```
599
+
600
+ ### Practical Examples (시간 비교 포함)
601
+
602
+ #### 예시 1: 여러 독립 버그 동시 수정
603
+
604
+ **상황:** 3개의 독립적인 버그 발견 (로그인, 결제, 프로필)
605
+
606
+ **순차 실행:**
607
+ ```typescript
608
+ // ❌ 순차 실행: 15-20분 소요
609
+ Task({
610
+ subagent_type: 'implementation-executor',
611
+ model: 'sonnet',
612
+ prompt: '로그인 버그 수정: 토큰 만료 처리 누락'
613
+ })
614
+ // 대기... (5-7분)
615
+
616
+ Task({
617
+ subagent_type: 'implementation-executor',
618
+ model: 'sonnet',
619
+ prompt: '결제 버그 수정: 금액 계산 오류'
620
+ })
621
+ // 대기... (5-7분)
622
+
623
+ Task({
624
+ subagent_type: 'implementation-executor',
625
+ model: 'sonnet',
626
+ prompt: '프로필 버그 수정: 이미지 업로드 실패'
627
+ })
628
+ // 대기... (5-7분)
629
+
630
+ // → 총 소요 시간: 15-20분
631
+ ```
632
+
633
+ **병렬 실행:**
634
+ ```typescript
635
+ // ✅ 병렬 실행: 5-7분 소요 (3배 빠름)
636
+ Task({
637
+ subagent_type: 'implementation-executor',
638
+ model: 'sonnet',
639
+ prompt: '로그인 버그 수정: src/auth/login.ts 토큰 만료 처리 추가'
640
+ })
641
+ Task({
642
+ subagent_type: 'implementation-executor',
643
+ model: 'sonnet',
644
+ prompt: '결제 버그 수정: src/payment/checkout.ts 금액 계산 로직 수정'
645
+ })
646
+ Task({
647
+ subagent_type: 'implementation-executor',
648
+ model: 'sonnet',
649
+ prompt: '프로필 버그 수정: src/routes/profile/-functions/upload.ts 파일 검증 추가'
650
+ })
651
+
652
+ // → 총 소요 시간: 5-7분 (동시 실행)
653
+ ```
654
+
655
+ #### 예시 2: 탐색 + 분석 + 수정 병렬
656
+
657
+ **상황:** 간헐적 타입 에러 발생, 원인 불명
658
+
659
+ **순차 실행:**
660
+ ```typescript
661
+ // ❌ 순차 실행: 20-25분 소요
662
+ Task({
663
+ subagent_type: 'explore',
664
+ model: 'haiku',
665
+ prompt: '타입 에러 발생 위치 및 조건 탐색'
666
+ })
667
+ // 대기... (5분)
668
+
669
+ Task({
670
+ subagent_type: 'architect',
671
+ model: 'sonnet',
672
+ prompt: '타입 에러 근본 원인 분석'
673
+ })
674
+ // 대기... (7분)
675
+
676
+ Task({
677
+ subagent_type: 'implementation-executor',
678
+ model: 'sonnet',
679
+ prompt: '타입 에러 수정'
680
+ })
681
+ // 대기... (8분)
682
+
683
+ // → 총 소요 시간: 20-25분
684
+ ```
685
+
686
+ **병렬 실행:**
687
+ ```typescript
688
+ // ✅ 병렬 실행: 10-12분 소요 (2배 빠름)
689
+ Task({
690
+ subagent_type: 'explore',
691
+ model: 'haiku',
692
+ prompt: '타입 에러 발생 위치, 재현 조건, 관련 파일 탐색'
693
+ })
694
+ Task({
695
+ subagent_type: 'architect',
696
+ model: 'sonnet',
697
+ prompt: '타입 정의 분석 및 근본 원인 파악'
698
+ })
699
+
700
+ // → 탐색 + 분석 결과 취합 후 수정 (10분)
701
+
702
+ Task({
703
+ subagent_type: 'implementation-executor',
704
+ model: 'sonnet',
705
+ prompt: '[탐색 결과 기반] 타입 정의 수정 및 사용처 업데이트'
706
+ })
707
+
708
+ // → 총 소요 시간: 10-12분
709
+ ```
710
+
711
+ #### 예시 3: 다중 파일 동일 버그 병렬 수정
712
+
713
+ **상황:** 10개 컴포넌트에서 동일한 패턴의 버그 발견 (React key prop 누락)
714
+
715
+ **순차 실행:**
716
+ ```typescript
717
+ // ❌ 순차 실행: 30-40분 소요
718
+ // 각 파일을 하나씩 수정... (10개 × 3-4분)
719
+
720
+ // → 총 소요 시간: 30-40분
721
+ ```
722
+
723
+ **병렬 실행:**
724
+ ```typescript
725
+ // ✅ 병렬 실행: 3-5분 소요 (10배 빠름)
726
+ Task({
727
+ subagent_type: 'implementation-executor',
728
+ model: 'haiku',
729
+ prompt: 'src/routes/posts/-components/PostList.tsx: key prop 추가'
730
+ })
731
+ Task({
732
+ subagent_type: 'implementation-executor',
733
+ model: 'haiku',
734
+ prompt: 'src/routes/comments/-components/CommentList.tsx: key prop 추가'
735
+ })
736
+ Task({
737
+ subagent_type: 'implementation-executor',
738
+ model: 'haiku',
739
+ prompt: 'src/routes/users/-components/UserList.tsx: key prop 추가'
740
+ })
741
+ // ... 10개 파일 동시 수정
742
+
743
+ // → 총 소요 시간: 3-5분 (동시 실행)
744
+ ```
745
+
746
+ #### 예시 4: 수정 후 다중 검증 병렬
747
+
748
+ **상황:** 보안 버그 수정 후 전체 검증 필요
749
+
750
+ **순차 실행:**
751
+ ```typescript
752
+ // ❌ 순차 실행: 25-30분 소요
753
+ Task({
754
+ subagent_type: 'implementation-executor',
755
+ model: 'sonnet',
756
+ prompt: 'SQL Injection 취약점 수정'
757
+ })
758
+ // 대기... (10분)
759
+
760
+ Task({
761
+ subagent_type: 'code-reviewer',
762
+ model: 'opus',
763
+ prompt: '보안 검토: 유사 취약점 확인'
764
+ })
765
+ // 대기... (8분)
766
+
767
+ Task({
768
+ subagent_type: 'code-reviewer',
769
+ model: 'opus',
770
+ prompt: '회귀 검토: 다른 기능 영향 확인'
771
+ })
772
+ // 대기... (7분)
773
+
774
+ // → 총 소요 시간: 25-30분
775
+ ```
776
+
777
+ **병렬 실행:**
778
+ ```typescript
779
+ // ✅ 병렬 실행: 15-18분 소요 (1.5배 빠름)
780
+ Task({
781
+ subagent_type: 'implementation-executor',
782
+ model: 'sonnet',
783
+ prompt: 'SQL Injection 취약점 수정: Prisma raw query 제거 및 ORM 사용'
784
+ })
785
+
786
+ // 수정 완료 후 동시 검증 (10분)
787
+ Task({
788
+ subagent_type: 'code-reviewer',
789
+ model: 'opus',
790
+ prompt: '보안 검토: 전체 코드베이스 SQL Injection 취약점 스캔'
791
+ })
792
+ Task({
793
+ subagent_type: 'code-reviewer',
794
+ model: 'opus',
795
+ prompt: '회귀 검토: 쿼리 변경으로 인한 성능/기능 영향 분석'
796
+ })
797
+ Task({
798
+ subagent_type: 'code-reviewer',
799
+ model: 'opus',
800
+ prompt: '접근성 검토: 에러 메시지 사용자 친화성 확인'
801
+ })
802
+
803
+ // → 총 소요 시간: 15-18분
804
+ ```
805
+
806
+ ### Bug Fix Workflow with Agents
807
+
808
+ | 단계 | 작업 | 에이전트 | 모델 | 병렬 실행 |
809
+ |------|------|---------|------|----------|
810
+ | 1 | 버그 재현 경로 탐색 | explore | haiku | ✅ (여러 영역) |
811
+ | 2 | 근본 원인 분석 | architect | sonnet/opus | ✅ (탐색과 동시) |
812
+ | 3 | 버그 수정 구현 | implementation-executor | sonnet | ✅ (독립 버그) |
813
+ | 4 | 린트/타입 수정 | lint-fixer | sonnet | ❌ (순차) |
814
+ | 5 | 코드 리뷰 | code-reviewer | opus | ✅ (다중 관점) |
815
+ | 6 | 테스트 실행 | implementation-executor | haiku | ✅ (unit/integration/e2e) |
816
+ | 7 | 문서화 | document-writer | haiku | ✅ (리포트/CHANGELOG) |
817
+
818
+ ### Checklist
819
+
820
+ 버그 수정 시 병렬 실행 체크리스트:
821
+
822
+ ```text
823
+ ✅ 여러 독립 버그 → 각 버그마다 별도 executor
824
+ ✅ 탐색 + 분석 → explore + architect 동시 실행
825
+ ✅ 다중 파일 수정 → 파일별 executor 병렬 실행
826
+ ✅ 수정 + 문서화 → executor + document-writer 동시 실행
827
+ ✅ 다중 검증 → 여러 code-reviewer 병렬 실행
828
+ ✅ 테스트 병렬화 → unit/integration/e2e 동시 실행
829
+ ✅ 모델 선택 → LOW: haiku / MEDIUM: sonnet / HIGH: opus
830
+ ✅ 심각도 확인 → CRITICAL은 즉시 수정 (병렬 금지)
831
+
832
+ ❌ 순차 의존성 있는 작업 → 병렬 실행 금지
833
+ ❌ 같은 파일 동시 수정 → 충돌 위험
834
+ ❌ CRITICAL 버그 → 병렬 금지, 즉시 수정
835
+ ```
836
+
837
+ ### Time Optimization Summary
838
+
839
+ | 작업 유형 | 순차 실행 | 병렬 실행 | 시간 절감 |
840
+ |----------|----------|----------|----------|
841
+ | 3개 독립 버그 수정 | 15-20분 | 5-7분 | **3배** |
842
+ | 탐색 + 분석 + 수정 | 20-25분 | 10-12분 | **2배** |
843
+ | 10개 파일 동일 버그 | 30-40분 | 3-5분 | **10배** |
844
+ | 수정 + 다중 검증 | 25-30분 | 15-18분 | **1.5배** |
845
+
846
+ **병렬 실행으로 평균 2-5배 빠른 버그 수정 가능.**
847
+
848
+ </parallel_agent_execution>
849
+
850
+ ---
851
+
852
+ <validation>
853
+
854
+ ## 검증 체크리스트
855
+
856
+ 실행 전 확인:
857
+
858
+ ```text
859
+ ✅ ARGUMENT 확인 (없으면 질문)
860
+ ✅ Sequential Thinking 최소 3단계
861
+ ✅ Task (Explore)로 코드 탐색
862
+ ✅ 원인 분석 명확히
863
+ ✅ 옵션 최소 2개, 권장 3개
864
+ ✅ 각 옵션에 장단점 명시
865
+ ✅ 수정 파일 위치 명시 (line 포함)
866
+ ```
867
+
868
+ 절대 금지:
869
+
870
+ ```text
871
+ ❌ ARGUMENT 없이 분석 시작
872
+ ❌ Sequential Thinking 3단계 미만
873
+ ❌ 코드 탐색 없이 추측으로 수정
874
+ ❌ 옵션 1개만 제시
875
+ ❌ 사용자 선택 없이 수정 시작
876
+ ❌ 수정 후 검증 생략
877
+ ❌ 장단점 없이 수정 방법만 나열
878
+ ```
879
+
880
+ </validation>
881
+
882
+ ---
883
+
884
+ <examples>
885
+
886
+ ## 실전 예시
887
+
888
+ ### 예시 1: 타입 에러
889
+
890
+ ```bash
891
+ 사용자: /bug-fix Property 'name' does not exist on type 'User'
892
+
893
+ 1. Sequential Thinking (3단계):
894
+ thought 1: "타입 에러 - 간단, User 타입 정의 확인"
895
+ thought 2: "User 타입 및 사용처 탐색 필요"
896
+ thought 3: "옵션 2개: 타입 정의 수정 vs 사용처 수정"
897
+
898
+ 2. Task 탐색:
899
+ Task (Explore): "User 타입 정의 위치 및 사용 파일 탐색"
900
+ → src/types/user.ts, src/components/UserProfile.tsx 파악
901
+
902
+ 3. 원인 분석:
903
+ User 타입에 name 속성 누락
904
+
905
+ 4. 옵션 제시:
906
+ 옵션 1: User 타입에 name 속성 추가 (추천)
907
+ - 장점: 근본 해결
908
+ - 단점: 없음
909
+
910
+ 옵션 2: 사용처에서 name 제거
911
+ - 장점: 빠른 수정
912
+ - 단점: 기능 손실
913
+
914
+ 5. 사용자 선택: 1
915
+
916
+ 6. Edit:
917
+ src/types/user.ts:3
918
+ + name: string;
919
+
920
+ 7. 검증:
921
+ npm run typecheck → 성공
922
+ ```
923
+
924
+ ### 예시 2: 런타임 에러
925
+
926
+ ```bash
927
+ 사용자: /bug-fix Cannot read property 'data' of undefined
928
+
929
+ 1. Sequential Thinking (5단계):
930
+ thought 1: "런타임 에러 - 보통 복잡도, null/undefined 체크 누락"
931
+ thought 2: "에러 발생 위치 파악 필요, 스택 트레이스 확인"
932
+ thought 3: "관련 코드 탐색: API 호출, 데이터 접근 패턴"
933
+ thought 4: "수정 방법: optional chaining, null 체크, 초기화"
934
+ thought 5: "optional chaining 추천 - 간결하고 안전"
935
+
936
+ 2. Task 탐색:
937
+ Task (Explore): "undefined 에러 발생 코드 및 데이터 흐름 분석"
938
+ → src/hooks/useUserData.ts:15, API 응답 체크 누락
939
+
940
+ 3. 원인 분석:
941
+ API 응답 실패 시 response가 undefined
942
+
943
+ 4. 옵션:
944
+ 옵션 1: optional chaining 사용 (추천)
945
+ 옵션 2: if 문으로 null 체크
946
+ 옵션 3: try-catch로 감싸기
947
+
948
+ 5. 선택 후 구현 → 검증
949
+ ```
950
+
951
+ ### 예시 3: 논리 오류
952
+
953
+ ```bash
954
+ 사용자: /bug-fix 사용자 목록이 중복으로 표시됨
955
+
956
+ 1. Sequential Thinking (5단계):
957
+ thought 1: "논리 오류 - 보통 복잡도, 상태 관리 이슈"
958
+ thought 2: "리렌더링 또는 데이터 fetch 중복 추측"
959
+ thought 3: "관련 컴포넌트 및 상태 관리 코드 탐색"
960
+ thought 4: "옵션: useEffect 의존성 수정, 중복 제거 로직 추가"
961
+ thought 5: "useEffect 의존성 수정 추천"
962
+
963
+ 2. Task 탐색:
964
+ Task (Explore): "사용자 목록 렌더링 컴포넌트 및 상태 관리"
965
+ → UserList.tsx, useEffect 의존성 배열 문제 발견
966
+
967
+ 3. 원인: useEffect 의존성 배열 누락으로 매번 fetch
968
+
969
+ 4. 옵션 제시 → 선택 → 구현 → 검증
970
+ ```
971
+
972
+ </examples>