@kood/claude-code 0.6.1 → 0.6.2

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 (24) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
  3. package/templates/.claude/instructions/agent-patterns/delegation-patterns.md +389 -0
  4. package/templates/.claude/instructions/context-optimization/phase-based-execution.md +410 -0
  5. package/templates/.claude/instructions/context-optimization/redundant-exploration-prevention.md +646 -0
  6. package/templates/.claude/instructions/context-optimization/sub-agent-distribution.md +476 -0
  7. package/templates/.claude/instructions/glossary.md +48 -0
  8. package/templates/.claude/instructions/project-context-template.md +453 -0
  9. package/templates/.claude/instructions/skill-integration.md +90 -0
  10. package/templates/.claude/instructions/sourcing/reliable-search.md +411 -0
  11. package/templates/.claude/instructions/validation/forbidden-patterns.md +47 -0
  12. package/templates/.claude/instructions/validation/required-behaviors.md +120 -0
  13. package/templates/.claude/instructions/validation/scope-completeness.md +367 -0
  14. package/templates/.claude/instructions/workflow-patterns/todowrite-pattern.md +2 -0
  15. package/templates/.claude/skills/brainstorm/SKILL.md +75 -672
  16. package/templates/.claude/skills/bug-fix/SKILL.md +9 -137
  17. package/templates/.claude/skills/docs-fetch/SKILL.md +64 -232
  18. package/templates/.claude/skills/elon-musk/SKILL.md +57 -310
  19. package/templates/.claude/skills/execute/SKILL.md +18 -397
  20. package/templates/.claude/skills/plan/SKILL.md +12 -986
  21. package/templates/.claude/skills/prd/SKILL.md +13 -1
  22. package/templates/.claude/skills/ralph/SKILL.md +15 -497
  23. package/templates/.claude/skills/refactor/SKILL.md +11 -655
  24. package/templates/.claude/skills/research/SKILL.md +20 -23
