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
18 changes: 18 additions & 0 deletions Fantasy-server/.agents/skills/build/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: build
description: Builds the Fantasy.Server project and reports errors. Use for checking build failures and debugging compile errors.
allowed-tools: Bash(dotnet build:*)
context: fork
---

Build the server project and report any errors.

## Steps

1. Run the build command:
```bash
dotnet build Fantasy.Server/Fantasy.Server.csproj
```
2. Check the build output:
- If the build **succeeds**: confirm success and show the summary (warnings, if any)
- If the build **fails**: list each error with its file path and line number, then explain the likely cause and how to fix it
158 changes: 158 additions & 0 deletions Fantasy-server/.agents/skills/code-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
---
name: code-review
description: Run a structured checklist over changed files against project conventions (architecture, code style, EF Core, DI, testing). Produces a ✓/⚠/✗ report in Korean.
allowed-tools: Bash(git diff:*), Bash(git log:*), Bash(git branch:*), Read, Glob, Grep
context: fork
---

# Code Review

Review changed files against project conventions and produce a Korean report.

## Step 1 — Determine Scope

1. Get current branch: `git branch --show-current`
2. Determine base branch:
- If an argument is provided (e.g., `/code-review develop`) → use that branch as base
- Otherwise → use `main` as base
3. List changed files: `git diff {base}...HEAD --name-only`
4. Get detailed diff: `git diff {base}...HEAD`
5. Get commit list: `git log {base}..HEAD --oneline`

## Step 2 — Read Changed Files

- Read each changed `.cs` file with the Read tool.
- Read non-`.cs` files (`.json`, `.md`, `.csproj`) only if relevant to the checklist.

## Step 3 — Apply Checklist

Review only files that were actually changed. Skip categories with no relevant changes.

---

### [ARCH] Architecture & Layering

- [ ] Controllers depend only on service interfaces — no concrete service classes
- [ ] Services depend only on repository interfaces — no direct `AppDbContext` access
- [ ] Only repositories access `AppDbContext`
- [ ] New domain follows `Domain/{Name}/` structure (Config / Controller / Dto / Entity / Repository / Service)
- [ ] New domain DI extension method is called from `Program.cs`

### [STYLE] C# Code Style

- [ ] `var` used only when type is obvious from the right-hand side
- [ ] Private fields: `_camelCase`; everything else: `PascalCase`
- [ ] Dependencies injected via constructor into `private readonly` fields
- [ ] Constructors contain no logic — assignments only
- [ ] Single-expression methods use expression-body (`=>`)
- [ ] No XML doc comments (`///`) unless explicitly requested
- [ ] No `#region` blocks

### [DTO] DTO Pattern

- [ ] `record` types with positional parameters
- [ ] DataAnnotations applied directly on parameters (`[Required]`, `[MaxLength]`, etc.)
- [ ] Requests in `Dto/Request/`, Responses in `Dto/Response/`

### [ENTITY] Entity Pattern

- [ ] All setters are `private set`
- [ ] Static factory method `Create(...)` used instead of public constructor
- [ ] Timestamps use `DateTime.UtcNow`
- [ ] No DataAnnotations on entities — EF config via Fluent API only
- [ ] EF Fluent config implements `IEntityTypeConfiguration<T>` in `Entity/Config/`
- [ ] `DbSet<T>` registered in `AppDbContext`
- [ ] Table/column names: `snake_case`, schema-qualified (`"schema"."table"`)
- [ ] Enums use `HasConversion<string>()`

### [SERVICE] Service Pattern

- [ ] One use case = one class + one interface
- [ ] Interface exposes exactly one `ExecuteAsync` method
- [ ] Business exceptions use Gamism.SDK types (`ConflictException`, `NotFoundException`, etc.)
- [ ] No empty catch blocks; no bare re-throw without added context

### [REPO] Repository Pattern

- [ ] Read-only queries use `AsNoTracking()`
- [ ] `SaveAsync` checks Detached state before calling `AddAsync`

### [CONTROLLER] Controller Pattern

- [ ] Return type is `CommonApiResponse` (Gamism.SDK)
- [ ] Only service interfaces injected — no concrete classes
- [ ] Rate limiting applied with `[EnableRateLimiting("login"|"game")]` where needed
- [ ] Authenticated endpoints annotated with `[Authorize]`

