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 +203 -0
- package/README.md +203 -0
- package/bin/cli.mjs +929 -0
- package/hooks/batch-checkpoint.mjs +81 -0
- package/hooks/build-guard.mjs +48 -0
- package/hooks/build-tracker.mjs +44 -0
- package/hooks/commit-guard.mjs +81 -0
- package/hooks/commit-message.mjs +55 -0
- package/hooks/debug-loop.mjs +114 -0
- package/hooks/file-size-warn.mjs +52 -0
- package/hooks/plan-guard.mjs +127 -0
- package/hooks/scope-guard.mjs +80 -0
- package/hooks/subagent-inject.mjs +37 -0
- package/hooks/tdd-guard.mjs +69 -0
- package/hooks/test-tracker.mjs +87 -0
- package/lib/config.mjs +89 -0
- package/lib/stats.mjs +39 -0
- package/package.json +42 -0
- package/templates/commands/smith-check.md +5 -0
- package/templates/commands/smith-plan.md +26 -0
- package/templates/commands/smith-report.md +5 -0
- package/templates/commands/smith-update.md +9 -0
- package/templates/commands/smith.md +9 -0
- package/templates/rules.en.md +216 -0
- package/templates/rules.ja.md +216 -0
- package/templates/rules.ko.md +216 -0
- package/templates/rules.md +216 -0
- package/templates/rules.zh.md +216 -0
- package/templates/settings.json +140 -0
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
|