Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .claude/commands/code-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Review the current branch changes against develop: $ARGUMENTS

## Rules

- **All review output must be written in Korean**

## Instructions

1. Run `git diff develop...HEAD` to get the full diff
2. Read the changed files directly to understand context
3. Review against the criteria below
4. Output findings organized by category

## Review Criteria

### 필수 확인
- **버그 가능성**: null/undefined 처리, 비동기 에러 처리, 엣지 케이스
- **보안**: XSS, 오픈 리다이렉트, 민감 정보 노출, 인증/인가 누락
- **타입 안전성**: `any` 사용, 잘못된 타입 단언

### 코드 품질
- **FSD 규칙 준수**: 레이어 의존성 방향 `app` → `views` → `widgets` → `entities` → `shared`, 역방향 참조 금지
- **불필요한 복잡도**: 과도한 추상화, 사용되지 않는 코드
- **중복**: 반복되는 로직

### 테스트
- 새 로직에 테스트가 있는지
- 테스트가 구현 세부사항이 아닌 동작을 검증하는지

## Output Format

```
## 코드 리뷰

### 🚨 필수 수정
- [파일명:라인] 문제점 및 제안

### 💡 권장 개선
- [파일명:라인] 문제점 및 제안

### 🔍 확인 사항 (선택)
- [파일명:라인] 의견

### ✅ 잘된 점
- ...
```

- 이슈가 없으면 해당 섹션 생략
- 문제가 전혀 없으면 "이슈 없음" 명시
- 각 항목에 파일 경로와 라인 번호 포함
54 changes: 54 additions & 0 deletions .claude/commands/commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Analyze staged changes and create a commit: $ARGUMENTS

## Commit Convention

```
<type>: <subject>
```

| Type | Usage |
|------|-------|
| `feat` | Add new feature |
| `fix` | Bug fix |
| `test` | Add or modify tests |
| `chore` | Build config, dependencies |
| `refactor` | Code improvement without behavior change |
| `style` | Formatting, whitespace — no logic change |
| `docs` | Documentation |
| `design` | UI design change |
| `comment` | Update comments |
| `init` | Project initialization |
| `rename` | Rename or move files / folders |
| `remove` | Delete files or folders |
| `perf` | Performance improvement |

- Subject must be written in Korean
- No period at end of subject line

## Commit Granularity Rules

- Keep commits as small as possible — one commit = one unit of change
- Always split into separate commits when change areas differ:
- Feature code / test code / config files → separate commits
- Different domains (e.g. `user` + `team` files) → separate commits
- If grouping is unavoidable, only bundle files of the same nature

## Instructions

0. **Run `git rev-parse --abbrev-ref HEAD` first. If the current branch is `main` or `develop`, STOP immediately and tell the user to switch to a feature branch. Never commit or push on these branches.**

1. Run `git diff --staged` and `git status` to understand what changed
2. Determine the appropriate type based on the nature of the change
3. Write a concise subject focused on "what and why"
4. If files span different areas, propose splitting into multiple commits
5. Confirm with the user before executing the commit

## Examples

```
feat: 로그인 폼 유효성 검사 추가
fix: 토큰 만료 시 무한 리다이렉트 수정
test: handleSigninFormSubmit 단위 테스트 추가
chore: vitest coverage 설정 변경
refactor: setLocationSearch 헬퍼 함수로 추출
```
49 changes: 49 additions & 0 deletions .claude/commands/create-branch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Create a new branch from develop and switch to it: $ARGUMENTS

## Branch Naming Convention

```
<type>/<name>
```

| Type | Usage |
|------|-------|
| `feat/<name>` | New feature |
| `fix/<name>` | Bug fix |
| `test/<name>` | Test code |
| `chore/<name>` | Config, dependencies |
| `refactor/<name>` | Code improvement |
| `perf/<name>` | Performance improvement |
| `design/<name>` | UI design change |
| `docs/<name>` | Documentation |

- `<name>`: lowercase + kebab-case (e.g. `feat/signin-validation`)
- Keep it short and descriptive

## Instructions

1. Check the current branch:
```bash
git rev-parse --abbrev-ref HEAD
```

2. Fetch the latest `develop`:
```bash
git fetch origin develop
```

3. Create and switch to the new branch from `develop`:
```bash
git checkout -b <type>/<name> origin/develop
```

4. Confirm the branch was created and is now active.

## Examples

```
/create-branch feat/signup-form
/create-branch fix/token-refresh
/create-branch test/auth-unit-tests
/create-branch chore/vitest-config
```
63 changes: 63 additions & 0 deletions .claude/commands/perf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Improve performance of the specified file or feature: $ARGUMENTS

## Rules

- All commit messages must be written in Korean
- Keep commits as small as possible — one optimization per commit
- Branch must follow: `perf/<name>` created from `develop`
- **Measure before and after** — do not optimize without evidence of a bottleneck

## What Counts as Performance Improvement

