jun-claude-code 0.0.11 → 0.0.13
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/README.md +122 -83
- package/dist/cli.js +40 -0
- package/dist/copy.js +92 -11
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/init-context.d.ts +4 -0
- package/dist/init-context.js +143 -0
- package/dist/init-project.js +4 -4
- package/dist/validate.d.ts +4 -0
- package/dist/validate.js +105 -0
- package/package.json +2 -2
- package/{.claude → templates/global}/CLAUDE.md +50 -21
- package/{.claude → templates/global}/agents/architect.md +23 -11
- package/{.claude → templates/global}/agents/code-reviewer.md +17 -7
- package/{.claude → templates/global}/agents/code-writer.md +27 -15
- package/{.claude → templates/global}/agents/context-collector.md +11 -3
- package/{.claude → templates/global}/agents/context-manager.md +21 -9
- package/{.claude → templates/global}/agents/designer.md +32 -20
- package/{.claude → templates/global}/agents/director.md +43 -31
- package/{.claude → templates/global}/agents/explore.md +13 -5
- package/{.claude → templates/global}/agents/git-manager.md +39 -22
- package/{.claude → templates/global}/agents/impact-analyzer.md +17 -7
- package/{.claude → templates/global}/agents/qa-tester.md +22 -8
- package/{.claude → templates/global}/agents/simple-code-writer.md +13 -5
- package/{.claude → templates/global}/agents/task-planner.md +18 -10
- package/{.claude → templates/global}/hooks/skill-forced.sh +56 -56
- package/{.claude → templates/global}/hooks/workflow-enforced.sh +49 -31
- package/{.claude → templates/global}/skills/Backend/SKILL.md +38 -9
- package/{.claude → templates/global}/skills/Coding/SKILL.md +69 -29
- package/{.claude → templates/global}/skills/Director/SKILL.md +9 -5
- package/{.claude → templates/global}/skills/Documentation/SKILL.md +68 -1
- package/{.claude → templates/global}/skills/Git/SKILL.md +8 -4
- package/{.claude → templates/global}/skills/Git/git.md +60 -28
- package/{.claude → templates/global}/skills/Git/pr-apply.md +18 -6
- package/{.claude → templates/global}/skills/Git/pr-review.md +4 -0
- package/templates/global/skills/PromptStructuring/SKILL.md +67 -0
- package/templates/global/skills/PromptStructuring/positive-phrasing.md +206 -0
- package/templates/global/skills/PromptStructuring/xml-tags.md +330 -0
- package/{.claude → templates/global}/skills/React/SKILL.md +28 -8
- package/{.claude → templates/global}/skills/React/react-hook-form.md +20 -12
- package/{.claude → templates/global}/skills/React/tailwind-styled.md +29 -7
- package/{.claude → templates/global}/skills/React/tanstack-router.md +21 -9
- package/templates/project/agents/context-generator.md +66 -0
- package/{.claude → templates/project}/agents/project-task-manager.md +19 -7
- package/templates/project/skills/ContextGeneration/SKILL.md +160 -0
- package/templates/project/workflows/context-gen.yml +75 -0
- /package/{.claude → templates/global}/settings.json +0 -0
- /package/{.claude → templates/project}/hooks/task-loader.sh +0 -0
- /package/{.claude → templates/project}/project.env.example +0 -0
|
@@ -26,6 +26,8 @@ src/features/auth/
|
|
|
26
26
|
└── useLoginMutation.ts # TRPC mutation 훅
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
<rules>
|
|
30
|
+
|
|
29
31
|
## 필수 준수 사항
|
|
30
32
|
|
|
31
33
|
| 규칙 | 올바른 예 | 잘못된 예 |
|
|
@@ -35,6 +37,8 @@ src/features/auth/
|
|
|
35
37
|
| 에러 표시 | `formState.errors` 사용 | 커스텀 에러 상태 |
|
|
36
38
|
| 로딩 상태 | `mutation.isPending` 사용 | 별도 loading 상태 |
|
|
37
39
|
|
|
40
|
+
</rules>
|
|
41
|
+
|
|
38
42
|
## 스키마 정의 패턴
|
|
39
43
|
|
|
40
44
|
```typescript
|
|
@@ -199,24 +203,28 @@ const formValues = watch()
|
|
|
199
203
|
{watchedEmail && <p>입력된 이메일: {watchedEmail}</p>}
|
|
200
204
|
```
|
|
201
205
|
|
|
206
|
+
<checklist>
|
|
207
|
+
|
|
202
208
|
## 체크리스트
|
|
203
209
|
|
|
204
210
|
### 스키마 설정
|
|
205
|
-
- [ ] 스키마를 별도 파일(*FormSchema.ts)로
|
|
206
|
-
- [ ] z.infer로 타입
|
|
207
|
-
- [ ] 에러
|
|
211
|
+
- [ ] 스키마를 별도 파일(*FormSchema.ts)로 분리했는가?
|
|
212
|
+
- [ ] z.infer로 타입 추론을 사용하는가?
|
|
213
|
+
- [ ] 에러 메시지를 한글화했는가?
|
|
208
214
|
|
|
209
215
|
### 폼 구현
|
|
210
|
-
- [ ] zodResolver
|
|
211
|
-
- [ ] defaultValues
|
|
212
|
-
- [ ] register로
|
|
216
|
+
- [ ] zodResolver를 사용하는가?
|
|
217
|
+
- [ ] defaultValues를 설정했는가?
|
|
218
|
+
- [ ] register로 필드를 등록했는가?
|
|
213
219
|
|
|
214
220
|
### 에러 처리
|
|
215
|
-
- [ ] formState.errors로
|
|
216
|
-
- [ ] 서버 에러는 setError로
|
|
217
|
-
- [ ] 필드별 에러
|
|
221
|
+
- [ ] formState.errors로 에러를 표시하는가?
|
|
222
|
+
- [ ] 서버 에러는 setError로 처리하는가?
|
|
223
|
+
- [ ] 필드별 에러 메시지를 표시하는가?
|
|
218
224
|
|
|
219
225
|
### TRPC 연동
|
|
220
|
-
- [ ] useMutation
|
|
221
|
-
- [ ] isPending으로 로딩
|
|
222
|
-
- [ ] onSuccess/onError
|
|
226
|
+
- [ ] useMutation을 사용하는가?
|
|
227
|
+
- [ ] isPending으로 로딩 상태를 표시하는가?
|
|
228
|
+
- [ ] onSuccess/onError 핸들러를 구현했는가?
|
|
229
|
+
|
|
230
|
+
</checklist>
|
|
@@ -7,11 +7,13 @@ estimated_tokens: ~350
|
|
|
7
7
|
|
|
8
8
|
# tailwind-styled-components 스킬
|
|
9
9
|
|
|
10
|
+
<rules>
|
|
11
|
+
|
|
10
12
|
## 핵심 원칙
|
|
11
13
|
|
|
12
14
|
**DOM depth를 최소화하라.**
|
|
13
|
-
- 불필요한 wrapper div 제거
|
|
14
|
-
-
|
|
15
|
+
- 불필요한 wrapper div를 제거
|
|
16
|
+
- 단일 수준 구조를 유지 (스타일 전용 중첩 대신)
|
|
15
17
|
- 하나의 Styled Component가 하나의 DOM 요소
|
|
16
18
|
|
|
17
19
|
## 필수 준수 사항
|
|
@@ -23,8 +25,13 @@ estimated_tokens: ~350
|
|
|
23
25
|
| `<Wrapper><Inner><Content>...</Content></Inner></Wrapper>` | `<Container>...</Container>` |
|
|
24
26
|
| `<div><div className="...">...</div></div>` | `<StyledDiv>...</StyledDiv>` |
|
|
25
27
|
|
|
28
|
+
</rules>
|
|
29
|
+
|
|
30
|
+
<examples>
|
|
31
|
+
|
|
26
32
|
### 예제: 불필요한 중첩 제거
|
|
27
33
|
|
|
34
|
+
<example type="bad">
|
|
28
35
|
```typescript
|
|
29
36
|
// ❌ Bad - 불필요한 DOM depth
|
|
30
37
|
const Card = () => (
|
|
@@ -38,7 +45,10 @@ const Card = () => (
|
|
|
38
45
|
</div>
|
|
39
46
|
</div>
|
|
40
47
|
);
|
|
41
|
-
|
|
48
|
+
```
|
|
49
|
+
</example>
|
|
50
|
+
<example type="good">
|
|
51
|
+
```typescript
|
|
42
52
|
// ✅ Good - 최소한의 DOM depth
|
|
43
53
|
const CardContainer = tw.div`
|
|
44
54
|
p-4
|
|
@@ -56,9 +66,11 @@ const Card = () => (
|
|
|
56
66
|
</CardContainer>
|
|
57
67
|
);
|
|
58
68
|
```
|
|
69
|
+
</example>
|
|
59
70
|
|
|
60
71
|
### 예제: Tailwind 디자인 변환
|
|
61
72
|
|
|
73
|
+
<example type="bad">
|
|
62
74
|
```typescript
|
|
63
75
|
// 원본 Tailwind (depth: 3)
|
|
64
76
|
<div className="p-5">
|
|
@@ -68,7 +80,10 @@ const Card = () => (
|
|
|
68
80
|
</div>
|
|
69
81
|
</div>
|
|
70
82
|
</div>
|
|
71
|
-
|
|
83
|
+
```
|
|
84
|
+
</example>
|
|
85
|
+
<example type="good">
|
|
86
|
+
```typescript
|
|
72
87
|
// ✅ 변환 후 (depth: 1)
|
|
73
88
|
const StepContent = tw.div`
|
|
74
89
|
p-5
|
|
@@ -83,6 +98,9 @@ const StepContent = tw.div`
|
|
|
83
98
|
<Title>Title</Title>
|
|
84
99
|
</StepContent>
|
|
85
100
|
```
|
|
101
|
+
</example>
|
|
102
|
+
|
|
103
|
+
</examples>
|
|
86
104
|
|
|
87
105
|
## Styled Component 네이밍
|
|
88
106
|
|
|
@@ -152,14 +170,18 @@ const Input = tw.input`
|
|
|
152
170
|
`;
|
|
153
171
|
```
|
|
154
172
|
|
|
173
|
+
<checklist>
|
|
174
|
+
|
|
155
175
|
## 체크리스트
|
|
156
176
|
|
|
157
177
|
### DOM 구조
|
|
158
|
-
- [ ]
|
|
159
|
-
- [ ] 중첩된 div를 하나로 합칠 수 있는가?
|
|
160
|
-
- [ ] depth가 3 이상인가?
|
|
178
|
+
- [ ] 스타일 전용 wrapper div가 있는가? (있다면 제거)
|
|
179
|
+
- [ ] 중첩된 div를 하나로 합칠 수 있는가? (합치기)
|
|
180
|
+
- [ ] depth가 3 이상인가? (리팩토링 고려)
|
|
161
181
|
|
|
162
182
|
### Styled Component
|
|
163
183
|
- [ ] 의미 있는 이름인가?
|
|
164
184
|
- [ ] transient props($prefix)를 사용하는가?
|
|
165
185
|
- [ ] 재사용 가능한 컴포넌트인가?
|
|
186
|
+
|
|
187
|
+
</checklist>
|
|
@@ -32,6 +32,8 @@ src/routes/
|
|
|
32
32
|
└── register.tsx # /auth/register
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
<rules>
|
|
36
|
+
|
|
35
37
|
## 필수 준수 사항
|
|
36
38
|
|
|
37
39
|
| 규칙 | 올바른 예 | 잘못된 예 |
|
|
@@ -41,6 +43,10 @@ src/routes/
|
|
|
41
43
|
| 루트 라우트 | `__root.tsx` (더블 언더스코어) | `root.tsx` |
|
|
42
44
|
| 네비게이션 훅 | `Route.useNavigate()` | `useNavigate()` 직접 import |
|
|
43
45
|
|
|
46
|
+
</rules>
|
|
47
|
+
|
|
48
|
+
<instructions>
|
|
49
|
+
|
|
44
50
|
## 라우트 정의 패턴
|
|
45
51
|
|
|
46
52
|
### 기본 라우트
|
|
@@ -166,19 +172,25 @@ export const Route = createFileRoute('/_admin')({
|
|
|
166
172
|
})
|
|
167
173
|
```
|
|
168
174
|
|
|
175
|
+
</instructions>
|
|
176
|
+
|
|
177
|
+
<checklist>
|
|
178
|
+
|
|
169
179
|
## 체크리스트
|
|
170
180
|
|
|
171
181
|
### 라우트 설정 시
|
|
172
|
-
- [ ] 동적 파라미터에 `$`
|
|
173
|
-
- [ ] 레이아웃 라우트에 `_`
|
|
174
|
-
- [ ] 루트 레이아웃은 `__root.tsx
|
|
182
|
+
- [ ] 동적 파라미터에 `$` 프리픽스를 사용하는가?
|
|
183
|
+
- [ ] 레이아웃 라우트에 `_` 프리픽스를 사용하는가?
|
|
184
|
+
- [ ] 루트 레이아웃은 `__root.tsx`인가?
|
|
175
185
|
|
|
176
186
|
### 네비게이션
|
|
177
|
-
- [ ] `Route.useNavigate()
|
|
178
|
-
- [ ] 타입 안전한 params
|
|
179
|
-
- [ ] 동적 파라미터는 params 객체로
|
|
187
|
+
- [ ] `Route.useNavigate()`를 사용하는가?
|
|
188
|
+
- [ ] 타입 안전한 params를 전달하는가?
|
|
189
|
+
- [ ] 동적 파라미터는 params 객체로 전달하는가?
|
|
180
190
|
|
|
181
191
|
### 인증
|
|
182
|
-
- [ ] beforeLoad에서
|
|
183
|
-
- [ ] redirect로
|
|
184
|
-
- [ ] 원래
|
|
192
|
+
- [ ] beforeLoad에서 인증을 체크하는가?
|
|
193
|
+
- [ ] redirect로 리다이렉트를 처리하는가?
|
|
194
|
+
- [ ] 원래 경로를 저장하는가? (redirect search param)
|
|
195
|
+
|
|
196
|
+
</checklist>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-generator
|
|
3
|
+
description: GitHub Action에서 PR diff 기반으로 .claude/context/ 문서를 자동 생성/업데이트 (CI 전용)
|
|
4
|
+
keywords: [context, PR, diff, codebase, business, 문서생성]
|
|
5
|
+
model: sonnet
|
|
6
|
+
color: green
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Context Generator Agent
|
|
10
|
+
|
|
11
|
+
PR의 변경 내용을 분석하여 `.claude/context/` 하위에 codebase/business 문서를 자동 생성하고 업데이트합니다.
|
|
12
|
+
|
|
13
|
+
## 실행 조건
|
|
14
|
+
|
|
15
|
+
- GitHub Action에서 PR 이벤트로 트리거
|
|
16
|
+
- `anthropics/claude-code-action@v1`을 통해 실행
|
|
17
|
+
|
|
18
|
+
## 프로세스
|
|
19
|
+
|
|
20
|
+
### 1. Diff 수집
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git diff HEAD~1 --name-only
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
변경된 파일 목록을 수집합니다.
|
|
27
|
+
|
|
28
|
+
### 2. 모듈 매핑
|
|
29
|
+
|
|
30
|
+
변경된 파일을 모듈 단위로 그룹화합니다.
|
|
31
|
+
- `src/cli.ts` → `cli` 모듈
|
|
32
|
+
- `src/copy.ts` → `copy-logic` 모듈
|
|
33
|
+
- `.claude/agents/*.md` → `agents` 모듈
|
|
34
|
+
|
|
35
|
+
### 3. 기존 Context 확인
|
|
36
|
+
|
|
37
|
+
`.claude/context/codebase/`와 `.claude/context/business/`에서 기존 문서를 확인합니다.
|
|
38
|
+
- 기존 문서가 있으면 → 업데이트
|
|
39
|
+
- 기존 문서가 없으면 → 새로 생성
|
|
40
|
+
|
|
41
|
+
### 4. Codebase Context 생성
|
|
42
|
+
|
|
43
|
+
[ContextGeneration Skill](../../skills/ContextGeneration/SKILL.md)의 Codebase 규칙에 따라:
|
|
44
|
+
- 모듈별 `.md` 파일 생성/업데이트
|
|
45
|
+
- 파일 경로와 함수명만 참조 (원본 코드 포함 금지)
|
|
46
|
+
- `codebase/INDEX.md` 업데이트
|
|
47
|
+
|
|
48
|
+
### 5. Business Context 생성
|
|
49
|
+
|
|
50
|
+
[ContextGeneration Skill](../../skills/ContextGeneration/SKILL.md)의 Business 규칙에 따라:
|
|
51
|
+
- 기술 용어를 비즈니스 관점으로 변환
|
|
52
|
+
- 도메인별 `.md` 파일 생성/업데이트
|
|
53
|
+
- `business/INDEX.md` 업데이트
|
|
54
|
+
|
|
55
|
+
### 6. 커밋
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
git add .claude/context/
|
|
59
|
+
git commit -m "docs: update context for PR changes"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 제약사항
|
|
63
|
+
|
|
64
|
+
- `.claude/context/**` 경로 변경은 무시 (무한루프 방지)
|
|
65
|
+
- 변경된 파일과 관련된 context만 업데이트 (전체 재생성 금지)
|
|
66
|
+
- 원본 소스 코드를 context 문서에 포함하지 않음
|
|
@@ -10,13 +10,15 @@ color: green
|
|
|
10
10
|
|
|
11
11
|
GitHub Project 태스크를 관리하는 Agent입니다.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
<role>
|
|
14
14
|
|
|
15
15
|
1. **태스크 조회**: 프로젝트 보드의 태스크 목록 조회
|
|
16
16
|
2. **태스크 생성**: 새 이슈 생성 및 프로젝트에 추가
|
|
17
17
|
3. **상태 변경**: 태스크 상태 업데이트 (Backlog/In progress/Done)
|
|
18
18
|
4. **태스크 검색**: 키워드/상태별 필터링
|
|
19
19
|
|
|
20
|
+
</role>
|
|
21
|
+
|
|
20
22
|
## 프로젝트 설정
|
|
21
23
|
|
|
22
24
|
이 Agent는 `.claude/project.env` 파일에서 프로젝트 정보를 읽습니다.
|
|
@@ -52,16 +54,20 @@ source .claude/project.env
|
|
|
52
54
|
- "이슈 #123을 프로젝트에 추가해줘"
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
<constraints>
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
59
|
+
### 다른 Agent 전담 영역
|
|
60
|
+
|
|
61
|
+
- 코드 작업은 code-writer가 전담한다
|
|
62
|
+
- PR 생성/관리는 git-manager가 전담한다
|
|
63
|
+
- 코드 리뷰는 code-reviewer가 전담한다
|
|
64
|
+
|
|
65
|
+
</constraints>
|
|
62
66
|
|
|
63
67
|
---
|
|
64
68
|
|
|
69
|
+
<instructions>
|
|
70
|
+
|
|
65
71
|
## 명령어 패턴
|
|
66
72
|
|
|
67
73
|
### 태스크 목록 조회
|
|
@@ -110,8 +116,12 @@ gh project item-edit --project-id <PROJECT_ID> --id <ITEM_ID> --field-id <FIELD_
|
|
|
110
116
|
gh issue close <issue-number> --repo "$GITHUB_PROJECT_REPO"
|
|
111
117
|
```
|
|
112
118
|
|
|
119
|
+
</instructions>
|
|
120
|
+
|
|
113
121
|
---
|
|
114
122
|
|
|
123
|
+
<output_format>
|
|
124
|
+
|
|
115
125
|
## 출력 형식
|
|
116
126
|
|
|
117
127
|
```markdown
|
|
@@ -134,6 +144,8 @@ gh issue close <issue-number> --repo "$GITHUB_PROJECT_REPO"
|
|
|
134
144
|
- #49 S3 URL 대신 CDN URL로 응답하도록 수정
|
|
135
145
|
```
|
|
136
146
|
|
|
147
|
+
</output_format>
|
|
148
|
+
|
|
137
149
|
---
|
|
138
150
|
|
|
139
151
|
## 권한 요구사항
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ContextGeneration
|
|
3
|
+
description: PR 변경 내용을 분석하여 .claude/context/ 문서를 자동 생성하는 규칙
|
|
4
|
+
keywords: [context, codebase, business, PR, 자동생성, 문서화]
|
|
5
|
+
estimated_tokens: ~800
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Context 자동 생성 규칙
|
|
9
|
+
|
|
10
|
+
PR 변경 내용을 분석하여 `.claude/context/` 하위에 codebase/business 문서를 자동 생성합니다.
|
|
11
|
+
|
|
12
|
+
## Context 디렉토리 구조
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
.claude/context/
|
|
16
|
+
├── codebase/
|
|
17
|
+
│ ├── INDEX.md # 모듈 목록 + 경로
|
|
18
|
+
│ └── <module-name>.md # 모듈별 구현 참조
|
|
19
|
+
└── business/
|
|
20
|
+
├── INDEX.md # 프로젝트 개요 + 도메인 목록
|
|
21
|
+
└── <domain-area>.md # 비즈니스 레벨 요약
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
<rules>
|
|
25
|
+
|
|
26
|
+
## Codebase Context 규칙
|
|
27
|
+
|
|
28
|
+
### 파일명
|
|
29
|
+
- **kebab-case** 사용 (예: `cli.md`, `copy-logic.md`, `auth-middleware.md`)
|
|
30
|
+
- 모듈/기능 단위로 분리
|
|
31
|
+
|
|
32
|
+
### 필수 섹션
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
---
|
|
36
|
+
name: <모듈명>
|
|
37
|
+
description: <한 줄 설명>
|
|
38
|
+
keywords: [관련, 키워드]
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
# <모듈명>
|
|
42
|
+
|
|
43
|
+
<2-3문장 개요>
|
|
44
|
+
|
|
45
|
+
## 파일 구조
|
|
46
|
+
|
|
47
|
+
| 파일 | 역할 | 핵심 함수/클래스 |
|
|
48
|
+
|------|------|-----------------|
|
|
49
|
+
| src/example.ts | 메인 로직 | mainFunction(), HelperClass |
|
|
50
|
+
|
|
51
|
+
## 핵심 흐름
|
|
52
|
+
|
|
53
|
+
1. <진입점> → <처리> → <결과>
|
|
54
|
+
2. ...
|
|
55
|
+
|
|
56
|
+
## 관련 Business Context
|
|
57
|
+
|
|
58
|
+
- [<도메인명>](../business/<domain>.md)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 참조 원칙
|
|
62
|
+
|
|
63
|
+
- 파일 경로와 함수/클래스명만 참조한다
|
|
64
|
+
- 파일 참조 형식: `| src/copy.ts | 파일 복사 메인 로직 | mergeSettingsJson() |`
|
|
65
|
+
- 원본 소스 코드 대신 경로와 함수 시그니처로 표현한다
|
|
66
|
+
|
|
67
|
+
## Business Context 규칙
|
|
68
|
+
|
|
69
|
+
### 파일명
|
|
70
|
+
- **비즈니스 도메인 기준**으로 명명한다 (예: `configuration-management.md`, `user-authentication.md`)
|
|
71
|
+
- 비즈니스 용어를 사용한다 (예: `settings-json-merge.md` -> `configuration-management.md`)
|
|
72
|
+
|
|
73
|
+
### 필수 섹션
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
---
|
|
77
|
+
name: <도메인명>
|
|
78
|
+
description: <비즈니스 관점 한 줄 설명>
|
|
79
|
+
keywords: [비즈니스, 키워드]
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
# <도메인명>
|
|
83
|
+
|
|
84
|
+
## 목적
|
|
85
|
+
|
|
86
|
+
<이 기능이 사용자에게 제공하는 가치>
|
|
87
|
+
|
|
88
|
+
## 핵심 기능
|
|
89
|
+
|
|
90
|
+
| 기능 | 설명 | 사용자 관점 |
|
|
91
|
+
|------|------|------------|
|
|
92
|
+
| 설정 복사 | 템플릿 설정을 사용자 환경에 적용 | 초기 설정 자동화 |
|
|
93
|
+
|
|
94
|
+
## 사용자 흐름
|
|
95
|
+
|
|
96
|
+
1. 사용자가 <동작> → <결과>
|
|
97
|
+
2. ...
|
|
98
|
+
|
|
99
|
+
## 관련 Codebase Context
|
|
100
|
+
|
|
101
|
+
- [<모듈명>](../codebase/<module>.md)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 변환 규칙
|
|
105
|
+
- Codebase의 기술 용어를 비즈니스 관점으로 변환한다
|
|
106
|
+
- `mergeSettingsJson()` -> "기존 설정을 보존하면서 새 설정 적용"
|
|
107
|
+
- `copyClaudeFiles()` -> "템플릿 설정을 사용자 환경에 배포"
|
|
108
|
+
|
|
109
|
+
</rules>
|
|
110
|
+
|
|
111
|
+
## INDEX.md 작성 규칙
|
|
112
|
+
|
|
113
|
+
### codebase/INDEX.md
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
---
|
|
117
|
+
name: Codebase Index
|
|
118
|
+
description: 코드베이스 모듈 참조 목록
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
# Codebase Context Index
|
|
122
|
+
|
|
123
|
+
## 모듈 목록
|
|
124
|
+
|
|
125
|
+
| 모듈 | 설명 | 문서 |
|
|
126
|
+
|------|------|------|
|
|
127
|
+
| CLI | 커맨드라인 인터페이스 | [cli.md](./cli.md) |
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### business/INDEX.md
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
---
|
|
134
|
+
name: Business Index
|
|
135
|
+
description: 비즈니스 도메인 참조 목록
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
# Business Context Index
|
|
139
|
+
|
|
140
|
+
## 프로젝트 개요
|
|
141
|
+
|
|
142
|
+
<프로젝트가 해결하는 문제와 대상 사용자 1-2문장>
|
|
143
|
+
|
|
144
|
+
## 도메인 목록
|
|
145
|
+
|
|
146
|
+
| 도메인 | 설명 | 문서 |
|
|
147
|
+
|--------|------|------|
|
|
148
|
+
| 설정 관리 | 사용자 설정 배포 및 관리 | [configuration-management.md](./configuration-management.md) |
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## 증분 업데이트 원칙
|
|
152
|
+
|
|
153
|
+
<checklist>
|
|
154
|
+
|
|
155
|
+
- PR에서 변경된 파일과 관련된 context 문서만 업데이트한다
|
|
156
|
+
- 기존 문서의 변경되지 않은 부분은 그대로 유지한다
|
|
157
|
+
- 새 모듈이 추가되면 INDEX.md에 행을 추가한다
|
|
158
|
+
- 모듈이 삭제되면 INDEX.md에서 해당 행을 제거하고 문서 파일을 삭제한다
|
|
159
|
+
|
|
160
|
+
</checklist>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: Context Auto-Generation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize]
|
|
6
|
+
paths-ignore:
|
|
7
|
+
- '.claude/context/**'
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
generate-context:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout PR branch
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
ref: ${{ github.head_ref }}
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
|
|
24
|
+
- name: Read skill files
|
|
25
|
+
id: read-skills
|
|
26
|
+
run: |
|
|
27
|
+
{
|
|
28
|
+
echo "agent_def<<AGENT_EOF"
|
|
29
|
+
cat .claude/agents/context-generator.md
|
|
30
|
+
echo "AGENT_EOF"
|
|
31
|
+
} >> $GITHUB_OUTPUT
|
|
32
|
+
{
|
|
33
|
+
echo "skill_guide<<SKILL_EOF"
|
|
34
|
+
cat .claude/skills/ContextGeneration/SKILL.md
|
|
35
|
+
echo "SKILL_EOF"
|
|
36
|
+
} >> $GITHUB_OUTPUT
|
|
37
|
+
|
|
38
|
+
- name: Generate context documents
|
|
39
|
+
uses: anthropics/claude-code-action@v1
|
|
40
|
+
with:
|
|
41
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
42
|
+
show_full_output: true
|
|
43
|
+
claude_args: '--allowedTools "Bash(git:*),Bash(ls:*),Bash(mkdir:*),Read,Write,Edit,Glob,Grep"'
|
|
44
|
+
prompt: |
|
|
45
|
+
# 에이전트 정의
|
|
46
|
+
${{ steps.read-skills.outputs.agent_def }}
|
|
47
|
+
|
|
48
|
+
# 스킬 가이드
|
|
49
|
+
${{ steps.read-skills.outputs.skill_guide }}
|
|
50
|
+
|
|
51
|
+
# 작업 지시
|
|
52
|
+
PR diff를 분석하고 .claude/context/ 아래에 컨텍스트 문서를 생성/업데이트하세요.
|
|
53
|
+
|
|
54
|
+
단계:
|
|
55
|
+
1. `git diff HEAD~1 --name-only`을 실행하여 변경된 파일 목록 가져오기
|
|
56
|
+
2. 변경된 각 모듈에 대해 .claude/context/codebase/<module>.md 생성 또는 업데이트
|
|
57
|
+
3. 영향을 받는 각 비즈니스 도메인에 대해 .claude/context/business/<domain>.md 생성 또는 업데이트
|
|
58
|
+
4. 두 디렉토리의 INDEX.md 파일 업데이트
|
|
59
|
+
|
|
60
|
+
중요사항:
|
|
61
|
+
- 컨텍스트 문서에 소스 코드를 포함하지 말고, 파일 경로와 함수 이름만 포함하세요
|
|
62
|
+
- 실제로 변경된 파일에 대해서만 컨텍스트 업데이트
|
|
63
|
+
- 위 스킬 가이드에 명시된 정확한 형식 따르기
|
|
64
|
+
- 커밋하지 마세요. 파일 생성/수정만 하세요.
|
|
65
|
+
|
|
66
|
+
- name: Push context changes
|
|
67
|
+
run: |
|
|
68
|
+
git config user.name "github-actions[bot]"
|
|
69
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
70
|
+
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"
|
|
71
|
+
git add .claude/context/
|
|
72
|
+
git diff --staged --quiet || git commit -m "docs: context 문서 자동 업데이트"
|
|
73
|
+
git push origin HEAD:refs/heads/${{ github.head_ref }}
|
|
74
|
+
env:
|
|
75
|
+
GITHUB_TOKEN: ${{ github.token }}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|