claude-auto 0.13.3 → 0.13.4

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.
Files changed (34) hide show
  1. package/.claude-auto/.claude.hooks.json +2 -1
  2. package/README.md +242 -88
  3. package/dist/bundle/scripts/auto-continue.js +1 -1
  4. package/dist/bundle/scripts/pre-tool-use.js +1 -1
  5. package/dist/src/cli/cli.test.js +246 -0
  6. package/dist/src/cli/cli.test.js.map +1 -1
  7. package/dist/src/cli/install.d.ts +2 -0
  8. package/dist/src/cli/install.d.ts.map +1 -1
  9. package/dist/src/cli/install.js +10 -5
  10. package/dist/src/cli/install.js.map +1 -1
  11. package/dist/src/cli/install.test.js +85 -0
  12. package/dist/src/cli/install.test.js.map +1 -1
  13. package/dist/src/cli/tui/log-tailer.d.ts.map +1 -1
  14. package/dist/src/cli/tui/log-tailer.js +1 -7
  15. package/dist/src/cli/tui/log-tailer.js.map +1 -1
  16. package/dist/src/cli/tui/log-tailer.test.js +19 -0
  17. package/dist/src/cli/tui/log-tailer.test.js.map +1 -1
  18. package/dist/src/cli/tui/tui.test.js +17 -0
  19. package/dist/src/cli/tui/tui.test.js.map +1 -1
  20. package/dist/src/commit-validator.test.js +188 -0
  21. package/dist/src/commit-validator.test.js.map +1 -1
  22. package/dist/src/hook-state.d.ts +1 -1
  23. package/dist/src/hook-state.d.ts.map +1 -1
  24. package/dist/src/hooks/auto-continue.js +1 -1
  25. package/dist/src/hooks/auto-continue.js.map +1 -1
  26. package/dist/src/hooks/auto-continue.test.js +26 -0
  27. package/dist/src/hooks/auto-continue.test.js.map +1 -1
  28. package/dist/src/hooks/pre-tool-use.js +1 -1
  29. package/dist/src/hooks/pre-tool-use.js.map +1 -1
  30. package/dist/src/hooks/pre-tool-use.test.js +7 -0
  31. package/dist/src/hooks/pre-tool-use.test.js.map +1 -1
  32. package/dist/src/validator-loader.test.js +22 -0
  33. package/dist/src/validator-loader.test.js.map +1 -1
  34. package/package.json +1 -1
@@ -6,7 +6,8 @@
6
6
  "skipModes": ["plan"]
7
7
  },
8
8
  "validateCommit": {
9
- "mode": "strict"
9
+ "mode": "strict",
10
+ "batchCount": 17
10
11
  },