### [ASYNC] Async Pattern

- [ ] All I/O methods are `async Task` / `async Task<T>`
- [ ] No `.Result` or `.Wait()` calls
- [ ] No unintentional fire-and-forget — every async call is awaited

### [SECURITY] Security

- [ ] No plain-text passwords — `BCrypt.Net.BCrypt.HashPassword` required
- [ ] No hardcoded secrets (API keys, passwords, connection strings)
- [ ] No sensitive data (passwords, tokens) written to logs

### [REDIS] Redis Cache Pattern (only when Redis code changed)

- [ ] Read flow: check Redis first → on miss query DB → SET cache → return
- [ ] Write flow: update DB → DEL cache key (invalidate)

### [DI] DI Registration

- [ ] Domain services registered via `{Name}ServiceConfig.cs` extension method
- [ ] Extension method called from `Program.cs`

### [TEST] Tests (only when Fantasy.Test files changed)

- [ ] Test class name: `{ServiceName}Test`
- [ ] Test method name: `{MethodName}_{Scenario}_{ExpectedResult}`
- [ ] No direct `AppDbContext` mocks — mock repository interfaces instead
- [ ] `NSubstitute` used for mocking
- [ ] Arrange / Act / Assert structure with blank line separators

---

## Step 4 — Output Report

Write the report in Korean using the following format:

```
## 코드 리뷰 리포트

### 변경 범위
- 브랜치: {current} ← {base}
- 변경 파일 수: N개
- 커밋: {commit summary}

---

### [ARCH] 아키텍처 · 레이어링
✓ ...
⚠ ...
✗ ...

(repeat for each category that has changes; skip empty categories)

---

### 종합 결과
| 등급 | 건수 |
|------|------|
| ✓ 통과 | N |
| ⚠ 경고 | N |
| ✗ 오류 | N |

총 N개 항목 검토 — 오류 N건, 경고 N건
```

**Symbol meanings:**
- ✓ — convention followed
- ⚠ — recommendation (optional fix)
- ✗ — convention violation (fix required)

For each ✗ item, include the file name, approximate line, and suggested fix.
Skip categories with no relevant changes.
45 changes: 30 additions & 15 deletions Fantasy-server/.agents/skills/commit/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
---
---
name: commit
description: Creates Git commits by splitting changes into logical units. Use for staging files and writing commit messages.
allowed-tools: Bash(git status:*), Bash(git diff:*), Bash(git add:*), Bash(git commit:*), Bash(git log:*)
---

Create Git commits following the project's commit conventions.

## Argument

`$ARGUMENTS` — optional GitHub issue number (e.g. `/commit 42`)

- If provided, add `#42` as the commit body (blank line after subject, then the reference).
- If omitted, commit without any issue reference.

## Commit Message Format

Subject line only (no issue):
```
{type}: {Korean description}
```

With issue number:
```
{type}: {Korean description}

#{issue}
```

**Types**:
- `feat` — new feature added
- `fix` — bug fix, missing config, or missing DI registration
- `update` — modification to existing code
- `docs` - documentation-only changes
- `cicd` — changes to CI/CD configuration, scripts, or workflows
- `chore` — tooling, CI/CD, dependency updates, config changes unrelated to app logic

**Description rules**:
- Written in **Korean**
Expand All @@ -28,29 +42,30 @@ Create Git commits following the project's commit conventions.
**Examples**:
```
feat: 로그인 로직 추가
```
```
fix: 세션 DI 누락 수정
update: Account 엔터티 수정
docs: API 명세서 업데이트
cicd: GitHub Actions 워크플로우 수정

#12
```

See `.claude/skills/commit/examples/type-guide.md` for a boundary-rule table and real scenarios from this project.

**Do NOT**:
- Add Claude as co-author
- Write descriptions in English
- Add a commit body — subject line only

## Steps

