@agentbrain/cli 1.4.20 → 1.4.34

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.md CHANGED
@@ -1,53 +1,99 @@
1
1
  # @agentbrain/cli
2
2
 
3
- Command-line interface for AgentBrain - generate smart context documentation for coding agents.
3
+ > Smart context generation for coding agents - Keep AI assistants in sync with your codebase
4
+
5
+ Command-line interface for AgentBrain. Automatically generates and maintains context documentation that helps coding agents (Claude, Cursor, Windsurf) understand your codebase instantly.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@agentbrain/cli.svg)](https://www.npmjs.com/package/@agentbrain/cli)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ ---
4
11
 
5
12
  ## Installation
6
13
 
14
+ ### Global Installation (Recommended)
15
+
7
16
  ```bash
8
17
  npm install -g @agentbrain/cli
9
18
  ```
10
19
 
20
+ ### Local Installation
21
+
22
+ ```bash
23
+ npm install --save-dev @agentbrain/cli
24
+ ```
25
+
26
+ ### Verify Installation
27
+
28
+ ```bash
29
+ agentbrain --version
30
+ ```
31
+
32
+ ---
33
+
11
34
  ## Quick Start
12
35
 
36
+ ### One-Command Setup
37
+
13
38
  ```bash
14
- # ONE-TIME SETUP: Complete automated setup
15
39
  cd /path/to/your/project
16
40
  agentbrain setup
17
-
18
- # That's it! AgentBrain now:
19
- # ✓ Generates context automatically on commits
20
- # ✓ Injects loading instructions into agent files
21
- # ✓ Keeps everything in sync with your codebase
22
41
  ```
23
42
 
24
- ### Manual Setup (Advanced)
43
+ **That's it!** AgentBrain now:
44
+ - ✓ Generates context automatically on every commit
45
+ - ✓ Injects loading instructions into your agent files
46
+ - ✓ Detects and warns about doom loops
47
+ - ✓ Keeps everything in sync with your codebase
25
48
 
26
- ```bash
27
- # Configure your API key
28
- agentbrain config
49
+ ### What Gets Created
29
50
 
30
- # Generate context docs for your repository
31
- cd /path/to/your/project
32
- agentbrain init
51
+ - `.agentbrain/context.md` - Full repository intelligence
52
+ - `.agentbrain/dependency-map.md` - Service relationships
53
+ - `.agentbrain/patterns.md` - Coding patterns and conventions
54
+ - `CLAUDE.md` / `.cursorrules` / `.windsurfrules` - Agent loading instructions
55
+ - `.git/hooks/post-commit` - Smart auto-regeneration hook
56
+
57
+ ---
58
+
59
+ ## Core Concepts
60
+
61
+ ### Smart Context Generation
62
+
63
+ AgentBrain analyzes your codebase and generates three intelligence documents:
64
+
65
+ 1. **Context** - Architecture, key files, and technical overview
66
+ 2. **Dependency Map** - How services/modules relate to each other
67
+ 3. **Patterns** - Coding patterns, conventions, and best practices
68
+
69
+ ### Automatic Regeneration
33
70
 
34
- # Generate task specification (optional)
35
- agentbrain spec "add user authentication"
71
+ After setup, context updates automatically in the background when you commit **source file changes**. Commits complete instantly (~0.05s) while regeneration happens in the background.
36
72
 
37
- # Generate coding standards
38
- agentbrain standards
73
+ **Smart Filtering:** Only regenerates when source code changes (skips docs/config updates to save time and API costs).
39
74
 
40
- # Generate session handoff
41
- agentbrain handoff
75
+ ### Doom Loop Detection
76
+
77
+ AgentBrain automatically detects when you're modifying the same files repeatedly in commits - a sign you may be stuck in a loop. When detected:
78
+
79
+ - ⚠ Warning displayed on next CLI command
80
+ - 🔔 Alert included in MCP tool responses
81
+ - 📝 Appended to handoff documents
82
+ - 💡 Suggests running `agentbrain spec` to plan a fix
83
+
84
+ **Check manually:**
85
+ ```bash
86
+ agentbrain doom
42
87
  ```
43
88
 
89
+ ---
90
+
44
91
  ## Commands
45
92
 
46
- ### `agentbrain setup`
93
+ ### `setup` - Complete Automated Setup
47
94
 
48
- **One-command automated setup** for AgentBrain in your repository.
95
+ One-command setup for AgentBrain in your repository.
49
96
 
50
- **Usage:**
51
97
  ```bash
52
98
  agentbrain setup [options]
53
99
  ```
@@ -56,541 +102,418 @@ agentbrain setup [options]
56
102
  - `--path <path>` - Repository path (default: current directory)
57
103
  - `--skip-hooks` - Skip git hooks installation
58
104
  - `--skip-agent-files` - Skip agent file injection
105
+ - `--no-confirm` - Skip all confirmation prompts
59
106
 
60
107
  **What it does:**
61
108
  1. Detects which agents you use (Claude Code, Cursor, Windsurf)
62
109
  2. Generates initial context documentation
63
- 3. Injects context loading instructions into agent files
64
- 4. Installs smart git hooks for automatic regeneration
65
- 5. Sets up complete automation
110
+ 3. Injects context loading instructions
111
+ 4. Installs smart git hooks
112
+ 5. Sets up doom loop detection
66
113
 
67
- **Output:**
68
- - Creates `agentbrain/` directory with context docs
69
- - Updates `CLAUDE.md`, `.cursorrules`, and/or `.windsurfrules`
70
- - Installs `.git/hooks/post-commit` for smart auto-regeneration
114
+ **Cost:** ~$0.02-0.05 for initial generation (cached repeats are free)
71
115
 
72
- **Example:**
73
- ```bash
74
- # Complete automated setup
75
- agentbrain setup
116
+ ---
117
+
118
+ ### `init` - Regenerate Context
76
119
 
77
- # Setup without git hooks
78
- agentbrain setup --skip-hooks
120
+ Manually regenerate all context documentation.
121
+
122
+ ```bash
123
+ agentbrain init [options]
79
124
  ```
80
125
 
81
- **Cost:** ~$0.02-0.05 for initial generation (cached repeats are free)
126
+ **Options:**
127
+ - `--path <path>` - Repository path
128
+ - `--no-confirm` - Skip confirmation prompt
129
+ - `--silent` - Suppress output (for scripts)
82
130
 
83
- **Smart Git Hooks:**
84
- After setup, AgentBrain automatically regenerates context in the background when you commit **source file changes**. Git commits complete instantly while context updates in the background. It intelligently skips regeneration when only documentation or configuration files change, saving time and API costs.
131
+ **Use when:**
132
+ - You want to force a fresh regeneration
133
+ - Context feels stale or inaccurate
134
+ - After major codebase changes
85
135
 
86
- You can check the update status in `.agentbrain/update.log`.
136
+ **Cost:** ~$0.02-0.05 per regeneration (same git hash = free from cache)
87
137
 
88
138
  ---
89
139
 
90
- ### `agentbrain init`
140
+ ### `spec` - Create Task Specifications
91
141
 
92
- Generate comprehensive context documentation for your repository.
142
+ Generate AI-guided task specifications with problem analysis and architecture planning.
93
143
 
94
- **Usage:**
95
144
  ```bash
96
- agentbrain init [options]
145
+ agentbrain spec "<task description>" [options]
97
146
  ```
98
147
 
99
148
  **Options:**
100
- - `--path <path>` - Repository path (default: current directory)
101
- - `--max-files <number>` - Maximum files to analyze (default: 100)
102
- - `--no-cache` - Skip cache and regenerate
103
- - `--dry-run` - Preview without generating (free!)
104
-
105
- **Output:**
106
- Creates three files in `agentbrain/` directory:
107
- - `context.md` - Navigation guide with exact file paths and function names
108
- - `dependency-map.md` - Actual code dependencies showing imports and data flow
109
- - `patterns.md` - Coding patterns and conventions found in the codebase
149
+ - `--path <path>` - Repository path
150
+ - `--load <slug>` - Load existing spec by slug
110
151
 
111
- **Example:**
152
+ **Examples:**
112
153
  ```bash
113
- # Preview cost first (free)
114
- agentbrain init --dry-run
154
+ # Create new spec
155
+ agentbrain spec "add user authentication with OAuth"
115
156
 
116
- # Generate for current directory
117
- agentbrain init
118
-
119
- # Generate for specific path with custom limit
120
- agentbrain init --path ~/my-project --max-files 50
157
+ # Load existing spec
158
+ agentbrain spec --load add-user-authentication
121
159
  ```
122
160
 
123
- **Cost:** ~$0.02-0.05 for typical repositories (cached repeats are free)
161
+ **What it creates:**
162
+ - Problem analysis and context
163
+ - Technical approach and architecture
164
+ - Implementation steps
165
+ - Testing strategy
166
+ - Done criteria
167
+
168
+ **Specs are saved to:** `.agentbrain/specs/<task-slug>.md`
169
+
170
+ **Cost:** ~$0.01-0.03 per spec generation
124
171
 
125
172
  ---
126
173
 
127
- ### `agentbrain spec`
174
+ ### `doom` - Detect Doom Loops
128
175
 
129
- Generate a structured specification for a task or feature using AI-guided prompts.
176
+ Analyze git history to detect if you're modifying the same files repeatedly.
130
177
 
131
- **Usage:**
132
178
  ```bash
133
- agentbrain spec [task-description] [options]
179
+ agentbrain doom [options]
134
180
  ```
135
181
 
136
- **Arguments:**
137
- - `task-description` - Brief task description (e.g., "add user authentication")
138
-
139
182
  **Options:**
140
- - `--path <path>` - Repository path (default: current directory)
183
+ - `--path <path>` - Repository path
184
+ - `--commits <n>` - Number of recent commits to analyze (default: 10)
185
+ - `--threshold <n>` - Minimum occurrences to flag (default: 4)
186
+ - `--json` - Output as JSON for programmatic use
141
187
 
142
- **Interactive prompts:**
143
- The command guides you through 5 questions to create a comprehensive spec:
144
- 1. **Problem** - What problem does this solve? (1-2 sentences)
145
- 2. **Approach** - What's your approach or implementation idea? (or "not sure yet")
146
- 3. **Out of Scope** - What should the agent NOT touch or change?
147
- 4. **Done Criteria** - What does "done" look like? (acceptance criteria)
148
- 5. **Risks** - Any edge cases or risks to consider?
149
-
150
- **Output:**
151
- Creates `agentbrain/specs/{task-slug}.md` with:
152
- - Problem statement
153
- - Scope boundaries
154
- - Acceptance criteria checklist
155
- - Risks & edge cases
156
- - Implementation notes (AI-generated using repository context)
157
- - Task checklist (ordered by dependency)
158
-
159
- **Automatic Injection:**
160
- Injects spec reference into your agent files (CLAUDE.md, .cursorrules, .windsurfrules) so the agent reads the spec before implementing.
161
-
162
- **Example:**
163
- ```bash
164
- # Generate spec with interactive prompts
165
- agentbrain spec "add OAuth authentication"
166
-
167
- # The command will:
168
- # 1. Ask 5 questions to gather requirements
169
- # 2. Use repository context to generate implementation notes
170
- # 3. Create agentbrain/specs/add-oauth-authentication.md
171
- # 4. Inject "Active Spec" reference into agent files
172
- # 5. Agent automatically reads spec at session start
188
+ **Example Output:**
173
189
  ```
190
+ Analyzing last 10 commits...
174
191
 
175
- **Example Spec Output:**
176
- ```markdown
177
- # Spec: add OAuth authentication
192
+ Doom loop detected!
178
193
 
179
- *Created: 2025-01-15 | Repo: my-project*
194
+ These files appear repeatedly:
195
+ apps/api/src/main.ts (9 times · 90%)
196
+ apps/api/src/auth.ts (6 times · 60%)
180
197
 
181
- ## Problem
182
- Users need to authenticate using OAuth providers instead of just email/password.
198
+ Suggestions:
199
+ Stop coding. Investigate root cause first.
200
+ → Run: agentbrain spec "fix [problem description]"
201
+ ```
183
202
 
184
- ## Scope
185
- **Out of scope:** Social login with Facebook/Twitter
203
+ **Automatic Detection:**
204
+ After commits, doom detection runs in the background. Warning shown on next command if detected.
186
205
 
187
- ## Acceptance Criteria
188
- - [ ] OAuth flow works with Google
189
- - [ ] Tokens are stored securely
190
- - [ ] Existing users can link OAuth accounts
206
+ ---
191
207
 
192
- ## Risks & Edge Cases
193
- - Token expiry handling
194
- - Race conditions during OAuth callback
208
+ ### `doctor` - Health Diagnostics
195
209
 
196
- ## Implementation Notes
197
- - Use existing auth middleware pattern from src/auth/
198
- - Store OAuth tokens in encrypted user_credentials table
199
- - Add OAuth callback route to existing auth router
200
- - Follow repository's error handling pattern
210
+ Run health checks on your AgentBrain setup.
201
211
 
202
- ## Task Checklist
203
- - [ ] Add OAuth provider configuration
204
- - [ ] Implement OAuth callback handler
205
- - [ ] Create token storage schema
206
- - [ ] Add OAuth middleware
207
- - [ ] Update auth routes
208
- - [ ] Write integration tests
212
+ ```bash
213
+ agentbrain doctor [options]
209
214
  ```
210
215
 
211
- **MCP Integration:**
212
- After creating a spec, agents can load it via the MCP `load_spec` tool:
213
- ```typescript
214
- // Agent automatically loads via injected reference
215
- // Or manually via MCP:
216
- load_spec({ repoPath: "/path/to/repo", task: "add-oauth-authentication" })
217
- ```
216
+ **Options:**
217
+ - `--path <path>` - Repository path
218
+ - `--json` - Output as JSON
218
219
 
219
- **Cost:** ~$0.01-0.02 (uses fast model with context-aware generation)
220
+ **Checks:**
221
+ - ✓ Git repository status
222
+ - ✓ Context files exist and are valid
223
+ - ✓ Agent files are configured
224
+ - ✓ Git hooks installed correctly
225
+ - ✓ API configuration
220
226
 
221
- **Workflow:**
222
- ```bash
223
- # 1. Plan feature with spec
224
- agentbrain spec "add OAuth authentication"
227
+ **Use when:**
228
+ - Setup isn't working as expected
229
+ - Context generation fails
230
+ - Git hooks not firing
231
+
232
+ ---
225
233
 
226
- # 2. Agent reads spec automatically at session start
227
- # (Injected into CLAUDE.md, .cursorrules, .windsurfrules)
234
+ ### `status` - Auto-Update Status
228
235
 
229
- # 3. Implement feature following the spec
230
- # ... coding session ...
236
+ View status of background context updates.
231
237
 
232
- # 4. Remove spec reference when done
233
- # (Manually edit agent files or use agentbrain disable)
238
+ ```bash
239
+ agentbrain status [options]
234
240
  ```
235
241
 
242
+ **Options:**
243
+ - `--path <path>` - Repository path
244
+
245
+ **Shows:**
246
+ - Recent update history from `.agentbrain/update.log`
247
+ - Success/failure status
248
+ - Update duration
249
+ - Git hash for each update
250
+
236
251
  ---
237
252
 
238
- ### `agentbrain standards`
253
+ ### `standards` - Generate Coding Standards
239
254
 
240
- Generate coding standards files for AI agents.
255
+ Generate coding standards documentation based on your codebase patterns.
241
256
 
242
- **Usage:**
243
257
  ```bash
244
258
  agentbrain standards [options]
245
259
  ```
246
260
 
247
261
  **Options:**
248
- - `--path <path>` - Repository path (default: current directory)
262
+ - `--path <path>` - Repository path
249
263
 
250
- **Interactive prompts:**
251
- - Primary language (e.g., TypeScript, Python)
252
- - Framework (e.g., React, Django)
253
- - Testing library (e.g., Jest, pytest)
254
- - Style guide (e.g., Prettier + ESLint)
255
- - Anti-patterns to avoid
256
- - Architecture notes
257
- - Target agents (Claude Code, Cursor, Windsurf)
258
-
259
- **Output:**
260
- Creates agent-specific files:
261
- - `CLAUDE.md` - For Claude Code CLI
262
- - `.cursorrules` - For Cursor (also supports legacy `.cursor/rules`)
263
- - `.windsurfrules` - For Windsurf
264
-
265
- **Example:**
266
- ```bash
267
- agentbrain standards
268
- # Follow the interactive prompts
269
- ```
264
+ **Creates:** `.agentbrain/standards.md`
270
265
 
271
- **Cost:** ~$0.01-0.02
266
+ **Cost:** ~$0.01-0.02 per generation
272
267
 
273
268
  ---
274
269
 
275
- ### `agentbrain handoff`
270
+ ### `handoff` - Generate Session Handoff
276
271
 
277
- Generate session handoff document from git changes.
272
+ Generate session handoff document with recent changes and context.
278
273
 
279
- **Usage:**
280
274
  ```bash
281
275
  agentbrain handoff [options]
282
276
  ```
283
277
 
284
278
  **Options:**
285
- - `--path <path>` - Repository path (default: current directory)
286
- - `--goal <goal>` - Session goal or objective
287
- - `--commits <number>` - Number of recent commits to include (default: 5)
288
-
289
- **Output:**
290
- Creates `agentbrain/handoff.md` with:
291
- - Summary of changes
292
- - Current state
293
- - Context & decisions
294
- - Next steps
295
- - Blockers & questions
296
-
297
- **Example:**
298
- ```bash
299
- # After making changes
300
- agentbrain handoff --goal "Implement user authentication"
279
+ - `--path <path>` - Repository path
280
+ - `--goal <goal>` - Session goal (optional)
281
+ - `--commits <n>` - Number of recent commits (default: 5)
301
282
 
302
- # Include more commit history
303
- agentbrain handoff --goal "Completed auth system" --commits 10
304
- ```
283
+ **Creates:** `.agentbrain/handoff.md`
284
+
285
+ **Includes:**
286
+ - Recent changes summary
287
+ - Session context
288
+ - Next steps recommendations
289
+ - ⚠ Doom loop warning (if detected)
305
290
 
306
- **Cost:** ~$0.01
291
+ **Cost:** ~$0.01-0.02 per generation
307
292
 
308
293
  ---
309
294
 
310
- ### `agentbrain config`
295
+ ### `config` - Configure API Settings
311
296
 
312
- Configure or view API key.
297
+ Configure AI provider API keys and settings.
313
298
 
314
- **Usage:**
315
299
  ```bash
316
- agentbrain config [options]
317
- ```
318
-
319
- **Options:**
320
- - `--show` - Display current configuration
321
-
322
- **Example:**
323
- ```bash
324
- # Set API key interactively
325
300
  agentbrain config
326
-
327
- # View current config
328
- agentbrain config --show
329
301
  ```
330
302
 
331
- **Supported providers:**
332
- - Anthropic (Claude) - keys starting with `sk-ant-`
333
- - OpenAI (GPT) - keys starting with `sk-`
303
+ **Interactive setup for:**
304
+ - Provider selection (OpenAI, Anthropic, or both)
305
+ - API key configuration
306
+ - Model selection
334
307
 
335
- Configuration stored at `~/.agentbrain/config.json` with secure permissions.
308
+ **Supports:**
309
+ - OpenAI (GPT-4, GPT-4 Turbo)
310
+ - Anthropic (Claude 3.5 Sonnet, Claude 3 Opus)
336
311
 
337
312
  ---
338
313
 
339
- ### `agentbrain disable`
314
+ ### `disable` - Disable AgentBrain
340
315
 
341
- Disable or uninstall AgentBrain from your repository.
316
+ Disable AgentBrain features in your repository.
342
317
 
343
- **Usage:**
344
318
  ```bash
345
319
  agentbrain disable [options]
346
320
  ```
347
321
 
348
322
  **Options:**
349
- - `--remove-hooks` - Remove git hooks only
350
- - `--remove-files` - Remove generated context files only (agentbrain/ directory)
351
- - `--remove-agent-files` - Remove agent config files (CLAUDE.md, .cursorrules, etc.)
352
- - `--full` - Complete uninstall (removes everything)
353
- - `--yes` - Skip confirmation prompts
323
+ - `--path <path>` - Repository path
324
+ - `--remove-hooks` - Remove git hooks
325
+ - `--remove-agent-files` - Remove agent file modifications
354
326
 
355
- **Interactive Mode:**
356
- If you run `agentbrain disable` without options, you'll be prompted to select what to remove.
327
+ **Use when:**
328
+ - Temporarily disabling automation
329
+ - Troubleshooting issues
330
+ - Removing AgentBrain from project
357
331
 
358
- **Example:**
359
- ```bash
360
- # Interactive mode - choose what to remove
361
- agentbrain disable
332
+ **Note:** Does not delete `.agentbrain/` directory or context files.
362
333
 
363
- # Remove only git hooks (keep context files)
364
- agentbrain disable --remove-hooks
334
+ ---
335
+
336
+ ## MCP Integration
365
337
 
366
- # Remove only generated files (keep hooks and agent files)
367
- agentbrain disable --remove-files
338
+ AgentBrain provides a Model Context Protocol (MCP) server that enables AI agents to access repository intelligence directly.
368
339
 
369
- # Complete uninstall without prompts
370
- agentbrain disable --full --yes
340
+ **Install MCP Server:**
341
+ ```bash
342
+ npm install -g @agentbrain/mcp-server
371
343
  ```
372
344
 
373
- **Re-enabling:**
374
- To re-enable AgentBrain after disabling, simply run `agentbrain setup` again.
345
+ **See:** [@agentbrain/mcp-server](https://www.npmjs.com/package/@agentbrain/mcp-server) for setup instructions.
375
346
 
376
- ---
347
+ **MCP Tools Include Doom Warnings:**
348
+ - `load_context` - Returns `doom_warning` field if loop detected
349
+ - `load_spec` - Returns `doom_warning` field if loop detected
350
+ - `save_handoff` - Appends doom section to handoff document
377
351
 
378
- ## API Key Configuration
352
+ ---
379
353
 
380
- AgentBrain supports multiple ways to provide your API key. They are checked in this priority order:
354
+ ## Troubleshooting
381
355
 
382
- ### 1. Environment Variables (Highest Priority)
356
+ ### Context Not Regenerating on Commits
383
357
 
358
+ **Check git hooks:**
384
359
  ```bash
385
- # Anthropic
386
- export ANTHROPIC_API_KEY="sk-ant-..."
387
-
388
- # OpenAI
389
- export OPENAI_API_KEY="sk-..."
360
+ agentbrain doctor
390
361
  ```
391
362
 
392
- ### 2. `.env` Files
393
-
394
- Create a `.env` or `.env.local` file in your project:
395
-
363
+ **Verify hook is installed:**
396
364
  ```bash
397
- # In your project directory
398
- cat > .env <<EOF
399
- OPENAI_API_KEY=sk-...
400
- EOF
365
+ cat .git/hooks/post-commit
366
+ # or for Husky:
367
+ cat .husky/post-commit
401
368
  ```
402
369
 
403
- AgentBrain will automatically load API keys from:
404
- - `.env.local` in current directory
405
- - `.env` in current directory
406
- - `.env.local` in git repository root
407
- - `.env` in git repository root
408
-
409
- **Note:** `.env` files are loaded automatically - no need to export or source them!
410
-
411
- ### 3. Stored Configuration (Lowest Priority)
412
-
413
- Use the `agentbrain config` command to store your key persistently:
414
-
370
+ **Reinstall hooks:**
415
371
  ```bash
416
- agentbrain config
372
+ agentbrain disable --remove-hooks
373
+ agentbrain setup
417
374
  ```
418
375
 
419
- This stores the key securely at `~/.agentbrain/config.json` with 0600 permissions.
420
-
421
376
  ---
422
377
 
423
- ## Summary: API Key Priority
378
+ ### Hook Errors After Commits
424
379
 
425
- 1. Environment variables (`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`)
426
- 2. ✅ `.env.local` in current directory
427
- 3. ✅ `.env` in current directory
428
- 4. ✅ `.env.local` in git root
429
- 5. ✅ `.env` in git root
430
- 6. ✅ `~/.agentbrain/config.json`
431
-
432
- ## Usage with AI Agents
433
-
434
- After running `agentbrain setup`, your agents automatically load context at every session start.
435
-
436
- ### Claude Code CLI
437
-
438
- AgentBrain injects loading instructions into `CLAUDE.md`, which Claude Code CLI reads automatically from your project root. No manual action needed.
439
-
440
- ### Cursor
441
-
442
- AgentBrain injects loading instructions into `.cursorrules` (or `.cursor/rules` for legacy setups), which Cursor reads automatically. No manual action needed.
380
+ **Check update log:**
381
+ ```bash
382
+ cat .agentbrain/update.log
383
+ ```
443
384
 
444
- ### Windsurf
385
+ **Common issues:**
386
+ - API key not configured: Run `agentbrain config`
387
+ - Permission errors: Check file permissions on `.agentbrain/`
388
+ - Path issues: Hook uses fallback paths to find `agentbrain` binary
445
389
 
446
- AgentBrain injects loading instructions into `.windsurfrules`, which Windsurf reads automatically. No manual action needed.
390
+ ---
447
391
 
448
- ### Manual Loading (Advanced)
392
+ ### Context Feels Stale
449
393
 
450
- If not using `agentbrain setup`, you can manually reference context files:
451
- ```markdown
452
- <!-- In agent prompt or rules file -->
453
- @agentbrain/context.md
454
- @agentbrain/dependency-map.md
455
- @agentbrain/patterns.md
394
+ **Force regeneration:**
395
+ ```bash
396
+ agentbrain init --no-confirm
456
397
  ```
457
398
 
458
- ## Cost Estimates
399
+ **Check cache:**
400
+ Cache is tied to git hash. If you haven't committed changes, old cache is used.
459
401
 
460
- All costs are approximate (as of January 2025):
402
+ ---
461
403
 
462
- | Operation | Tokens | Anthropic | OpenAI |
463
- |-----------|--------|-----------|--------|
464
- | Init (small) | 10-20K | $0.02-0.05 | $0.02-0.04 |
465
- | Init (medium) | 30-50K | $0.08-0.15 | $0.07-0.12 |
466
- | Spec | 3-5K | $0.01-0.02 | $0.01-0.02 |
467
- | Standards | 5-8K | $0.01-0.02 | $0.01-0.02 |
468
- | Handoff | 3-5K | $0.01 | $0.01 |
469
- | **Cached repeat** | 0 | **$0.00** | **$0.00** |
404
+ ### Doom Loop False Positives
470
405
 
471
- **Cache-first:** Repeat runs on same git commit are instant and free!
406
+ **Adjust sensitivity:**
407
+ ```bash
408
+ # Check last 15 commits, flag if file appears 6+ times
409
+ agentbrain doom --commits 15 --threshold 6
410
+ ```
472
411
 
473
- ## Workflow Example
412
+ **Excluded patterns:**
413
+ - Lock files (package-lock.json, etc.)
414
+ - AgentBrain files (CLAUDE.md, .cursorrules, etc.)
415
+ - Markdown files
474
416
 
475
- ### Recommended: Automated Setup
417
+ ---
476
418
 
477
- ```bash
478
- # 1. One-time setup (do once per repo)
479
- cd /path/to/project
480
- agentbrain setup
419
+ ### API Costs Too High
481
420
 
482
- # 2. Start coding - context auto-updates on commits!
483
- # ... make changes ...
484
- git commit -m "Add feature"
485
- # AgentBrain automatically regenerates context (if source files changed)
421
+ **Smart regeneration already optimized:**
422
+ - Only regenerates on source file changes
423
+ - Skips docs/config updates
424
+ - Caches by git hash
486
425
 
487
- # 3. Generate handoff when needed
488
- agentbrain handoff --goal "Completed authentication feature"
426
+ **Further reduce costs:**
427
+ - Use `--skip-hooks` during development sprints
428
+ - Manually regenerate only when needed: `agentbrain init`
429
+ - Disable temporarily: `agentbrain disable`
489
430
 
490
- # That's it! Everything else is automatic.
491
- ```
431
+ ---
492
432
 
493
- ### Manual Setup (Advanced)
433
+ ### Husky Compatibility
494
434
 
495
- ```bash
496
- # 1. Initial setup
497
- cd /path/to/project
498
- agentbrain config
435
+ AgentBrain detects and supports Husky automatically.
499
436
 
500
- # 2. Generate context (do once per repo)
501
- agentbrain init --dry-run # Preview first
502
- agentbrain init # Actually generate
437
+ **Husky v9+ (recommended):**
438
+ Hook installs directly to `.husky/post-commit`
503
439
 
504
- # 3. Generate standards (do once per repo)
505
- agentbrain standards
440
+ **Custom hook paths:**
441
+ Detects `git config core.hooksPath` and installs there
506
442
 
507
- # 4. During development sessions
508
- # ... make changes ...
509
- agentbrain handoff --goal "Add authentication feature"
443
+ **No conflicts:** AgentBrain hook runs alongside existing hooks
510
444
 
511
- # 5. Manually regenerate context after changes
512
- agentbrain init # Only costs money if git hash changed
513
- ```
445
+ ---
514
446
 
515
- ## Troubleshooting
447
+ ## Files & Directories
516
448
 
517
- ### "No API key found"
449
+ ### Generated Files
518
450
 
519
- Set your API key:
520
- ```bash
521
- agentbrain config
522
- # or
523
- export ANTHROPIC_API_KEY="sk-ant-..."
524
451
  ```
525
-
526
- ### "Command not found: agentbrain"
527
-
528
- Reinstall globally:
529
- ```bash
530
- npm install -g @agentbrain/cli
452
+ .agentbrain/
453
+ ├── context.md # Full repository intelligence
454
+ ├── dependency-map.md # Service relationships
455
+ ├── patterns.md # Coding patterns
456
+ ├── standards.md # Coding standards (optional)
457
+ ├── handoff.md # Session handoff (optional)
458
+ ├── update.log # Auto-update history
459
+ └── specs/ # Task specifications
460
+ └── <task-slug>.md
531
461
  ```
532
462
 
533
- ### Permission errors
463
+ ### Agent Files (Modified)
534
464
 
535
- Fix npm permissions:
536
- ```bash
537
- mkdir ~/.npm-global
538
- npm config set prefix '~/.npm-global'
539
- echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
540
- source ~/.bashrc
541
- ```
465
+ - `CLAUDE.md` - Claude Code loading instructions
466
+ - `.cursorrules` - Cursor loading instructions
467
+ - `.windsurfrules` - Windsurf loading instructions
542
468
 
543
- ## Examples
469
+ ### Git Hooks
544
470
 
545
- ### Generate docs for multiple projects
471
+ - `.git/hooks/post-commit` - Standard installation
472
+ - `.husky/post-commit` - Husky installation
546
473
 
547
- ```bash
548
- for project in ~/projects/*; do
549
- echo "Processing $project..."
550
- agentbrain init --path "$project"
551
- done
552
- ```
474
+ ---
553
475
 
554
- ### CI/CD integration
476
+ ## Best Practices
555
477
 
556
- ```bash
557
- # In CI pipeline
558
- export ANTHROPIC_API_KEY="${ANTHROPIC_KEY}"
559
- agentbrain init --path . --no-cache
560
- # Commit generated docs to repo
561
- git add agentbrain/
562
- git commit -m "Update context docs"
563
- ```
478
+ ### When to Use AgentBrain
564
479
 
565
- ## Advanced Usage
480
+ **Good for:**
481
+ - Active development with AI assistants
482
+ - Onboarding new developers
483
+ - Complex codebases with multiple services
484
+ - Keeping AI agents in sync with changes
566
485
 
567
- ### Custom file limits
486
+ **Skip if:**
487
+ - Early prototyping (context not stable yet)
488
+ - API costs are a major concern
489
+ - Repository is < 10 files
568
490
 
569
- ```bash
570
- # For large repos, limit files
571
- agentbrain init --max-files 50
491
+ ### Workflow Tips
572
492
 
573
- # For small repos, increase limit
574
- agentbrain init --max-files 200
575
- ```
493
+ 1. **Initial setup:** Run `agentbrain setup` once
494
+ 2. **Let automation work:** Commits regenerate context automatically
495
+ 3. **Check doom warnings:** If shown, investigate before continuing
496
+ 4. **Use specs:** Plan complex tasks with `agentbrain spec`
497
+ 5. **Handoff cleanly:** Generate handoff at session end
576
498
 
577
- ### Force regeneration
499
+ ### Cost Management
578
500
 
579
- ```bash
580
- # Skip cache even if git hash unchanged
581
- agentbrain init --no-cache
582
- ```
501
+ - Initial setup: ~$0.02-0.05
502
+ - Auto-regeneration: ~$0.02-0.05 per commit (only on source changes)
503
+ - Specs: ~$0.01-0.03 each
504
+ - **Expected monthly cost:** $1-5 for typical projects
583
505
 
584
- ## Related Packages
506
+ ---
585
507
 
586
- - [@agentbrain/core](../core) - Core library
587
- - [@agentbrain/mcp-server](../mcp-server) - MCP server for agents
508
+ ## Links
588
509
 
589
- ## Support
510
+ - **npm:** https://www.npmjs.com/package/@agentbrain/cli
511
+ - **GitHub:** https://github.com/benmalcom/agentbrain
512
+ - **MCP Server:** https://www.npmjs.com/package/@agentbrain/mcp-server
513
+ - **Core Library:** https://www.npmjs.com/package/@agentbrain/core
590
514
 
591
- - GitHub Issues: [Report bugs](https://github.com/benmalcom/agentbrain/issues)
592
- - Documentation: [Full docs](https://github.com/benmalcom/agentbrain)
515
+ ---
593
516
 
594
517
  ## License
595
518
 
596
- MIT
519
+ MIT © AgentBrain
@@ -1 +1 @@
1
- {"version":3,"file":"doom.d.ts","sourceRoot":"","sources":["../../src/commands/doom.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,wBAAgB,iBAAiB,IAAI,OAAO,CAsD3C"}
1
+ {"version":3,"file":"doom.d.ts","sourceRoot":"","sources":["../../src/commands/doom.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,wBAAgB,iBAAiB,IAAI,OAAO,CAoE3C"}
@@ -8,11 +8,20 @@ export function createDoomCommand() {
8
8
  .option('--path <path>', 'Repository path', process.cwd())
9
9
  .option('--commits <number>', 'Number of commits to analyze', '10')
10
10
  .option('--threshold <number>', 'Threshold for doom loop detection', '4')
11
+ .option('--json', 'Output results as JSON')
11
12
  .action(async (options) => {
12
- const { path, commits, threshold } = options;
13
- console.log(chalk.blue.bold('\n🧠 AgentBrain\n'));
13
+ const { path, commits, threshold, json } = options;
14
+ if (!json) {
15
+ console.log(chalk.blue.bold('\n🧠 AgentBrain\n'));
16
+ }
14
17
  try {
15
18
  const result = await analyzeDoomLoop(path, parseInt(commits), parseInt(threshold));
19
+ // JSON output mode
20
+ if (json) {
21
+ console.log(JSON.stringify(result, null, 2));
22
+ return;
23
+ }
24
+ // Human-readable output mode
16
25
  if (result.detected) {
17
26
  console.log(chalk.yellow.bold('⚠ Possible doom loop detected\n'));
18
27
  console.log(`These files were modified ${threshold}+ times in the last ${result.commitsAnalyzed} commits:\n`);
@@ -32,13 +41,18 @@ export function createDoomCommand() {
32
41
  }
33
42
  }
34
43
  catch (error) {
35
- if (error instanceof Error) {
36
- if (error.message.includes('Not a git repository')) {
37
- console.error(chalk.red('✗ Error: Not a git repository'));
38
- console.error(chalk.gray('Run this command from a git repository\n'));
39
- }
40
- else {
41
- console.error(chalk.red('✗ Error:'), error.message, '\n');
44
+ if (json) {
45
+ console.error(JSON.stringify({ error: error instanceof Error ? error.message : 'Unknown error' }));
46
+ }
47
+ else {
48
+ if (error instanceof Error) {
49
+ if (error.message.includes('Not a git repository')) {
50
+ console.error(chalk.red('✗ Error: Not a git repository'));
51
+ console.error(chalk.gray('Run this command from a git repository\n'));
52
+ }
53
+ else {
54
+ console.error(chalk.red('✗ Error:'), error.message, '\n');
55
+ }
42
56
  }
43
57
  }
44
58
  process.exit(1);
@@ -1 +1 @@
1
- {"version":3,"file":"doom.js","sourceRoot":"","sources":["../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AC,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAA;YACpG,CAAC;iBAAM,CAAC;gBACN,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;oBAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,CAAC;wBACnD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC,CAAA;wBACzD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC,CAAA;oBACvE,CAAC;yBAAM,CAAC;wBACN,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;oBAC3D,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IACH,CAAC,CAAC,CAAA;IAEJ,OAAO,IAAI,CAAA;AACb,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  // AgentBrain CLI entry point
3
3
  import { Command } from 'commander';
4
+ import { checkPendingDoomWarning } from '@agentbrain/core';
4
5
  import { createConfigCommand } from './commands/config.js';
5
6
  import { createInitCommand } from './commands/init.js';
6
7
  import { createStandardsCommand } from './commands/standards.js';
@@ -15,7 +16,20 @@ const program = new Command();
15
16
  program
16
17
  .name('agentbrain')
17
18
  .description('Generate smart context docs for coding agents')
18
- .version('1.4.20');
19
+ .version('1.4.34')
20
+ .hook('preAction', async () => {
21
+ // Check for pending doom warnings before every command
22
+ try {
23
+ const warning = await checkPendingDoomWarning(process.cwd());
24
+ if (warning) {
25
+ // Write to stderr so it doesn't interfere with command output
26
+ console.error('\n' + warning);
27
+ }
28
+ }
29
+ catch {
30
+ // Silently ignore errors (e.g., not in a git repo)
31
+ }
32
+ });
19
33
  // Add commands
20
34
  program.addCommand(createSetupCommand());
21
35
  program.addCommand(createInitCommand());
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,6BAA6B;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAA;AAE7B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CAAC,+CAA+C,CAAC;KAC5D,OAAO,CAAC,QAAQ,CAAC,CAAA;AAEpB,eAAe;AACf,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AACvC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AACvC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAA;AAC5C,OAAO,CA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AC5D,OAAO,CAAC,QAAQ,CAAC;KACjB,IAAI,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;IAC5B,uDAAuD;IACvD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC5D,IAAI,OAAO,EAAE,CAAC;YACZ,8DAA8D;YAC9D,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,CAAA;QAC/B,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,mDAAmD;IACrD,CAAC;AACH,CAAC,CAAC,CAAA;AAEJ,eAAe;AACf,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AACvC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AACvC,OAAO,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAA;AAC5C,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAA;AAC1C,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAA;AACzC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAA;AACzC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AACvC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAA;AACzC,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAA;AAE1C,kBAAkB;AAClB,OAAO,CAAC,KAAK,EAAE,CAAA;AACf,aAAa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentbrain/cli",
3
- "version": "1.4.20",
3
+ "version": "1.4.34",
4
4
  "description": "CLI for AgentBrain - generate smart context documentation for coding agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",