claude-smith 3.0.0

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.
package/README.ko.md ADDED
@@ -0,0 +1,203 @@
1
+ [English](README.md) | **ν•œκ΅­μ–΄**
2
+
3
+ # πŸ”¨ claude-smith
4
+
5
+ > **Claude Code의 ESLint** β€” AI μ½”λ”© μ„Έμ…˜μ— 물리적 κ°•μ œλ₯Ό λ”ν•©λ‹ˆλ‹€.
6
+
7
+ ## 문제
8
+
9
+ Claude Codeμ—κ²Œ μ΄λ ‡κ²Œ 말해본 적 μžˆλ‚˜μš”?
10
+
11
+ - "ν…ŒμŠ€νŠΈ λ¨Όμ € μž‘μ„±ν•΄μ€˜" β†’ μ½”λ“œλΆ€ν„° μž‘μ„±ν•˜κ³  "μž‘λ™ν•  κ²λ‹ˆλ‹€" 라고 닡함
12
+ - "κΉ¨μ§„ μ½”λ“œ μ»€λ°‹ν•˜μ§€ 마" β†’ ν…ŒμŠ€νŠΈ μ‹€νŒ¨ μƒνƒœλ‘œ 컀밋함
13
+ - "같은 파일 계속 κ³ μΉ˜μ§€ 말고 원인뢀터 νŒŒμ•…ν•΄" β†’ 8번째 μˆ˜μ • μ‹œλ„ 쀑
14
+
15
+ **μ™œ 이런 일이 λ°œμƒν•˜λ‚˜:** Claude CodeλŠ” *μ œμ•ˆ*만 μ΄ν•΄ν•˜κ³  *μ œμ•½*은 λͺ¨λ¦…λ‹ˆλ‹€. `CLAUDE.md`의 κ·œμΉ™μ€ μš”μ²­μΌ 뿐 β€” Claudeκ°€ λ¬΄μ‹œν•΄λ„ 물리적으둜 막을 수 μžˆλŠ” 것이 μ—†μŠ΅λ‹ˆλ‹€. κ°€μ΄λ“œλΌμΈ β‰  κ°•μ œ.
16
+
17
+ λΉ„μš©μ€ λˆ„μ λ©λ‹ˆλ‹€: λ‚­λΉ„λ˜λŠ” 디버깅 μ‹œκ°„, κΉ¨μ§„ CI λΉŒλ“œ, 일관성 μ—†λŠ” μ½”λ“œ, 그리고 κ·œμΉ™μ΄ μ†Œμš©μ—†λ‹€λŠ” 쒌절감.
18
+
19
+ ## ν•΄κ²°μ±…
20
+
21
+ claude-smithλŠ” Claude Code의 λ„€μ΄ν‹°λΈŒ [Hook μ‹œμŠ€ν…œ](https://docs.anthropic.com/en/docs/claude-code/hooks)을 μ‚¬μš©ν•˜μ—¬ 도ꡬ ν˜ΈμΆœμ„ κ°€λ‘œμ±„κ³  κ·œμœ¨μ„ κ°•μ œν•©λ‹ˆλ‹€:
22
+
23
+ ```
24
+ Claudeκ°€ μ»€λ°‹ν•˜λ €κ³  함
25
+ ↓
26
+ Hook이 κ°€λ‘œμ±”: "ν…ŒμŠ€νŠΈ ν†΅κ³Όν–ˆμ–΄?"
27
+ ↓
28
+ 톡과함 β†’ 컀밋 μ§„ν–‰
29
+ μ‹€νŒ¨ν•¨ β†’ exit code 2 β†’ 컀밋이 물리적으둜 차단됨
30
+ ```
31
+
32
+ **"κ·œμΉ™μ„ λ”°λΌμ£Όμ„Έμš”"κ°€ μ•„λ‹ˆλΌ "κ·œμΉ™μ„ λ”°λ₯΄κΈ° μ „κΉŒμ§€ μ§„ν–‰ν•  수 μ—†μŠ΅λ‹ˆλ‹€."**
33
+
34
+ ## λΉ λ₯Έ μ‹œμž‘
35
+
36
+ ```bash
37
+ npx claude-smith init
38
+ ```
39
+
40
+ μ–Έμ–΄λ₯Ό μ„ νƒν•˜λ©΄(en/ko/zh/ja) 끝. 12개 Hook μ„€μΉ˜, κ·œμΉ™ μ£Όμž…, κ°•μ œ ν™œμ„±ν™”.
41
+
42
+ ## 12개 Hook
43
+
44
+ ### μ°¨λ‹¨ν•˜λŠ” Hook (exit code 2 β€” μ§„ν–‰ 자체λ₯Ό λ§‰μŒ)
45
+
46
+ | Hook | μ–Έμ œ | 뭘 ν•˜λ‚˜ |
47
+ |------|------|---------|
48
+ | **Commit Guard** | `git commit` μ‹œ | 졜근 5λΆ„ λ‚΄ ν…ŒμŠ€νŠΈ 톡과 기둝 μ—†μœΌλ©΄ 차단 |
49
+ | **Commit Message** | `git commit` μ‹œ | Conventional Commits ν˜•μ‹ μ•„λ‹ˆλ©΄ 차단 (`feat:`, `fix:`, `docs:` λ“±) |
50
+ | **Build Guard** | `git commit` μ‹œ | λ§ˆμ§€λ§‰ λΉŒλ“œκ°€ μ‹€νŒ¨ν–ˆμœΌλ©΄ 차단 (κΈ°λ³Έ λΉ„ν™œμ„±) |
51
+ | **Debug Loop** | 같은 파일 5회 νŽΈμ§‘ μ‹œ | νŽΈμ§‘ 차단 β€” κ·Όλ³Έ 원인 쑰사λ₯Ό κ°•μ œ |
52
+
53
+ ### κ²½κ³ ν•˜λŠ” Hook (계속 μ§„ν–‰ κ°€λŠ₯ν•˜μ§€λ§Œ μΈμ§€μ‹œν‚΄)
54
+
55
+ | Hook | μ–Έμ œ | 뭘 ν•˜λ‚˜ |
56
+ |------|------|---------|
57
+ | **TDD Guard** | μ½”λ“œ 파일 νŽΈμ§‘ μ‹œ | "아직 ν…ŒμŠ€νŠΈ νŒŒμΌμ„ μˆ˜μ •ν•˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€" |
58
+ | **Debug Loop** | 같은 파일 3회 νŽΈμ§‘ μ‹œ | 슀마트 diff 뢄석: λ°œμ‚°ν˜•(증상 μˆ˜μ •) vs μˆ˜λ ΄ν˜•(μ˜λ―ΈμžˆλŠ” μ§„ν–‰) |
59
+ | **File Size Warn** | 파일 νŽΈμ§‘ μ‹œ | "이 파일이 500쀄 μ΄μƒμž…λ‹ˆλ‹€ β€” 뢄리λ₯Ό κ³ λ €ν•˜μ„Έμš”" |
60
+ | **Scope Guard** | 파일 νŽΈμ§‘ μ‹œ | "변경이 5개 이상 디렉터리에 κ±ΈμΉ©λ‹ˆλ‹€ β€” λ²”μœ„κ°€ λ„“μ§€ μ•Šλ‚˜μš”?" |
61
+ | **Batch Checkpoint** | 3개 νŒŒμΌλ§ˆλ‹€ | "κ³„μ†ν•˜κΈ° 전에 μ‚¬μš©μžμ—κ²Œ μ§„ν–‰ 상황을 λ³΄κ³ ν•˜μ„Έμš”" |
62
+ | **Plan Guard** | μ½”λ“œ 파일 5개 이상 νŽΈμ§‘ μ‹œ | "κ³„μ†ν•˜κΈ° 전에 λΆ„ν•΄ κ³„νšμ„ μž‘μ„±ν•˜μ„Έμš”" |
63
+
64
+ ### μΆ”μ ν•˜λŠ” Hook (무음, 데이터 기둝)
65
+
66
+ | Hook | μ–Έμ œ | 뭘 ν•˜λ‚˜ |
67
+ |------|------|---------|
68
+ | **Test Tracker** | ν…ŒμŠ€νŠΈ λͺ…λ Ή μ‹€ν–‰ μ‹œ | 톡과/μ‹€νŒ¨ 기둝 + 컀버리지 κ°μ†Œ μ‹œ κ²½κ³  |
69
+ | **Build Tracker** | λΉŒλ“œ λͺ…λ Ή μ‹€ν–‰ μ‹œ | 톡과/μ‹€νŒ¨ 기둝 (Commit Guard / Build Guardκ°€ μ°Έμ‘°) |
70
+
71
+ ### μ£Όμž…ν•˜λŠ” Hook (μ»¨ν…μŠ€νŠΈ μ‚½μž…)
72
+
73
+ | Hook | μ–Έμ œ | 뭘 ν•˜λ‚˜ |
74
+ |------|------|---------|
75
+ | **Subagent Injector** | μ„œλΈŒμ—μ΄μ „νŠΈ 생성 μ‹œ | CLAUDE.md κ·œμΉ™μ„ μ„œλΈŒμ—μ΄μ „νŠΈμ— μžλ™ μ£Όμž… |
76
+
77
+ ## λ™μž‘ 원리
78
+
79
+ ```
80
+ Claude Code μ„Έμ…˜
81
+ ↓ (도ꡬ 호좜: Edit, Bash, Write λ“±)
82
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
83
+ β”‚ claude-smith hooks β”‚
84
+ β”‚ β”‚
85
+ β”‚ PreToolUse (도ꡬ μ‹€ν–‰ μ „) β”‚
86
+ β”‚ Edit/Write β†’ TDD Guard (κ²½κ³ ) β”‚
87
+ β”‚ git commit β†’ Commit Guard (차단) β”‚
88
+ β”‚ git commit β†’ Commit Message (차단) β”‚
89
+ β”‚ git commit β†’ Build Guard (차단) β”‚
90
+ β”‚ β”‚
91
+ β”‚ PostToolUse (도ꡬ μ‹€ν–‰ ν›„) β”‚
92
+ β”‚ ν…ŒμŠ€νŠΈ λͺ…λ Ή β†’ Test Tracker (좔적) β”‚
93
+ β”‚ λΉŒλ“œ λͺ…λ Ή β†’ Build Tracker (좔적) β”‚
94
+ β”‚ Edit β†’ Debug Loop (κ²½κ³ /차단) β”‚
95
+ β”‚ Edit β†’ File Size Warn (κ²½κ³ ) β”‚
96
+ │ Edit/Write→ Scope Guard (경고) │
97
+ │ Edit/Write→ Batch Checkpoint (경고) │
98
+ β”‚ Edit/Writeβ†’ Plan Guard (κ²½κ³ /차단) β”‚
99
+ β”‚ β”‚
100
+ β”‚ SubagentStart β”‚
101
+ β”‚ 생성 μ‹œ β†’ Rule Injector (μ£Όμž…) β”‚
102
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
103
+ ↓
104
+ μ½”λ“œ 정상 μ‹€ν–‰
105
+ ```
106
+
107
+ μ™ΈλΆ€ μ˜μ‘΄μ„± μ—†μŒ. λ°±κ·ΈλΌμš΄λ“œ ν”„λ‘œμ„ΈμŠ€ μ—†μŒ. Hook은 ν™œμ„± Claude Code μ„Έμ…˜ μ€‘μ—λ§Œ λ„€μ΄ν‹°λΈŒ `.claude/settings.json`을 톡해 μ‹€ν–‰λ©λ‹ˆλ‹€.
108
+
109
+ ## μ„€μΉ˜λ˜λŠ” ν•­λͺ©
110
+
111
+ | μ»΄ν¬λ„ŒνŠΈ | μœ„μΉ˜ | μš©λ„ |
112
+ |---------|------|------|
113
+ | **12개 κ°•μ œ Hook** | `.claude/hooks/` | 도ꡬ μ‚¬μš© 쀑 μžλ™ 검사 |
114
+ | **Hook μ„€μ •** | `.claude/settings.json` | Hook μ‹€ν–‰ μ‹œμ  μ •μ˜ (κΈ°μ‘΄ μ„€μ •κ³Ό 병합) |
115
+ | **μ›Œν¬ν”Œλ‘œμš° κ·œμΉ™** | `CLAUDE.md` μ„Ήμ…˜ | 사고 νŒ¨ν„΄ ꡐ정 (문제 λΆ„ν•΄, 체계적 디버깅, 합리화 λ°©μ–΄) |
116
+
117
+ ## μŠ¬λž˜μ‹œ μ»€λ§¨λ“œ
118
+
119
+ μ„€μΉ˜ ν›„ Claude Codeμ—μ„œ μ‚¬μš© κ°€λŠ₯ν•œ μ»€λ§¨λ“œ:
120
+
121
+ | μ»€λ§¨λ“œ | κΈ°λŠ₯ |
122
+ |--------|------|
123
+ | `/smith` | μ„Έμ…˜ κ·œμ • μ€€μˆ˜ 톡계 |
124
+ | `/smith-report` | 상세 κ·œμ • μ€€μˆ˜ 리포트 |
125
+ | `/smith-check` | μ„€μΉ˜ 검증 |
126
+ | `/smith-plan` | λΆ„ν•΄ κ³„νš ν…œν”Œλ¦Ώ 생성 |
127
+ | `/smith-update` | 버전 체크 + μ—…κ·Έλ ˆμ΄λ“œ |
128
+
129
+ ## λͺ…λ Ήμ–΄
130
+
131
+ ```bash
132
+ claude-smith init # μ„€μΉ˜ (μΈν„°λž™ν‹°λΈŒ μ–Έμ–΄ 선택)
133
+ claude-smith init --lang=ko # νŠΉμ • μ–Έμ–΄λ‘œ μ„€μΉ˜
134
+ claude-smith update # Hook μ΅œμ‹  버전 μ—…λ°μ΄νŠΈ
135
+ claude-smith check # μ„€μΉ˜ 검증 (12개 Hook)
136
+ claude-smith check --ci # CI/CD용 JSON 좜λ ₯
137
+ claude-smith stats # μ„Έμ…˜ κ·œμ • μ€€μˆ˜ 톡계
138
+ claude-smith report # 상세 κ·œμ • μ€€μˆ˜ 리포트
139
+ claude-smith dashboard # HTML μ‹œκ°μ  λŒ€μ‹œλ³΄λ“œ (λΈŒλΌμš°μ €μ—μ„œ μ—΄λ¦Ό)
140
+ claude-smith create-hook my-hook # μ»€μŠ€ν…€ Hook ν…œν”Œλ¦Ώ 생성
141
+ claude-smith uninstall # λͺ¨λ“  ꡬ성 μš”μ†Œ 제거
142
+ ```
143
+
144
+ ## μ„€μ •
145
+
146
+ ν”„λ‘œμ νŠΈ 레벨 μ„€μ • `.claude-smith.json` (λͺ¨λ“  ν•­λͺ© 선택사항):
147
+
148
+ ```json
149
+ {
150
+ "language": "ko",
151
+ "hooks": {
152
+ "commit-guard": { "maxTestAge": 300 },
153
+ "debug-loop": { "warnAt": 3, "blockAt": 5 },
154
+ "batch-checkpoint": { "fileThreshold": 3 },
155
+ "file-size-warn": { "maxLines": 500 },
156
+ "scope-guard": { "maxDirectories": 5 },
157
+ "build-guard": { "enabled": false }
158
+ }
159
+ }
160
+ ```
161
+
162
+ νŒ€ 전체가 λ™μΌν•œ κ·œμΉ™μ„ κ³΅μœ ν•  수 μžˆλ„λ‘ `.claude-smith.json`을 μ»€λ°‹ν•˜λŠ” 것을 ꢌμž₯ν•©λ‹ˆλ‹€. κ°œλ°œμžλ³„ 섀정을 μ›ν•˜λ©΄ `.gitignore`에 μΆ”κ°€ν•˜μ„Έμš”.
163
+
164
+ ### oh-my-claudecode ν˜Έν™˜μ„±
165
+
166
+ [oh-my-claudecode](https://github.com/nicobailon/oh-my-claudecode)의 병렬 μ—μ΄μ „νŠΈ λͺ¨λ“œ(autopilot, ultrawork, ralph)λ₯Ό μ‚¬μš©ν•˜λŠ” 경우, `omcCompat`둜 μž„κ³„κ°’μ„ μžλ™ 상ν–₯:
167
+
168
+ ```json
169
+ { "omcCompat": true }
170
+ ```
171
+
172
+ | Hook | κΈ°λ³Έκ°’ | omcCompat |
173
+ |------|--------|-----------|
174
+ | debug-loop warnAt | 3 | 6 |
175
+ | debug-loop blockAt | 5 | 10 |
176
+ | batch-checkpoint fileThreshold | 3 | 10 |
177
+ | scope-guard maxDirectories | 5 | 10 |
178
+ | plan-guard warnAt | 5 | 10 |
179
+ | plan-guard blockAt | 10 | 20 |
180
+
181
+ μ‚¬μš©μž 섀정이 항상 `omcCompat` 기본값보닀 μš°μ„ ν•©λ‹ˆλ‹€.
182
+
183
+ ## λ³΄μ•ˆ
184
+
185
+ - **크둜슀 ν”Œλž«νΌ**: macOS, Linux, Windows (`os.tmpdir()`둜 μž„μ‹œ 디렉터리)
186
+ - **μž…λ ₯ 검증**: μ„Έμ…˜/μ—μ΄μ „νŠΈ ID 검증 (`[a-zA-Z0-9_-]`, μ΅œλŒ€ 128자)
187
+ - **μ•ˆμ „ν•œ κΆŒν•œ**: 디렉터리 `0o700`, 파일 `0o600`
188
+ - **경쟁 쑰건 λ°©μ§€**: Hook별 μ›μžμ  μΉ΄μš΄ν„° (곡유 JSON λ―Έμ‚¬μš©)
189
+ - **제둜 μ˜μ‘΄μ„±**: Node.js κΈ°λ³Έ λͺ¨λ“ˆλ§Œ μ‚¬μš©
190
+ - **63개 ν…ŒμŠ€νŠΈ**: λ³΄μ•ˆ μ—£μ§€ μΌ€μ΄μŠ€, μ—λŸ¬ 처리, 크둜슀 ν”Œλž«νΌ μ‹œλ‚˜λ¦¬μ˜€
191
+
192
+ ## μš”κ΅¬ 사항
193
+
194
+ - Node.js >= 18
195
+ - Hook을 μ§€μ›ν•˜λŠ” Claude Code (`.claude/settings.json`)
196
+
197
+ ## λΌμ΄μ„ μŠ€
198
+
199
+ MIT
200
+
201
+ ## 리포지토리
202
+
203
+ https://github.com/lazysaturday91/claude-smith
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ **English** | [ν•œκ΅­μ–΄](README.ko.md)
2
+
3
+ # πŸ”¨ claude-smith
4
+
5
+ > **Claude Code's ESLint** β€” Physical enforcement for AI coding sessions.
6
+
7
+ ## The Problem
8
+
9
+ Have you ever said this to Claude Code?
10
+
11
+ - "Write tests first" β†’ Writes code first, claims "it should work"
12
+ - "Don't commit broken code" β†’ Commits with failing tests anyway
13
+ - "Stop editing the same file" β†’ 8th attempt, still no root cause analysis
14
+
15
+ **Why it happens:** Claude Code understands *suggestions*, not *constraints*. Rules in `CLAUDE.md` are requests β€” Claude can ignore them because nothing physically stops it. Guidelines β‰  enforcement.
16
+
17
+ The cost compounds: wasted debugging time, broken CI builds, inconsistent code, and the frustration of rules that don't stick.
18
+
19
+ ## The Solution
20
+
21
+ claude-smith uses Claude Code's native [Hook system](https://docs.anthropic.com/en/docs/claude-code/hooks) to intercept tool calls and enforce discipline:
22
+
23
+ ```
24
+ Claude tries to commit
25
+ ↓
26
+ Hook intercepts: "Did tests pass?"
27
+ ↓
28
+ Yes β†’ Commit proceeds
29
+ No β†’ exit code 2 β†’ Commit physically blocked
30
+ ```
31
+
32
+ **Not "please follow the rules" β€” "you cannot proceed until you follow the rules."**
33
+
34
+ ## Quick Start
35
+
36
+ ```bash
37
+ npx claude-smith init
38
+ ```
39
+
40
+ Select your language (en/ko/zh/ja), and you're done. 12 hooks installed, rules injected, enforcement active.
41
+
42
+ ## The 12 Hooks
43
+
44
+ ### Hooks That Block (exit code 2 β€” action physically prevented)
45
+
46
+ | Hook | When | What |
47
+ |------|------|------|
48
+ | **Commit Guard** | `git commit` | Blocks if tests haven't passed in the last 5 minutes |
49
+ | **Commit Message** | `git commit` | Blocks non-conventional format (`feat:`, `fix:`, `docs:`, etc.) |
50
+ | **Build Guard** | `git commit` | Blocks if last build failed (off by default) |
51
+ | **Debug Loop** | 5th edit to same file | Blocks editing β€” forces root cause investigation |
52
+
53
+ ### Hooks That Warn (continues but Claude sees the warning)
54
+
55
+ | Hook | When | What |
56
+ |------|------|------|
57
+ | **TDD Guard** | Code file edit | "You haven't edited a test file yet" |
58
+ | **Debug Loop** | 3rd edit to same file | Smart diff analysis: divergent (symptom-fixing) vs convergent (meaningful progress) |
59
+ | **File Size Warn** | File edit | "This file is 500+ lines β€” consider splitting" |
60
+ | **Scope Guard** | File edit | "Changes span 5+ directories β€” scope too broad?" |
61
+ | **Batch Checkpoint** | Every 3 files | "Report progress to the user before continuing" |
62
+ | **Plan Guard** | 5+ code files edited | "Create a decomposition plan before continuing" |
63
+
64
+ ### Hooks That Track (silent, records data)
65
+
66
+ | Hook | When | What |
67
+ |------|------|------|
68
+ | **Test Tracker** | Test command runs | Records pass/fail + warns on coverage decrease |
69
+ | **Build Tracker** | Build command runs | Records pass/fail for Commit Guard / Build Guard |
70
+
71
+ ### Hooks That Inject (context insertion)
72
+
73
+ | Hook | When | What |
74
+ |------|------|------|
75
+ | **Subagent Injector** | Subagent spawns | Auto-injects CLAUDE.md rules into subagent context |
76
+
77
+ ## How It Works
78
+
79
+ ```
80
+ Claude Code Session
81
+ ↓ (tool call: Edit, Bash, Write, etc.)
82
+ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
83
+ β”‚ claude-smith hooks β”‚
84
+ β”‚ β”‚
85
+ β”‚ PreToolUse (before tool executes) β”‚
86
+ β”‚ Edit/Write β†’ TDD Guard (warn) β”‚
87
+ β”‚ git commit β†’ Commit Guard (block) β”‚
88
+ β”‚ git commit β†’ Commit Message (block) β”‚
89
+ β”‚ git commit β†’ Build Guard (block) β”‚
90
+ β”‚ β”‚
91
+ β”‚ PostToolUse (after tool executes) β”‚
92
+ β”‚ test cmd β†’ Test Tracker (track) β”‚
93
+ β”‚ build cmd β†’ Build Tracker (track) β”‚
94
+ β”‚ Edit β†’ Debug Loop (warn/block) β”‚
95
+ β”‚ Edit β†’ File Size Warn (warn) β”‚
96
+ │ Edit/Write→ Scope Guard (warn) │
97
+ │ Edit/Write→ Batch Checkpoint (warn) │
98
+ │ Edit/Write→ Plan Guard (warn/block) │
99
+ β”‚ β”‚
100
+ β”‚ SubagentStart β”‚
101
+ β”‚ Any spawn β†’ Rule Injector (inject) β”‚
102
+ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
103
+ ↓
104
+ Code runs normally
105
+ ```
106
+
107
+ No external dependencies. No background processes. Hooks run only during active Claude Code sessions via native `.claude/settings.json`.
108
+
109
+ ## What Gets Installed
110
+
111
+ | Component | Location | Purpose |
112
+ |-----------|----------|---------|
113
+ | **12 Enforcement Hooks** | `.claude/hooks/` | Automated checks during tool use |
114
+ | **Hook Configuration** | `.claude/settings.json` | Defines when hooks run (merged with existing) |
115
+ | **Workflow Rules** | `CLAUDE.md` section | Thought-pattern coaching (problem decomposition, systematic debugging, rationalization defense) |
116
+
117
+ ## Slash Commands
118
+
119
+ After installation, these commands are available in Claude Code:
120
+
121
+ | Command | What it does |
122
+ |---------|-------------|
123
+ | `/smith` | Session compliance statistics |
124
+ | `/smith-report` | Detailed compliance report |
125
+ | `/smith-check` | Validate installation |
126
+ | `/smith-plan` | Generate decomposition plan template |
127
+ | `/smith-update` | Check for updates and upgrade |
128
+
129
+ ## Commands
130
+
131
+ ```bash
132
+ claude-smith init # Install (interactive language selection)
133
+ claude-smith init --lang=ko # Install with specific language
134
+ claude-smith update # Update hooks to latest version
135
+ claude-smith check # Validate installation (12 hooks)
136
+ claude-smith check --ci # JSON output for CI/CD pipelines
137
+ claude-smith stats # Session compliance statistics
138
+ claude-smith report # Detailed compliance report
139
+ claude-smith dashboard # HTML visual dashboard (opens in browser)
140
+ claude-smith create-hook my-hook # Scaffold a custom hook
141
+ claude-smith uninstall # Remove all components
142
+ ```
143
+
144
+ ## Configuration
145
+
146
+ Project-level settings in `.claude-smith.json` (all optional):
147
+
148
+ ```json
149
+ {
150
+ "language": "en",
151
+ "hooks": {
152
+ "commit-guard": { "maxTestAge": 300 },
153
+ "debug-loop": { "warnAt": 3, "blockAt": 5 },
154
+ "batch-checkpoint": { "fileThreshold": 3 },
155
+ "file-size-warn": { "maxLines": 500 },
156
+ "scope-guard": { "maxDirectories": 5 },
157
+ "build-guard": { "enabled": false }
158
+ }
159
+ }
160
+ ```
161
+
162
+ We recommend committing `.claude-smith.json` so the whole team shares the same enforcement. For per-developer settings, add it to `.gitignore`.
163
+
164
+ ### oh-my-claudecode Compatibility
165
+
166
+ If you use [oh-my-claudecode](https://github.com/nicobailon/oh-my-claudecode) with parallel agent modes (autopilot, ultrawork, ralph), enable `omcCompat` to auto-raise thresholds:
167
+
168
+ ```json
169
+ { "omcCompat": true }
170
+ ```
171
+
172
+ | Hook | Default | omcCompat |
173
+ |------|---------|-----------|
174
+ | debug-loop warnAt | 3 | 6 |
175
+ | debug-loop blockAt | 5 | 10 |
176
+ | batch-checkpoint fileThreshold | 3 | 10 |
177
+ | scope-guard maxDirectories | 5 | 10 |
178
+ | plan-guard warnAt | 5 | 10 |
179
+ | plan-guard blockAt | 10 | 20 |
180
+
181
+ User settings always take priority over `omcCompat` defaults.
182
+
183
+ ## Security
184
+
185
+ - **Cross-platform**: macOS, Linux, Windows (`os.tmpdir()` for temp dirs)
186
+ - **Input sanitization**: Session/agent IDs validated (`[a-zA-Z0-9_-]`, max 128 chars)
187
+ - **Secure permissions**: Directories `0o700`, files `0o600`
188
+ - **Race-condition safe**: Per-hook atomic counters (no shared JSON)
189
+ - **Zero dependencies**: Node.js built-in modules only
190
+ - **63 tests**: Security edge cases, error handling, cross-platform scenarios
191
+
192
+ ## Requirements
193
+
194
+ - Node.js >= 18
195
+ - Claude Code with hook support (`.claude/settings.json`)
196
+
197
+ ## License
198
+
199
+ MIT
200
+
201
+ ## Repository
202
+
203
+ https://github.com/lazysaturday91/claude-smith