1. Check all changes with `git status` and `git diff`
2. Categorize changes into logical units:
- New feature addition → `feat`
- Bug / missing registration fix → `fix`
- Modification to existing code → `update`
- New feature addition → `feat`
- Bug / missing registration fix → `fix`
- Modification to existing code → `update`
3. Group files by each logical unit
4. For each group:
- **Stage only the relevant files** with `git add <files>`
- Write a concise commit message following the format above
- **IMPORTANT: Display the staged files and the proposed commit message to the user.**
- **Ask the user: "이 내용으로 커밋하시겠습니까? (Y/n)"**
- **Only execute `git commit -m "message"` if the user approves.**
- Stage only the relevant files with `git add <files>`
- Write a concise commit message following the format above
- If `$ARGUMENTS` is provided: `git commit -m "{subject}" -m "#{issue}"`
- If `$ARGUMENTS` is omitted: `git commit -m "{subject}"`
5. Verify results with `git log --oneline -n {number of commits made}`
82 changes: 82 additions & 0 deletions Fantasy-server/.agents/skills/commit/examples/type-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Commit Type Guide — Fantasy Server

## feat — New capability added to the codebase

Use when creating new files is the primary change.

**Examples from this project:**

| Change | Commit message |
|---|---|
| Add LoginService.cs, LogoutService.cs | `feat: 로그인·로그아웃 서비스 추가` |
| Add AuthController.cs | `feat: Auth 컨트롤러 추가` |
| Add RefreshTokenRedisRepository.cs | `feat: 리프레시 토큰 Redis 레포지토리 추가` |
| Add new Entity class | `feat: {EntityName} 엔터티 추가` |
| Add new test class | `feat: {ServiceName} 테스트 추가` |
| Add new migration file | `feat: {MigrationName} 마이그레이션 추가` |

---

## fix — Broken behavior or missing registration/config corrected

Use when existing code is wrong, or a required wiring (DI, config key, middleware) is absent.
Adding only a DI registration line without adding the service file itself is also `fix`.

**Examples from this project:**

| Change | Commit message |
|---|---|
| Add missing `services.AddScoped<IAccountRepository, AccountRepository>()` in `Program.cs` | `fix: IAccountRepository DI 누락 수정` |
| Fix wrong prefix on Redis key | `fix: Redis 리프레시 토큰 키 prefix 수정` |
| Remove misconfigured EF Core ValueGeneration | `fix: UpdatedAt 자동 생성 설정 제거` |
| Fix typo in port value in `appsettings.json` | `fix: 개발 환경 DB 포트 수정` |
| Fix password comparison using HashPassword instead of BCrypt.Verify | `fix: 비밀번호 검증 로직 수정` |

---

## update — Existing code modified without adding a new capability

Use when modifying files that already exist — renaming, restructuring, adjusting behavior, etc.

**Examples from this project:**

| Change | Commit message |
|---|---|
| Change response type from `T` to `CommonApiResponse<T>` | `update: Auth 응답 타입을 CommonApiResponse로 변경` |
| Move JwtProvider to a different namespace | `update: JwtProvider를 Jwt 네임스페이스로 이동` |
| Update port/connection string in appsettings | `update: Docker 서비스 이름 통일 및 연결 문자열 수정` |
| Modify a property on an existing Entity | `update: Account 엔터티 수정` |
| Add a test method to an existing test class | `update: LoginService 테스트 추가` |
| Merge CI workflow steps | `update: CI 워크플로우 빌드·테스트 단계 통합` |

---

## Boundary rules

| Situation | Type |
|---|---|
| New `.cs` service/repository/controller file added | `feat` |
| New method added to an existing `.cs` file | `update` |
| DI registration line added alone, no new service file (`Program.cs`, `*Config.cs`) | `fix` |
| New service file + its DI registration added together | `feat` (same logical unit) |
| New migration file added | `feat` |
| Existing migration file corrected (column issue) | `fix` |
| New test class added | `feat` |
| Test method added to an existing test class | `update` |
| Refactoring without behavior change | `update` |

---

## When to split into multiple commits

If a branch mixes new features with unrelated bug fixes, split them:

```
# New service + its DI registration → one logical unit, commit together
git add Domain/Auth/Service/LoginService.cs Domain/Auth/Config/AuthServiceConfig.cs
git commit -m "feat: 로그인 서비스 추가"

# Separate Redis key bug fix → independent fix
git add Domain/Auth/Repository/RefreshTokenRedisRepository.cs
git commit -m "fix: 리프레시 토큰 Redis 키 prefix 수정"
```
Loading
Loading