package/dist/index.js CHANGED
@@ -846,7 +846,7 @@ var init = async (options) => {
846
846
 
847
847
  // src/index.ts
848
848
  var program = new Command();
849
- program.name("claude-code").description("Claude Code documentation installer for projects").version("0.6.1");
849
+ program.name("claude-code").description("Claude Code documentation installer for projects").version("0.6.2");
850
850
  program.option(
851
851
  "-t, --template <names>",
852
852
  "template names (comma-separated: tanstack-start,hono)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kood/claude-code",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Claude Code documentation installer for projects",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",
@@ -0,0 +1,389 @@
1
+ # Agent Delegation Patterns (에이전트 위임 패턴)
2
+
3
+ **목적**: 스킬에서 공통으로 사용하는 에이전트 위임/병렬 실행 패턴 통합 참조
4
+
5
+ ---
6
+
7
+ ## Recommended Agents
8
+
9
+ ### Tier 1: 계획 및 분석
10
+
11
+ | Agent | 기본 모델 | 복잡 시 | 병렬 | 역할 |
12
+ |-------|----------|--------|------|------|
13
+ | **planner** | opus | opus | ❌ | 계획 수립, 검증 승인 |
14
+ | **analyst** | sonnet | opus | ✅ | 요구사항 분석, 가정 검증, 엣지 케이스 |
15
+ | **architect** | sonnet | opus | ✅ | 아키텍처 분석/설계 (READ-ONLY) |
16
+ | **critic** | opus | opus | ❌ | 계획 리뷰, OKAY/REJECT 판정 |
17
+
18
+ ### Tier 2: 실행 및 구현
19
+
20
+ | Agent | 기본 모델 | 복잡 시 | 병렬 | 역할 |
21
+ |-------|----------|--------|------|------|
22
+ | **implementation-executor** | sonnet | opus | ✅ | 기능 구현, 버그 수정 |
23
+ | **designer** | sonnet | opus | ✅ | UI/UX 구현 (Tailwind CSS) |
24
+ | **lint-fixer** | sonnet | sonnet | ✅ | tsc/eslint 오류 수정 |
25
+
26
+ ### Tier 3: 검증 및 지원
27
+
28
+ | Agent | 기본 모델 | 복잡 시 | 병렬 | 역할 |
29
+ |-------|----------|--------|------|------|
30
+ | **code-reviewer** | opus | opus | ✅ | 코드 품질/보안/성능 검토 (READ-ONLY) |
31
+ | **deployment-validator** | sonnet | sonnet | ❌ | typecheck/lint/build 검증 |
32
+ | **refactor-advisor** | sonnet | opus | ✅ | 리팩토링 조언 (READ-ONLY) |
33
+
34
+ ### Tier 4: 유틸리티
35
+
36
+ | Agent | 기본 모델 | 복잡 시 | 병렬 | 역할 |
37
+ |-------|----------|--------|------|------|
38
+ | **explore** | haiku | sonnet | ✅ | 코드베이스 탐색, 구조 파악 |
39
+ | **document-writer** | haiku | sonnet | ✅ | 기술 문서 작성 |
40
+ | **git-operator** | haiku | sonnet | ❌ | Git 커밋/푸시 (순차 필수) |
41
+ | **researcher** | sonnet | sonnet | ✅ | 외부 문서/API 조사 |
42
+ | **scientist** | sonnet | sonnet | ✅ | 데이터 분석, 통계 연구 |
43
+ | **dependency-manager** | sonnet | sonnet | ❌ | 의존성 분석/업데이트 (순차) |
44
+ | **ko-to-en-translator** | haiku | sonnet | ✅ | 한글→영어 번역 |
45
+ | **qa-tester** | sonnet | sonnet | ✅ | CLI/서비스 테스트 |
46
+ | **security-reviewer** | opus | opus | ✅ | 보안 취약점 검토 |
47
+ | **vision** | sonnet | sonnet | ✅ | 이미지/PDF 분석 |
48
+
49
+ ---
50
+
51
+ ## Agent Selection Decision Tree
52
+
53
+ ### 작업 유형별 에이전트 매핑
54
+
55
+ ```
56
+ 작업 유형 → 적합한 에이전트 (기본 모델)
57
+ ───────────────────────────────────────────────────────
58
+ 코드베이스 탐색 → explore (haiku)
59
+ 기능 구현 (CRUD/로직) → implementation-executor (sonnet)
60
+ UI/UX 구현 → designer (sonnet)
61
+ 보안/성능 검토 → code-reviewer (opus)
62
+ 계획 수립/검증 → planner (opus)
63
+ 문서 작성 (단순) → document-writer (haiku)
64
+ 문서 작성 (복잡) → document-writer (sonnet)
65
+ 아키텍처 분석/설계 → architect (sonnet/opus)
66
+ 요구사항 분석 → analyst (sonnet)
67
+ 외부 조사 → researcher (sonnet)
68
+ Git 작업 → git-operator (haiku)
69
+ 린트/타입 오류 수정 → lint-fixer (sonnet)
70
+ ```
71
+
72
+ ### 복잡도별 모델 선택
73
+
74
+ | 복잡도 | 파일 수 | 권장 모델 | 예시 |
75
+ |--------|---------|-----------|------|
76
+ | 낮음 | 1-3 | haiku | 단일 파일 탐색, 단순 문서 |
77
+ | 중간 | 4-10 | sonnet | 일반 기능 구현, UI 개발 |
78
+ | 높음 | 10+ | opus | 아키텍처 설계, 계획 수립 |
79
+ | 매우 높음 | - | opus | 보안 검토, 복잡한 리팩토링 |
80
+
81
+ ---
82
+
83
+ ## 위임 결정 기준
84
+
85
+ ### 에이전트에 위임하는 조건
86
+
87
+ 다음 중 **하나라도** 해당 시 위임:
88
+
89
+ | 조건 | 예시 |
90
+ |------|------|
91
+ | 독립적인 작업 | 백엔드 API + 프론트엔드 UI 동시 |
92
+ | 새 컨텍스트 필요 | 대규모 코드베이스 탐색 |
93
+ | 전문 지식 필요 | 보안 검토, 아키텍처 설계 |
94
+ | 10분 이상 예상 | 복잡한 기능 구현 |
95
+
96
+ ### 직접 처리하는 조건
97
+
98
+ | 조건 | 예시 |
99
+ |------|------|
100
+ | 간단한 파일 읽기/수정 | 1-2줄 Edit, 단일 Read |
101
+ | 즉각적인 명령어 | `git status`, `ls` |
102
+ | 순차 의존성 강한 작업 | A 결과가 B 입력 |
103
+
104
+ ---
105
+
106
+ ## Context Passing Standards
107
+
108
+ ### 에이전트 호출 시 전달 정보
109
+
110
+ 모든 에이전트 호출 시 다음 4가지 요소를 명확히 전달:
111
+
112
+ | 요소 | 설명 | 예시 |
113
+ |------|------|------|
114
+ | **목표 (What)** | 수행할 작업의 명확한 목적 | "인증 구조 분석", "User CRUD API 구현" |
115
+ | **범위 (Scope)** | 대상 디렉토리/파일/도메인 | `src/auth/`, `src/middleware/`, 최대 5개 파일 |
116
+ | **출력 (Output)** | 기대하는 결과 형식 | "핵심 파일 3개 + 500자 요약", "구현 코드 + 테스트" |
117
+ | **제약 (Constraints)** | 금지 사항, 제한 조건 | "구현 코드 수정 금지", "READ-ONLY", "기존 API 유지" |
118
+
119
+ ### 표준 프롬프트 템플릿
120
+
121
+ ```typescript
122
+ // ✅ 명확한 컨텍스트 전달
123
+ Task(subagent_type="explore",
124
+ model="haiku",
125
+ prompt=`
126
+ 목표: 인증 구조 분석
127
+ 범위: src/auth/, src/middleware/ (최대 10개 파일)
128
+ 출력: 핵심 파일 3개 + 아키텍처 요약 500자
129
+ 제약: 구현 코드 수정 금지, READ-ONLY
130
+ `)
131
+
132
+ // ✅ 구현 에이전트 호출
133
+ Task(subagent_type="implementation-executor",
134
+ model="sonnet",
135
+ prompt=`
136
+ 목표: User CRUD API 구현
137
+ 범위: src/api/users/, 신규 파일 생성 가능
138
+ 출력: createUser, getUser, updateUser, deleteUser 함수 + Zod 스키마
139
+ 제약: 기존 Prisma 스키마 유지, 트랜잭션 필수
140
+ `)
141
+
142
+ // ✅ 검토 에이전트 호출
143
+ Task(subagent_type="code-reviewer",
144
+ model="opus",
145
+ prompt=`
146
+ 목표: 보안 검토
147
+ 범위: src/api/users/mutations.ts (단일 파일)
148
+ 출력: 취약점 목록 + 심각도 (HIGH/MEDIUM/LOW) + 수정 권장사항
149
+ 제약: READ-ONLY, 구현 변경 금지
150
+ `)
151
+ ```
152
+
153
+ ### 잘못된 프롬프트 예시
154
+
155
+ ```typescript
156
+ // ❌ 모호한 지시
157
+ Task(subagent_type="explore",
158
+ prompt="인증 관련 코드 좀 봐줘")
159
+
160
+ // ❌ 범위 없음
161
+ Task(subagent_type="implementation-executor",
162
+ prompt="User API 만들어줘")
163
+
164
+ // ❌ 출력 형식 없음
165
+ Task(subagent_type="analyst",
166
+ prompt="이 코드 분석해줘")
167
+ ```
168
+
169
+ ### 컨텍스트 최적화 참조
170
+
171
+ 상세한 컨텍스트 압축 전략:
172
+ - `@../context-optimization/sub-agent-distribution.md` (하위 에이전트 컨텍스트 분산)
173
+ - 압축된 결과 형식, 토큰 효율화 패턴
174
+
175
+ ---
176
+
177
+ ## 병렬 실행 패턴
178
+
179
+ ### 패턴 1: 탐색 + 분석 병렬
180
+
181
+ 여러 영역을 동시에 조사할 때:
182
+
183
+ ```typescript
184
+ // 프론트엔드 + 백엔드 + DB 동시 탐색
185
+ Task(subagent_type="explore", model="haiku",
186
+ prompt="프론트엔드 인증 UI 및 상태 관리 구조 분석")
187
+ Task(subagent_type="explore", model="haiku",
188
+ prompt="백엔드 인증 API 엔드포인트 및 미들웨어 분석")
189
+ Task(subagent_type="architect", model="sonnet",
190
+ prompt="현재 인증 아키텍처 평가 및 개선점 도출")
191
+ ```
192
+
193
+ ### 패턴 2: 다중 옵션 병렬 분석
194
+
195
+ 여러 옵션을 동시에 평가:
196
+
197
+ ```typescript
198
+ // 옵션 A, B, C를 각각 다른 analyst에게
199
+ Task(subagent_type="analyst", model="sonnet",
200
+ prompt="옵션 A (Zustand) 분석: 장단점, 리스크")
201
+ Task(subagent_type="analyst", model="sonnet",
202
+ prompt="옵션 B (Jotai) 분석: 장단점, 리스크")
203
+ Task(subagent_type="analyst", model="sonnet",
204
+ prompt="옵션 C (Context API) 분석: 장단점, 리스크")
205
+ // → 결과 비교 후 최적 옵션 추천
206
+ ```
207
+
208
+ ### 패턴 3: 풀스택 병렬 구현
209
+
210
+ 백엔드 + 프론트엔드 + 문서를 동시에:
211
+
212
+ ```typescript
213
+ Task(subagent_type="implementation-executor", model="sonnet",
214
+ prompt="User API CRUD 구현")
215
+ Task(subagent_type="designer", model="sonnet",
216
+ prompt="User Profile UI 구현")
217
+ Task(subagent_type="document-writer", model="haiku",
218
+ prompt="User API 문서 작성")
219
+ ```
220
+
221
+ ### 패턴 4: 다중 관점 검증
222
+
223
+ 보안/성능/접근성을 동시에 검토:
224
+
225
+ ```typescript
226
+ Task(subagent_type="code-reviewer", model="opus",
227
+ prompt="보안 검토: XSS, SQL Injection, CSRF")
228
+ Task(subagent_type="code-reviewer", model="opus",
229
+ prompt="성능 검토: N+1 쿼리, 불필요한 리렌더")
230
+ Task(subagent_type="code-reviewer", model="opus",
231
+ prompt="접근성 검토: ARIA, 키보드 네비게이션")
232
+ ```
233
+
234
+ ### 패턴 5: 문서 병렬 생성
235
+
236
+ 여러 문서를 동시에 작성:
237
+
238
+ ```typescript
239
+ Task(subagent_type="document-writer", model="haiku",
240
+ prompt="OVERVIEW.md 작성")
241
+ Task(subagent_type="document-writer", model="sonnet",
242
+ prompt="IMPLEMENTATION.md 작성") // 복잡한 문서는 sonnet
243
+ Task(subagent_type="document-writer", model="haiku",
244
+ prompt="RISKS.md 작성")
245
+ Task(subagent_type="document-writer", model="haiku",
246
+ prompt="REFERENCES.md 작성")
247
+ ```
248
+
249
+ ### 패턴 6: 기술 조사 병렬
250
+
251
+ 외부 조사와 내부 분석을 동시에:
252
+
253
+ ```typescript
254
+ Task(subagent_type="researcher", model="sonnet",
255
+ prompt="WebSocket vs SSE 공식 문서 및 성능 비교 2026")
256
+ Task(subagent_type="analyst", model="sonnet",
257
+ prompt="현재 프로젝트에서 실시간 통신 요구사항 분석")
258
+ Task(subagent_type="explore", model="haiku",
259
+ prompt="기존 통신 관련 코드 탐색")
260
+ ```
261
+
262
+ ### 패턴 7: 리스크 평가 병렬
263
+
264
+ 기술/일정/비용 리스크를 동시에 평가:
265
+
266
+ ```typescript
267
+ Task(subagent_type="analyst", model="sonnet",
268
+ prompt="기술적 리스크: 호환성, 데이터 무결성")
269
+ Task(subagent_type="planner", model="opus",
270
+ prompt="일정 리스크: 병목 구간, 완충 시간")
271
+ Task(subagent_type="analyst", model="sonnet",
272
+ prompt="비용 리스크: 인프라 전환, ROI")
273
+ ```
274
+
275
+ ### 패턴 8: 계획 후 검증
276
+
277
+ 계획 완료 후 critic으로 검증:
278
+
279
+ ```typescript
280
+ // 계획 수립
281
+ Task(subagent_type="planner", model="opus",
282
+ prompt="인증 시스템 재설계 계획 수립")
283
+ // 계획 완료 후 → 검증
284
+ Task(subagent_type="critic", model="opus",
285
+ prompt=".claude/plan/00.인증_시스템/IMPLEMENTATION.md 검증")
286
+ ```
287
+
288
+ ---
289
+
290
+ ## 모델 선택 가이드
291
+
292
+ ```
293
+ 작업 시작
294
+
295
+ 파일 1-3개, 단순 CRUD? → haiku (explore, document-writer, git-operator)
296
+ 파일 4-10개, 일반 로직? → sonnet (implementation-executor, designer, analyst)
297
+ 파일 10개+, 아키텍처? → opus (planner, architect, code-reviewer)
298
+
299
+ 보안/성능 중요? → opus 승격
300
+ 비용 절감 필요? → haiku 강등 (단, 품질 확인)
301
+ ```
302
+
303
+ ---
304
+
305
+ ## 병렬 vs 순차 결정
306
+
307
+ | 조건 | 실행 방식 |
308
+ |------|----------|
309
+ | 독립적인 작업 | ✅ 병렬 |
310
+ | 다른 파일/영역 | ✅ 병렬 |
311
+ | 다른 도메인 (백엔드/프론트) | ✅ 병렬 |
312
+ | READ-ONLY 에이전트 여러 개 | ✅ 병렬 (안전) |
313
+ | 순차 의존성 (A→B) | ❌ 순차 |
314
+ | 같은 파일 수정 | ❌ 순차 |
315
+ | Git 작업 | ❌ 순차 |
316
+
317
+ ---
318
+
319
+ ## Failure Recovery
320
+
321
+ ### 에이전트 실패 시 복구 전략
322
+
323
+ | 실패 유형 | 증상 | 복구 전략 | 예시 |
324
+ |----------|------|----------|------|
325
+ | **타임아웃** | 작업 시간 초과 | 작업 범위 축소 후 재시도 | 10개 파일 → 3개 파일로 분할 |
326
+ | **잘못된 결과** | 요구사항 미충족, 오류 코드 | 다른 모델로 재시도 | haiku → sonnet → opus |
327
+ | **컨텍스트 초과** | 토큰 한계 도달 | 작업 분할 후 순차 실행 | 전체 탐색 → 도메인별 순차 탐색 |
328
+ | **병렬 충돌** | 같은 파일 동시 수정 | 순차 실행으로 전환 | 병렬 3개 → 순차 3번 |
329
+ | **의존성 오류** | A 작업 실패로 B 블록 | A 재시도 또는 수동 처리 | planner 실패 → 직접 계획 수립 |
330
+ | **모델 오버로드** | 너무 많은 병렬 작업 | 배치 크기 축소 (5개 → 3개) | 10개 병렬 → 3+3+4 순차 배치 |
331
+
332
+ ### 복구 흐름도
333
+
334
+ ```
335
+ 에이전트 실패 감지
336
+
337
+ 실패 유형 분석
338
+
339
+ ┌─────────────────┬─────────────────┬─────────────────┐
340
+ │ 타임아웃/초과 │ 잘못된 결과 │ 충돌 │
341
+ │ → 범위 축소 │ → 모델 승격 │ → 순차 전환 │
342
+ └─────────────────┴─────────────────┴─────────────────┘
343
+
344
+ 재시도 (최대 2회)
345
+
346
+ 실패 시 → 직접 처리 또는 사용자에게 보고
347
+ ```
348
+
349
+ ### 재시도 전략
350
+
351
+ ```typescript
352
+ // 1차 시도 (haiku)
353
+ Task(subagent_type="explore", model="haiku",
354
+ prompt="대규모 코드베이스 탐색")
355
+ // 실패 시 → 2차 시도 (sonnet + 범위 축소)
356
+ Task(subagent_type="explore", model="sonnet",
357
+ prompt="src/core/ 디렉토리만 탐색 (최대 5개 파일)")
358
+ // 실패 시 → 직접 처리
359
+ Read("src/core/index.ts")
360
+ Grep("export", glob="src/core/**/*.ts")
361
+ ```
362
+
363
+ ### 품질 검증
364
+
365
+ 에이전트 결과를 받은 후 즉시 검증:
366
+
367
+ | 항목 | 검증 방법 | 실패 시 조치 |
368
+ |------|----------|-------------|
369
+ | **파일 존재** | Read로 확인 | 재생성 요청 |
370
+ | **문법 오류** | tsc/eslint 실행 | lint-fixer 호출 |
371
+ | **요구사항** | 체크리스트 대조 | 구체적 피드백 + 재시도 |
372
+ | **충돌** | Git status 확인 | 수동 병합 |
373
+
374
+ ---
375
+
376
+ ## 체크리스트
377
+
378
+ 작업 시작 전 확인:
379
+
380
+ ```
381
+ [ ] 이 작업은 독립적인가? → 병렬 에이전트 고려
382
+ [ ] 새 컨텍스트 필요한가? → 에이전트 위임
383
+ [ ] 전문 지식 필요한가? → 도메인 에이전트 선택
384
+ [ ] 적절한 모델 선택했는가? (haiku/sonnet/opus)
385
+ [ ] 병렬 실행 수 3-5개 범위인가?
386
+ [ ] 결과 통합 계획 있는가?
387
+ [ ] 컨텍스트 전달 (목표/범위/출력/제약) 명확한가?
388
+ [ ] 실패 시 복구 전략 준비되었는가?
389
+ ```