11
12
  "denyList": {
12
13
  "enabled": true,
package/README.md CHANGED
@@ -1,172 +1,326 @@
1
1
  # Claude Auto
2
2
 
3
- **Put Claude on Auto.**
3
+ Husky-style hooks and skills management for Claude Code.
4
4
 
5
- [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE) [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square)]()
5
+ [![Build](https://img.shields.io/github/actions/workflow/status/BeOnAuto/claude-auto/ci.yml?style=flat-square)](https://github.com/BeOnAuto/claude-auto/actions) [![npm](https://img.shields.io/npm/v/claude-auto?style=flat-square)](https://www.npmjs.com/package/claude-auto) [![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE) [![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square)]()
6
6
 
7
7
  ---
8
8
 
9
- ## The Problem: You're an AI Babysitter
9
+ ## Purpose
10
10
 
11
- AI-assisted coding captured your cognitive load.
11
+ Without Claude Auto, you babysit every AI coding session. You watch, nudge, correct, and context-switch constantly. One task at a time, full attention required.
12
12
 
13
- Every session demands your full attention. Watching, nudging, correcting. You can't shift focus because you don't trust the system.
13
+ Claude Auto installs a quality loop into Claude Code via hooks. Validators gate every commit. Reminders inject your guidelines into every prompt. Deny-lists protect files from modification. Auto-continue keeps the agent working until the plan is done. The system earns trust, and trust enables parallelization via git worktrees.
14
14
 
15
- - You can't context-switch while supervising
16
- - One task at a time, full attention required
17
- - The bottleneck is your attention, not AI's speed
15
+ ## Key Concepts
18
16
 
19
- That's not multiplication. That's marginally faster serial work.
17
+ - **Hooks**: Four integration points (SessionStart, PreToolUse, UserPromptSubmit, Stop) that let Claude Auto observe and control Claude Code's behavior
18
+ - **Validators**: Markdown files with YAML frontmatter that ACK or NACK commits based on your criteria
19
+ - **Reminders**: Context-injection files that surface your guidelines at the right moment
20
+ - **Deny-list**: Glob patterns that protect files from modification
21
+ - **TCR Discipline**: Test && Commit || Revert. Bad code auto-reverts
22
+ - **Auto-Continue**: Keeps the agent going until the plan is done
20
23
 
21
24
  ---
22
25
 
23
- ## The Solution: The Quality Loop
26
+ ## Installation
24
27
 
25
- Claude Auto earns trust. Trust enables parallelization.
28
+ ```bash
29
+ npx claude-auto install
30
+ ```
31
+
32
+ ## Quick Start
33
+
34
+ ```bash
35
+ npx claude-auto install
36
+ npx claude-auto doctor
37
+ ```
38
+
39
+ After installation, Claude Auto automatically:
40
+
41
+ - Injects hooks that validate every commit against your criteria
42
+ - Creates reminders that inject your guidelines into prompts
43
+ - Sets up file protection via deny-lists
44
+ - Merges settings with smart project/local overrides
26
45
 
27
- | Component | What It Does | Result |
28
- | ------------------ | -------------------------------------------- | ------------------------------- |
29
- | **Auto-Planner** | Generates plan from your requirements | No need to specify every detail |
30
- | **Supervisor AI** | Validates every commit against your criteria | Automated review |
31
- | **TCR Discipline** | Test && Commit \|\| Revert | Bad code auto-reverts |
32
- | **Auto-Continue** | Keeps going until the plan is done | You check back, not babysit |
46
+ **Next steps:**
33
47
 
34
- The system is trustworthy. That's what lets you direct instead of babysit.
48
+ - [Getting Started guide](./docs/getting-started.md)
49
+ - [The Ketchup Technique](./docs/ketchup-technique.md)
35
50
 
36
51
  ---
37
52
 
38
- ## The Multiplier: Git Worktrees
53
+ ## How-to Guides
39
54
 
40
- Git worktrees let you run multiple isolated workspaces from the same repo.
55
+ ### Verify Installation Health
56
+
57
+ ```bash
58
+ npx claude-auto doctor
59
+ ```
60
+
61
+ ### Fix Broken Symlinks
62
+
63
+ ```bash
64
+ npx claude-auto repair
65
+ ```
66
+
67
+ ### List Active Reminders
68
+
69
+ ```bash
70
+ npx claude-auto reminders
71
+ ```
72
+
73
+ ### Configure for CI/CD
74
+
75
+ ```bash
76
+ npx claude-auto install --non-interactive
77
+ ```
78
+
79
+ ### Multiply with Git Worktrees
41
80
 
42
81
  ```bash
43
- # Create worktrees for parallel features
44
82
  git worktree add ../feature-auth feature/auth
45
83
  git worktree add ../feature-payments feature/payments
46
- git worktree add ../feature-dashboard feature/dashboard
47
- ```
48
84
 
49
- Each runs a Claude Auto instance. All quality-validated.
85
+ cd ../feature-auth && npx claude-auto install
86
+ cd ../feature-payments && npx claude-auto install
87
+ ```
50
88
 
51
- | Approach | Features/Week |
52
- | ----------------------------- | ------------- |
53
- | Manual coding | 1 |
54
- | AI-assisted (babysitting) | 1-2 |
55
- | **Claude Auto + Worktrees** | **10+** |
89
+ Each worktree runs its own Claude Auto instance, all quality-validated.
56
90
 
57
91
  ---
58
92
 
59
- ## Three Steps
93
+ ## CLI Reference
94
+
95
+ ### Commands
96
+
97
+ #### `claude-auto install`
60
98
 
61
- ### 1. Install
99
+ Install and configure Claude Auto in your project.
62
100
 
63
101
  ```bash
64
- npx claude-auto install
102
+ claude-auto install [target-path] [options]
65
103
  ```
66
104
 
67
- Feed your requirements. Claude Auto auto-generates the plan with Bottles, Bursts, and Dependencies.
105
+ | Option | Type | Default | Description |
106
+ | ------ | ---- | ------- | ----------- |
107
+ | `--local` | boolean | false | Use development mode (runs TypeScript source directly via tsx) |
68
108
 
69
- ### 2. Release
109
+ #### `claude-auto doctor`
70
110
 
71
- Start execution and shift your focus. The Supervisor validates every commit. Auto-continue keeps it going. Check back to review outcomes.
111
+ Verify every expected symlink is valid and report issues.
72
112
 
73
- ### 3. Multiply
113
+ ```bash
114
+ claude-auto doctor
115
+ ```
74
116
 
75
- Open another worktree. Start another instance. Run 3-5 features in parallel. Ship 10+ per week.
117
+ #### `claude-auto status`
76
118
 
77
- ---
119
+ Show symlink status for hook scripts, validators, and reminders.
78
120
 
79
- ## The Transformation
121
+ ```bash
122
+ claude-auto status
123
+ ```
80
124
 
81
- | Before (Babysitter) | After (Bionic) |
82
- | -------------------------------- | ------------------------------ |
83
- | Watching one AI session | Directing multiple workstreams |
84
- | Nudging, correcting in real-time | Defining, approving, releasing |
85
- | Serial productivity | Parallel productivity |
86
- | Marginal gains (1.5x) | Multiplicative gains (10x+) |
87
- | Brain captured by supervision | Brain freed for the next thing |
125
+ #### `claude-auto repair`
88
126
 
89
- From Babysitter to Bionic.
127
+ Recreate broken or missing symlinks between the package and project directories.
90
128
 
91
- ---
129
+ ```bash
130
+ claude-auto repair
131
+ ```
92
132
 
93
- ## Installation
133
+ #### `claude-auto reminders`
134
+
135
+ List active reminders with name, hook, and priority metadata.
94
136
 
95
137
  ```bash
96
- # Install Claude Auto
97
- npx claude-auto install
138
+ claude-auto reminders
139
+ ```
98
140
 
99
- # Verify installation
100
- npx claude-auto doctor
141
+ #### `claude-auto clean-logs`
142
+
143
+ Remove old log files from the logs directory.
101
144
 
102
- # You're ready to become Bionic
145
+ ```bash
146
+ claude-auto clean-logs [options]
103
147
  ```
104
148
 
105
- After installation, claude-auto automatically:
149
+ | Option | Type | Default | Description |
150
+ | ------ | ---- | ------- | ----------- |
151
+ | `--older-than` | number | 60 | Keep logs newer than N minutes |
106
152
 
107
- - Injects hooks that validate every commit
108
- - Creates reminders that inject your guidelines
109
- - Sets up file protection via deny-lists
110
- - Merges settings with smart project/local overrides
153
+ #### `claude-auto tui`
111
154
 
112
- ---
155
+ Launch the full-screen terminal UI with live log tailing.
113
156
 
114
- ## Authority: Battle-Tested
157
+ ```bash
158
+ claude-auto tui
159
+ ```
115
160
 
116
- Built on foundations from Kent Beck's TCR and Extreme Programming principles. Refined through production features at Auto.
161
+ ### Configuration File
162
+
163
+ ```json
164
+ {
165
+ "autoContinue": { "mode": "smart" },
166
+ "validateCommit": { "mode": "strict", "batchCount": 3 },
167
+ "denyList": { "enabled": true },
168
+ "promptReminder": { "enabled": true },
169
+ "subagentHooks": {
170
+ "validateCommitOnExplore": false,
171
+ "validateCommitOnWork": true,
172
+ "validateCommitOnUnknown": true
173
+ }
174
+ }
175
+ ```
117
176
 
118
- The on.auto team ships 10+ features per week. Not 1-2.
177
+ Configuration lives in `.claude-auto/.claude.hooks.json`. See the [Configuration guide](./docs/configuration.md) for all options.
119
178
 
120
- **[Read the origin story →](./docs/origin-story.md)**
179
+ ### Settings Layering
180
+
181
+ Settings merge in priority order:
182
+
183
+ 1. `templates/settings.json` (package defaults)
184
+ 2. `.claude/settings.project.json` (team overrides)
185
+ 3. `.claude/settings.local.json` (personal overrides)
121
186
 
122
187
  ---
123
188
 
124
- ## CLI Reference
189
+ ## How It Works
190
+
191
+ ```mermaid
192
+ flowchart LR
193
+ A[Claude Code] --> B[Hook Scripts]
194
+ B --> C{Hook Type}
195
+ C -->|SessionStart| D[Load Reminders]
196
+ C -->|PreToolUse| E[Validate Commits + Deny-list]
197
+ C -->|UserPromptSubmit| F[Inject Reminders]
198
+ C -->|Stop| G[Auto-Continue Decision]
199
+ E -->|ACK| H[Allow]
200
+ E -->|NACK| I[Block + Revert]
201
+ ```
202
+
203
+ Hook scripts read JSON from stdin, delegate to handlers in `src/hooks/`, log results, and output JSON to stdout. Validators are batched (default 3 per Claude CLI call) for efficient parallel validation. Reminders are matched by hook type, mode, and tool name, then injected as `<system-reminder>` blocks.
204
+
205
+ ---
206
+
207
+ ## Troubleshooting
208
+
209
+ ### Command Not Found
210
+
211
+ **Symptom:** `claude-auto: command not found`
212
+
213
+ **Cause:** Package not installed globally or not in PATH.
214
+
215
+ **Solution:**
216
+
217
+ ```bash
218
+ npx claude-auto install
219
+ ```
220
+
221
+ ### Hooks Not Firing
222
+
223
+ **Symptom:** Commits go through without validation.
125
224
 
126
- | Command | Description |
127
- | ------------------------- | --------------------------------------------------- |
128
- | `claude-auto install` | Install and configure claude-auto in your project |
129
- | `claude-auto init` | Initialize configuration |
130
- | `claude-auto status` | Show symlink status for hook scripts and reminders |
131
- | `claude-auto doctor` | Diagnose installation health |
132
- | `claude-auto repair` | Recreate broken or missing symlinks |
133
- | `claude-auto reminders` | List active reminders with metadata |
134
- | `claude-auto clean-logs` | Remove old log files (use `--older-than=N` to keep N recent logs) |
225
+ **Cause:** Settings not merged or symlinks broken.
226
+
227
+ **Solution:**
228
+
229
+ ```bash
230
+ npx claude-auto doctor
231
+ npx claude-auto repair
232
+ ```
233
+
234
+ ### Enable Debug Logging
235
+
236
+ ```bash
237
+ DEBUG=claude-auto npx claude-auto install
238
+ ```
239
+
240
+ Debug logs write to `.claude-auto/logs/claude-auto/debug.log`.
135
241
 
136
242
  ---
137
243
 
138
244
  ## Documentation
139
245
 
140
- | Guide | Description |
141
- | ------------------------------------------------ | ------------------------------- |
142
- | [Getting Started](./docs/getting-started.md) | 5-minute transformation |
143
- | [Installation](./docs/installation.md) | Detailed installation guide |
246
+ | Guide | Description |
247
+ | ----- | ----------- |
248
+ | [Getting Started](./docs/getting-started.md) | First-time setup and core concepts |
249
+ | [Installation](./docs/installation.md) | Detailed installation guide |
144
250
  | [The Ketchup Technique](./docs/ketchup-technique.md) | The planning methodology |
145
- | [Configuration](./docs/configuration.md) | All configuration options |
146
- | [Hooks Guide](./docs/hooks-guide.md) | Configure your supervision |
147
- | [Reminders Guide](./docs/reminders-guide.md) | Context injection system |
148
- | [Validators Guide](./docs/validators-guide.md) | Commit validation rules |
149
- | [API Reference](./docs/api-reference.md) | Programmatic access |
150
- | [Architecture](./docs/architecture.md) | System design internals |
251
+ | [Configuration](./docs/configuration.md) | All configuration options |
252
+ | [Hooks Guide](./docs/hooks-guide.md) | Hook system deep-dive |
253
+ | [Reminders Guide](./docs/reminders-guide.md) | Context injection system |
254
+ | [Validators Guide](./docs/validators-guide.md) | Commit validation rules |
255
+ | [API Reference](./docs/api-reference.md) | Programmatic access |
256
+ | [Architecture](./docs/architecture.md) | System design internals |
257
+ | [Origin Story](./docs/origin-story.md) | How Claude Auto came to be |
258
+
259
+ ---
260
+
261
+ ## Architecture
262
+
263
+ ```
264
+ src/
265
+ ├── cli/ # CLI commands (install, doctor, repair, status, reminders, tui)
266
+ │ └── tui/ # Full-screen terminal UI with live log tailing
267
+ ├── hooks/ # Hook handlers (session-start, pre-tool-use, user-prompt-submit, auto-continue)
268
+ ├── commit-validator.ts # Batched commit validation with appeal support
269
+ ├── config-loader.ts # Cosmiconfig-based configuration
270
+ ├── deny-list.ts # File protection via micromatch patterns
271
+ ├── reminder-loader.ts # Markdown + YAML frontmatter reminder system
272
+ ├── settings-merger.ts # Three-layer settings merge with lock-file caching
273
+ ├── hook-state.ts # Hook state management (.claude.hooks.json)
274
+ ├── validator-loader.ts # Markdown validator loader
275
+ └── index.ts # Public API barrel exports
276
+ scripts/
277
+ ├── session-start.ts # SessionStart hook entry-point
278
+ ├── pre-tool-use.ts # PreToolUse hook entry-point
279
+ ├── user-prompt-submit.ts # UserPromptSubmit hook entry-point
280
+ └── auto-continue.ts # Stop hook entry-point
281
+ ```
282
+
283
+ ### Dependencies
284
+
285
+ | Package | Usage |
286
+ | ------- | ----- |
287
+ | commander | CLI framework |
288
+ | cosmiconfig | Configuration file discovery |
289
+ | gray-matter | YAML frontmatter parsing for validators and reminders |
290
+ | micromatch | Glob pattern matching for deny-lists |
151
291
 
152
292
  ---
153
293
 
154
294
  ## Development
155
295
 
296
+ ### Prerequisites
297
+
298
+ - Node.js 18+
299
+ - pnpm 10+
300
+
301
+ ### Setup
302
+
156
303
  ```bash
157
304
  git clone https://github.com/BeOnAuto/claude-auto.git
158
305
  cd claude-auto
159
306
  pnpm install
160
- pnpm test
161
307
  pnpm build
162
308
  ```
163
309
 
310
+ ### Commands
311
+
312
+ | Command | Description |
313
+ | ------- | ----------- |
314
+ | `pnpm build` | TypeScript compile + esbuild bundle scripts |
315
+ | `pnpm test` | Run all tests (vitest) |
316
+ | `pnpm type-check` | TypeScript type checking |
317
+ | `pnpm lint` | Biome lint check |
318
+ | `pnpm check` | Full CI: build + type-check + test + lint |
319
+
164
320
  ---
165
321
 
166
322
  ## License
167
323
 
168
- MIT © 2025 BeOnAuto, Inc.
324
+ MIT &copy; 2025 BeOnAuto, Inc.
169
325
 
170
326
  See [LICENSE](LICENSE) for details.
171
-
172
- ---
@@ -4971,7 +4971,7 @@ function handleStop(autoDir, input2) {
4971
4971
  if (input2.stop_hook_active) {
4972
4972
  return { decision: "allow", reason: "stop hook already active" };
4973
4973
  }
4974
- const modesToSkip = skipModes ?? ["plan"];
4974
+ const modesToSkip = skipModes;
4975
4975
  if (input2.permission_mode && modesToSkip.includes(input2.permission_mode)) {
4976
4976
  return { decision: "allow", reason: `skipping mode: ${input2.permission_mode}` };
4977
4977
  }
@@ -11611,7 +11611,7 @@ async function handleCommitValidation(claudeDir2, sessionId, command, options2,
11611
11611
  const context = getCommitContext(process.cwd(), command);
11612
11612
  const state = createHookState(autoDir).read();
11613
11613
  const onLog = (event, name, detail) => {
11614
- activityLog(autoDir, sessionId, "pre-tool-use", `validator ${event}: ${name}${detail ? ` \u2192 ${detail}` : ""}`);
11614
+ activityLog(autoDir, sessionId, "pre-tool-use", `validator ${event}: ${name} \u2192 ${detail}`);
11615
11615
  };
11616
11616
  const results = await validateCommit(validators, context, options2.executor, onLog, state.validateCommit.batchCount);
11617
11617
  const nacks = results.filter((r) => r.decision === "NACK");