@hivehub/rulebook 5.2.1 → 5.3.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/.claude/commands/analysis.md +35 -0
- package/.claude/commands/rulebook-task-apply.md +7 -25
- package/.claude/commands/rulebook-task-archive.md +10 -19
- package/.claude/commands/rulebook-task-create.md +1 -1
- package/README.md +354 -965
- package/dist/cli/commands/analysis.d.ts +8 -0
- package/dist/cli/commands/analysis.d.ts.map +1 -0
- package/dist/cli/commands/analysis.js +78 -0
- package/dist/cli/commands/analysis.js.map +1 -0
- package/dist/cli/commands/context-intelligence.d.ts +33 -0
- package/dist/cli/commands/context-intelligence.d.ts.map +1 -0
- package/dist/cli/commands/context-intelligence.js +181 -0
- package/dist/cli/commands/context-intelligence.js.map +1 -0
- package/dist/cli/commands/index.d.ts +19 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/index.js +19 -0
- package/dist/cli/commands/index.js.map +1 -0
- package/dist/cli/commands/init.d.ts +15 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +608 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +10 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +128 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/memory.d.ts +24 -0
- package/dist/cli/commands/memory.d.ts.map +1 -0
- package/dist/cli/commands/memory.js +265 -0
- package/dist/cli/commands/memory.js.map +1 -0
- package/dist/cli/commands/misc.d.ts +33 -0
- package/dist/cli/commands/misc.d.ts.map +1 -0
- package/dist/cli/commands/misc.js +576 -0
- package/dist/cli/commands/misc.js.map +1 -0
- package/dist/cli/commands/plans.d.ts +15 -0
- package/dist/cli/commands/plans.d.ts.map +1 -0
- package/dist/cli/commands/plans.js +266 -0
- package/dist/cli/commands/plans.js.map +1 -0
- package/dist/cli/commands/ralph.d.ts +45 -0
- package/dist/cli/commands/ralph.d.ts.map +1 -0
- package/dist/cli/commands/ralph.js +694 -0
- package/dist/cli/commands/ralph.js.map +1 -0
- package/dist/cli/commands/skills.d.ts +9 -0
- package/dist/cli/commands/skills.d.ts.map +1 -0
- package/dist/cli/commands/skills.js +249 -0
- package/dist/cli/commands/skills.js.map +1 -0
- package/dist/cli/commands/task.d.ts +16 -0
- package/dist/cli/commands/task.d.ts.map +1 -0
- package/dist/cli/commands/task.js +256 -0
- package/dist/cli/commands/task.js.map +1 -0
- package/dist/cli/commands/update.d.ts +14 -0
- package/dist/cli/commands/update.d.ts.map +1 -0
- package/dist/cli/commands/update.js +636 -0
- package/dist/cli/commands/update.js.map +1 -0
- package/dist/cli/commands/workspace.d.ts +6 -0
- package/dist/cli/commands/workspace.d.ts.map +1 -0
- package/dist/cli/commands/workspace.js +141 -0
- package/dist/cli/commands/workspace.js.map +1 -0
- package/dist/core/agent-template-engine.js +28 -28
- package/dist/core/analysis-manager.d.ts +56 -0
- package/dist/core/analysis-manager.d.ts.map +1 -0
- package/dist/core/analysis-manager.js +218 -0
- package/dist/core/analysis-manager.js.map +1 -0
- package/dist/core/claude-md-generator.d.ts +52 -0
- package/dist/core/claude-md-generator.d.ts.map +1 -0
- package/dist/core/claude-md-generator.js +104 -0
- package/dist/core/claude-md-generator.js.map +1 -0
- package/dist/core/claude-settings-manager.d.ts +37 -0
- package/dist/core/claude-settings-manager.d.ts.map +1 -0
- package/dist/core/claude-settings-manager.js +168 -0
- package/dist/core/claude-settings-manager.js.map +1 -0
- package/dist/core/compact-context-manager.d.ts +34 -0
- package/dist/core/compact-context-manager.d.ts.map +1 -0
- package/dist/core/compact-context-manager.js +60 -0
- package/dist/core/compact-context-manager.js.map +1 -0
- package/dist/core/doctor.d.ts +19 -0
- package/dist/core/doctor.d.ts.map +1 -0
- package/dist/core/doctor.js +163 -0
- package/dist/core/doctor.js.map +1 -0
- package/dist/core/generator.js +28 -28
- package/dist/core/mcp-reference-generator.d.ts +13 -0
- package/dist/core/mcp-reference-generator.d.ts.map +1 -0
- package/dist/core/mcp-reference-generator.js +66 -0
- package/dist/core/mcp-reference-generator.js.map +1 -0
- package/dist/core/merger.d.ts +35 -0
- package/dist/core/merger.d.ts.map +1 -1
- package/dist/core/merger.js +120 -0
- package/dist/core/merger.js.map +1 -1
- package/dist/core/prd-generator.d.ts.map +1 -1
- package/dist/core/prd-generator.js +7 -1
- package/dist/core/prd-generator.js.map +1 -1
- package/dist/core/ralph-manager.d.ts.map +1 -1
- package/dist/core/ralph-manager.js +17 -0
- package/dist/core/ralph-manager.js.map +1 -1
- package/dist/core/rules-generator.d.ts +73 -0
- package/dist/core/rules-generator.d.ts.map +1 -0
- package/dist/core/rules-generator.js +201 -0
- package/dist/core/rules-generator.js.map +1 -0
- package/dist/core/state-writer.d.ts +35 -0
- package/dist/core/state-writer.d.ts.map +1 -0
- package/dist/core/state-writer.js +81 -0
- package/dist/core/state-writer.js.map +1 -0
- package/dist/core/task-manager.d.ts +35 -0
- package/dist/core/task-manager.d.ts.map +1 -1
- package/dist/core/task-manager.js +135 -38
- package/dist/core/task-manager.js.map +1 -1
- package/dist/core/telemetry.d.ts +29 -0
- package/dist/core/telemetry.d.ts.map +1 -0
- package/dist/core/telemetry.js +57 -0
- package/dist/core/telemetry.js.map +1 -0
- package/dist/core/workflow-generator.d.ts.map +1 -1
- package/dist/core/workflow-generator.js +2 -177
- package/dist/core/workflow-generator.js.map +1 -1
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/rulebook-server.d.ts.map +1 -1
- package/dist/mcp/rulebook-server.js +190 -7
- package/dist/mcp/rulebook-server.js.map +1 -1
- package/dist/memory/memory-store.js +91 -91
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/gitignore.d.ts +10 -0
- package/dist/utils/gitignore.d.ts.map +1 -0
- package/dist/utils/gitignore.js +38 -0
- package/dist/utils/gitignore.js.map +1 -0
- package/package.json +1 -1
- package/templates/compact-context/_default.md +23 -0
- package/templates/compact-context/cpp.md +26 -0
- package/templates/compact-context/go.md +26 -0
- package/templates/compact-context/python.md +26 -0
- package/templates/compact-context/rust.md +28 -0
- package/templates/compact-context/typescript.md +29 -0
- package/templates/core/CLAUDE_MD_v2.md +71 -0
- package/templates/hooks/check-context-and-handoff.ps1 +50 -0
- package/templates/hooks/check-context-and-handoff.sh +69 -0
- package/templates/hooks/enforce-mcp-for-tasks.sh +31 -0
- package/templates/hooks/enforce-no-deferred.sh +21 -0
- package/templates/hooks/enforce-no-shortcuts.sh +31 -0
- package/templates/hooks/enforce-team-for-background-agents.ps1 +63 -0
- package/templates/hooks/enforce-team-for-background-agents.sh +55 -0
- package/templates/hooks/on-compact-reinject.sh +34 -0
- package/templates/hooks/resume-from-handoff.ps1 +33 -0
- package/templates/hooks/resume-from-handoff.sh +55 -0
- package/templates/rules/consult-analysis-before-implementing.md +23 -0
- package/templates/rules/cpp.md +46 -0
- package/templates/rules/csharp.md +44 -0
- package/templates/rules/diagnostic-first.md +39 -0
- package/templates/rules/fail-twice-escalate.md +46 -0
- package/templates/rules/go.md +40 -0
- package/templates/rules/java.md +43 -0
- package/templates/rules/javascript.md +39 -0
- package/templates/rules/multi-agent-teams.md +75 -0
- package/templates/rules/python.md +43 -0
- package/templates/rules/respect-handoff-trigger.md +41 -0
- package/templates/rules/rust.md +40 -0
- package/templates/rules/typescript.md +40 -0
- package/templates/skills/dev/analysis/SKILL.md +19 -0
- package/templates/skills/dev/handoff/SKILL.md +27 -0
package/README.md
CHANGED
|
@@ -1,965 +1,354 @@
|
|
|
1
|
-
# @hivehub/rulebook
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@hivehub/rulebook)
|
|
4
|
-
[](https://www.npmjs.com/package/@hivehub/rulebook)
|
|
5
|
-
[](LICENSE)
|
|
6
|
-
[](https://nodejs.org/)
|
|
7
|
-
[](https://www.typescriptlang.org/)
|
|
8
|
-
|
|
9
|
-
[](https://github.com/hivellm/rulebook/actions/workflows/test.yml)
|
|
10
|
-
[](https://codecov.io/gh/hivellm/rulebook)
|
|
11
|
-
[](https://github.com/hivellm/rulebook/actions/workflows/build.yml)
|
|
12
|
-
[](https://github.com/hivellm/rulebook/actions/workflows/lint.yml)
|
|
13
|
-
|
|
14
|
-
> Tool-agnostic AI development framework. Standardize projects across Claude Code, Cursor, Gemini, Codex, Windsurf, Copilot with automated templates, quality gates, persistent memory, and framework detection for 28 languages, 17 frameworks, 13 MCP modules, and 20 services.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
###
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
###
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
###
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
###
|
|
182
|
-
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
###
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
rulebook
|
|
228
|
-
rulebook
|
|
229
|
-
rulebook
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
- **Config** → `{project}/.rulebook/rulebook.json` — independent settings
|
|
356
|
-
- **Skills** → resolved per project root
|
|
357
|
-
|
|
358
|
-
Cross-project operations (search, task listing) are explicit and deliberate.
|
|
359
|
-
|
|
360
|
-
### Configuration
|
|
361
|
-
|
|
362
|
-
`.rulebook/workspace.json` at the workspace root:
|
|
363
|
-
|
|
364
|
-
```json
|
|
365
|
-
{
|
|
366
|
-
"name": "my-workspace",
|
|
367
|
-
"version": "1.0.0",
|
|
368
|
-
"projects": [
|
|
369
|
-
{ "name": "frontend", "path": "./frontend" },
|
|
370
|
-
{ "name": "backend", "path": "./backend" },
|
|
371
|
-
{ "name": "shared", "path": "/absolute/path/to/shared-lib" }
|
|
372
|
-
],
|
|
373
|
-
"defaultProject": "backend",
|
|
374
|
-
"idleTimeoutMs": 300000
|
|
375
|
-
}
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
> **Tip**: `rulebook workspace init` auto-generates this from your monorepo structure.
|
|
379
|
-
|
|
380
|
-
---
|
|
381
|
-
|
|
382
|
-
## Key Features
|
|
383
|
-
|
|
384
|
-
- 🤖 **Ralph Autonomous Loop**: Multi-iteration AI task solving with fresh context per iteration (v3.1+)
|
|
385
|
-
- Quality gates: type-check, lint, tests, coverage verification
|
|
386
|
-
- Graceful pause/resume capabilities
|
|
387
|
-
- Complete iteration history and metrics
|
|
388
|
-
- 6 CLI commands + 4 MCP tools
|
|
389
|
-
- 🧠 **Persistent Memory**: Context that survives across AI sessions — hybrid BM25+HNSW search, auto-capture, native SQLite with WASM fallback
|
|
390
|
-
- 🔍 **Auto-Detection**: Detects languages, frameworks, MCP modules, and services from your project files
|
|
391
|
-
- 📁 **Modular Architecture**: Templates in `/.rulebook/` directory — smaller AGENTS.md, on-demand loading
|
|
392
|
-
- 🔗 **Git Hook Automation**: Pre-commit/pre-push hooks with language-aware quality checks
|
|
393
|
-
- 🔌 **26 MCP Functions**: Task management (7), skills (6), persistent memory (6), Ralph loop (4), workspace (4) via Model Context Protocol
|
|
394
|
-
- 📝 **106+ Templates**: 28 languages, 17 frameworks, 8 IDEs, 20 services, 15 CLI agents
|
|
395
|
-
- 🤖 **AI-Optimized**: Works with 23 AI assistants (Cursor, Claude, Gemini, etc.)
|
|
396
|
-
- 📦 **Publication Ready**: CI/CD pipelines for npm, crates.io, PyPI, Maven Central, and more
|
|
397
|
-
- 🔄 **Automatic Migration**: Existing projects automatically migrated to modular structure
|
|
398
|
-
|
|
399
|
-
## VSCode Extension
|
|
400
|
-
|
|
401
|
-
The **Rulebook Dashboard** extension brings full visibility into your AI-powered workflow directly inside VSCode.
|
|
402
|
-
|
|
403
|
-
```bash
|
|
404
|
-
# Install from .vsix (local)
|
|
405
|
-
code --install-extension vscode-extension/rulebook-dashboard-*.vsix
|
|
406
|
-
|
|
407
|
-
# Or build from source
|
|
408
|
-
cd vscode-extension && npm install && npm run compile
|
|
409
|
-
# Press F5 to launch Extension Development Host
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
| Tab | What it shows |
|
|
413
|
-
|-----|---------------|
|
|
414
|
-
| 🤖 **Agents** | All Claude agent team members with real-time status (active/idle), memory state, last activity |
|
|
415
|
-
| 📋 **Tasks** | Project tasks with progress bars, expandable details, Archive & Update via AI buttons |
|
|
416
|
-
| 🔄 **Ralph** | Autonomous loop status, current iteration, progress tracking |
|
|
417
|
-
| 🧠 **Memory** | Memory stats (count, DB size, types), full-text search, clear/reprocess |
|
|
418
|
-
| 🔍 **Indexer** | Background indexer status, files processed, queue size, reindex button |
|
|
419
|
-
|
|
420
|
-
**Multi-root workspace support** — scans all open workspace folders for `.claude/agents/`, `.rulebook/tasks/`, and more.
|
|
421
|
-
|
|
422
|
-
**Status Bar** — `📖 Rulebook` button (opens dashboard), indexer indicator, Ralph running state.
|
|
423
|
-
|
|
424
|
-
> See [`vscode-extension/README.md`](vscode-extension/README.md) for full documentation.
|
|
425
|
-
|
|
426
|
-
## What It Does
|
|
427
|
-
|
|
428
|
-
**For New Projects:**
|
|
429
|
-
1. Detects your language(s), frameworks, MCP modules, and services
|
|
430
|
-
2. Asks setup questions (or use `--minimal` for defaults)
|
|
431
|
-
3. Generates AGENTS.md with AI assistant rules (modular structure)
|
|
432
|
-
4. Creates `/.rulebook/` directory with language/framework/module/service templates
|
|
433
|
-
5. Creates/updates `.gitignore` automatically for detected languages
|
|
434
|
-
6. Auto-configures Claude Code integration (MCP + skills) if detected
|
|
435
|
-
7. Optionally installs Git hooks (pre-commit/pre-push)
|
|
436
|
-
8. Creates GitHub Actions workflows
|
|
437
|
-
9. Scaffolds README, LICENSE, /docs, and /tests
|
|
438
|
-
|
|
439
|
-
**For Existing Projects:**
|
|
440
|
-
```bash
|
|
441
|
-
npx @hivehub/rulebook update
|
|
442
|
-
```
|
|
443
|
-
- Automatically migrates embedded templates to modular `/.rulebook/` structure
|
|
444
|
-
- Automatically migrates OpenSpec tasks to Rulebook format (if OpenSpec exists)
|
|
445
|
-
- Merges latest templates while preserving your customizations
|
|
446
|
-
- Updates AGENTS.md with references to modular files
|
|
447
|
-
- Updates `.gitignore` with missing patterns for detected languages
|
|
448
|
-
|
|
449
|
-
## Commands
|
|
450
|
-
|
|
451
|
-
### Core Commands
|
|
452
|
-
|
|
453
|
-
```bash
|
|
454
|
-
# Project Initialization & Updates
|
|
455
|
-
npx @hivehub/rulebook@latest init # Initialize new project (interactive)
|
|
456
|
-
npx @hivehub/rulebook@latest init --minimal # Minimal setup (essentials only)
|
|
457
|
-
npx @hivehub/rulebook@latest init --light # Light mode (no quality enforcement)
|
|
458
|
-
npx @hivehub/rulebook@latest init --yes # Skip prompts, use defaults
|
|
459
|
-
npx @hivehub/rulebook@latest update # Update AGENTS.md to latest version
|
|
460
|
-
npx @hivehub/rulebook@latest update --yes # Update without confirmation
|
|
461
|
-
npx @hivehub/rulebook@latest update --light # Update in light mode
|
|
462
|
-
|
|
463
|
-
# Workflow & CI/CD
|
|
464
|
-
npx @hivehub/rulebook@latest workflows # Generate GitHub Actions workflows
|
|
465
|
-
|
|
466
|
-
# Validation & Health
|
|
467
|
-
npx @hivehub/rulebook@latest validate # Check project standards
|
|
468
|
-
npx @hivehub/rulebook@latest health # Project health score (0-100)
|
|
469
|
-
npx @hivehub/rulebook@latest fix # Auto-fix common issues
|
|
470
|
-
|
|
471
|
-
# Documentation
|
|
472
|
-
npx @hivehub/rulebook@latest generate-docs # Create /docs structure
|
|
473
|
-
npx @hivehub/rulebook@latest generate-docs --yes # Skip prompts, use defaults
|
|
474
|
-
|
|
475
|
-
# Dependencies & Coverage
|
|
476
|
-
npx @hivehub/rulebook@latest check-deps # Check outdated/vulnerable dependencies
|
|
477
|
-
npx @hivehub/rulebook@latest check-coverage # Check test coverage (default: 95%)
|
|
478
|
-
npx @hivehub/rulebook@latest check-coverage -t 80 # Custom threshold
|
|
479
|
-
|
|
480
|
-
# Versioning
|
|
481
|
-
npx @hivehub/rulebook@latest version <type> # Bump version (major|minor|patch)
|
|
482
|
-
npx @hivehub/rulebook@latest changelog # Generate changelog from git commits
|
|
483
|
-
npx @hivehub/rulebook@latest changelog -v 1.0.0 # Specify version
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
> **Note**: If installed globally (`npm install -g @hivehub/rulebook`), you can use `rulebook` directly instead of `npx @hivehub/rulebook@latest`.
|
|
487
|
-
|
|
488
|
-
### Advanced Commands (Beta)
|
|
489
|
-
|
|
490
|
-
```bash
|
|
491
|
-
# Real-time Monitoring
|
|
492
|
-
npx @hivehub/rulebook@latest watcher # Full-screen task monitoring UI
|
|
493
|
-
# - Live task progress tracking
|
|
494
|
-
# - Activity log with timestamps
|
|
495
|
-
# - System status monitoring
|
|
496
|
-
# - Auto-refresh every 2 seconds
|
|
497
|
-
|
|
498
|
-
# Autonomous Agent
|
|
499
|
-
npx @hivehub/rulebook@latest agent # Start AI CLI workflow automation
|
|
500
|
-
npx @hivehub/rulebook@latest agent --dry-run # Simulate without changes
|
|
501
|
-
npx @hivehub/rulebook@latest agent --tool cursor-agent # Specify CLI tool
|
|
502
|
-
npx @hivehub/rulebook@latest agent --iterations 10 # Max iterations
|
|
503
|
-
npx @hivehub/rulebook@latest agent --watch # Enable watcher mode
|
|
504
|
-
|
|
505
|
-
# Task Management
|
|
506
|
-
npx @hivehub/rulebook@latest task create <task-id> # Create new task
|
|
507
|
-
npx @hivehub/rulebook@latest task list # List all tasks
|
|
508
|
-
npx @hivehub/rulebook@latest task list --archived # List including archived tasks
|
|
509
|
-
npx @hivehub/rulebook@latest task show <task-id> # Show task details
|
|
510
|
-
npx @hivehub/rulebook@latest task validate <task-id> # Validate task format
|
|
511
|
-
npx @hivehub/rulebook@latest task archive <task-id> # Archive completed task
|
|
512
|
-
npx @hivehub/rulebook@latest task archive --skip-validation <task-id> # Archive without validation
|
|
513
|
-
npx @hivehub/rulebook@latest tasks [options] # Legacy command (DEPRECATED - use 'task' commands)
|
|
514
|
-
|
|
515
|
-
# Skills Management (v2.0)
|
|
516
|
-
npx @hivehub/rulebook@latest skill list # List all available skills
|
|
517
|
-
npx @hivehub/rulebook@latest skill list --category languages # Filter by category
|
|
518
|
-
npx @hivehub/rulebook@latest skill list --enabled # Show only enabled skills
|
|
519
|
-
npx @hivehub/rulebook@latest skill add <skill-id> # Enable a skill
|
|
520
|
-
npx @hivehub/rulebook@latest skill remove <skill-id> # Disable a skill
|
|
521
|
-
npx @hivehub/rulebook@latest skill show <skill-id> # Show skill details
|
|
522
|
-
npx @hivehub/rulebook@latest skill search <query> # Search for skills
|
|
523
|
-
|
|
524
|
-
# Persistent Memory (v3.0)
|
|
525
|
-
npx @hivehub/rulebook@latest memory search <query> # Search memories (hybrid BM25+vector)
|
|
526
|
-
npx @hivehub/rulebook@latest memory save <text> # Save a memory
|
|
527
|
-
npx @hivehub/rulebook@latest memory list # List all memories
|
|
528
|
-
npx @hivehub/rulebook@latest memory stats # Database stats and health
|
|
529
|
-
npx @hivehub/rulebook@latest memory cleanup # Run cache eviction
|
|
530
|
-
npx @hivehub/rulebook@latest memory export # Export as JSON or CSV
|
|
531
|
-
|
|
532
|
-
# Ralph Autonomous Loop (v3.1)
|
|
533
|
-
npx @hivehub/rulebook@latest ralph init # Initialize Ralph and generate PRD
|
|
534
|
-
npx @hivehub/rulebook@latest ralph run # Execute autonomous iteration loop
|
|
535
|
-
npx @hivehub/rulebook@latest ralph run --max-iterations 10 # Set max iterations
|
|
536
|
-
npx @hivehub/rulebook@latest ralph run --tool claude # Specify AI tool (claude|amp|gemini)
|
|
537
|
-
npx @hivehub/rulebook@latest ralph status # Show loop status
|
|
538
|
-
npx @hivehub/rulebook@latest ralph history # View iteration history
|
|
539
|
-
npx @hivehub/rulebook@latest ralph history --limit 5 # Last N iterations
|
|
540
|
-
npx @hivehub/rulebook@latest ralph pause # Gracefully pause loop
|
|
541
|
-
npx @hivehub/rulebook@latest ralph resume # Resume from pause
|
|
542
|
-
|
|
543
|
-
# Configuration
|
|
544
|
-
npx @hivehub/rulebook@latest config --show # Show current config
|
|
545
|
-
npx @hivehub/rulebook@latest config --set key=value # Set config value
|
|
546
|
-
npx @hivehub/rulebook@latest config --feature watcher --enable # Enable feature
|
|
547
|
-
npx @hivehub/rulebook@latest config --feature agent --disable # Disable feature
|
|
548
|
-
```
|
|
549
|
-
|
|
550
|
-
## Setup Modes
|
|
551
|
-
|
|
552
|
-
### Full Mode (Default)
|
|
553
|
-
Complete setup with all features: Task management, Watcher, MCP modules, comprehensive workflows.
|
|
554
|
-
|
|
555
|
-
### Minimal Mode
|
|
556
|
-
```bash
|
|
557
|
-
npx @hivehub/rulebook@latest init --minimal
|
|
558
|
-
```
|
|
559
|
-
Essentials only: README, LICENSE, tests/, basic CI. Perfect for small teams or initial adoption.
|
|
560
|
-
|
|
561
|
-
### Light Mode
|
|
562
|
-
```bash
|
|
563
|
-
npx @hivehub/rulebook@latest init --light
|
|
564
|
-
```
|
|
565
|
-
Bare minimum rules: no quality enforcement, no testing requirements, no linting. Use for quick prototypes or non-production projects.
|
|
566
|
-
|
|
567
|
-
## Supported Languages & Frameworks
|
|
568
|
-
|
|
569
|
-
**28 Languages**: TypeScript, JavaScript, Python, Rust, Go, Java, Kotlin, C, C++, C#, PHP, Ruby, Swift, Elixir, Dart, Scala, Haskell, Julia, R, Lua, Solidity, Zig, Erlang, Ada, SAS, Lisp, Objective-C, SQL
|
|
570
|
-
|
|
571
|
-
**17 Frameworks** (auto-detected):
|
|
572
|
-
- Backend: NestJS, Spring Boot, Laravel, Django, Flask, Ruby on Rails, Symfony, Zend
|
|
573
|
-
- Frontend: Angular, React, Vue, Nuxt, Next.js, jQuery
|
|
574
|
-
- Mobile: React Native, Flutter
|
|
575
|
-
- Desktop: Electron
|
|
576
|
-
|
|
577
|
-
## MCP Modules (13)
|
|
578
|
-
|
|
579
|
-
**Core**: Vectorizer • Synap • Context7 • GitHub MCP • Playwright • Memory
|
|
580
|
-
|
|
581
|
-
**Services**: Supabase • Notion • Atlassian • Serena • Figma • Grafana
|
|
582
|
-
|
|
583
|
-
### MCP Server for Task Management
|
|
584
|
-
|
|
585
|
-
Rulebook provides an MCP (Model Context Protocol) server that exposes task management functions, allowing AI models to manage tasks programmatically through MCP instead of executing terminal commands.
|
|
586
|
-
|
|
587
|
-
**Benefits:**
|
|
588
|
-
- ✅ Direct MCP integration - no shell command execution needed
|
|
589
|
-
- ✅ Structured error handling with proper error codes and messages
|
|
590
|
-
- ✅ Consistent interface with other MCP operations
|
|
591
|
-
- ✅ Better automation capabilities for AI agents
|
|
592
|
-
- ✅ Improved reliability compared to terminal command execution
|
|
593
|
-
- ✅ Automatic project detection - finds `.rulebook` by walking up directories (like git)
|
|
594
|
-
- ✅ Zero configuration - works out of the box after `rulebook mcp init`
|
|
595
|
-
|
|
596
|
-
**Quick Setup:**
|
|
597
|
-
|
|
598
|
-
```bash
|
|
599
|
-
# Initialize MCP configuration in your project (one-time setup)
|
|
600
|
-
npx @hivehub/rulebook@latest mcp init
|
|
601
|
-
```
|
|
602
|
-
|
|
603
|
-
This command:
|
|
604
|
-
- Adds `mcp` block to your `.rulebook` file
|
|
605
|
-
- Creates/updates `.cursor/mcp.json` automatically
|
|
606
|
-
- Server uses stdio transport (MCP standard)
|
|
607
|
-
|
|
608
|
-
> **Note**: `rulebook init` and `rulebook update` automatically detect Claude Code and configure `.mcp.json` at the project root + install skills to `.claude/commands/`. No manual setup needed for Claude Code users.
|
|
609
|
-
|
|
610
|
-
**Available MCP Functions:**
|
|
611
|
-
|
|
612
|
-
- `rulebook_task_create` - Create a new task with OpenSpec-compatible format
|
|
613
|
-
- Input: `taskId` (string), optional `proposal` object
|
|
614
|
-
- Output: Task creation confirmation with path
|
|
615
|
-
- `rulebook_task_list` - List all tasks with optional filters
|
|
616
|
-
- Input: `includeArchived` (boolean), `status` (enum)
|
|
617
|
-
- Output: Array of tasks with metadata
|
|
618
|
-
- `rulebook_task_show` - Show detailed task information
|
|
619
|
-
- Input: `taskId` (string)
|
|
620
|
-
- Output: Complete task details including proposal, tasks, specs
|
|
621
|
-
- `rulebook_task_update` - Update task status or progress
|
|
622
|
-
- Input: `taskId` (string), optional `status`, `progress`
|
|
623
|
-
- Output: Update confirmation
|
|
624
|
-
- `rulebook_task_validate` - Validate task format against OpenSpec requirements
|
|
625
|
-
- Input: `taskId` (string)
|
|
626
|
-
- Output: Validation results with errors and warnings
|
|
627
|
-
- `rulebook_task_archive` - Archive completed task and apply spec deltas
|
|
628
|
-
- Input: `taskId` (string), optional `skipValidation`
|
|
629
|
-
- Output: Archive confirmation with archive path
|
|
630
|
-
- `rulebook_task_delete` - Delete a task permanently
|
|
631
|
-
- Input: `taskId` (string)
|
|
632
|
-
- Output: Deletion confirmation
|
|
633
|
-
|
|
634
|
-
**Total: 7 MCP functions** for complete task lifecycle management.
|
|
635
|
-
|
|
636
|
-
**Skills MCP Functions (v2.0):**
|
|
637
|
-
|
|
638
|
-
- `rulebook_skill_list` - List available skills with optional category filter
|
|
639
|
-
- `rulebook_skill_show` - Show detailed skill information
|
|
640
|
-
- `rulebook_skill_enable` - Enable a skill for the project
|
|
641
|
-
- `rulebook_skill_disable` - Disable a skill
|
|
642
|
-
- `rulebook_skill_search` - Search skills by name, description, or tags
|
|
643
|
-
- `rulebook_skill_validate` - Validate skills configuration
|
|
644
|
-
|
|
645
|
-
**Memory MCP Functions (v3.0):**
|
|
646
|
-
|
|
647
|
-
- `rulebook_memory_search` - Hybrid BM25+vector search with mode selection (hybrid/bm25/vector)
|
|
648
|
-
- `rulebook_memory_timeline` - Chronological context around a specific memory
|
|
649
|
-
- `rulebook_memory_get` - Full details for specific memory IDs
|
|
650
|
-
- `rulebook_memory_save` - Save new memories with type, title, content, and tags
|
|
651
|
-
- `rulebook_memory_stats` - Database statistics (size, count, usage, health)
|
|
652
|
-
- `rulebook_memory_cleanup` - Force eviction and cleanup
|
|
653
|
-
|
|
654
|
-
**Total: 19 MCP functions** (7 task + 6 skills + 6 memory).
|
|
655
|
-
|
|
656
|
-
## Skills System (v2.0)
|
|
657
|
-
|
|
658
|
-
Rulebook v2.0 introduces a modular skills system for AI-assisted development. Skills are pluggable capabilities that can be enabled or disabled per project.
|
|
659
|
-
|
|
660
|
-
### What are Skills?
|
|
661
|
-
|
|
662
|
-
Skills are YAML-frontmatter Markdown files that define specific capabilities or rules for AI assistants. Each skill has:
|
|
663
|
-
|
|
664
|
-
- **Metadata**: Name, description, version, category, tags, dependencies
|
|
665
|
-
- **Content**: Markdown content with rules, patterns, and examples
|
|
666
|
-
|
|
667
|
-
### Skill Categories
|
|
668
|
-
|
|
669
|
-
Skills are organized into 10 categories:
|
|
670
|
-
|
|
671
|
-
| Category | Description | Examples |
|
|
672
|
-
|----------|-------------|----------|
|
|
673
|
-
| `languages` | Language-specific rules | TypeScript, Rust, Python |
|
|
674
|
-
| `frameworks` | Framework conventions | NestJS, React, Django |
|
|
675
|
-
| `modules` | MCP module integration | Vectorizer, Context7 |
|
|
676
|
-
| `services` | Service integration | PostgreSQL, Redis |
|
|
677
|
-
| `workflows` | CI/CD patterns | GitHub Actions |
|
|
678
|
-
| `ides` | IDE configuration | Cursor, VS Code |
|
|
679
|
-
| `core` | Core rulebook standards | Quality gates |
|
|
680
|
-
| `cli` | AI CLI configuration | Claude Code, Codex |
|
|
681
|
-
| `git` | Git workflow rules | Branching, commits |
|
|
682
|
-
| `hooks` | Git hooks configuration | Pre-commit, pre-push |
|
|
683
|
-
|
|
684
|
-
### Using Skills
|
|
685
|
-
|
|
686
|
-
```bash
|
|
687
|
-
# List all available skills
|
|
688
|
-
rulebook skill list
|
|
689
|
-
|
|
690
|
-
# Filter by category
|
|
691
|
-
rulebook skill list --category languages
|
|
692
|
-
|
|
693
|
-
# Enable a skill
|
|
694
|
-
rulebook skill add languages/typescript
|
|
695
|
-
|
|
696
|
-
# Disable a skill
|
|
697
|
-
rulebook skill remove languages/typescript
|
|
698
|
-
|
|
699
|
-
# Show skill details
|
|
700
|
-
rulebook skill show languages/typescript
|
|
701
|
-
|
|
702
|
-
# Search for skills
|
|
703
|
-
rulebook skill search "testing"
|
|
704
|
-
```
|
|
705
|
-
|
|
706
|
-
### Auto-Detection
|
|
707
|
-
|
|
708
|
-
During `rulebook init` and `rulebook update`, skills are automatically detected and enabled based on your project's:
|
|
709
|
-
|
|
710
|
-
- Detected languages (e.g., TypeScript → `languages/typescript`)
|
|
711
|
-
- Detected frameworks (e.g., NestJS → `frameworks/nestjs`)
|
|
712
|
-
- Detected modules (e.g., Vectorizer → `modules/vectorizer`)
|
|
713
|
-
- Detected services (e.g., PostgreSQL → `services/postgresql`)
|
|
714
|
-
|
|
715
|
-
### Creating Custom Skills
|
|
716
|
-
|
|
717
|
-
Create a `SKILL.md` file in `templates/skills/<category>/<skill-name>/`:
|
|
718
|
-
|
|
719
|
-
```markdown
|
|
720
|
-
---
|
|
721
|
-
name: My Custom Skill
|
|
722
|
-
description: Description of what this skill does
|
|
723
|
-
version: 1.0.0
|
|
724
|
-
category: core
|
|
725
|
-
tags: ["custom", "example"]
|
|
726
|
-
---
|
|
727
|
-
|
|
728
|
-
# My Custom Skill
|
|
729
|
-
|
|
730
|
-
Add your rules and patterns here.
|
|
731
|
-
```
|
|
732
|
-
|
|
733
|
-
## Service Integration Templates (20)
|
|
734
|
-
|
|
735
|
-
Rulebook provides comprehensive integration templates for popular backend services, including databases, caches, message queues, and object storage.
|
|
736
|
-
|
|
737
|
-
**Relational Databases**: PostgreSQL • MySQL • MariaDB • SQL Server • Oracle • SQLite
|
|
738
|
-
|
|
739
|
-
**NoSQL Databases**: MongoDB • Cassandra • DynamoDB
|
|
740
|
-
|
|
741
|
-
**Caches**: Redis • Memcached
|
|
742
|
-
|
|
743
|
-
**Search & Analytics**: Elasticsearch
|
|
744
|
-
|
|
745
|
-
**Graph Databases**: Neo4j
|
|
746
|
-
|
|
747
|
-
**Time-Series Databases**: InfluxDB
|
|
748
|
-
|
|
749
|
-
**Message Queues**: RabbitMQ • Kafka
|
|
750
|
-
|
|
751
|
-
**Object Storage**: AWS S3 • Azure Blob Storage • Google Cloud Storage • MinIO
|
|
752
|
-
|
|
753
|
-
### Automatic Service Detection
|
|
754
|
-
|
|
755
|
-
The CLI automatically detects services in your project by analyzing:
|
|
756
|
-
- **`package.json`**: Database drivers and client libraries (e.g., `pg`, `mongoose`, `redis`, `ioredis`)
|
|
757
|
-
- **`.env` files**: Connection strings and environment variables (e.g., `POSTGRES_*`, `REDIS_*`, `MONGODB_*`)
|
|
758
|
-
- **`docker-compose.yml`**: Service definitions in Docker Compose files
|
|
759
|
-
|
|
760
|
-
### Service Templates Include
|
|
761
|
-
|
|
762
|
-
Each service template provides:
|
|
763
|
-
- Connection setup and configuration
|
|
764
|
-
- Basic CRUD operations (where applicable)
|
|
765
|
-
- Advanced patterns and best practices
|
|
766
|
-
- Docker Compose examples
|
|
767
|
-
- Environment variable configuration
|
|
768
|
-
- Development and testing integration
|
|
769
|
-
- Common pitfalls and solutions
|
|
770
|
-
|
|
771
|
-
Templates are generated in `/.rulebook/specs/[SERVICE].md` and referenced in `AGENTS.md` for easy access during development.
|
|
772
|
-
|
|
773
|
-
**Server Details:**
|
|
774
|
-
- **Transport**: stdio only - stdout contains ONLY JSON-RPC 2.0 messages
|
|
775
|
-
- **Configuration**: Loaded from `.rulebook` file automatically
|
|
776
|
-
- **Project Detection**: Finds `.rulebook` by walking up directories (like git)
|
|
777
|
-
- **Protocol**: MCP over stdio (MCP-compliant, no stdout pollution)
|
|
778
|
-
|
|
779
|
-
**Configuration:**
|
|
780
|
-
|
|
781
|
-
The MCP server configuration lives in your `.rulebook` file:
|
|
782
|
-
|
|
783
|
-
```json
|
|
784
|
-
{
|
|
785
|
-
"mcp": {
|
|
786
|
-
"enabled": true,
|
|
787
|
-
"tasksDir": ".rulebook/tasks",
|
|
788
|
-
"archiveDir": ".rulebook/archive"
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
```
|
|
792
|
-
|
|
793
|
-
**Note:** The server uses stdio transport only (no configuration needed).
|
|
794
|
-
|
|
795
|
-
**Cursor Configuration (`.cursor/mcp.json`):**
|
|
796
|
-
|
|
797
|
-
After running `rulebook mcp init`, your `.cursor/mcp.json` will be automatically configured:
|
|
798
|
-
|
|
799
|
-
```json
|
|
800
|
-
{
|
|
801
|
-
"mcpServers": {
|
|
802
|
-
"rulebook": {
|
|
803
|
-
"command": "npx",
|
|
804
|
-
"args": ["-y", "@hivehub/rulebook@latest", "mcp-server"]
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
```
|
|
809
|
-
|
|
810
|
-
That's it! No need for `--project-root`, `--port`, or environment variables. The server automatically:
|
|
811
|
-
- Finds your `.rulebook` file by walking up directories
|
|
812
|
-
- Uses the `mcp` configuration from `.rulebook`
|
|
813
|
-
- Works from any subdirectory in your project
|
|
814
|
-
|
|
815
|
-
**Manual Override (if needed):**
|
|
816
|
-
|
|
817
|
-
If you need to override the `.rulebook` location:
|
|
818
|
-
|
|
819
|
-
```json
|
|
820
|
-
{
|
|
821
|
-
"mcpServers": {
|
|
822
|
-
"rulebook": {
|
|
823
|
-
"command": "npx",
|
|
824
|
-
"args": ["-y", "@hivehub/rulebook@latest", "mcp-server"],
|
|
825
|
-
"env": {
|
|
826
|
-
"RULEBOOK_CONFIG": "/path/to/.rulebook"
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
```
|
|
832
|
-
|
|
833
|
-
**Note:** After running `rulebook mcp init` or updating `.cursor/mcp.json`, restart Cursor for the changes to take effect.
|
|
834
|
-
|
|
835
|
-
**Troubleshooting:**
|
|
836
|
-
|
|
837
|
-
### Server Not Starting
|
|
838
|
-
|
|
839
|
-
If the MCP server fails to start:
|
|
840
|
-
|
|
841
|
-
1. **Verify `.rulebook` exists**: Run `rulebook mcp init` in your project root
|
|
842
|
-
2. **Check Node.js version**: Requires Node.js 20+ (`node --version`)
|
|
843
|
-
3. **Verify MCP configuration**: Check that `.cursor/mcp.json` exists and is valid JSON
|
|
844
|
-
4. **Debug mode**: Set `RULEBOOK_MCP_DEBUG=1` to see debug logs in stderr:
|
|
845
|
-
```bash
|
|
846
|
-
RULEBOOK_MCP_DEBUG=1 npx @hivehub/rulebook@latest mcp-server
|
|
847
|
-
```
|
|
848
|
-
|
|
849
|
-
### Empty Schemas or Missing Parameters
|
|
850
|
-
|
|
851
|
-
If tools don't show descriptions or parameters:
|
|
852
|
-
|
|
853
|
-
1. **Clear npm cache**:
|
|
854
|
-
```bash
|
|
855
|
-
# Clear npm cache
|
|
856
|
-
npm cache clean --force
|
|
857
|
-
|
|
858
|
-
# Or clear npx cache specifically
|
|
859
|
-
rm -rf ~/.npm/_npx
|
|
860
|
-
```
|
|
861
|
-
|
|
862
|
-
2. **Rebuild the project**:
|
|
863
|
-
```bash
|
|
864
|
-
npm run build
|
|
865
|
-
```
|
|
866
|
-
|
|
867
|
-
3. Restart your MCP client and try again.
|
|
868
|
-
|
|
869
|
-
### "Unexpected token" or "Invalid JSON" Errors
|
|
870
|
-
|
|
871
|
-
These errors occur when the server outputs non-JSON to stdout. This is fixed in v1.0.9+:
|
|
872
|
-
- Ensure you're using `@hivehub/rulebook@latest` (v1.0.9 or newer)
|
|
873
|
-
- stdout now contains ONLY JSON-RPC 2.0 messages
|
|
874
|
-
- All logs go to stderr (use `RULEBOOK_MCP_DEBUG=1` to see them)
|
|
875
|
-
|
|
876
|
-
### ".rulebook not found" Error
|
|
877
|
-
|
|
878
|
-
If you see this error:
|
|
879
|
-
1. Run `rulebook mcp init` in your project root
|
|
880
|
-
2. Or manually create `.rulebook` file with `mcp` block
|
|
881
|
-
3. Or set `RULEBOOK_CONFIG` environment variable to point to your `.rulebook` file
|
|
882
|
-
|
|
883
|
-
### "Received a response for an unknown message ID" Warning
|
|
884
|
-
|
|
885
|
-
If you see this warning in Cursor logs:
|
|
886
|
-
- **This is a cosmetic warning** - it does NOT affect functionality
|
|
887
|
-
- All tools work correctly despite this warning
|
|
888
|
-
- The server is responding correctly with valid JSON-RPC 2.0 messages
|
|
889
|
-
- This is a known issue with Cursor's MCP client ID tracking
|
|
890
|
-
- The warning can be safely ignored - all MCP tools function normally
|
|
891
|
-
|
|
892
|
-
### "Received a response for an unknown message ID" Warning
|
|
893
|
-
|
|
894
|
-
If you see this warning in the logs:
|
|
895
|
-
- This is usually harmless - the server is working correctly
|
|
896
|
-
- The warning appears during the initial handshake but doesn't affect functionality
|
|
897
|
-
- If you see "Successfully connected to stdio server" after the warning, everything is fine
|
|
898
|
-
- This is a known behavior with some MCP clients and can be safely ignored
|
|
899
|
-
|
|
900
|
-
**Automated Setup:**
|
|
901
|
-
|
|
902
|
-
```bash
|
|
903
|
-
# Initialize MCP in your project (recommended)
|
|
904
|
-
npx @hivehub/rulebook@latest mcp init
|
|
905
|
-
|
|
906
|
-
# Or use the setup script (for CI/CD)
|
|
907
|
-
npm run setup:mcp
|
|
908
|
-
```
|
|
909
|
-
|
|
910
|
-
## AI Tools Supported (23)
|
|
911
|
-
|
|
912
|
-
**IDEs**: Cursor, Windsurf, VS Code, GitHub Copilot, Tabnine, Replit, JetBrains AI, Zed
|
|
913
|
-
|
|
914
|
-
**CLI Agents**: Aider, Continue, Claude, Claude Code, Gemini, Cline, Amazon Q, Auggie, CodeBuddy, Factory, OpenCode, Kilo, Codex, Codeium, Cursor CLI
|
|
915
|
-
|
|
916
|
-
## Documentation
|
|
917
|
-
|
|
918
|
-
Full documentation available in `/docs`:
|
|
919
|
-
- [Getting Started](docs/guides/GETTING_STARTED.md)
|
|
920
|
-
- [Best Practices](docs/guides/BEST_PRACTICES.md)
|
|
921
|
-
- [CLI Agents](docs/CLI_AGENTS.md)
|
|
922
|
-
- [Roadmap](docs/ROADMAP.md)
|
|
923
|
-
- [Framework Templates](templates/frameworks/)
|
|
924
|
-
|
|
925
|
-
## Contributing
|
|
926
|
-
|
|
927
|
-
Contributions welcome! Node.js 18+ required.
|
|
928
|
-
|
|
929
|
-
```bash
|
|
930
|
-
npm install
|
|
931
|
-
npm test
|
|
932
|
-
npm run build
|
|
933
|
-
```
|
|
934
|
-
|
|
935
|
-
## Acknowledgments
|
|
936
|
-
|
|
937
|
-
We gratefully acknowledge and draw inspiration from these excellent open-source projects:
|
|
938
|
-
|
|
939
|
-
### [Ralph - Autonomous AI Agent Loop](https://github.com/snarktank/ralph)
|
|
940
|
-
Ralph inspired the autonomous loop integration in Rulebook v3.1+, enabling multi-iteration AI task solving with fresh context per iteration. We adapted Ralph's architectural patterns for integration with the Rulebook task management system, enabling AI agents to solve complex problems across multiple iterations without context exhaustion.
|
|
941
|
-
|
|
942
|
-
### [OpenSpec - AI-Native Task Format](https://github.com/Fission-AI/openspec)
|
|
943
|
-
OpenSpec's innovative approach to AI-native task management influenced Rulebook's task structure, including:
|
|
944
|
-
- Delta-based specifications (ADDED/MODIFIED/REMOVED)
|
|
945
|
-
- Given/When/Then scenario definitions
|
|
946
|
-
- Requirement-focused organization
|
|
947
|
-
- Structured task metadata and tracking
|
|
948
|
-
|
|
949
|
-
Rulebook builds on these concepts to provide a comprehensive task management system that works seamlessly with AI agents while maintaining compatibility with the OpenSpec format.
|
|
950
|
-
|
|
951
|
-
### Special Thanks
|
|
952
|
-
|
|
953
|
-
- **Ralph Team** for pioneering autonomous AI iteration patterns
|
|
954
|
-
- **Fission AI** for the OpenSpec format that standardizes AI task management
|
|
955
|
-
- All contributors who have helped shape Rulebook into a comprehensive solution for AI-generated project standardization
|
|
956
|
-
|
|
957
|
-
These projects demonstrate that with clear structure and standards, AI agents can consistently deliver high-quality code and documentation.
|
|
958
|
-
|
|
959
|
-
## License
|
|
960
|
-
|
|
961
|
-
Apache License 2.0 © HiveLLM Team
|
|
962
|
-
|
|
963
|
-
---
|
|
964
|
-
|
|
965
|
-
**Links**: [Issues](https://github.com/hivellm/rulebook/issues) • [Discussions](https://github.com/hivellm/rulebook/discussions) • [Ralph](https://github.com/snarktank/ralph) • [OpenSpec](https://github.com/Fission-AI/openspec)
|
|
1
|
+
# @hivehub/rulebook
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@hivehub/rulebook)
|
|
4
|
+
[](https://www.npmjs.com/package/@hivehub/rulebook)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
|
|
9
|
+
[](https://github.com/hivellm/rulebook/actions/workflows/test.yml)
|
|
10
|
+
[](https://codecov.io/gh/hivellm/rulebook)
|
|
11
|
+
[](https://github.com/hivellm/rulebook/actions/workflows/build.yml)
|
|
12
|
+
[](https://github.com/hivellm/rulebook/actions/workflows/lint.yml)
|
|
13
|
+
|
|
14
|
+
> Tool-agnostic AI development framework. Standardize projects across Claude Code, Cursor, Gemini, Codex, Windsurf, and Copilot with automated templates, quality gates, persistent memory, and framework detection for 28 languages, 17 frameworks, 13 MCP modules, and 20 services.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Initialize — auto-detects languages, tools, and complexity
|
|
22
|
+
npx @hivehub/rulebook@latest init
|
|
23
|
+
|
|
24
|
+
# Update existing project to latest rules
|
|
25
|
+
npx @hivehub/rulebook@latest update
|
|
26
|
+
|
|
27
|
+
# Check project health
|
|
28
|
+
npx @hivehub/rulebook@latest doctor
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
That's it. Rulebook detects your stack, generates rules for every AI tool in your project, sets up quality gates, and configures MCP integration — all in one command.
|
|
32
|
+
|
|
33
|
+
> Install globally with `npm install -g @hivehub/rulebook` to use `rulebook` directly.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## What Rulebook Does
|
|
38
|
+
|
|
39
|
+
AI coding assistants produce inconsistent, error-prone code without clear guidelines. Rulebook gives every AI tool in your project the same set of rules — automatically.
|
|
40
|
+
|
|
41
|
+
**One `init`, every tool configured:**
|
|
42
|
+
|
|
43
|
+
| What | How |
|
|
44
|
+
|------|-----|
|
|
45
|
+
| **Rules for every AI tool** | `AGENTS.md` + `CLAUDE.md` + `.cursor/rules/` + Gemini/Copilot/Windsurf configs — all generated from a single source of truth |
|
|
46
|
+
| **Quality gates** | Pre-commit hooks (lint, type-check, format) + pre-push hooks (build, tests) — language-aware, cross-platform |
|
|
47
|
+
| **40+ MCP tools** | Task management, persistent memory, skills, decisions, knowledge, learnings, Ralph loop, workspace — all via Model Context Protocol |
|
|
48
|
+
| **Structural enforcement** | `PreToolUse` hooks block forbidden patterns (deferred tasks, stubs/TODOs, manual task files) before edits reach disk |
|
|
49
|
+
| **Session continuity** | Persistent memory across sessions, automatic handoff at context limits, STATE.md live status |
|
|
50
|
+
| **Autonomous task solving** | Ralph loop: multi-iteration AI agent with quality gates, learning extraction, pause/resume |
|
|
51
|
+
| **28 languages, 17 frameworks** | Auto-detected with confidence scores, language-specific templates and CI/CD workflows |
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Core Features
|
|
56
|
+
|
|
57
|
+
### Modular Rule System
|
|
58
|
+
|
|
59
|
+
Rulebook generates a **modular `@import` chain** instead of one massive file:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
CLAUDE.md (thin, ~100 lines)
|
|
63
|
+
@imports AGENTS.md — team-shared rules
|
|
64
|
+
@imports AGENTS.override.md — your project overrides (survives updates)
|
|
65
|
+
@imports .rulebook/STATE.md — live task/health status
|
|
66
|
+
@imports .rulebook/PLANS.md — session scratchpad
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Path-scoped rules in `.claude/rules/` load only when the AI touches matching files (e.g., TypeScript rules load only for `.ts` files). 5 always-on rules enforce core behaviors: diagnostic-first, fail-twice-escalate, no-deferred, no-shortcuts, sequential-editing.
|
|
70
|
+
|
|
71
|
+
### Persistent Memory
|
|
72
|
+
|
|
73
|
+
Context that survives across AI sessions. Decisions, bugs, patterns, and preferences are stored locally and searchable.
|
|
74
|
+
|
|
75
|
+
| Component | Technology |
|
|
76
|
+
|-----------|-----------|
|
|
77
|
+
| Storage | better-sqlite3 (native) with sql.js WASM fallback |
|
|
78
|
+
| Search | Hybrid BM25 keyword + HNSW vector (256-dim TF-IDF, no API calls) |
|
|
79
|
+
| Ranking | Reciprocal Rank Fusion |
|
|
80
|
+
| Privacy | Auto-redact `<private>` tags, local-only storage |
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
rulebook memory search "authentication approach" # Hybrid search
|
|
84
|
+
rulebook memory save "Chose JWT over sessions" # Save context
|
|
85
|
+
rulebook memory stats # DB health
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Task Management
|
|
89
|
+
|
|
90
|
+
Spec-driven development with OpenSpec-compatible format. Phase-prefixed task IDs, mandatory tail items (docs + tests + verify), and automatic archival.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
rulebook task create phase1_add-auth # Create task with structure
|
|
94
|
+
rulebook task list # See pending work
|
|
95
|
+
rulebook task validate phase1_add-auth # Check format
|
|
96
|
+
rulebook task archive phase1_add-auth # Archive when done
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Each task gets: `proposal.md` (why), `tasks.md` (checklist), `specs/` (technical requirements with SHALL/MUST keywords and Given/When/Then scenarios).
|
|
100
|
+
|
|
101
|
+
### Ralph Autonomous Loop
|
|
102
|
+
|
|
103
|
+
Multi-iteration AI agent that solves tasks from a PRD with fresh context per iteration. 5 quality gates (type-check, lint, tests, coverage, security) must pass before an iteration succeeds.
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
rulebook ralph init # Generate PRD from tasks
|
|
107
|
+
rulebook ralph run --max-iterations 10 # Execute loop
|
|
108
|
+
rulebook ralph status # Check progress
|
|
109
|
+
rulebook ralph history # Review iterations
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Features: parallel story execution, plan checkpoints, context compression, learning extraction, graceful pause/resume.
|
|
113
|
+
|
|
114
|
+
### Multi-Project Workspace
|
|
115
|
+
|
|
116
|
+
One MCP server manages all projects in a monorepo, with fully isolated per-project managers.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
rulebook workspace init # Create workspace config
|
|
120
|
+
rulebook workspace add ./frontend # Add projects
|
|
121
|
+
rulebook mcp init --workspace # Single MCP for all
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Auto-discovers from `pnpm-workspace.yaml`, `turbo.json`, `nx.json`, `lerna.json`, or `*.code-workspace`.
|
|
125
|
+
|
|
126
|
+
### Structural Enforcement Hooks
|
|
127
|
+
|
|
128
|
+
3 `PreToolUse` hooks block forbidden patterns at the tool level — before edits reach disk:
|
|
129
|
+
|
|
130
|
+
| Hook | Blocks |
|
|
131
|
+
|------|--------|
|
|
132
|
+
| `enforce-no-deferred` | `deferred`, `skip`, `later`, `TODO` in tasks.md |
|
|
133
|
+
| `enforce-no-shortcuts` | Stubs, placeholders, `HACK`/`FIXME` in source files |
|
|
134
|
+
| `enforce-mcp-for-tasks` | Manual `mkdir`/`Write` in `.rulebook/tasks/` |
|
|
135
|
+
|
|
136
|
+
Cross-platform (Node.js, no `jq` dependency).
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## MCP Server
|
|
141
|
+
|
|
142
|
+
40+ MCP tools exposed via stdio transport. Zero configuration after `rulebook mcp init`.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
rulebook mcp init # One-time setup — configures .mcp.json automatically
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
| Category | Tools | Examples |
|
|
149
|
+
|----------|-------|---------|
|
|
150
|
+
| Tasks (7) | CRUD + validate + archive + delete | `rulebook_task_create`, `rulebook_task_list` |
|
|
151
|
+
| Skills (6) | List, show, enable, disable, search, validate | `rulebook_skill_enable`, `rulebook_skill_search` |
|
|
152
|
+
| Memory (6) | Save, search, get, timeline, stats, cleanup | `rulebook_memory_search`, `rulebook_memory_save` |
|
|
153
|
+
| Ralph (4) | Init, run, status, history | `rulebook_ralph_run`, `rulebook_ralph_status` |
|
|
154
|
+
| Workspace (4) | List, status, search, tasks | `rulebook_workspace_search`, `rulebook_workspace_tasks` |
|
|
155
|
+
| Knowledge (3) | Add, list, show | `rulebook_knowledge_add`, `rulebook_knowledge_list` |
|
|
156
|
+
| Decisions (4) | Create, list, show, update | `rulebook_decision_create`, `rulebook_decision_list` |
|
|
157
|
+
| Learnings (3) | Capture, list, promote | `rulebook_learn_capture`, `rulebook_learn_list` |
|
|
158
|
+
| Analysis (3) | Create, list, show | `rulebook_analysis_create`, `rulebook_analysis_list` |
|
|
159
|
+
| Other (3+) | Doctor, rules list, blockers, session, codebase | `rulebook_doctor_run`, `rulebook_rules_list` |
|
|
160
|
+
|
|
161
|
+
All tools accept optional `projectId` for workspace routing.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## CLI Reference
|
|
166
|
+
|
|
167
|
+
### Project Setup
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
rulebook init # Interactive setup (auto-detects everything)
|
|
171
|
+
rulebook init --minimal # Essentials only
|
|
172
|
+
rulebook init --lean # AGENTS.md as <3KB index
|
|
173
|
+
rulebook init --light # No quality enforcement
|
|
174
|
+
rulebook update # Update to latest rules
|
|
175
|
+
rulebook doctor # 7 health checks
|
|
176
|
+
rulebook validate # Check project standards
|
|
177
|
+
rulebook health # Health score (0-100)
|
|
178
|
+
rulebook fix # Auto-fix common issues
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Task Management
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
rulebook task create <task-id> # Create (phase-prefixed: phase1_add-auth)
|
|
185
|
+
rulebook task list # List active tasks
|
|
186
|
+
rulebook task show <task-id> # Show details
|
|
187
|
+
rulebook task validate <task-id> # Validate format
|
|
188
|
+
rulebook task archive <task-id> # Archive completed task
|
|
189
|
+
rulebook task delete <task-id> # Delete permanently
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Memory & Knowledge
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
rulebook memory search <query> # Hybrid BM25+vector search
|
|
196
|
+
rulebook memory save <text> # Save context
|
|
197
|
+
rulebook memory stats # Database health
|
|
198
|
+
rulebook memory cleanup # Evict old memories
|
|
199
|
+
rulebook knowledge list # View patterns and anti-patterns
|
|
200
|
+
rulebook learn list # View captured learnings
|
|
201
|
+
rulebook decision list # View architecture decisions
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Ralph Autonomous Loop
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
rulebook ralph init # Generate PRD from tasks
|
|
208
|
+
rulebook ralph run # Execute iteration loop
|
|
209
|
+
rulebook ralph status # Current progress
|
|
210
|
+
rulebook ralph history # Past iterations
|
|
211
|
+
rulebook ralph pause # Gracefully pause
|
|
212
|
+
rulebook ralph resume # Resume from pause
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Workspace
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
rulebook workspace init # Create workspace config
|
|
219
|
+
rulebook workspace add <path> # Add project
|
|
220
|
+
rulebook workspace list # List all projects
|
|
221
|
+
rulebook workspace status # Status with task counts
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Rules & Skills
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
rulebook rules list # List rules by tier
|
|
228
|
+
rulebook rules add <rule> # Install from library
|
|
229
|
+
rulebook rules project # Project to all tools
|
|
230
|
+
rulebook skill list # List available skills
|
|
231
|
+
rulebook skill add <skill-id> # Enable a skill
|
|
232
|
+
rulebook skill show <skill-id> # Show skill details
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### CI/CD & Quality
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
rulebook workflows # Generate GitHub Actions
|
|
239
|
+
rulebook check-deps # Check dependencies
|
|
240
|
+
rulebook check-coverage # Check test coverage
|
|
241
|
+
rulebook version <major|minor|patch> # Bump version
|
|
242
|
+
rulebook changelog # Generate from git commits
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Supported Stack
|
|
248
|
+
|
|
249
|
+
**28 Languages**: TypeScript, JavaScript, Python, Rust, Go, Java, Kotlin, C, C++, C#, PHP, Ruby, Swift, Elixir, Dart, Scala, Haskell, Julia, R, Lua, Solidity, Zig, Erlang, Ada, SAS, Lisp, Objective-C, SQL
|
|
250
|
+
|
|
251
|
+
**17 Frameworks**: NestJS, Spring Boot, Laravel, Django, Flask, Rails, Symfony, Zend, Angular, React, Vue, Nuxt, Next.js, jQuery, React Native, Flutter, Electron
|
|
252
|
+
|
|
253
|
+
**20 Services**: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, MongoDB, Cassandra, DynamoDB, Redis, Memcached, Elasticsearch, Neo4j, InfluxDB, RabbitMQ, Kafka, S3, Azure Blob, GCS, MinIO
|
|
254
|
+
|
|
255
|
+
**13 MCP Modules**: Vectorizer, Synap, Context7, GitHub MCP, Playwright, Memory, Supabase, Notion, Atlassian, Serena, Figma, Grafana, Sequential Thinking
|
|
256
|
+
|
|
257
|
+
**23 AI Tools**: Cursor, Windsurf, VS Code, GitHub Copilot, Tabnine, Replit, JetBrains AI, Zed, Aider, Continue, Claude, Claude Code, Gemini, Cline, Amazon Q, Auggie, CodeBuddy, Factory, OpenCode, Kilo, Codex, Codeium, Cursor CLI
|
|
258
|
+
|
|
259
|
+
---
|
|
260
|
+
|
|
261
|
+
## VSCode Extension
|
|
262
|
+
|
|
263
|
+
The **Rulebook Dashboard** extension provides full visibility into your AI workflow.
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
code --install-extension vscode-extension/rulebook-dashboard-*.vsix
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
| Tab | Shows |
|
|
270
|
+
|-----|-------|
|
|
271
|
+
| Agents | Team members with real-time status, memory state, last activity |
|
|
272
|
+
| Tasks | Progress bars, expandable details, Archive & Update buttons |
|
|
273
|
+
| Memory | Stats (count, DB size, types), full-text search |
|
|
274
|
+
| Analysis | Structured analyses with findings and execution plans |
|
|
275
|
+
| Doctor | 7 health checks with auto-run |
|
|
276
|
+
| Telemetry | MCP tool latency and success rates |
|
|
277
|
+
|
|
278
|
+
Status bar: context usage indicator (`ctx 78%` with green/yellow/red), Rulebook button, indexer state.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Configuration
|
|
283
|
+
|
|
284
|
+
All config lives in `.rulebook/rulebook.json`:
|
|
285
|
+
|
|
286
|
+
```json
|
|
287
|
+
{
|
|
288
|
+
"version": "5.3.0",
|
|
289
|
+
"mode": "full",
|
|
290
|
+
"features": {
|
|
291
|
+
"mcp": true,
|
|
292
|
+
"memory": true,
|
|
293
|
+
"ralph": true,
|
|
294
|
+
"multiAgent": true,
|
|
295
|
+
"hooks": true,
|
|
296
|
+
"telemetry": false
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Key files generated by Rulebook:**
|
|
302
|
+
|
|
303
|
+
| File | Purpose |
|
|
304
|
+
|------|---------|
|
|
305
|
+
| `AGENTS.md` | Team-shared AI rules (regenerated on update) |
|
|
306
|
+
| `AGENTS.override.md` | Your project overrides (survives updates) |
|
|
307
|
+
| `CLAUDE.md` | Claude Code entry point with @imports |
|
|
308
|
+
| `.claude/rules/` | Path-scoped rules (language-specific + always-on) |
|
|
309
|
+
| `.claude/settings.json` | Hooks and env vars for Claude Code |
|
|
310
|
+
| `.rulebook/specs/` | Detailed spec templates per language/framework |
|
|
311
|
+
| `.rulebook/STATE.md` | Machine-written live status |
|
|
312
|
+
| `.rulebook/tasks/` | Active task directories |
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Documentation
|
|
317
|
+
|
|
318
|
+
Full documentation in [`/docs`](docs/):
|
|
319
|
+
|
|
320
|
+
- [Getting Started](docs/guides/GETTING_STARTED.md)
|
|
321
|
+
- [Best Practices](docs/guides/BEST_PRACTICES.md)
|
|
322
|
+
- [CLI Agents](docs/CLI_AGENTS.md)
|
|
323
|
+
- [Roadmap](docs/ROADMAP.md)
|
|
324
|
+
|
|
325
|
+
See the full [CHANGELOG](CHANGELOG.md) for version history.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Contributing
|
|
330
|
+
|
|
331
|
+
Contributions welcome! Requires Node.js 20+.
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
git clone https://github.com/hivellm/rulebook.git
|
|
335
|
+
cd rulebook
|
|
336
|
+
npm install
|
|
337
|
+
npm test
|
|
338
|
+
npm run build
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## Acknowledgments
|
|
344
|
+
|
|
345
|
+
- **[Ralph](https://github.com/snarktank/ralph)** — Inspired the autonomous loop integration (multi-iteration AI task solving with fresh context per iteration)
|
|
346
|
+
- **[OpenSpec](https://github.com/Fission-AI/openspec)** — Influenced the task management format (delta-based specs, Given/When/Then scenarios, requirement-focused organization)
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## License
|
|
351
|
+
|
|
352
|
+
Apache License 2.0 © HiveLLM Team
|
|
353
|
+
|
|
354
|
+
[Issues](https://github.com/hivellm/rulebook/issues) · [Discussions](https://github.com/hivellm/rulebook/discussions) · [npm](https://www.npmjs.com/package/@hivehub/rulebook)
|