@kood/claude-code 0.5.3 → 0.5.4
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 +548 -340
- package/package.json +1 -1
- package/templates/.claude/agents/document-writer.md +71 -304
- package/templates/.claude/instructions/agent-patterns/index.md +7 -7
- package/templates/.claude/instructions/document-templates/ralph-templates.md +71 -0
- package/templates/.claude/instructions/index.md +14 -14
- package/templates/.claude/instructions/multi-agent/agent-roster.md +14 -14
- package/templates/.claude/instructions/multi-agent/index.md +4 -4
- package/templates/.claude/skills/docs-creator/AGENTS.md +54 -176
- package/templates/.claude/skills/docs-creator/SKILL.md +97 -463
- package/templates/.claude/skills/docs-refactor/AGENTS.md +61 -190
- package/templates/.claude/skills/docs-refactor/SKILL.md +66 -442
- package/templates/.claude/skills/execute/SKILL.md +540 -13
- package/templates/.claude/skills/plan/SKILL.md +83 -17
- package/templates/.claude/skills/ralph/SKILL.md +17 -14
- package/templates/.claude/skills/refactor/AGENTS.md +269 -0
- package/templates/.claude/skills/refactor/SKILL.md +424 -66
- package/templates/.claude/skills/stitch-design/README.md +34 -0
- package/templates/.claude/skills/stitch-design/SKILL.md +213 -0
- package/templates/.claude/skills/stitch-design/examples/DESIGN.md +154 -0
- package/templates/.claude/skills/stitch-loop/README.md +54 -0
- package/templates/.claude/skills/stitch-loop/SKILL.md +316 -0
- package/templates/.claude/skills/stitch-loop/examples/SITE.md +73 -0
- package/templates/.claude/skills/stitch-loop/examples/next-prompt.md +25 -0
- package/templates/.claude/skills/stitch-loop/resources/baton-schema.md +61 -0
- package/templates/.claude/skills/stitch-loop/resources/site-template.md +104 -0
- package/templates/.claude/skills/stitch-react/README.md +36 -0
- package/templates/.claude/skills/stitch-react/SKILL.md +323 -0
- package/templates/.claude/skills/stitch-react/examples/gold-standard-card.tsx +88 -0
- package/templates/.claude/skills/stitch-react/package-lock.json +231 -0
- package/templates/.claude/skills/stitch-react/package.json +16 -0
- package/templates/.claude/skills/stitch-react/resources/architecture-checklist.md +15 -0
- package/templates/.claude/skills/stitch-react/resources/component-template.tsx +37 -0
- package/templates/.claude/skills/stitch-react/resources/stitch-api-reference.md +14 -0
- package/templates/.claude/skills/stitch-react/resources/style-guide.json +24 -0
- package/templates/.claude/skills/stitch-react/scripts/fetch-stitch.sh +30 -0
- package/templates/.claude/skills/stitch-react/scripts/validate.js +77 -0
|
@@ -3,7 +3,7 @@ name: docs-refactor
|
|
|
3
3
|
description: 기존 Claude Code 문서 개선. CLAUDE.md, SKILL.md, COMMAND.md 토큰 효율 50% 개선 및 명확성 강화.
|
|
4
4
|
metadata:
|
|
5
5
|
author: kood
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.2.0"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
@../../instructions/workflow-patterns/sequential-thinking.md
|
|
@@ -12,12 +12,10 @@ metadata:
|
|
|
12
12
|
|
|
13
13
|
# Docs Refactor Skill
|
|
14
14
|
|
|
15
|
-
> 기존
|
|
15
|
+
> 기존 문서 Anthropic 가이드라인 기반 50% 토큰 감소
|
|
16
16
|
|
|
17
17
|
<purpose>
|
|
18
|
-
|
|
19
|
-
**목표:** 토큰 효율 50% 개선, 명확성 향상, 유지보수성 강화
|
|
20
|
-
|
|
18
|
+
토큰 50% 감소, 명확성 향상, 유지보수성 강화
|
|
21
19
|
</purpose>
|
|
22
20
|
|
|
23
21
|
---
|
|
@@ -26,13 +24,13 @@ metadata:
|
|
|
26
24
|
|
|
27
25
|
| 상황 | 리팩토링 필요 |
|
|
28
26
|
|------|--------------|
|
|
29
|
-
| **토큰 과다** |
|
|
30
|
-
| **가독성 저하** | XML 태그
|
|
31
|
-
| **중복 발견** |
|
|
32
|
-
| **설명 과다** | 코드
|
|
27
|
+
| **토큰 과다** | 500줄 초과 |
|
|
28
|
+
| **가독성 저하** | XML 태그 미사용 |
|
|
29
|
+
| **중복 발견** | 2회 이상 반복 |
|
|
30
|
+
| **설명 과다** | 코드 < 설명 |
|
|
33
31
|
| **@imports 미사용** | 공통 규칙 반복 |
|
|
34
|
-
| **모호한 지시** | "적절히", "필요시"
|
|
35
|
-
| **부정형 과다** | Don't
|
|
32
|
+
| **모호한 지시** | "적절히", "필요시" |
|
|
33
|
+
| **부정형 과다** | Don't 위주 |
|
|
36
34
|
|
|
37
35
|
</trigger_conditions>
|
|
38
36
|
|
|
@@ -40,141 +38,24 @@ metadata:
|
|
|
40
38
|
|
|
41
39
|
<parallel_agent_execution>
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
**목표:** 여러 문서 동시 리팩토링, 대기 시간 최소화, 처리량 극대화.
|
|
46
|
-
|
|
47
|
-
### 기본 원칙
|
|
48
|
-
|
|
49
|
-
| 원칙 | 적용 방법 | 효과 |
|
|
50
|
-
|------|----------|------|
|
|
51
|
-
| **PARALLEL** | 독립 문서 동시 리팩토링 | 5-15배 속도 향상 |
|
|
52
|
-
| **DELEGATE** | 에이전트별 전문화 (분석/리팩토링/검증) | 품질 향상 |
|
|
53
|
-
| **SMART MODEL** | 복잡도별 모델 (haiku/sonnet/opus) | 비용 최적화 |
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
### Phase별 에이전트 활용
|
|
58
|
-
|
|
59
|
-
| Phase | 에이전트 | 모델 | 작업 | 병렬 |
|
|
60
|
-
|-------|---------|------|------|------|
|
|
61
|
-
| **1. 분석** | explore | haiku | 여러 문서 구조 분석 | ✅ |
|
|
62
|
-
| **2. 리팩토링** | document-writer | sonnet | 독립 문서 개선 | ✅ |
|
|
63
|
-
| **3. 검증** | analyst | sonnet | 토큰 감소 확인 | ✅ |
|
|
64
|
-
| **4. 리뷰** | code-reviewer | opus | 정보 손실 체크 | ✅ |
|
|
65
|
-
|
|
66
|
-
---
|
|
67
|
-
|
|
68
|
-
### 실전 패턴
|
|
69
|
-
|
|
70
|
-
### Read 도구 병렬화
|
|
71
|
-
|
|
72
|
-
**프로젝트 분석 시 파일 병렬 읽기:**
|
|
73
|
-
|
|
74
|
-
```typescript
|
|
75
|
-
// ❌ 순차 읽기 (느림)
|
|
76
|
-
Read({ file_path: "src/file1.ts" })
|
|
77
|
-
// 대기...
|
|
78
|
-
Read({ file_path: "src/file2.ts" })
|
|
79
|
-
|
|
80
|
-
// ✅ 병렬 읽기 (빠름)
|
|
81
|
-
Read({ file_path: "src/file1.ts" })
|
|
82
|
-
Read({ file_path: "src/file2.ts" })
|
|
83
|
-
Read({ file_path: "src/file3.ts" })
|
|
84
|
-
Read({ file_path: "docs/api.md" })
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
**복잡한 탐색은 explore 에이전트 활용:**
|
|
88
|
-
|
|
89
|
-
```typescript
|
|
90
|
-
// 여러 영역 동시 탐색
|
|
91
|
-
Task(subagent_type="explore", model="haiku",
|
|
92
|
-
prompt="영역 1 파일 구조 및 패턴 분석")
|
|
93
|
-
Task(subagent_type="explore", model="haiku",
|
|
94
|
-
prompt="영역 2 의존성 및 관계 분석")
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
---
|
|
41
|
+
@../docs-creator/SKILL.md#parallel_agent_execution
|
|
98
42
|
|
|
99
|
-
|
|
43
|
+
**리팩토링 특화:**
|
|
100
44
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
Task(subagent_type="document-writer", model="sonnet",
|
|
107
|
-
prompt="@.claude/skills/refactor/SKILL.md 리팩토링 (50% 토큰 감소)")
|
|
108
|
-
|
|
109
|
-
Task(subagent_type="document-writer", model="sonnet",
|
|
110
|
-
prompt="@.claude/skills/feature-add/SKILL.md 리팩토링 (50% 토큰 감소)")
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
**효과:** 순차 180초 → 병렬 60초 (3배 향상)
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
#### Pattern 2: 분석 + 리팩토링 동시
|
|
45
|
+
| 작업 | 패턴 | 효과 |
|
|
46
|
+
|------|------|------|
|
|
47
|
+
| **독립 문서** | 병렬 document-writer | 3-4배 향상 |
|
|
48
|
+
| **@imports 추출** | 분석 + 공통화 병렬 | 70-90% 절감 |
|
|
49
|
+
| **배치 처리** | 동일 패턴 여러 문서 | 순차 대비 3배 |
|
|
118
50
|
|
|
119
51
|
```typescript
|
|
120
|
-
//
|
|
52
|
+
// 여러 SKILL.md 동시 리팩토링 (순차 180초 → 병렬 60초)
|
|
121
53
|
Task(subagent_type="document-writer", model="sonnet",
|
|
122
|
-
prompt="
|
|
123
|
-
|
|
124
|
-
Task(subagent_type="explore", model="haiku",
|
|
125
|
-
prompt="다음 COMMAND.md 구조 분석 및 중복 식별")
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
#### Pattern 3: 배치 처리
|
|
131
|
-
|
|
132
|
-
```typescript
|
|
133
|
-
// 동일 패턴 여러 문서 (토큰 70-90% 절감)
|
|
54
|
+
prompt="@.claude/skills/bug-fix/SKILL.md 리팩토링 (50% 감소)")
|
|
134
55
|
Task(subagent_type="document-writer", model="sonnet",
|
|
135
|
-
prompt
|
|
136
|
-
|
|
137
|
-
파일 목록:
|
|
138
|
-
- projects/project-a/CLAUDE.md
|
|
139
|
-
- projects/project-b/CLAUDE.md
|
|
140
|
-
- projects/project-c/CLAUDE.md
|
|
141
|
-
|
|
142
|
-
공통 규칙:
|
|
143
|
-
1. @imports 분리
|
|
144
|
-
2. tech_stack 표 형식
|
|
145
|
-
3. quick_patterns 코드만
|
|
146
|
-
4. 50% 토큰 감소`)
|
|
56
|
+
prompt="@.claude/skills/refactor/SKILL.md 리팩토링 (50% 감소)")
|
|
147
57
|
```
|
|
148
58
|
|
|
149
|
-
---
|
|
150
|
-
|
|
151
|
-
### Model Routing
|
|
152
|
-
|
|
153
|
-
| 작업 | 모델 | 이유 |
|
|
154
|
-
|------|------|------|
|
|
155
|
-
| **구조 분석** | haiku | 빠르고 저렴 |
|
|
156
|
-
| **리팩토링** | sonnet | 일반 품질 |
|
|
157
|
-
| **검증/리뷰** | opus | 정보 손실 방지 |
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
### 체크리스트
|
|
162
|
-
|
|
163
|
-
**병렬 실행 전:**
|
|
164
|
-
- [ ] 문서 독립적인가?
|
|
165
|
-
- [ ] 3개 이상 문서인가?
|
|
166
|
-
- [ ] 동일 패턴 적용 가능한가?
|
|
167
|
-
|
|
168
|
-
**실행 중:**
|
|
169
|
-
- [ ] 단일 메시지에서 다중 Tool 호출
|
|
170
|
-
- [ ] 복잡도별 모델 선택
|
|
171
|
-
- [ ] TaskList로 진행 상황 모니터링
|
|
172
|
-
|
|
173
|
-
**실행 후:**
|
|
174
|
-
- [ ] 각 문서 50% 토큰 감소 확인
|
|
175
|
-
- [ ] 정보 손실 없는지 검증
|
|
176
|
-
- [ ] XML 태그 중첩 오류 확인
|
|
177
|
-
|
|
178
59
|
</parallel_agent_execution>
|
|
179
60
|
|
|
180
61
|
---
|
|
@@ -208,203 +89,45 @@ Task(subagent_type="document-writer", model="sonnet",
|
|
|
208
89
|
|
|
209
90
|
<refactoring_patterns>
|
|
210
91
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
파일을 읽을 때는 Read 도구를 사용하세요. 파일을 수정할 때는 Edit...
|
|
218
|
-
|
|
219
|
-
✅ After (25 토큰):
|
|
220
|
-
| 작업 | 도구 |
|
|
221
|
-
|------|------|
|
|
222
|
-
| 읽기 | Read |
|
|
223
|
-
| 수정 | Edit |
|
|
224
|
-
| 생성 | Write |
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
---
|
|
228
|
-
|
|
229
|
-
### Pattern 2: 중복 내용 → @imports
|
|
230
|
-
|
|
231
|
-
**절약:** 70-80%
|
|
232
|
-
|
|
233
|
-
```markdown
|
|
234
|
-
❌ Before (각 파일 150 토큰):
|
|
235
|
-
Git 커밋: "Co-Authored-By:" 금지, 한 줄, 이모지 금지...
|
|
236
|
-
(CLAUDE.md, SKILL.md에 동일 내용 반복)
|
|
237
|
-
|
|
238
|
-
✅ After (각 파일 10 토큰):
|
|
239
|
-
# CLAUDE.md
|
|
240
|
-
@instructions/git-rules.md
|
|
241
|
-
|
|
242
|
-
# git-rules.md (60 토큰, 공유)
|
|
243
|
-
<git_commit>
|
|
244
|
-
| 규칙 | 설명 |
|
|
245
|
-
|------|------|
|
|
246
|
-
| **형식** | `<prefix>: <설명>` |
|
|
247
|
-
| **금지** | 이모지, "Co-Authored-By:" |
|
|
248
|
-
</git_commit>
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
---
|
|
252
|
-
|
|
253
|
-
### Pattern 3: XML 태그 미사용 → 구조화
|
|
254
|
-
|
|
255
|
-
**절약:** 30-40%
|
|
256
|
-
|
|
257
|
-
```markdown
|
|
258
|
-
❌ Before (120 토큰):
|
|
259
|
-
절대 하지 말 것: any 타입, 불필요한 추상화
|
|
260
|
-
반드시 할 것: 명시적 return type, const 함수
|
|
261
|
-
|
|
262
|
-
✅ After (75 토큰):
|
|
263
|
-
<forbidden>
|
|
264
|
-
| 분류 | 금지 |
|
|
265
|
-
|------|------|
|
|
266
|
-
| **타입** | any |
|
|
267
|
-
| **구조** | 불필요한 추상화 |
|
|
268
|
-
</forbidden>
|
|
92
|
+
| 패턴 | Before | After | 절약 |
|
|
93
|
+
|------|--------|-------|------|
|
|
94
|
+
| **설명 → 표** | 장황한 설명문 (80 토큰) | 표 형식 (25 토큰) | 69% |
|
|
95
|
+
| **중복 → @imports** | 각 파일 반복 (150 토큰) | @imports (10 토큰) | 93% |
|
|
96
|
+
| **설명 → 코드** | 설명 중심 (180 토큰) | 코드 예시 (65 토큰) | 64% |
|
|
97
|
+
| **부정 → 긍정** | Don't 나열 (100 토큰) | required 표 (70 토큰) | 30% |
|
|
269
98
|
|
|
270
|
-
|
|
271
|
-
| 분류 | 필수 |
|
|
272
|
-
|------|------|
|
|
273
|
-
| **타입** | 명시적 return type |
|
|
274
|
-
| **선언** | const 함수 |
|
|
275
|
-
</required>
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
### Pattern 4: 설명 과다 → 코드 예시
|
|
281
|
-
|
|
282
|
-
**절약:** 50-60%
|
|
283
|
-
|
|
284
|
-
```markdown
|
|
285
|
-
❌ Before (180 토큰):
|
|
286
|
-
Server Function을 만들 때는 createServerFn을 사용합니다.
|
|
287
|
-
method를 지정하고, 인증이 필요하면 middleware를...
|
|
288
|
-
|
|
289
|
-
✅ After (65 토큰):
|
|
290
|
-
```typescript
|
|
291
|
-
// POST + Validation + Auth
|
|
292
|
-
export const createUser = createServerFn({ method: 'POST' })
|
|
293
|
-
.middleware([authMiddleware])
|
|
294
|
-
.inputValidator(schema)
|
|
295
|
-
.handler(async ({ data }) => ...)
|
|
296
|
-
```
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
---
|
|
300
|
-
|
|
301
|
-
### Pattern 5: 부정형 → 긍정형
|
|
302
|
-
|
|
303
|
-
**절약:** 20-30%
|
|
304
|
-
|
|
305
|
-
```markdown
|
|
306
|
-
❌ Before (100 토큰):
|
|
307
|
-
Don't use any type
|
|
308
|
-
Don't create unnecessary abstractions
|
|
309
|
-
Don't skip validation
|
|
310
|
-
|
|
311
|
-
✅ After (70 토큰):
|
|
312
|
-
<required>
|
|
313
|
-
| 분류 | 필수 |
|
|
314
|
-
|------|------|
|
|
315
|
-
| **타입** | 명시적 타입 (unknown) |
|
|
316
|
-
| **구조** | 직접적 코드 |
|
|
317
|
-
| **검증** | inputValidator 사용 |
|
|
318
|
-
</required>
|
|
319
|
-
```
|
|
99
|
+
**우선순위:** @imports > 표 > 코드 > 긍정형
|
|
320
100
|
|
|
321
101
|
</refactoring_patterns>
|
|
322
102
|
|
|
323
103
|
---
|
|
324
104
|
|
|
325
|
-
<
|
|
326
|
-
|
|
327
|
-
| 문서 유형 | 최우선 작업 | 절약 효과 |
|
|
328
|
-
|----------|------------|----------|
|
|
329
|
-
| **CLAUDE.md** | @imports 분리 → tech_stack 표 형식 → quick_patterns 코드만 | 60-70% |
|
|
330
|
-
| **SKILL.md** | trigger_conditions 표 → workflow 코드 블록 → 설명 제거 | 65-75% |
|
|
331
|
-
| **COMMAND.md** | purpose 1-2문장 → workflow bash 코드 → examples ✅/❌ | 55-65% |
|
|
332
|
-
|
|
333
|
-
**공통 체크리스트:**
|
|
334
|
-
- [ ] XML 태그로 모든 섹션 구분
|
|
335
|
-
- [ ] 표 형식 최대 활용
|
|
336
|
-
- [ ] 코드 예시 중심
|
|
337
|
-
- [ ] 라이브러리 버전 명시
|
|
338
|
-
- [ ] @imports로 중복 제거
|
|
339
|
-
|
|
340
|
-
</document_type_strategies>
|
|
341
|
-
|
|
342
|
-
---
|
|
343
|
-
|
|
344
|
-
<token_optimization>
|
|
105
|
+
<strategies>
|
|
345
106
|
|
|
346
|
-
|
|
|
347
|
-
|
|
348
|
-
|
|
|
349
|
-
|
|
|
350
|
-
|
|
|
351
|
-
| **코드 우선** | 설명 + 코드 → 코드만 | 50% |
|
|
352
|
-
| **공백 제거** | 빈 줄 최소화 | 10% |
|
|
353
|
-
| **예시 통합** | 개별 예시 → 통합 코드 블록 | 60% |
|
|
107
|
+
| 문서 | 최우선 | 절약 |
|
|
108
|
+
|------|--------|------|
|
|
109
|
+
| **CLAUDE.md** | @imports → tech_stack 표 → quick_patterns 코드 | 60-70% |
|
|
110
|
+
| **SKILL.md** | trigger_conditions 표 → workflow 간소화 → 설명 제거 | 65-75% |
|
|
111
|
+
| **COMMAND.md** | purpose 1문장 → workflow bash → examples ✅/❌ | 55-65% |
|
|
354
112
|
|
|
355
|
-
|
|
356
|
-
-
|
|
357
|
-
-
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
- [ ] @imports 중복 제거
|
|
113
|
+
**기법:**
|
|
114
|
+
- 단어: "사용해야 합니다" → "사용" (80%)
|
|
115
|
+
- 구조: 리스트 → 표 (40%)
|
|
116
|
+
- 반복: @imports (70%)
|
|
117
|
+
- 우선: 설명 → 코드 (50%)
|
|
361
118
|
|
|
362
|
-
</
|
|
119
|
+
</strategies>
|
|
363
120
|
|
|
364
121
|
---
|
|
365
122
|
|
|
366
123
|
<workflow>
|
|
367
124
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
- [ ] 중복 내용 표시
|
|
375
|
-
</checklist>
|
|
376
|
-
</step>
|
|
377
|
-
|
|
378
|
-
<step number="2">
|
|
379
|
-
<action>리팩토링 계획</action>
|
|
380
|
-
<priority>
|
|
381
|
-
1. 중복 → @imports 분리
|
|
382
|
-
2. XML 태그 구조화
|
|
383
|
-
3. 표 형식 변환
|
|
384
|
-
4. 코드 중심 전환
|
|
385
|
-
5. 긍정형 변환
|
|
386
|
-
</priority>
|
|
387
|
-
</step>
|
|
388
|
-
|
|
389
|
-
<step number="3">
|
|
390
|
-
<action>리팩토링 실행</action>
|
|
391
|
-
<guidelines>
|
|
392
|
-
- Pattern 1-5 적용
|
|
393
|
-
- 문서 유형별 전략 사용
|
|
394
|
-
- 토큰 최적화 기법 적용
|
|
395
|
-
</guidelines>
|
|
396
|
-
</step>
|
|
397
|
-
|
|
398
|
-
<step number="4">
|
|
399
|
-
<action>검증</action>
|
|
400
|
-
<validation>
|
|
401
|
-
- [ ] 토큰 50% 감소 확인
|
|
402
|
-
- [ ] 핵심 정보 보존 확인
|
|
403
|
-
- [ ] XML 태그 중첩 확인
|
|
404
|
-
- [ ] 코드 블록 짝수 확인
|
|
405
|
-
- [ ] 부정형 5개 미만
|
|
406
|
-
</validation>
|
|
407
|
-
</step>
|
|
125
|
+
| Step | 작업 | 도구/방법 |
|
|
126
|
+
|------|------|----------|
|
|
127
|
+
| **1** | 분석 (Read → `wc -w` → 유형 확인 → 중복 식별) | Read, Bash |
|
|
128
|
+
| **2** | 계획 (@imports → XML → 표 → 코드 → 긍정형) | - |
|
|
129
|
+
| **3** | 실행 (패턴 적용, 문서별 전략) | Edit |
|
|
130
|
+
| **4** | 검증 (50% 감소, 정보 보존, XML, 코드 블록, 부정형 < 5) | Bash, 수동 |
|
|
408
131
|
|
|
409
132
|
</workflow>
|
|
410
133
|
|
|
@@ -412,7 +135,7 @@ Don't skip validation
|
|
|
412
135
|
|
|
413
136
|
<examples>
|
|
414
137
|
|
|
415
|
-
|
|
138
|
+
## CLAUDE.md 리팩토링
|
|
416
139
|
|
|
417
140
|
**Before (650 토큰):**
|
|
418
141
|
```markdown
|
|
@@ -425,19 +148,15 @@ Server Function을 만들 때는 createServerFn을 사용해야 합니다...
|
|
|
425
148
|
Git 커밋 시에는 반드시 다음 규칙을 따라야 합니다:
|
|
426
149
|
- 한 줄 커밋 메시지만 사용
|
|
427
150
|
- 이모지 사용 금지...
|
|
428
|
-
|
|
429
|
-
TypeScript는 5.x 버전을 사용하고...
|
|
430
151
|
```
|
|
431
152
|
|
|
432
153
|
**After (280 토큰):**
|
|
433
154
|
```markdown
|
|
434
|
-
# CLAUDE.md - TanStack Start
|
|
155
|
+
# CLAUDE.md - TanStack Start
|
|
435
156
|
|
|
436
157
|
<instructions>
|
|
437
158
|
@.claude/instructions/git-rules.md
|
|
438
159
|
@docs/library/tanstack-start/index.md
|
|
439
|
-
@docs/library/prisma/index.md
|
|
440
|
-
@docs/library/zod/index.md
|
|
441
160
|
</instructions>
|
|
442
161
|
|
|
443
162
|
---
|
|
@@ -445,138 +164,51 @@ TypeScript는 5.x 버전을 사용하고...
|
|
|
445
164
|
<forbidden>
|
|
446
165
|
| 분류 | 금지 |
|
|
447
166
|
|------|------|
|
|
448
|
-
| **Server Function** | handler 내부 수동 검증/인증 |
|
|
449
167
|
| **타입** | any (unknown 사용) |
|
|
450
168
|
</forbidden>
|
|
451
169
|
|
|
452
170
|
---
|
|
453
171
|
|
|
454
|
-
<required>
|
|
455
|
-
| 분류 | 필수 |
|
|
456
|
-
|------|------|
|
|
457
|
-
| **Server Function** | POST/PUT → inputValidator + middleware |
|
|
458
|
-
| **타입** | 명시적 return type |
|
|
459
|
-
</required>
|
|
460
|
-
|
|
461
|
-
---
|
|
462
|
-
|
|
463
172
|
<tech_stack>
|
|
464
|
-
| 기술 | 버전 |
|
|
465
|
-
|
|
466
|
-
|
|
|
467
|
-
|
|
|
468
|
-
| Zod | 4.x | z.email(), z.url() |
|
|
173
|
+
| 기술 | 버전 |
|
|
174
|
+
|------|------|
|
|
175
|
+
| Prisma | 7.x |
|
|
176
|
+
| Zod | 4.x |
|
|
469
177
|
</tech_stack>
|
|
470
178
|
|
|
471
179
|
---
|
|
472
180
|
|
|
473
181
|
<quick_patterns>
|
|
474
182
|
```typescript
|
|
475
|
-
// Server Function
|
|
476
183
|
export const createUser = createServerFn({ method: 'POST' })
|
|
477
184
|
.middleware([authMiddleware])
|
|
478
185
|
.inputValidator(schema)
|
|
479
186
|
.handler(async ({ data }) => ...)
|
|
480
|
-
|
|
481
|
-
// Zod v4
|
|
482
|
-
const schema = z.object({
|
|
483
|
-
email: z.email(),
|
|
484
|
-
website: z.url().optional(),
|
|
485
|
-
})
|
|
486
187
|
```
|
|
487
188
|
</quick_patterns>
|
|
488
189
|
```
|
|
489
190
|
|
|
490
|
-
|
|
191
|
+
**효과:** 650 → 280 (57% 감소)
|
|
491
192
|
|
|
492
193
|
</examples>
|
|
493
194
|
|
|
494
195
|
---
|
|
495
196
|
|
|
496
|
-
<common_mistakes>
|
|
497
|
-
|
|
498
|
-
### 실수 1: 핵심 정보 손실
|
|
499
|
-
|
|
500
|
-
```markdown
|
|
501
|
-
❌ After (정보 손실):
|
|
502
|
-
Prisma 사용
|
|
503
|
-
|
|
504
|
-
✅ After (정보 보존):
|
|
505
|
-
| 기술 | 버전 | 필수 설정 |
|
|
506
|
-
|------|------|----------|
|
|
507
|
-
| Prisma | 7.x | prisma-client, output |
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
---
|
|
511
|
-
|
|
512
|
-
### 실수 2: XML 태그 불일치
|
|
513
|
-
|
|
514
|
-
```markdown
|
|
515
|
-
❌ 불일치:
|
|
516
|
-
<forbidden>
|
|
517
|
-
...
|
|
518
|
-
</required> ← 잘못됨
|
|
519
|
-
|
|
520
|
-
✅ 일치:
|
|
521
|
-
<forbidden>
|
|
522
|
-
...
|
|
523
|
-
</forbidden>
|
|
524
|
-
```
|
|
525
|
-
|
|
526
|
-
---
|
|
527
|
-
|
|
528
|
-
### 실수 3: 버전 정보 누락
|
|
529
|
-
|
|
530
|
-
```markdown
|
|
531
|
-
❌ 버전 없음:
|
|
532
|
-
Zod, Prisma 사용
|
|
533
|
-
|
|
534
|
-
✅ 버전 명시:
|
|
535
|
-
| 기술 | 버전 |
|
|
536
|
-
|------|------|
|
|
537
|
-
| Zod | 4.x |
|
|
538
|
-
| Prisma | 7.x |
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
</common_mistakes>
|
|
542
|
-
|
|
543
|
-
---
|
|
544
|
-
|
|
545
197
|
<validation>
|
|
546
198
|
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
|
550
|
-
|
|
551
|
-
|
|
|
552
|
-
|
|
|
553
|
-
| **코드 블록** | 짝수 개 | `grep -c '\`\`\`' file.md` |
|
|
554
|
-
| **부정형** | < 5개 | `grep -c "Don't\|Never" file.md` |
|
|
555
|
-
|
|
556
|
-
## 체크리스트
|
|
557
|
-
|
|
558
|
-
**구조:**
|
|
559
|
-
- [ ] 모든 섹션 XML 태그
|
|
560
|
-
- [ ] forbidden/required 분리
|
|
199
|
+
| 항목 | 기준 | 검증 |
|
|
200
|
+
|------|------|------|
|
|
201
|
+
| **토큰** | 50% 감소 | `wc -w` |
|
|
202
|
+
| **XML** | 올바른 중첩 | 수동 |
|
|
203
|
+
| **코드 블록** | 짝수 | `grep -c '\`\`\`'` |
|
|
204
|
+
| **부정형** | < 5 | `grep -c "Don't"` |
|
|
561
205
|
|
|
562
|
-
|
|
206
|
+
**체크리스트:**
|
|
563
207
|
- [ ] 토큰 50% 감소
|
|
564
208
|
- [ ] 핵심 정보 보존
|
|
565
|
-
- [ ]
|
|
566
|
-
|
|
567
|
-
**예시:**
|
|
568
|
-
- [ ] 코드 블록 짝수
|
|
569
|
-
- [ ] ✅/❌ 마커
|
|
570
|
-
- [ ] 실행 가능한 코드
|
|
571
|
-
|
|
572
|
-
**표현:**
|
|
573
|
-
- [ ] 부정형 < 5
|
|
574
|
-
- [ ] 긍정형 지시
|
|
575
|
-
|
|
576
|
-
**최적화:**
|
|
209
|
+
- [ ] XML 태그 중첩
|
|
210
|
+
- [ ] 코드 실행 가능
|
|
577
211
|
- [ ] @imports 중복 제거
|
|
578
|
-
- [ ] 표 형식 압축
|
|
579
|
-
- [ ] 코드 중심
|
|
580
212
|
|
|
581
213
|
</validation>
|
|
582
214
|
|
|
@@ -584,19 +216,11 @@ Zod, Prisma 사용
|
|
|
584
216
|
|
|
585
217
|
<best_practices>
|
|
586
218
|
|
|
587
|
-
| 원칙 | 방법 |
|
|
588
|
-
|
|
589
|
-
| **정보
|
|
590
|
-
| **코드 중심** | 설명 →
|
|
591
|
-
|
|
|
592
|
-
| **측정 기반** | Before/After |
|
|
593
|
-
|
|
594
|
-
**문서별 팁:**
|
|
595
|
-
|
|
596
|
-
| 문서 | 핵심 작업 |
|
|
597
|
-
|------|----------|
|
|
598
|
-
| **CLAUDE.md** | @imports 최대 활용, quick_patterns 코드만 |
|
|
599
|
-
| **SKILL.md** | trigger_conditions 명확, 설명 제거 |
|
|
600
|
-
| **COMMAND.md** | workflow 실행 가능 코드, examples ✅/❌ |
|
|
219
|
+
| 원칙 | 방법 |
|
|
220
|
+
|------|------|
|
|
221
|
+
| **정보 우선** | 토큰 < 정보 |
|
|
222
|
+
| **코드 중심** | 설명 → 코드 |
|
|
223
|
+
| **점진적** | 한 번에 하나 |
|
|
224
|
+
| **측정 기반** | Before/After |
|
|
601
225
|
|
|
602
226
|
</best_practices>
|