Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
9 changes: 0 additions & 9 deletions .claude/hooks/notify.ps1

This file was deleted.

29 changes: 0 additions & 29 deletions .claude/hooks/notify.py

This file was deleted.

48 changes: 0 additions & 48 deletions .claude/hooks/post-edit-check.py

This file was deleted.

18 changes: 18 additions & 0 deletions .claude/rules/code-style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Code Style

## Naming
- DTO factory: `of(A, B)` for multiple params / `from(X)` for single param
- Request/Response classes: `XxxRequest`, `XxxResponse`
- REST endpoints: kebab-case only (`/user-profile`, NOT `/userProfile`)

## Formatting
- Blank line before every class declaration
- Newline at end of every file
- No wildcard imports
- Controller method params: always on separate lines
- 3+ params anywhere: always on separate lines
- Private methods: placed immediately below the public method that calls them

## Types
- Non-null: primitives (`int`, `long`, `boolean`)
- Nullable: wrapper types (`Integer`, `Long`, `Boolean`)
31 changes: 31 additions & 0 deletions .claude/rules/database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Database

## JPA Entity

- Every field requires `@Column(name = "...", nullable = ...)`
- Field name must match DB column name exactly (snake_case)
- `@Table(name = "...")` required on every entity class
Comment on lines +11 to +13
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

1) 규칙 문구가 예시와 충돌합니다 (Line 6)

현재 문구(Field name must match DB column name exactly (snake_case))는 아래 예시 코드의 camelCase 필드와 모순됩니다. “필드명과 컬럼명이 1:1 매핑되어야 하며, 컬럼명은 snake_case”처럼 표현을 바꾸는 편이 정확합니다.

수정 제안
-- Field name must match DB column name exactly (snake_case)
+- Java field names should map 1:1 to DB columns via `@Column(name = "...")`, and DB column names must use snake_case
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/rules/database.md around lines 5 - 7, The rule text "Field name must
match DB column name exactly (snake_case)" contradicts the example using
camelCase; update that line to clarify the intended mapping by replacing it with
a phrase like "Field name must map 1:1 to DB column name; DB column names must
be snake_case" so the rule and the example align; ensure the exact phrase "Field
name must map 1:1 to DB column name; DB column names must be snake_case" (or
equivalent) is used in place of the old sentence to remove ambiguity.


```java
@Entity
@Table(name = "chat_room")
public class ChatRoom {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;

@Column(name = "is_group", nullable = false)
private boolean isGroup;

@Column(name = "mentoring_id", nullable = true)
private Long mentoringId;
}
```

## Flyway

- Location: `src/main/resources/db/migration/`
- Naming: `V{VERSION}__{DESCRIPTION}.sql` (double underscore)
- NEVER modify a deployed migration — always create a new version
41 changes: 41 additions & 0 deletions .claude/rules/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Testing

Base annotation: `@TestContainerSpringBootTest` for all integration tests.

## Test data — Fixture pattern

```java
@TestComponent
@RequiredArgsConstructor
public class ChatRoomFixture {
private final ChatRoomFixtureBuilder chatRoomFixtureBuilder;

public ChatRoom 채팅방(boolean isGroup) { ... } // Korean method names
public ChatRoom 멘토링_채팅방(long mentoringId) { ... }
}
```

## Test class structure

```java
@TestContainerSpringBootTest
@DisplayName("XXX 서비스 테스트")
class XxxServiceTest {

@Nested
class 기능명 {

@Test
void 한국어_메서드명() {
// given
// when
// then
}
}
}
```

- `@Nested` for grouping by feature
- Korean names on `@Nested` classes and `@Test` methods
- Given-When-Then with inline comments
- Tests are independent — no shared state across tests
11 changes: 0 additions & 11 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
},
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "python3 .claude/hooks/notify.py 2>/dev/null || python .claude/hooks/notify.py"
}
]
}
],
"PostToolUse": [
{
"matcher": "Edit|Write",
Expand Down
Loading
Loading