@choblue/claude-code-toolkit 1.1.4 → 1.1.6

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.
@@ -1 +1 @@
1
- 03a6f698d5246e33e211ef5f209fc9471c01cf50
1
+ d077ab9cf015379b7523bdb1d5f301e8492bd08a
package/.claude/CLAUDE.md CHANGED
@@ -89,6 +89,7 @@ Main Agent의 Context Window는 제한적이다. 반드시 서브에이전트에
89
89
  - `SKILL.md` - 공통 TDD 원칙
90
90
  - `frontend.md` - React 테스트 규칙
91
91
  - `backend.md` - NestJS 테스트 규칙
92
+ - `.claude/skills/DDD/SKILL.md` - DDD 전술적 패턴 (Entity, VO, Aggregate, Repository, Domain Event)
92
93
  - `.claude/skills/Git/SKILL.md` - Git 커밋/PR/브랜치 규칙
93
94
 
94
95
  ### Scripts
@@ -7,9 +7,9 @@
7
7
 
8
8
  - **이름**: @choblue/claude-code-toolkit
9
9
  - **브랜치**: main
10
- - **최근 커밋**: 03a6f69 DOCS: skill-detector hook 문서 반영 및 CHANGELOG 추가
11
- - **생성 시간**: 2026-02-25 15:12:39
12
- - **총 파일 수**: 41
10
+ - **최근 커밋**: 1a377b9 FEAT: DDD 전술적 패턴 스킬 추가
11
+ - **생성 시간**: 2026-02-26 14:09:28
12
+ - **총 파일 수**: 44
13
13
 
14
14
  ## 디렉토리 구조
15
15
 
@@ -21,6 +21,7 @@
21
21
  ./.claude/scripts
22
22
  ./.claude/skills
23
23
  ./.claude/skills/Coding
24
+ ./.claude/skills/DDD
24
25
  ./.claude/skills/Git
25
26
  ./.claude/skills/NextJS
26
27
  ./.claude/skills/React
@@ -16,4 +16,5 @@ TypeScript|TypeScript|typescript 타입스크립트 타입 type interface generi
16
16
  TypeORM|TypeORM|typeorm 타입오알엠 entity repository querybuilder migration 마이그레이션 relation 트랜잭션 transaction
17
17
  Coding|Coding|리팩토링 refactor 클린코드 clean code 네이밍 naming 에러처리 error handling 코드품질
18
18
  TDD|TDD|tdd 테스트 test jest vitest 단위테스트 unit test e2e 통합테스트 integration test mock stub spy
19
- Git|Git|git 커밋 commit 브랜치 branch pr pull request merge rebase
19
+ Git|Git|git 커밋 commit 브랜치 branch pr pull request merge rebase
20
+ DDD|DDD|ddd domain entity value object aggregate repository domain service domain event bounded context 도메인 엔티티 값객체 애그리거트 리포지토리 도메인서비스 도메인이벤트
@@ -26,10 +26,108 @@ FE/BE별 상세 규칙은 각각의 파일을 참고한다.
26
26
  - **높은 응집도**: 관련 있는 로직을 같은 모듈에 모은다
27
27
  - 하나의 모듈 안에서 데이터와 동작이 밀접하게 관련된다
28
28
 
29
+ ### Early Return (Guard Clause)
30
+ - 예외/실패 조건을 함수 상단에서 먼저 처리하고 빠져나온다
31
+ - 중첩 if를 줄여 가독성을 높인다
32
+
33
+ ```typescript
34
+ // Bad - 깊은 중첩
35
+ function processOrder(order: Order): void {
36
+ if (order) {
37
+ if (order.isValid()) {
38
+ if (order.items.length > 0) {
39
+ // 실제 로직
40
+ }
41
+ }
42
+ }
43
+ }
44
+
45
+ // Good - 얼리 리턴
46
+ function processOrder(order: Order): void {
47
+ if (!order) return;
48
+ if (!order.isValid()) return;
49
+ if (order.items.length === 0) return;
50
+
51
+ // 실제 로직
52
+ }
53
+ ```
54
+
29
55
  ### DRY (Don't Repeat Yourself)
30
56
  - 동일한 로직이 3번 이상 반복되면 추출한다
31
57
  - 단, 2번까지는 중복을 허용한다 (섣부른 추상화 방지)
32
58
 
59
+ ### 선언적 & 함수형 스타일
60
+
61
+ **선언적 > 명령적** - "어떻게(how)" 대신 "무엇(what)"을 표현한다.
62
+
63
+ ```typescript
64
+ // Bad - 명령적: 루프로 직접 조작
65
+ const activeNames: string[] = [];
66
+ for (const user of users) {
67
+ if (user.isActive) {
68
+ activeNames.push(user.name);
69
+ }
70
+ }
71
+
72
+ // Good - 선언적: 의도를 바로 드러냄
73
+ // 필터/변환 조건은 변수로 추출하여 합성하라
74
+ const isActive = (u: User) => u.isActive;
75
+ const toName = (u: User) => u.name;
76
+ const activeNames = users.filter(isActive).map(toName);
77
+ ```
78
+
79
+ **순수 함수 우선** - 같은 입력이면 항상 같은 출력, 부수효과 없음.
80
+
81
+ ```typescript
82
+ // Bad - 외부 상태를 변경
83
+ let totalPrice = 0;
84
+ function addItemPrice(price: number): void {
85
+ totalPrice += price; // 외부 변수 변경
86
+ }
87
+
88
+ // Good - 새 값을 반환하는 순수 함수
89
+ function calculateTotal(prices: number[]): number {
90
+ return prices.reduce((sum, price) => sum + price, 0);
91
+ }
92
+ ```
93
+
94
+ **불변성** - 기존 데이터를 변경하지 않고 새 데이터를 생성한다.
95
+
96
+ ```typescript
97
+ // Bad - 원본 변경
98
+ user.role = 'admin';
99
+ items.push(newItem);
100
+
101
+ // Good - 새 객체/배열 생성
102
+ const promotedUser = { ...user, role: 'admin' };
103
+ const updatedItems = [...items, newItem];
104
+ ```
105
+
106
+ **부수효과 격리** - 순수 로직과 부수효과(I/O)를 분리한다.
107
+
108
+ ```typescript
109
+ // Bad - 비즈니스 로직에 부수효과가 섞임
110
+ async function processOrder(order: Order): Promise<void> {
111
+ const total = order.items.reduce((s, i) => s + i.price, 0);
112
+ const discount = total > 100 ? total * 0.1 : 0;
113
+ await db.save({ ...order, total: total - discount }); // 부수효과
114
+ await sendEmail(order.userId, total - discount); // 부수효과
115
+ }
116
+
117
+ // Good - 순수 계산과 부수효과를 분리
118
+ function calcOrderTotal(items: OrderItem[]): number {
119
+ const total = items.reduce((s, i) => s + i.price, 0);
120
+ const discount = total > 100 ? total * 0.1 : 0;
121
+ return total - discount;
122
+ }
123
+
124
+ async function processOrder(order: Order): Promise<void> {
125
+ const finalTotal = calcOrderTotal(order.items); // 순수
126
+ await db.save({ ...order, total: finalTotal }); // I/O 경계
127
+ await sendEmail(order.userId, finalTotal); // I/O 경계
128
+ }
129
+ ```
130
+
33
131
  ---
34
132
 
35
133
  ## 2. 네이밍 컨벤션