- Reducing unnecessary re-renders (React.memo, useMemo, useCallback)
- Optimizing TanStack Query cache (`staleTime`, `gcTime`, `enabled`)
- Code splitting / lazy loading components
- Reducing bundle size (removing unused dependencies, dynamic imports)
- Image optimization (Next.js `<Image>`, size, format)
- Eliminating redundant API calls
- Server Component conversion (removing unnecessary `"use client"`)

## Instructions

0. **Run `git rev-parse --abbrev-ref HEAD` first. If the current branch is `main` or `develop`, STOP and tell the user to create a `perf/<name>` branch first.**

1. Read the target file(s) and identify the performance bottleneck
2. Confirm the issue before optimizing — do not optimize speculatively
3. Apply the optimization
4. Check that behavior is unchanged after the change
5. Run existing tests to confirm nothing broke:
```bash
npm run test:run
```
6. Propose commits grouped by optimization type

## Common Patterns in This Project

```ts
// ✅ Prevent unnecessary re-renders
const Component = memo(function Component({ ... }) { ... })

// ✅ Optimize TanStack Query cache
useQuery({
queryKey: ["school", name],
queryFn: () => getSchool(name),
staleTime: 1000 * 60 * 60 * 24,
gcTime: 1000 * 60 * 60 * 24,
})

// ✅ Lazy load heavy components
const HeavyComponent = dynamic(() => import("./HeavyComponent"), {
loading: () => <Spinner />,
})

// ✅ Convert to Server Component where possible (remove "use client")
```

## Commit Examples

```
perf: SigninForm memo 적용으로 불필요한 리렌더링 제거
perf: useGetSchool staleTime 24시간으로 설정
perf: HeavyComponent dynamic import로 코드 분리
perf: 미사용 의존성 제거로 번들 크기 감소
```
54 changes: 54 additions & 0 deletions .claude/commands/pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Draft and create a pull request based on the current branch: $ARGUMENTS

## Rules

- **All PR content must be written in Korean** (title, summary, work details, review notes)
- **Base branch**: always `develop` (direct PR to `main` is forbidden)
- **Must follow the project PR template** defined in `.github/PULL_REQUEST_TEMPLATE.md`
- Merge only after CI passes

## Instructions

0. **Run `git rev-parse --abbrev-ref HEAD` first. If the current branch is `main` or `develop`, STOP and tell the user to switch to a feature branch before creating a PR.**

1. Run `git log develop..HEAD` to get the commit list
2. Run `git diff develop...HEAD` to understand all changes
3. Draft the PR title and body following the template below
4. Confirm with the user, then run `gh pr create --base develop`

## PR Title Format

```
type: 한국어로 간결하게 (70자 이내)
```

## PR Body Template (must follow exactly)

```markdown
## 💡 PR 요약

> 해당 PR의 변경사항, 해당 이슈 등에 대한 간략한 설명을 작성해주세요.

- {변경사항을 bullet point로 작성}

## 📋 작업 내용

> 해당 PR에서 작업한 내용을 자세히 설명해주세요.

{구체적인 작업 내용 작성}

## 🤝 리뷰 시 참고사항

> 리뷰어분들이 리뷰를 할 때 참고하면 좋을 사항이나 질문사항을 작성해주세요.

{참고사항이 없으면 이 섹션 삭제}
```

## Title Examples

```
feat: 로그인 폼 유효성 검사 추가
fix: 토큰 만료 시 무한 리다이렉트 수정
test: auth 관련 단위 테스트 추가
chore: GitHub Actions CI 설정 추가
```
45 changes: 45 additions & 0 deletions .claude/commands/resolve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Read all open PR review comments and post a reply to each thread: $ARGUMENTS

## Rules

- **All replies must be written in Korean**
- Be concise and clear — include the commit hash when referencing a fix

## Instructions

1. Accept a PR number as argument, or auto-detect from the current branch
```bash
gh pr view --json number,comments,reviewThreads
```

2. Fetch all open review comments
```bash
gh api repos/:owner/:repo/pulls/{pr}/comments
```

3. Classify each comment into one of:
- **반영 완료**: 이미 코드에 반영된 피드백
- **반영 예정**: 수정이 필요한 피드백
- **스킵**: 범위 밖이거나 동의하지 않는 피드백

4. Post a reply to each comment thread
```bash
gh api repos/:owner/:repo/pulls/comments/{comment_id}/replies \
-X POST -f body="<한국어 답글>"
```

## Reply Guidelines

- **반영 완료**: 어떻게 수정했는지 + 커밋 해시 포함
- 예: "`clearAllCookies()` 헬퍼를 추가하고 `beforeEach`에서 호출하도록 수정했습니다. (f812496)"
- **반영 예정**: 수정 방향과 이유 설명
- 예: "다음 커밋에서 `setLocationSearch()` 헬퍼로 추출하겠습니다."
- **스킵**: 이유를 명확하게, 대안이 있으면 함께 제시
- 예: "해당 부분은 Next.js 빌드 산출물 수준으로 판단해 테스트 범위에서 제외했습니다."

## Usage

```
/resolve 174
/resolve https://github.com/School-of-Company/Gwangju-talent-festival-Client/pull/174
```
Loading
Loading