@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.
- package/dist/index.js +163 -28
- package/package.json +1 -1
- package/templates/.claude/agents/analyst.md +6 -14
- package/templates/.claude/agents/architect.md +6 -14
- package/templates/.claude/agents/code-reviewer.md +8 -14
- package/templates/.claude/agents/dependency-manager.md +8 -14
- package/templates/.claude/agents/deployment-validator.md +8 -14
- package/templates/.claude/agents/designer.md +8 -0
- package/templates/.claude/agents/document-writer.md +6 -14
- package/templates/.claude/agents/explore.md +8 -3
- package/templates/.claude/agents/git-operator.md +63 -17
- package/templates/.claude/agents/implementation-executor.md +14 -37
- package/templates/.claude/agents/ko-to-en-translator.md +8 -13
- package/templates/.claude/agents/lint-fixer.md +8 -172
- package/templates/.claude/agents/planner.md +6 -14
- package/templates/.claude/agents/refactor-advisor.md +8 -14
- package/templates/.claude/commands/git-all.md +3 -167
- package/templates/.claude/commands/git-session.md +3 -71
- package/templates/.claude/commands/lint-fix.md +119 -82
- package/templates/.claude/commands/lint-init.md +2 -54
- package/templates/.claude/commands/pre-deploy.md +143 -82
- package/templates/.claude/commands/version-update.md +171 -66
- package/templates/.claude/instructions/agent-patterns/agent-coordination.md +208 -0
- package/templates/.claude/instructions/agent-patterns/index.md +264 -0
- package/templates/.claude/instructions/agent-patterns/model-routing.md +167 -0
- package/templates/.claude/instructions/agent-patterns/parallel-execution.md +91 -0
- package/templates/.claude/instructions/agent-patterns/read-parallelization.md +106 -0
- package/templates/.claude/instructions/index.md +350 -0
- package/templates/.claude/instructions/multi-agent/agent-roster.md +811 -0
- package/templates/.claude/{PARALLEL_AGENTS.md → instructions/multi-agent/coordination-guide.md} +27 -336
- package/templates/.claude/instructions/{parallel-agent-execution.md → multi-agent/execution-patterns.md} +127 -438
- package/templates/.claude/instructions/multi-agent/index.md +282 -0
- package/templates/.claude/instructions/multi-agent/performance-optimization.md +456 -0
- package/templates/.claude/instructions/tech-stack/design-standards.md +282 -0
- package/templates/.claude/instructions/tech-stack/index.md +70 -0
- package/templates/.claude/instructions/tech-stack/prisma-patterns.md +352 -0
- package/templates/.claude/instructions/tech-stack/tanstack-patterns.md +275 -0
- package/templates/.claude/instructions/validation/forbidden-patterns.md +281 -0
- package/templates/.claude/instructions/validation/index.md +32 -0
- package/templates/.claude/instructions/validation/required-behaviors.md +331 -0
- package/templates/.claude/instructions/validation/verification-checklist.md +318 -0
- package/templates/.claude/instructions/workflow-patterns/index.md +18 -0
- package/templates/.claude/instructions/workflow-patterns/phase-based-workflow.md +250 -0
- package/templates/.claude/instructions/workflow-patterns/sequential-thinking.md +217 -0
- package/templates/.claude/instructions/workflow-patterns/todowrite-pattern.md +215 -0
- package/templates/.claude/skills/bug-fix/SKILL.md +972 -0
- package/templates/.claude/skills/docs-creator/AGENTS.md +4 -1
- package/templates/.claude/skills/docs-creator/SKILL.md +258 -0
- package/templates/.claude/skills/docs-refactor/AGENTS.md +4 -1
- package/templates/.claude/skills/docs-refactor/SKILL.md +145 -0
- package/templates/.claude/skills/execute/SKILL.md +15 -242
- package/templates/.claude/skills/figma-to-code/AGENTS.md +4 -1
- package/templates/.claude/skills/figma-to-code/SKILL.md +306 -0
- package/templates/.claude/skills/global-uiux-design/AGENTS.md +4 -1
- package/templates/.claude/skills/global-uiux-design/SKILL.md +455 -125
- package/templates/.claude/skills/korea-uiux-design/AGENTS.md +4 -1
- package/templates/.claude/skills/korea-uiux-design/SKILL.md +461 -116
- package/templates/.claude/skills/nextjs-react-best-practices/SKILL.md +177 -0
- package/templates/.claude/skills/plan/SKILL.md +1102 -98
- package/templates/.claude/skills/prd/SKILL.md +367 -66
- package/templates/.claude/skills/ralph/AGENTS.md +4 -1
- package/templates/.claude/skills/ralph/SKILL.md +83 -0
- package/templates/.claude/skills/refactor/SKILL.md +1214 -0
- package/templates/.claude/skills/tanstack-start-react-best-practices/SKILL.md +149 -0
- package/templates/.claude/commands/bug-fix.md +0 -510
- package/templates/.claude/commands/refactor.md +0 -788
|
@@ -8,6 +8,12 @@ metadata:
|
|
|
8
8
|
adapted_for: tanstack-start
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
+
@../../instructions/agent-patterns/read-parallelization.md
|
|
12
|
+
@../../instructions/validation/forbidden-patterns.md
|
|
13
|
+
@../../instructions/validation/required-behaviors.md
|
|
14
|
+
@../../instructions/multi-agent/coordination-guide.md
|
|
15
|
+
@../../instructions/multi-agent/execution-patterns.md
|
|
16
|
+
|
|
11
17
|
# TanStack Start React 베스트 프랙티스
|
|
12
18
|
|
|
13
19
|
React와 TanStack Start 애플리케이션 성능 최적화 가이드. 7개 카테고리, 38개 규칙 포함. 영향도별 우선순위로 자동 리팩토링과 코드 생성 가이드 제공.
|
|
@@ -30,6 +36,149 @@ React와 TanStack Start 애플리케이션 성능 최적화 가이드. 7개 카
|
|
|
30
36
|
|
|
31
37
|
---
|
|
32
38
|
|
|
39
|
+
<parallel_agent_execution>
|
|
40
|
+
|
|
41
|
+
## 병렬 에이전트 실행
|
|
42
|
+
|
|
43
|
+
**ULTRAWORK MODE:** TanStack Start 최적화 작업 시 여러 규칙을 동시에 적용하여 5-15배 성능 향상.
|
|
44
|
+
|
|
45
|
+
### 기본 원칙
|
|
46
|
+
|
|
47
|
+
| 원칙 | 실행 방법 | 효과 |
|
|
48
|
+
|------|----------|------|
|
|
49
|
+
| **PARALLEL** | 독립 작업을 단일 메시지에서 동시 실행 | 5-15배 속도 향상 |
|
|
50
|
+
| **DELEGATE** | 전문 에이전트에게 즉시 위임 | 품질 향상, 컨텍스트 격리 |
|
|
51
|
+
| **SMART MODEL** | 복잡도별 모델 선택 (haiku/sonnet/opus) | 비용 최적화 |
|
|
52
|
+
|
|
53
|
+
### Phase별 에이전트 활용
|
|
54
|
+
|
|
55
|
+
| Phase | 작업 | 에이전트 | 병렬 실행 |
|
|
56
|
+
|-------|------|---------|----------|
|
|
57
|
+
| **1. 코드베이스 분석** | 라우트 구조, Server Functions, 컴포넌트 파악 | explore (haiku) | ✅ 여러 도메인 동시 탐색 |
|
|
58
|
+
| **2. 규칙 적용** | waterfall 제거, 번들 최적화, re-render 최적화 | implementation-executor (sonnet) | ✅ 독립 라우트/컴포넌트 동시 수정 |
|
|
59
|
+
| **3. 검증** | typecheck/lint/build, 성능/보안 리뷰 | lint-fixer (sonnet), code-reviewer (opus) | ❌ lint-fixer 순차, code-reviewer 병렬 |
|
|
60
|
+
| **4. 완료** | git commit | git-operator (sonnet) | ❌ 순차 |
|
|
61
|
+
|
|
62
|
+
### 에이전트별 역할
|
|
63
|
+
|
|
64
|
+
| 에이전트 | 모델 | TanStack Start 작업 | 병렬 실행 |
|
|
65
|
+
|---------|------|---------------------|----------|
|
|
66
|
+
| **explore** | haiku | 라우트/Server Functions/컴포넌트 구조 분석 | ✅ |
|
|
67
|
+
| **implementation-executor** | sonnet | 규칙 적용 (async-parallel, bundle-lazy-routes 등) | ✅ |
|
|
68
|
+
| **code-reviewer** | opus | 성능/보안 검토 (server-cache-lru, client-tanstack-query) | ✅ |
|
|
69
|
+
| **lint-fixer** | sonnet | tsc/eslint 에러 자동 수정 | ❌ (순차) |
|
|
70
|
+
|
|
71
|
+
### 실전 패턴
|
|
72
|
+
|
|
73
|
+
#### 패턴 1: 독립 라우트 병렬 최적화
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
// 시나리오: 여러 라우트에 async-parallel, bundle-lazy-routes 적용
|
|
77
|
+
|
|
78
|
+
// ❌ 순차 실행 (느림)
|
|
79
|
+
Task(subagent_type="implementation-executor", model="sonnet",
|
|
80
|
+
prompt="/posts 라우트 최적화: async-parallel, bundle-lazy-routes")
|
|
81
|
+
// 60초 대기
|
|
82
|
+
Task(subagent_type="implementation-executor", model="sonnet",
|
|
83
|
+
prompt="/users 라우트 최적화: async-parallel, bundle-lazy-routes")
|
|
84
|
+
// 총 120초
|
|
85
|
+
|
|
86
|
+
// ✅ 병렬 실행 (빠름)
|
|
87
|
+
Task(subagent_type="implementation-executor", model="sonnet",
|
|
88
|
+
prompt=`/posts 라우트 최적화:
|
|
89
|
+
- async-parallel: loader에서 Promise.all()
|
|
90
|
+
- bundle-lazy-routes: 무거운 컴포넌트 lazy()`)
|
|
91
|
+
|
|
92
|
+
Task(subagent_type="implementation-executor", model="sonnet",
|
|
93
|
+
prompt=`/users 라우트 최적화:
|
|
94
|
+
- async-parallel: loader에서 Promise.all()
|
|
95
|
+
- bundle-lazy-routes: 무거운 컴포넌트 lazy()`)
|
|
96
|
+
// 총 60초 (가장 긴 작업 기준)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### 패턴 2: Server Function + UI 동시 구현
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// 시나리오: 새 기능 추가 (API + UI + 테스트)
|
|
103
|
+
|
|
104
|
+
// ✅ Fan-Out: 병렬 실행
|
|
105
|
+
Task(subagent_type="implementation-executor", model="sonnet",
|
|
106
|
+
prompt=`createServerFn으로 Comment API 구현:
|
|
107
|
+
- getComments (GET)
|
|
108
|
+
- createComment (POST + inputValidator)
|
|
109
|
+
- server-parallel-fetching 적용`)
|
|
110
|
+
|
|
111
|
+
Task(subagent_type="designer", model="sonnet",
|
|
112
|
+
prompt=`Comment UI 구현:
|
|
113
|
+
- client-tanstack-query 사용
|
|
114
|
+
- rerender-memo로 최적화
|
|
115
|
+
- bundle-barrel-imports 준수 (직접 import)`)
|
|
116
|
+
|
|
117
|
+
Task(subagent_type="implementation-executor", model="sonnet",
|
|
118
|
+
prompt=`Comment 통합 테스트:
|
|
119
|
+
- API 테스트
|
|
120
|
+
- UI 테스트`)
|
|
121
|
+
|
|
122
|
+
// Fan-In: 결과 수집 후 통합
|
|
123
|
+
Read("functions/comments.ts")
|
|
124
|
+
Read("components/Comments.tsx")
|
|
125
|
+
Read("tests/comments.test.ts")
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### 패턴 3: 대규모 리팩토링 (배치 처리)
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
// 시나리오: 10개 컴포넌트에 rerender-memo, rerender-dependencies 적용
|
|
132
|
+
|
|
133
|
+
// ✅ 배치 처리 (토큰 70-90% 절감)
|
|
134
|
+
Task(subagent_type="implementation-executor", model="sonnet",
|
|
135
|
+
prompt=`다음 컴포넌트들에 re-render 최적화 적용:
|
|
136
|
+
|
|
137
|
+
파일 목록:
|
|
138
|
+
- components/UserList.tsx
|
|
139
|
+
- components/PostList.tsx
|
|
140
|
+
- ... (10개)
|
|
141
|
+
|
|
142
|
+
공통 규칙:
|
|
143
|
+
1. rerender-memo: 비싼 작업 → React.memo() 추출
|
|
144
|
+
2. rerender-dependencies: effect 의존성 → 원시값 사용
|
|
145
|
+
3. rerender-functional-setstate: setState → 함수형 업데이트
|
|
146
|
+
|
|
147
|
+
패턴:
|
|
148
|
+
❌ setItems([...items, newItem])
|
|
149
|
+
✅ setItems(curr => [...curr, newItem])`)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Model Routing
|
|
153
|
+
|
|
154
|
+
**원칙:** 작업 복잡도에 따라 모델 선택.
|
|
155
|
+
|
|
156
|
+
| 복잡도 | 모델 | TanStack Start 작업 예시 | 비용 | 속도 |
|
|
157
|
+
|--------|------|------------------------|------|------|
|
|
158
|
+
| **LOW** | haiku | 라우트 구조 파악, Server Functions 위치 확인 | 💰 | ⚡⚡⚡ |
|
|
159
|
+
| **MEDIUM** | sonnet | async-parallel 적용, bundle-lazy-routes 구현 | 💰💰 | ⚡⚡ |
|
|
160
|
+
| **HIGH** | opus | 아키텍처 설계, server-cache-lru 전략, 보안 검토 | 💰💰💰 | ⚡ |
|
|
161
|
+
|
|
162
|
+
### 체크리스트
|
|
163
|
+
|
|
164
|
+
**실행 전 확인:**
|
|
165
|
+
|
|
166
|
+
- [ ] 독립 작업 파악 → 병렬 실행 (여러 라우트, 컴포넌트)
|
|
167
|
+
- [ ] 10개 이상 유사 작업 → 배치 처리 (동일 규칙 적용)
|
|
168
|
+
- [ ] 복잡도별 모델 선택 (탐색=haiku, 구현=sonnet, 리뷰=opus)
|
|
169
|
+
- [ ] Phase별 실행 (분석 → 구현 → 검증 → 완료)
|
|
170
|
+
- [ ] 의존성 확인 (Server Function 완료 후 UI 통합)
|
|
171
|
+
|
|
172
|
+
**효율 목표:**
|
|
173
|
+
|
|
174
|
+
- 순차 실행 대비 5-15배 속도 향상
|
|
175
|
+
- 토큰 사용 70-90% 절감 (배치 처리)
|
|
176
|
+
- 병렬도 3-10개 (과도한 병렬 방지)
|
|
177
|
+
|
|
178
|
+
</parallel_agent_execution>
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
33
182
|
<categories>
|
|
34
183
|
|
|
35
184
|
## 카테고리별 우선순위
|
|
@@ -1,510 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: 버그 원인 분석 및 수정. sequential thinking 3-5 + Task (Explore) 필수.
|
|
3
|
-
allowed-tools: Read, Grep, Glob, Task, Edit, Bash(npm:*, yarn:*), mcp__sequential-thinking__sequentialthinking
|
|
4
|
-
argument-hint: <버그 설명 또는 에러 메시지>
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Bug Fix Command
|
|
8
|
-
|
|
9
|
-
> 버그 원인 분석, 수정 옵션 제시, 구현까지 처리하는 커맨드.
|
|
10
|
-
|
|
11
|
-
**버그 대상**: $ARGUMENTS
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<argument_validation>
|
|
16
|
-
|
|
17
|
-
## ARGUMENT 필수 확인
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
$ARGUMENTS 없음 → 즉시 질문:
|
|
21
|
-
|
|
22
|
-
"어떤 버그를 수정해야 하나요? 구체적으로 알려주세요.
|
|
23
|
-
|
|
24
|
-
예시:
|
|
25
|
-
- 에러 메시지 및 발생 위치
|
|
26
|
-
- 예상 동작 vs 실제 동작
|
|
27
|
-
- 재현 방법
|
|
28
|
-
- 관련 파일 경로"
|
|
29
|
-
|
|
30
|
-
$ARGUMENTS 있음 → 다음 단계 진행
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
</argument_validation>
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
<workflow>
|
|
38
|
-
|
|
39
|
-
## 실행 흐름
|
|
40
|
-
|
|
41
|
-
| 단계 | 작업 | 도구 |
|
|
42
|
-
|------|------|------|
|
|
43
|
-
| 1. 입력 확인 | ARGUMENT 검증, 없으면 질문 | - |
|
|
44
|
-
| 2. 복잡도 판단 | Sequential Thinking으로 분석 범위 결정 | sequentialthinking (1단계) |
|
|
45
|
-
| 3. 버그 재현 | 에러 재현, 관련 파일 파악 | Read/Grep/Glob |
|
|
46
|
-
| 4. 원인 분석 | Task (Explore)로 관련 코드 탐색 | Task (Explore) |
|
|
47
|
-
| 5. 옵션 도출 | 수정 방법 2-3개 도출 | sequentialthinking (2-4단계) |
|
|
48
|
-
| 6. 옵션 제시 | 장단점, 영향 범위 제시 | - |
|
|
49
|
-
| 7. 사용자 선택 | 수정 방법 선택 대기 | - |
|
|
50
|
-
| 8. 구현 | 선택된 방법으로 코드 수정 | Edit |
|
|
51
|
-
| 9. 검증 | 테스트 실행, 빌드 확인 | Bash |
|
|
52
|
-
|
|
53
|
-
</workflow>
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
<thinking_strategy>
|
|
58
|
-
|
|
59
|
-
## Sequential Thinking 가이드
|
|
60
|
-
|
|
61
|
-
### 복잡도 판단 (thought 1)
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
thought 1: 복잡도 판단
|
|
65
|
-
- 에러 유형: syntax/runtime/logic/type
|
|
66
|
-
- 영향 범위: 단일 파일 vs 다중 파일
|
|
67
|
-
- 의존성: 외부 라이브러리, API 연동
|
|
68
|
-
- 재현 가능성: 항상 발생 vs 간헐적
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### 복잡도별 전략
|
|
72
|
-
|
|
73
|
-
| 복잡도 | 사고 횟수 | 판단 기준 | 사고 패턴 |
|
|
74
|
-
|--------|----------|----------|------------|
|
|
75
|
-
| **간단** | 3 | 명확한 에러, 1-2 파일 | 복잡도 판단 → 원인 분석 → 수정 방법 |
|
|
76
|
-
| **보통** | 5 | 논리 오류, 3-5 파일 | 복잡도 판단 → 재현 → 원인 분석 → 옵션 비교 → 추천안 |
|
|
77
|
-
| **복잡** | 7+ | 간헐적 오류, 다중 모듈 | 복잡도 판단 → 재현 시도 → 심층 분석 → 옵션 탐색 → 비교 → 추천안 |
|
|
78
|
-
|
|
79
|
-
### 보통 복잡도 패턴 (5단계)
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
thought 1: 복잡도 판단 및 분석 범위
|
|
83
|
-
thought 2: 버그 재현 및 에러 메시지 분석
|
|
84
|
-
thought 3: 관련 코드 탐색 및 원인 파악
|
|
85
|
-
thought 4: 수정 방법 2-3개 비교 분석
|
|
86
|
-
thought 5: 최종 추천안 및 근거
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### 핵심 원칙
|
|
90
|
-
|
|
91
|
-
```text
|
|
92
|
-
✅ 사고 과정을 출력해야 실제로 생각이 일어남
|
|
93
|
-
✅ 복잡도가 불확실하면 높게 책정 (3→5로 확장 가능)
|
|
94
|
-
✅ 각 thought에서 구체적 분석 필요 (추상적 설명 금지)
|
|
95
|
-
✅ 필요 시 isRevision으로 이전 사고 수정
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
</thinking_strategy>
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
<exploration>
|
|
103
|
-
|
|
104
|
-
## Task (Explore) 활용
|
|
105
|
-
|
|
106
|
-
### 탐색 전략
|
|
107
|
-
|
|
108
|
-
| 버그 유형 | 탐색 대상 | prompt 예시 |
|
|
109
|
-
|----------|----------|-------------|
|
|
110
|
-
| **타입 에러** | 타입 정의, 사용처 | "타입 X 정의 위치 및 사용 파일 탐색" |
|
|
111
|
-
| **런타임 에러** | 함수 호출 체인 | "함수 Y 호출 경로 및 관련 파일" |
|
|
112
|
-
| **논리 오류** | 상태 관리, 데이터 흐름 | "상태 Z 변경 위치 및 영향 범위" |
|
|
113
|
-
| **API 에러** | 엔드포인트, 요청/응답 | "API /path 관련 코드 구조" |
|
|
114
|
-
|
|
115
|
-
### Task 호출 패턴
|
|
116
|
-
|
|
117
|
-
**단일 탐색:**
|
|
118
|
-
|
|
119
|
-
```typescript
|
|
120
|
-
Task({
|
|
121
|
-
subagent_type: 'Explore',
|
|
122
|
-
description: '에러 관련 코드 탐색',
|
|
123
|
-
prompt: `
|
|
124
|
-
에러 발생 관련 코드 구조 파악:
|
|
125
|
-
- 에러가 발생하는 정확한 위치
|
|
126
|
-
- 관련 함수/컴포넌트
|
|
127
|
-
- 의존하는 모듈/라이브러리
|
|
128
|
-
- 최근 수정 이력 (git blame)
|
|
129
|
-
`
|
|
130
|
-
})
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
**병렬 탐색 (복잡한 경우):**
|
|
134
|
-
|
|
135
|
-
```typescript
|
|
136
|
-
// 단일 메시지에 다중 Task 호출
|
|
137
|
-
Task({
|
|
138
|
-
subagent_type: 'Explore',
|
|
139
|
-
prompt: '프론트엔드 에러 발생 컴포넌트 분석'
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
Task({
|
|
143
|
-
subagent_type: 'Explore',
|
|
144
|
-
prompt: '백엔드 API 엔드포인트 분석'
|
|
145
|
-
})
|
|
146
|
-
|
|
147
|
-
Task({
|
|
148
|
-
subagent_type: 'Explore',
|
|
149
|
-
prompt: '타입 정의 및 인터페이스 분석'
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
// → 결과 취합 후 원인 파악
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### 탐색 체크리스트
|
|
156
|
-
|
|
157
|
-
```text
|
|
158
|
-
✅ 에러 발생 정확한 위치
|
|
159
|
-
✅ 관련 함수/클래스/컴포넌트
|
|
160
|
-
✅ 데이터 흐름 및 상태 변경
|
|
161
|
-
✅ 외부 의존성 (라이브러리, API)
|
|
162
|
-
✅ 최근 변경 사항 (git log/blame)
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
</exploration>
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
<option_presentation>
|
|
170
|
-
|
|
171
|
-
## 옵션 제시 형식
|
|
172
|
-
|
|
173
|
-
### 옵션 2-3개 제시
|
|
174
|
-
|
|
175
|
-
```markdown
|
|
176
|
-
## 버그 분석 결과
|
|
177
|
-
|
|
178
|
-
**원인:** [원인 설명]
|
|
179
|
-
|
|
180
|
-
**영향 범위:** [파일 및 모듈 목록]
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
### 옵션 1: [수정 방법] (추천)
|
|
185
|
-
|
|
186
|
-
**수정 내용:**
|
|
187
|
-
- 변경 사항 1
|
|
188
|
-
- 변경 사항 2
|
|
189
|
-
|
|
190
|
-
| 장점 | 단점 |
|
|
191
|
-
|------|------|
|
|
192
|
-
| 장점 1 | 단점 1 |
|
|
193
|
-
| 장점 2 | 단점 2 |
|
|
194
|
-
|
|
195
|
-
**수정 파일:**
|
|
196
|
-
- `src/file1.ts:line`
|
|
197
|
-
- `src/file2.ts:line`
|
|
198
|
-
|
|
199
|
-
**리스크:** 낮음
|
|
200
|
-
|
|
201
|
-
---
|
|
202
|
-
|
|
203
|
-
### 옵션 2: [수정 방법]
|
|
204
|
-
|
|
205
|
-
**수정 내용:**
|
|
206
|
-
...
|
|
207
|
-
|
|
208
|
-
| 장점 | 단점 |
|
|
209
|
-
|------|------|
|
|
210
|
-
| ... | ... |
|
|
211
|
-
|
|
212
|
-
**수정 파일:**
|
|
213
|
-
...
|
|
214
|
-
|
|
215
|
-
**리스크:** 중간
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
### 옵션 3: [수정 방법] (임시 해결)
|
|
220
|
-
|
|
221
|
-
**수정 내용:**
|
|
222
|
-
...
|
|
223
|
-
|
|
224
|
-
**리스크:** 높음 (근본 해결 아님)
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## 추천 및 근거
|
|
229
|
-
|
|
230
|
-
옵션 1을 추천합니다.
|
|
231
|
-
- 근거 1
|
|
232
|
-
- 근거 2
|
|
233
|
-
|
|
234
|
-
어떤 옵션으로 수정하시겠습니까? (1/2/3)
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
</option_presentation>
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
<implementation>
|
|
242
|
-
|
|
243
|
-
## 구현 가이드
|
|
244
|
-
|
|
245
|
-
### 수정 단계
|
|
246
|
-
|
|
247
|
-
```
|
|
248
|
-
1. 사용자 옵션 선택 대기
|
|
249
|
-
2. Edit 도구로 코드 수정
|
|
250
|
-
3. 수정 내용 설명
|
|
251
|
-
4. 테스트/빌드 실행 (선택)
|
|
252
|
-
5. 결과 확인
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### 수정 후 검증
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
# 타입 체크
|
|
259
|
-
npm run typecheck
|
|
260
|
-
# 또는
|
|
261
|
-
tsc --noEmit
|
|
262
|
-
|
|
263
|
-
# 테스트 실행
|
|
264
|
-
npm test
|
|
265
|
-
# 또는
|
|
266
|
-
npm test -- <관련 테스트 파일>
|
|
267
|
-
|
|
268
|
-
# 빌드 확인
|
|
269
|
-
npm run build
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### 검증 체크리스트
|
|
273
|
-
|
|
274
|
-
```text
|
|
275
|
-
✅ 에러 해결 확인
|
|
276
|
-
✅ 기존 기능 영향 없음
|
|
277
|
-
✅ 타입 에러 없음
|
|
278
|
-
✅ 테스트 통과
|
|
279
|
-
✅ 빌드 성공
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
</implementation>
|
|
283
|
-
|
|
284
|
-
---
|
|
285
|
-
|
|
286
|
-
<parallel_agent_execution>
|
|
287
|
-
|
|
288
|
-
## Parallel Agent Execution
|
|
289
|
-
|
|
290
|
-
### Recommended Agents
|
|
291
|
-
|
|
292
|
-
| Agent | Model | 용도 |
|
|
293
|
-
|-------|-------|------|
|
|
294
|
-
| **@explore** | haiku/sonnet | 버그 재현 경로 탐색 |
|
|
295
|
-
| **@architect** | sonnet | 버그 원인 분석 및 설계 논의 |
|
|
296
|
-
| **@implementation-executor** | sonnet | 버그 수정 구현 |
|
|
297
|
-
| **@code-reviewer** | haiku | 수정 후 검증 |
|
|
298
|
-
|
|
299
|
-
### Parallel Execution Patterns
|
|
300
|
-
|
|
301
|
-
**여러 버그 동시 수정:**
|
|
302
|
-
- 각 버그마다 별도 executor 할당
|
|
303
|
-
- 독립적인 파일/모듈 수정 시 병렬 실행
|
|
304
|
-
|
|
305
|
-
**탐색 + 분석 병렬:**
|
|
306
|
-
- explore와 architect 동시 실행
|
|
307
|
-
- 재현 경로 파악과 근본 원인 분석을 동시에 진행
|
|
308
|
-
|
|
309
|
-
**수정 + 문서화 병렬:**
|
|
310
|
-
- executor와 document-writer 동시 실행
|
|
311
|
-
- 코드 수정과 동시에 변경 사항 문서화
|
|
312
|
-
|
|
313
|
-
### Model Routing
|
|
314
|
-
|
|
315
|
-
| 복잡도 | 버그 유형 | 모델 |
|
|
316
|
-
|--------|----------|------|
|
|
317
|
-
| **LOW** | 단순 버그 (오타, 명백한 로직 오류) | haiku |
|
|
318
|
-
| **MEDIUM** | 일반 버그 (기능 오작동) | sonnet |
|
|
319
|
-
| **HIGH** | 복잡한 버그 (아키텍처, 성능) | opus |
|
|
320
|
-
|
|
321
|
-
### Practical Examples
|
|
322
|
-
|
|
323
|
-
**여러 버그 병렬 수정:**
|
|
324
|
-
|
|
325
|
-
```typescript
|
|
326
|
-
// ✅ 각 버그를 독립적으로 수정
|
|
327
|
-
Task({
|
|
328
|
-
subagent_type: 'implementation-executor',
|
|
329
|
-
model: 'sonnet',
|
|
330
|
-
prompt: '로그인 버그 수정: src/auth/login.ts에서 토큰 만료 처리 누락'
|
|
331
|
-
})
|
|
332
|
-
|
|
333
|
-
Task({
|
|
334
|
-
subagent_type: 'implementation-executor',
|
|
335
|
-
model: 'sonnet',
|
|
336
|
-
prompt: '결제 버그 수정: src/payment/checkout.ts에서 금액 계산 오류'
|
|
337
|
-
})
|
|
338
|
-
|
|
339
|
-
// → 두 버그가 동시에 수정됨
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
**탐색 + 분석 병렬:**
|
|
343
|
-
|
|
344
|
-
```typescript
|
|
345
|
-
// ✅ 재현과 분석을 동시에 진행
|
|
346
|
-
Task({
|
|
347
|
-
subagent_type: 'explore',
|
|
348
|
-
model: 'haiku',
|
|
349
|
-
prompt: '간헐적 500 에러 재현 경로 탐색 및 재현 조건 파악'
|
|
350
|
-
})
|
|
351
|
-
|
|
352
|
-
Task({
|
|
353
|
-
subagent_type: 'architect',
|
|
354
|
-
model: 'sonnet',
|
|
355
|
-
prompt: '500 에러 패턴 분석 및 근본 원인 파악 (로그, 스택 트레이스 기반)'
|
|
356
|
-
})
|
|
357
|
-
|
|
358
|
-
// → 탐색 결과와 분석 결과를 종합하여 수정 방향 결정
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
**복잡도별 모델 선택:**
|
|
362
|
-
|
|
363
|
-
```typescript
|
|
364
|
-
// ✅ LOW: 단순 오타 수정
|
|
365
|
-
Task({
|
|
366
|
-
subagent_type: 'implementation-executor',
|
|
367
|
-
model: 'haiku',
|
|
368
|
-
prompt: 'typo 수정: src/utils/format.ts의 함수명 오타'
|
|
369
|
-
})
|
|
370
|
-
|
|
371
|
-
// ✅ MEDIUM: 일반 버그 수정
|
|
372
|
-
Task({
|
|
373
|
-
subagent_type: 'implementation-executor',
|
|
374
|
-
model: 'sonnet',
|
|
375
|
-
prompt: '사용자 목록 중복 렌더링 버그 수정'
|
|
376
|
-
})
|
|
377
|
-
|
|
378
|
-
// ✅ HIGH: 복잡한 성능 이슈
|
|
379
|
-
Task({
|
|
380
|
-
subagent_type: 'architect',
|
|
381
|
-
model: 'opus',
|
|
382
|
-
prompt: 'N+1 쿼리 문제 분석 및 최적화 방안 설계'
|
|
383
|
-
})
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
</parallel_agent_execution>
|
|
387
|
-
|
|
388
|
-
---
|
|
389
|
-
|
|
390
|
-
<validation>
|
|
391
|
-
|
|
392
|
-
## 검증 체크리스트
|
|
393
|
-
|
|
394
|
-
실행 전 확인:
|
|
395
|
-
|
|
396
|
-
```text
|
|
397
|
-
✅ ARGUMENT 확인 (없으면 질문)
|
|
398
|
-
✅ Sequential Thinking 최소 3단계
|
|
399
|
-
✅ Task (Explore)로 코드 탐색
|
|
400
|
-
✅ 원인 분석 명확히
|
|
401
|
-
✅ 옵션 최소 2개, 권장 3개
|
|
402
|
-
✅ 각 옵션에 장단점 명시
|
|
403
|
-
✅ 수정 파일 위치 명시 (line 포함)
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
절대 금지:
|
|
407
|
-
|
|
408
|
-
```text
|
|
409
|
-
❌ ARGUMENT 없이 분석 시작
|
|
410
|
-
❌ Sequential Thinking 3단계 미만
|
|
411
|
-
❌ 코드 탐색 없이 추측으로 수정
|
|
412
|
-
❌ 옵션 1개만 제시
|
|
413
|
-
❌ 사용자 선택 없이 수정 시작
|
|
414
|
-
❌ 수정 후 검증 생략
|
|
415
|
-
❌ 장단점 없이 수정 방법만 나열
|
|
416
|
-
```
|
|
417
|
-
|
|
418
|
-
</validation>
|
|
419
|
-
|
|
420
|
-
---
|
|
421
|
-
|
|
422
|
-
<examples>
|
|
423
|
-
|
|
424
|
-
## 실전 예시
|
|
425
|
-
|
|
426
|
-
### 예시 1: 타입 에러
|
|
427
|
-
|
|
428
|
-
```bash
|
|
429
|
-
사용자: /bug-fix Property 'name' does not exist on type 'User'
|
|
430
|
-
|
|
431
|
-
1. Sequential Thinking (3단계):
|
|
432
|
-
thought 1: "타입 에러 - 간단, User 타입 정의 확인"
|
|
433
|
-
thought 2: "User 타입 및 사용처 탐색 필요"
|
|
434
|
-
thought 3: "옵션 2개: 타입 정의 수정 vs 사용처 수정"
|
|
435
|
-
|
|
436
|
-
2. Task 탐색:
|
|
437
|
-
Task (Explore): "User 타입 정의 위치 및 사용 파일 탐색"
|
|
438
|
-
→ src/types/user.ts, src/components/UserProfile.tsx 파악
|
|
439
|
-
|
|
440
|
-
3. 원인 분석:
|
|
441
|
-
User 타입에 name 속성 누락
|
|
442
|
-
|
|
443
|
-
4. 옵션 제시:
|
|
444
|
-
옵션 1: User 타입에 name 속성 추가 (추천)
|
|
445
|
-
- 장점: 근본 해결
|
|
446
|
-
- 단점: 없음
|
|
447
|
-
|
|
448
|
-
옵션 2: 사용처에서 name 제거
|
|
449
|
-
- 장점: 빠른 수정
|
|
450
|
-
- 단점: 기능 손실
|
|
451
|
-
|
|
452
|
-
5. 사용자 선택: 1
|
|
453
|
-
|
|
454
|
-
6. Edit:
|
|
455
|
-
src/types/user.ts:3
|
|
456
|
-
+ name: string;
|
|
457
|
-
|
|
458
|
-
7. 검증:
|
|
459
|
-
npm run typecheck → 성공
|
|
460
|
-
```
|
|
461
|
-
|
|
462
|
-
### 예시 2: 런타임 에러
|
|
463
|
-
|
|
464
|
-
```bash
|
|
465
|
-
사용자: /bug-fix Cannot read property 'data' of undefined
|
|
466
|
-
|
|
467
|
-
1. Sequential Thinking (5단계):
|
|
468
|
-
thought 1: "런타임 에러 - 보통 복잡도, null/undefined 체크 누락"
|
|
469
|
-
thought 2: "에러 발생 위치 파악 필요, 스택 트레이스 확인"
|
|
470
|
-
thought 3: "관련 코드 탐색: API 호출, 데이터 접근 패턴"
|
|
471
|
-
thought 4: "수정 방법: optional chaining, null 체크, 초기화"
|
|
472
|
-
thought 5: "optional chaining 추천 - 간결하고 안전"
|
|
473
|
-
|
|
474
|
-
2. Task 탐색:
|
|
475
|
-
Task (Explore): "undefined 에러 발생 코드 및 데이터 흐름 분석"
|
|
476
|
-
→ src/hooks/useUserData.ts:15, API 응답 체크 누락
|
|
477
|
-
|
|
478
|
-
3. 원인 분석:
|
|
479
|
-
API 응답 실패 시 response가 undefined
|
|
480
|
-
|
|
481
|
-
4. 옵션:
|
|
482
|
-
옵션 1: optional chaining 사용 (추천)
|
|
483
|
-
옵션 2: if 문으로 null 체크
|
|
484
|
-
옵션 3: try-catch로 감싸기
|
|
485
|
-
|
|
486
|
-
5. 선택 후 구현 → 검증
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
### 예시 3: 논리 오류
|
|
490
|
-
|
|
491
|
-
```bash
|
|
492
|
-
사용자: /bug-fix 사용자 목록이 중복으로 표시됨
|
|
493
|
-
|
|
494
|
-
1. Sequential Thinking (5단계):
|
|
495
|
-
thought 1: "논리 오류 - 보통 복잡도, 상태 관리 이슈"
|
|
496
|
-
thought 2: "리렌더링 또는 데이터 fetch 중복 추측"
|
|
497
|
-
thought 3: "관련 컴포넌트 및 상태 관리 코드 탐색"
|
|
498
|
-
thought 4: "옵션: useEffect 의존성 수정, 중복 제거 로직 추가"
|
|
499
|
-
thought 5: "useEffect 의존성 수정 추천"
|
|
500
|
-
|
|
501
|
-
2. Task 탐색:
|
|
502
|
-
Task (Explore): "사용자 목록 렌더링 컴포넌트 및 상태 관리"
|
|
503
|
-
→ UserList.tsx, useEffect 의존성 배열 문제 발견
|
|
504
|
-
|
|
505
|
-
3. 원인: useEffect 의존성 배열 누락으로 매번 fetch
|
|
506
|
-
|
|
507
|
-
4. 옵션 제시 → 선택 → 구현 → 검증
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
</examples>
|