Skip to content

Commit c213e3f

Browse files
committed
chore: ai-config-toolkit 으로부터 문서 동기화
1 parent a9fc023 commit c213e3f

File tree

11 files changed

+225
-7
lines changed

11 files changed

+225
-7
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

.claude/commands/prepare-pr.md

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
---
2+
allowed-tools: Bash(git:*), Write
3+
description: Generate PR title and description from multiple commits (Korean and English)
4+
argument-hint: [BASE-BRANCH (default: auto-detect)]
5+
---
6+
7+
# Pull Request Content Generator
8+
9+
Generates PR title and description by analyzing all commits in the current branch compared to the base branch. **Creates both Korean and English versions for easy copying.**
10+
11+
## Repository State Analysis
12+
13+
- Git status: !git status --porcelain
14+
- Current branch: !git branch --show-current
15+
- Default branch: !git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@' || echo "main"
16+
- Remote branches: !git branch -r --list 'origin/main' 'origin/master' 2>/dev/null
17+
- Commits since divergence: !git log --oneline origin/HEAD..HEAD 2>/dev/null || git log --oneline origin/main..HEAD 2>/dev/null || git log --oneline origin/master..HEAD 2>/dev/null || echo "Unable to detect base branch"
18+
- Changed files summary: !git diff --stat origin/HEAD..HEAD 2>/dev/null || git diff --stat origin/main..HEAD 2>/dev/null || git diff --stat origin/master..HEAD 2>/dev/null
19+
20+
## What This Command Does
21+
22+
1. Detects the base branch (main/master) automatically or uses provided argument
23+
2. Collects all commits from base to current HEAD
24+
3. Analyzes commit messages and changed files
25+
4. Generates a consolidated PR title (Conventional Commits style)
26+
5. Generates PR description with summary, changes, and related issues
27+
6. **Saves to pr_content.md file for easy copying**
28+
29+
## When to Use This Command
30+
31+
| Scenario | Recommendation |
32+
| ----------------------- | ------------------------------------------------------------ |
33+
| Single commit PR | Use commit message directly (GitHub does this automatically) |
34+
| **Multiple commits PR** | **Use this command** to consolidate changes |
35+
| Large feature branch | Use this command to summarize all work |
36+
37+
## PR Title Format (Conventional Commits)
38+
39+
```
40+
<type>[(optional scope)]: <description>
41+
```
42+
43+
### Type Selection for PRs
44+
45+
Analyze all commits and select the dominant type:
46+
47+
| Pattern | PR Type |
48+
| ------------------------- | --------------------------------- |
49+
| Mostly `feat` commits | `feat` |
50+
| Mostly `fix` commits | `fix` |
51+
| Mixed `feat` and `fix` | `feat` (features take precedence) |
52+
| Only `docs` commits | `docs` |
53+
| Only `chore`/`ci` commits | `chore` |
54+
| `refactor` focused | `refactor` |
55+
56+
**Priority**: `feat` > `fix` > `refactor` > `perf` > `docs` > `chore`
57+
58+
### Title Writing Guidelines
59+
60+
- **50 characters or less** (GitHub truncates longer titles)
61+
- Focus on **user-facing value**, not implementation details
62+
- Use imperative mood: "add feature" not "added feature"
63+
64+
**Examples:**
65+
66+
-`feat: add user authentication with OAuth2`
67+
-`fix: resolve memory leak in dashboard`
68+
-`Update files` (too vague)
69+
-`feat: implement OAuth2 authentication flow with Google and GitHub providers and session management` (too long)
70+
71+
## PR Body Format
72+
73+
### Summary Section
74+
75+
1-3 sentences describing the overall change and its purpose.
76+
77+
### Changes Section
78+
79+
- Bullet points of key changes
80+
- Group by category if many changes
81+
- Focus on **what** changed, not **how**
82+
83+
### Related Issues Section
84+
85+
- Extract issue numbers from branch name and commits
86+
- Use `fix #N` format (consistent with commit.md)
87+
88+
### Test Plan Section (Optional)
89+
90+
- How to verify the changes work
91+
- Only include if non-trivial testing is needed
92+
93+
## Output Template
94+
95+
```markdown
96+
## PR Title (Korean)
97+
98+
{type}: {한글 제목}
99+
100+
## PR Title (English)
101+
102+
{type}: {English title}
103+
104+
---
105+
106+
## PR Body (Korean)
107+
108+
### 요약
109+
110+
{변경사항 요약 1-3문장}
111+
112+
### 주요 변경사항
113+
114+
- {변경사항 1}
115+
- {변경사항 2}
116+
- {변경사항 3}
117+
118+
### 관련 이슈
119+
120+
fix #{issue_number}
121+
122+
### 테스트 계획
123+
124+
{테스트 방법 - 필요시만}
125+
126+
---
127+
128+
## PR Body (English)
129+
130+
### Summary
131+
132+
{1-3 sentence summary of changes}
133+
134+
### Changes
135+
136+
- {Change 1}
137+
- {Change 2}
138+
- {Change 3}
139+
140+
### Related Issues
141+
142+
fix #{issue_number}
143+
144+
### Test Plan
145+
146+
{How to test - if needed}
147+
```
148+
149+
## Issue Number Detection
150+
151+
Extract issue numbers from:
152+
153+
1. **Branch name**: `feature/123-add-auth``#123`
154+
2. **Commit messages**: `fix: resolve bug (fix #456)``#456`
155+
3. **Branch patterns**: `develop/user/42`, `issue-42-fix``#42`
156+
157+
## Important Notes
158+
159+
- This command ONLY generates PR content - it never creates actual PRs
160+
- **pr_content.md file contains both versions** - choose the one you prefer
161+
- For single-commit PRs, consider using the commit message directly
162+
- If branch name contains issue number, it will be auto-detected
163+
- Copy content from generated file and paste into GitHub PR form
164+
- Use `gh pr create` with the generated content for CLI workflow
165+
166+
## Execution Instructions for Claude
167+
168+
1. **Determine base branch**:
169+
- Use argument if provided: `$ARGUMENTS`
170+
- Otherwise: detect from `origin/HEAD`, `origin/main`, or `origin/master`
171+
172+
2. **Collect commit information**:
173+
- Run: `git log --oneline {base}..HEAD`
174+
- Run: `git log --pretty=format:"%s" {base}..HEAD` for full messages
175+
- Run: `git diff --stat {base}..HEAD` for changed files
176+
177+
3. **Analyze commits**:
178+
- Count commit types (feat, fix, docs, etc.)
179+
- Identify primary type based on frequency
180+
- Extract scope if commits share a common scope
181+
182+
4. **Extract issue numbers**:
183+
- From branch name (current branch)
184+
- From commit messages (fix #N, closes #N patterns)
185+
186+
5. **Generate PR title**:
187+
- Use dominant type
188+
- Summarize the overall change in ≤50 chars
189+
- Focus on user value
190+
191+
6. **Generate PR body**:
192+
- Summary: What and why
193+
- Changes: Key modifications (3-7 bullet points)
194+
- Issues: All detected issue numbers
195+
- Test Plan: Only if non-trivial
196+
197+
7. **Create both versions**:
198+
- Korean version first
199+
- English version second
200+
201+
8. **Write to file**:
202+
- Save to `/workspaces/ai-config-toolkit/pr_content.md`
203+
- Overwrite if exists
204+
205+
**Token optimization**:
206+
207+
- Focus on commit messages, not full diffs
208+
- Summarize file changes by category
209+
- Limit to most recent 20 commits if branch has many
File renamed without changes.

.claude/skills/golang/SKILL.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,16 @@ description: |
124124

125125
### init() Functions
126126

127-
- Generally forbidden. Prefer explicit initialization functions
127+
- Avoid unless necessary for registration patterns (database drivers, plugins)
128+
- Prefer explicit initialization functions for business logic
129+
- Acceptable uses:
130+
- Driver/plugin registration (e.g., `database/sql` drivers)
131+
- Static route/handler registration with no I/O
132+
- Complex constant initialization without side effects
133+
- Forbidden uses:
134+
- External I/O (database, file, network)
135+
- Global state mutation
136+
- Error-prone initialization (use constructors that return errors)
128137

129138
## Package Structure
130139

@@ -134,7 +143,7 @@ description: |
134143

135144
## Recommended Libraries
136145

137-
- Web: Fiber
146+
- Web: chi
138147
- DB: Bun, SQLBoiler (when managing migrations externally)
139148
- Logging: slog
140149
- CLI: cobra

.claude/skills/typescript-test/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
name: typescript-test
33
description: |
4-
Provides Jest-based TypeScript testing expertise and best practices. Ensures proper test structure, mocking strategies, async handling patterns, and coverage optimization. Specializes in unit testing, integration testing, test organization with describe/it blocks, jest.mock patterns, snapshot testing, and testing library integration for UI components.
5-
Use when: writing TypeScript test files (.spec.ts, .test.ts), structuring tests with describe/it/test blocks, implementing mocks with jest.mock/jest.spyOn, testing async code with async/await or promises, creating test fixtures and helpers, implementing snapshot tests, testing React components with Testing Library, measuring and improving code coverage, or configuring Jest for TypeScript projects.
4+
Provides Vitest-based TypeScript testing expertise and best practices. Ensures proper test structure, mocking strategies, async handling patterns, and coverage optimization. Specializes in unit testing, integration testing, test organization with describe/it blocks, vi.mock patterns, snapshot testing, and testing library integration for UI components.
5+
Use when: writing TypeScript test files (.spec.ts, .test.ts), structuring tests with describe/it/test blocks, implementing mocks with vi.mock/vi.spyOn, testing async code with async/await or promises, creating test fixtures and helpers, implementing snapshot tests, testing React components with Testing Library, measuring and improving code coverage, or configuring Vitest for TypeScript projects.
66
---
77

88
# TypeScript Testing Code Guide
@@ -19,7 +19,7 @@ Format: `{target-file-name}.spec.ts`.
1919

2020
## Test Framework
2121

22-
Use Jest. Maintain consistency within the project.
22+
Use Vitest. Maintain consistency within the project.
2323

2424
## Test Hierarchy
2525

@@ -71,7 +71,7 @@ Group methods/functionality with `describe`, write individual cases with `it`. C
7171

7272
## Mocking
7373

74-
Utilize Jest's `jest.mock()`, `jest.spyOn()`. Mock external modules at the top level; change behavior per test with `mockReturnValue`, `mockImplementation`.
74+
Utilize Vitest's `vi.mock()`, `vi.spyOn()`. Mock external modules at the top level; change behavior per test with `mockReturnValue`, `mockImplementation`.
7575

7676
## Async Testing
7777

0 commit comments

Comments
 (0)