@hivehub/rulebook 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +779 -654
- package/dist/cli/commands.d.ts +22 -0
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +291 -8
- package/dist/cli/commands.js.map +1 -1
- package/dist/core/claude-mcp.d.ts +32 -0
- package/dist/core/claude-mcp.d.ts.map +1 -0
- package/dist/core/claude-mcp.js +92 -0
- package/dist/core/claude-mcp.js.map +1 -0
- package/dist/core/config-manager.d.ts.map +1 -1
- package/dist/core/config-manager.js +27 -6
- package/dist/core/config-manager.js.map +1 -1
- package/dist/core/generator.d.ts.map +1 -1
- package/dist/core/generator.js +98 -49
- package/dist/core/generator.js.map +1 -1
- package/dist/core/migrator.d.ts +13 -0
- package/dist/core/migrator.d.ts.map +1 -1
- package/dist/core/migrator.js +76 -9
- package/dist/core/migrator.js.map +1 -1
- package/dist/core/openspec-migrator.d.ts +1 -1
- package/dist/core/openspec-migrator.d.ts.map +1 -1
- package/dist/core/openspec-migrator.js +14 -7
- package/dist/core/openspec-migrator.js.map +1 -1
- package/dist/core/workflow-generator.js +297 -176
- package/dist/core/workflow-generator.js.map +1 -1
- package/dist/index.js +40 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/rulebook-server.d.ts.map +1 -1
- package/dist/mcp/rulebook-server.js +255 -74
- package/dist/mcp/rulebook-server.js.map +1 -1
- package/dist/memory/hnsw-index.d.ts +63 -0
- package/dist/memory/hnsw-index.d.ts.map +1 -0
- package/dist/memory/hnsw-index.js +421 -0
- package/dist/memory/hnsw-index.js.map +1 -0
- package/dist/memory/memory-cache.d.ts +33 -0
- package/dist/memory/memory-cache.d.ts.map +1 -0
- package/dist/memory/memory-cache.js +85 -0
- package/dist/memory/memory-cache.js.map +1 -0
- package/dist/memory/memory-hooks.d.ts +42 -0
- package/dist/memory/memory-hooks.d.ts.map +1 -0
- package/dist/memory/memory-hooks.js +193 -0
- package/dist/memory/memory-hooks.js.map +1 -0
- package/dist/memory/memory-manager.d.ts +55 -0
- package/dist/memory/memory-manager.d.ts.map +1 -0
- package/dist/memory/memory-manager.js +209 -0
- package/dist/memory/memory-manager.js.map +1 -0
- package/dist/memory/memory-search.d.ts +42 -0
- package/dist/memory/memory-search.d.ts.map +1 -0
- package/dist/memory/memory-search.js +166 -0
- package/dist/memory/memory-search.js.map +1 -0
- package/dist/memory/memory-store.d.ts +59 -0
- package/dist/memory/memory-store.d.ts.map +1 -0
- package/dist/memory/memory-store.js +394 -0
- package/dist/memory/memory-store.js.map +1 -0
- package/dist/memory/memory-types.d.ts +69 -0
- package/dist/memory/memory-types.d.ts.map +1 -0
- package/dist/memory/memory-types.js +7 -0
- package/dist/memory/memory-types.js.map +1 -0
- package/dist/memory/memory-vectorizer.d.ts +29 -0
- package/dist/memory/memory-vectorizer.d.ts.map +1 -0
- package/dist/memory/memory-vectorizer.js +104 -0
- package/dist/memory/memory-vectorizer.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +107 -106
- package/templates/cli/CLAUDE_CODE.md +114 -13
- package/templates/commands/rulebook-memory-save.md +48 -0
- package/templates/commands/rulebook-memory-search.md +47 -0
- package/templates/commands/rulebook-task-apply.md +2 -2
- package/templates/commands/rulebook-task-archive.md +2 -2
- package/templates/commands/rulebook-task-create.md +2 -2
- package/templates/commands/rulebook-task-list.md +2 -2
- package/templates/commands/rulebook-task-show.md +2 -2
- package/templates/commands/rulebook-task-validate.md +2 -2
- package/templates/git/CI_CD_PATTERNS.md +4 -4
- package/templates/git/GITHUB_ACTIONS.md +3 -3
- package/templates/git/GITLAB_CI.md +4 -4
- package/templates/git/SECRETS_MANAGEMENT.md +4 -4
- package/templates/hooks/COMMIT_MSG.md +4 -4
- package/templates/hooks/POST_CHECKOUT.md +3 -3
- package/templates/hooks/PREPARE_COMMIT_MSG.md +3 -3
- package/templates/hooks/PRE_COMMIT.md +4 -4
- package/templates/hooks/PRE_PUSH.md +4 -4
- package/templates/modules/MEMORY.md +63 -0
- package/templates/skills/cli/aider/SKILL.md +59 -0
- package/templates/skills/cli/amazon-q/SKILL.md +35 -0
- package/templates/skills/cli/auggie/SKILL.md +42 -0
- package/templates/skills/cli/claude/SKILL.md +42 -0
- package/templates/skills/cli/claude-code/SKILL.md +146 -0
- package/templates/skills/cli/cline/SKILL.md +42 -0
- package/templates/skills/cli/codebuddy/SKILL.md +30 -0
- package/templates/skills/cli/codeium/SKILL.md +30 -0
- package/templates/skills/cli/codex/SKILL.md +31 -0
- package/templates/skills/cli/continue/SKILL.md +44 -0
- package/templates/skills/cli/cursor-cli/SKILL.md +38 -0
- package/templates/skills/cli/factory/SKILL.md +28 -0
- package/templates/skills/cli/gemini/SKILL.md +45 -0
- package/templates/skills/cli/kilocode/SKILL.md +28 -0
- package/templates/skills/cli/opencode/SKILL.md +28 -0
- package/templates/skills/core/agent-automation/SKILL.md +194 -0
- package/templates/skills/core/dag/SKILL.md +314 -0
- package/templates/skills/core/documentation-rules/SKILL.md +47 -0
- package/templates/skills/core/quality-enforcement/SKILL.md +78 -0
- package/templates/skills/frameworks/angular/SKILL.md +46 -0
- package/templates/skills/frameworks/django/SKILL.md +93 -0
- package/templates/skills/frameworks/electron/SKILL.md +157 -0
- package/templates/skills/frameworks/flask/SKILL.md +48 -0
- package/templates/skills/frameworks/flutter/SKILL.md +65 -0
- package/templates/skills/frameworks/jquery/SKILL.md +42 -0
- package/templates/skills/frameworks/laravel/SKILL.md +48 -0
- package/templates/skills/frameworks/nestjs/SKILL.md +53 -0
- package/templates/skills/frameworks/nextjs/SKILL.md +137 -0
- package/templates/skills/frameworks/nuxt/SKILL.md +50 -0
- package/templates/skills/frameworks/rails/SKILL.md +76 -0
- package/templates/skills/frameworks/react/SKILL.md +48 -0
- package/templates/skills/frameworks/react-native/SKILL.md +57 -0
- package/templates/skills/frameworks/spring/SKILL.md +49 -0
- package/templates/skills/frameworks/symfony/SKILL.md +46 -0
- package/templates/skills/frameworks/vue/SKILL.md +46 -0
- package/templates/skills/frameworks/zend/SKILL.md +45 -0
- package/templates/skills/ides/copilot/SKILL.md +47 -0
- package/templates/skills/ides/cursor/SKILL.md +53 -0
- package/templates/skills/ides/jetbrains-ai/SKILL.md +45 -0
- package/templates/skills/ides/replit/SKILL.md +46 -0
- package/templates/skills/ides/tabnine/SKILL.md +39 -0
- package/templates/skills/ides/vscode/SKILL.md +50 -0
- package/templates/skills/ides/windsurf/SKILL.md +46 -0
- package/templates/skills/ides/zed/SKILL.md +42 -0
- package/templates/skills/languages/ada/SKILL.md +68 -0
- package/templates/skills/languages/c/SKILL.md +343 -0
- package/templates/skills/languages/cpp/SKILL.md +753 -0
- package/templates/skills/languages/csharp/SKILL.md +427 -0
- package/templates/skills/languages/dart/SKILL.md +342 -0
- package/templates/skills/languages/elixir/SKILL.md +464 -0
- package/templates/skills/languages/erlang/SKILL.md +371 -0
- package/templates/skills/languages/go/SKILL.md +655 -0
- package/templates/skills/languages/haskell/SKILL.md +187 -0
- package/templates/skills/languages/java/SKILL.md +617 -0
- package/templates/skills/languages/javascript/SKILL.md +641 -0
- package/templates/skills/languages/julia/SKILL.md +107 -0
- package/templates/skills/languages/kotlin/SKILL.md +521 -0
- package/templates/skills/languages/lisp/SKILL.md +110 -0
- package/templates/skills/languages/lua/SKILL.md +84 -0
- package/templates/skills/languages/objectivec/SKILL.md +100 -0
- package/templates/skills/languages/php/SKILL.md +426 -0
- package/templates/skills/languages/python/SKILL.md +692 -0
- package/templates/skills/languages/r/SKILL.md +360 -0
- package/templates/skills/languages/ruby/SKILL.md +431 -0
- package/templates/skills/languages/rust/SKILL.md +487 -0
- package/templates/skills/languages/sas/SKILL.md +83 -0
- package/templates/skills/languages/scala/SKILL.md +358 -0
- package/templates/skills/languages/solidity/SKILL.md +590 -0
- package/templates/skills/languages/sql/SKILL.md +147 -0
- package/templates/skills/languages/swift/SKILL.md +476 -0
- package/templates/skills/languages/zig/SKILL.md +275 -0
- package/templates/skills/modules/atlassian/SKILL.md +265 -0
- package/templates/skills/modules/context7/SKILL.md +64 -0
- package/templates/skills/modules/figma/SKILL.md +277 -0
- package/templates/skills/modules/github-mcp/SKILL.md +74 -0
- package/templates/skills/modules/grafana/SKILL.md +338 -0
- package/templates/skills/modules/memory/SKILL.md +73 -0
- package/templates/skills/modules/notion/SKILL.md +257 -0
- package/templates/skills/modules/playwright/SKILL.md +100 -0
- package/templates/skills/modules/rulebook-mcp/SKILL.md +166 -0
- package/templates/skills/modules/serena/SKILL.md +347 -0
- package/templates/skills/modules/supabase/SKILL.md +233 -0
- package/templates/skills/modules/synap/SKILL.md +79 -0
- package/templates/skills/modules/vectorizer/SKILL.md +73 -0
- package/templates/skills/services/azure-blob/SKILL.md +194 -0
- package/templates/skills/services/cassandra/SKILL.md +249 -0
- package/templates/skills/services/dynamodb/SKILL.md +318 -0
- package/templates/skills/services/elasticsearch/SKILL.md +357 -0
- package/templates/skills/services/gcs/SKILL.md +188 -0
- package/templates/skills/services/influxdb/SKILL.md +275 -0
- package/templates/skills/services/kafka/SKILL.md +351 -0
- package/templates/skills/services/mariadb/SKILL.md +193 -0
- package/templates/skills/services/memcached/SKILL.md +252 -0
- package/templates/skills/services/minio/SKILL.md +211 -0
- package/templates/skills/services/mongodb/SKILL.md +278 -0
- package/templates/skills/services/mysql/SKILL.md +368 -0
- package/templates/skills/services/neo4j/SKILL.md +257 -0
- package/templates/skills/services/oracle/SKILL.md +300 -0
- package/templates/skills/services/postgresql/SKILL.md +336 -0
- package/templates/skills/services/rabbitmq/SKILL.md +296 -0
- package/templates/skills/services/redis/SKILL.md +302 -0
- package/templates/skills/services/s3/SKILL.md +308 -0
- package/templates/skills/services/sqlite/SKILL.md +304 -0
- package/templates/skills/services/sqlserver/SKILL.md +304 -0
package/README.md
CHANGED
|
@@ -1,654 +1,779 @@
|
|
|
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
|
-
> Standardize AI-generated projects with automated templates, quality gates, and framework detection for 28 languages, 17 frameworks,
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## Why Rulebook?
|
|
19
|
-
|
|
20
|
-
Large Language Models (LLMs) for software development need **clear directives** to generate high-quality code consistently. Without standardized guidelines, AI-generated code can be inconsistent, error-prone, and difficult to maintain.
|
|
21
|
-
|
|
22
|
-
**Rulebook solves this by providing:**
|
|
23
|
-
|
|
24
|
-
- 📋 **Comprehensive Rule Sets**: Language-specific guidelines (TypeScript, Rust, Python, etc.), framework conventions (NestJS, Django, React), testing standards, linting rules, spell-checking, CI/CD pipelines, Git hooks, and version control best practices
|
|
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
|
-
- 🔌 **Claude Code
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
rulebook
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
-
|
|
470
|
-
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
-
|
|
477
|
-
-
|
|
478
|
-
-
|
|
479
|
-
-
|
|
480
|
-
-
|
|
481
|
-
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
-
|
|
488
|
-
-
|
|
489
|
-
-
|
|
490
|
-
-
|
|
491
|
-
|
|
492
|
-
**
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
-
|
|
602
|
-
-
|
|
603
|
-
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
**
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
```
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
```
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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
|
+
> Standardize AI-generated projects 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
|
+
## Why Rulebook?
|
|
19
|
+
|
|
20
|
+
Large Language Models (LLMs) for software development need **clear directives** to generate high-quality code consistently. Without standardized guidelines, AI-generated code can be inconsistent, error-prone, and difficult to maintain.
|
|
21
|
+
|
|
22
|
+
**Rulebook solves this by providing:**
|
|
23
|
+
|
|
24
|
+
- 📋 **Comprehensive Rule Sets**: Language-specific guidelines (TypeScript, Rust, Python, etc.), framework conventions (NestJS, Django, React), testing standards, linting rules, spell-checking, CI/CD pipelines, Git hooks, and version control best practices
|
|
25
|
+
- 🧠 **Persistent Memory**: Context that survives across AI sessions with hybrid BM25+HNSW search, zero native dependencies
|
|
26
|
+
- 🎯 **Normalized Deliverables**: Ensures consistent code quality across all AI-generated outputs
|
|
27
|
+
- 🛡️ **Error Reduction**: Catches issues early through automated quality gates and pre-commit/pre-push hooks
|
|
28
|
+
- ⚙️ **Process Automation**: Automates repetitive tasks like formatting, testing, and deployment
|
|
29
|
+
- 🔌 **MCP Integration**: 19 MCP functions for task management, skills, and persistent memory
|
|
30
|
+
- 📊 **Task Management**: Built-in task management system (OpenSpec-compatible format) for structured development
|
|
31
|
+
|
|
32
|
+
By giving LLMs a clear "rulebook" to follow, you ensure that every piece of generated code meets your project's standards—**automatically**.
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# New project (interactive)
|
|
38
|
+
npx @hivehub/rulebook@latest init
|
|
39
|
+
|
|
40
|
+
# Minimal setup (essentials only)
|
|
41
|
+
npx @hivehub/rulebook@latest init --minimal
|
|
42
|
+
|
|
43
|
+
# Light mode (prototypes without strict rules)
|
|
44
|
+
npx @hivehub/rulebook@latest init --light
|
|
45
|
+
|
|
46
|
+
# Update existing project
|
|
47
|
+
npx @hivehub/rulebook@latest update
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## What's New
|
|
51
|
+
|
|
52
|
+
### v3.0.0 (Latest)
|
|
53
|
+
|
|
54
|
+
- 🧠 **Persistent Memory System**: Zero-dependency persistent context across AI sessions
|
|
55
|
+
- Hybrid search: BM25 keyword + HNSW vector with Reciprocal Rank Fusion
|
|
56
|
+
- TF-IDF embeddings with FNV1a feature hashing (256-dim, pure TypeScript)
|
|
57
|
+
- SQLite persistence via sql.js WASM (zero native compilation)
|
|
58
|
+
- LRU cache eviction (500MB default, protects decision memories)
|
|
59
|
+
- Privacy filter: auto-redacts `<private>...</private>` tags
|
|
60
|
+
- 7 memory types: bugfix, feature, refactor, decision, discovery, change, observation
|
|
61
|
+
- 6 MCP tools + 6 CLI commands for complete memory management
|
|
62
|
+
- 🧩 **119 Skills with YAML Frontmatter**: All 106 legacy templates converted to proper SKILL.md format
|
|
63
|
+
- 28 languages, 17 frameworks, 13 modules, 20 services, 8 IDEs, 15 CLI, 5 core + git/hooks
|
|
64
|
+
- 🔌 **Claude Code Commands**: Memory + task commands auto-installed to `.claude/commands/`
|
|
65
|
+
- 🔧 **Update Preserves Config**: `rulebook update` no longer resets custom `.rulebook` fields (memory, skills, timeouts, etc.)
|
|
66
|
+
- 🛡️ **MCP Config Safety**: `.mcp.json` entry preserved if already configured (no more overwriting)
|
|
67
|
+
|
|
68
|
+
### v2.1.0
|
|
69
|
+
|
|
70
|
+
- 🔒 **Claude Code Critical Directives**: New mandatory rules for Claude Code CLI
|
|
71
|
+
- **Sequential File Editing**: Files must be edited one at a time to prevent failures from parallel edits
|
|
72
|
+
- **Complete Test Implementation**: Strict rules against simplifying tests, placeholder assertions, or skipping test cases
|
|
73
|
+
- Updated `CLAUDE.md` generation with comprehensive guidelines and examples
|
|
74
|
+
- 🪟 **Windows Test Suite Fix**: Tests no longer hang on Windows (705 tests passing, 11x faster)
|
|
75
|
+
|
|
76
|
+
### v2.0.0
|
|
77
|
+
|
|
78
|
+
- 🧩 **Skills System**: New modular skills architecture for AI-assisted development
|
|
79
|
+
- Skills are YAML-frontmatter Markdown files with enable/disable functionality
|
|
80
|
+
- 10 skill categories: languages, frameworks, modules, services, workflows, ides, core, cli, git, hooks
|
|
81
|
+
- Auto-detection of skills based on project configuration
|
|
82
|
+
- CLI commands: `rulebook skill list|add|remove|show|search`
|
|
83
|
+
- MCP functions: `rulebook_skill_list|show|enable|disable|search|validate`
|
|
84
|
+
- 🤖 **AI CLI Configuration Files**: Auto-generated files for AI CLI tools
|
|
85
|
+
- `CLAUDE.md` - Claude Code CLI configuration
|
|
86
|
+
- `CODEX.md` - OpenAI Codex CLI configuration
|
|
87
|
+
- `GEMINI.md` - Google Gemini CLI configuration
|
|
88
|
+
- `gemini-extension.json` - Gemini CLI extension manifest
|
|
89
|
+
- 🔌 **Claude Code Plugin**: `marketplace.json` + `.claude-plugin/` structure for marketplace distribution
|
|
90
|
+
- `marketplace.json` - Marketplace manifest for plugin discovery
|
|
91
|
+
- Plugin manifest, MCP configuration, slash commands, and skills
|
|
92
|
+
|
|
93
|
+
### v1.1.5
|
|
94
|
+
|
|
95
|
+
- 🗄️ **Service Integration Templates**: Added comprehensive service integration templates
|
|
96
|
+
- 20 service templates: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, MongoDB, Cassandra, DynamoDB, Redis, Memcached, Elasticsearch, Neo4j, InfluxDB, RabbitMQ, Kafka, S3, Azure Blob, GCS, MinIO
|
|
97
|
+
- Automatic service detection from `package.json`, `.env`, and `docker-compose.yml`
|
|
98
|
+
- Service-specific integration instructions with connection setup, operations, best practices, and configuration
|
|
99
|
+
- Templates generated in `/rulebook/[SERVICE].md` with references in `AGENTS.md`
|
|
100
|
+
- Interactive CLI prompt to select which services to include templates for
|
|
101
|
+
|
|
102
|
+
### v1.1.4
|
|
103
|
+
|
|
104
|
+
- 🔧 **Cross-platform Git Hooks**: Git hooks now work on both Windows and Linux
|
|
105
|
+
- Hooks are now generated as Node.js scripts with shell wrappers
|
|
106
|
+
- Shell wrapper detects Node.js in common locations (Windows and Linux)
|
|
107
|
+
- Node.js scripts use native `child_process.spawn` for cross-platform command execution
|
|
108
|
+
- Pre-commit and pre-push hooks now function correctly on Windows (Git Bash) and Linux
|
|
109
|
+
- 🔄 **Git Hooks Architecture**: Refactored hook generation system
|
|
110
|
+
- Hooks are now generated as two files: shell wrapper + Node.js script
|
|
111
|
+
- Shell templates (`.sh`) are automatically converted to Node.js scripts
|
|
112
|
+
- Improved command parsing from shell templates to Node.js
|
|
113
|
+
- Better error handling and cross-platform compatibility
|
|
114
|
+
|
|
115
|
+
### v1.1.3
|
|
116
|
+
|
|
117
|
+
- 🗑️ **MCP Tool: `rulebook_task_delete`**: Delete tasks permanently
|
|
118
|
+
- New tool to permanently delete tasks from the filesystem
|
|
119
|
+
- Removes task directory recursively
|
|
120
|
+
- Useful for cleaning up test tasks or removing unwanted tasks
|
|
121
|
+
- Total of 7 MCP functions now available
|
|
122
|
+
|
|
123
|
+
### v1.1.2
|
|
124
|
+
|
|
125
|
+
- 🔧 **ESLint v9 Migration**: Updated to ESLint flat config format
|
|
126
|
+
- Migrated from `.eslintrc.json` to `eslint.config.js`
|
|
127
|
+
- Updated to ESLint 9.37.0 with TypeScript ESLint 8.47.0
|
|
128
|
+
- Added proper Node.js global type definitions
|
|
129
|
+
- Linting now shows only errors (warnings suppressed with `--quiet`)
|
|
130
|
+
|
|
131
|
+
### v1.0.3
|
|
132
|
+
|
|
133
|
+
- 🔧 **Zod v3 Compatibility**: Using Zod v3.25.76 for full MCP SDK compatibility
|
|
134
|
+
- MCP SDK v1.22.0 requires Zod v3 (see [Issue #1429](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1429))
|
|
135
|
+
- Will upgrade to Zod v4 when MCP SDK officially supports it
|
|
136
|
+
- 🔄 **Dependency Updates**: All dependencies updated to latest versions
|
|
137
|
+
- TypeScript tooling (ESLint 8.47.0, Vitest 4.0.13)
|
|
138
|
+
- Node.js types updated to support Node.js 24.x
|
|
139
|
+
- CLI tools and build utilities updated
|
|
140
|
+
- 🐛 **Windows CI Fix**: Fixed PowerShell compatibility in GitHub Actions workflows
|
|
141
|
+
- Removed bash-specific syntax from Windows runners
|
|
142
|
+
- Cross-platform compatibility improved
|
|
143
|
+
|
|
144
|
+
### v1.0.2
|
|
145
|
+
|
|
146
|
+
- 🔌 **MCP Server for Task Management**: New MCP server enables AI models to manage tasks programmatically
|
|
147
|
+
- 7 MCP functions: create, list, show, update, validate, archive, delete tasks
|
|
148
|
+
- Available via `npx @hivellm/rulebook@latest mcp-server` or `npx rulebook-mcp`
|
|
149
|
+
- Better integration with MCP-compatible AI assistants
|
|
150
|
+
- ⚡ **Faster Pre-commit Hooks**: Tests removed from pre-commit for faster backup commits
|
|
151
|
+
- Pre-commit now runs only: format check, lint, type-check
|
|
152
|
+
- Tests moved to pre-push hook for comprehensive validation
|
|
153
|
+
- 🏗️ **Build Verification**: Build check now mandatory before push (runs first)
|
|
154
|
+
- 📦 **pnpm Recommendation**: Added pnpm as preferred package manager with `.npmrc` configuration
|
|
155
|
+
- 🚀 **Rust Build Optimization**: Comprehensive guide for faster Rust builds
|
|
156
|
+
- sccache configuration, incremental compilation, lld linker
|
|
157
|
+
- Anti-pattern documentation for `pub use big_crate::*;`
|
|
158
|
+
- 📋 **Enhanced Task Management**: Strengthened OpenSpec format compliance and archiving rules
|
|
159
|
+
- 📁 **Strict Markdown Organization**: UPPERCASE naming and `/docs` directory requirements
|
|
160
|
+
|
|
161
|
+
### v1.0.0
|
|
162
|
+
|
|
163
|
+
- 🎉 **First Stable Release**: Production-ready with comprehensive features
|
|
164
|
+
- 🔒 **Apache 2.0 License**: Changed from MIT to Apache License 2.0 for better compatibility
|
|
165
|
+
- 🛡️ **Git Hooks Enforcement**: Pre-commit and pre-push hooks now block commits with lint/test errors
|
|
166
|
+
- 📋 **Task File Structure Rules**: Enhanced directives in AGENTS.md about correct task structure
|
|
167
|
+
- 🎯 **Built-in Task Management**: OpenSpec deprecated and integrated into Rulebook's native task system
|
|
168
|
+
- 📋 **RULEBOOK.md Template**: Core template with task management directives and Context7 MCP requirements
|
|
169
|
+
- 🚫 **Automatic .gitignore**: `npx @hivellm/rulebook@latest init` now creates/updates `.gitignore` automatically for 28 languages
|
|
170
|
+
- 🔄 **Migration Support**: Existing OpenSpec tasks automatically migrated to `/rulebook/tasks/` format
|
|
171
|
+
|
|
172
|
+
> **Breaking Change**: OpenSpec module removed. Use `npx @hivellm/rulebook@latest task` commands instead. See [Migration Guide](docs/guides/OPENSPEC_MIGRATION.md).
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Persistent Memory System
|
|
177
|
+
|
|
178
|
+
> **NEW in v3.0.0** — Give your AI assistant a brain that persists across sessions.
|
|
179
|
+
|
|
180
|
+
Every time you open a new tab or restart your editor, the AI loses all context about your project. Rulebook's persistent memory solves this — decisions, bugs, discoveries, and preferences are stored locally and searchable across sessions.
|
|
181
|
+
|
|
182
|
+
### How It Works
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
Session 1: "Let's use sql.js instead of better-sqlite3 for zero native deps"
|
|
186
|
+
→ Saved to memory automatically
|
|
187
|
+
|
|
188
|
+
Session 2 (new tab, days later):
|
|
189
|
+
AI searches memory → finds the decision → continues with full context
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Architecture
|
|
193
|
+
|
|
194
|
+
| Component | Technology | Purpose |
|
|
195
|
+
|-----------|-----------|---------|
|
|
196
|
+
| **Storage** | SQLite via sql.js WASM | Zero native compilation, works everywhere |
|
|
197
|
+
| **Keyword Search** | BM25 | Fast exact-match scoring |
|
|
198
|
+
| **Vector Search** | HNSW index | Semantic similarity matching |
|
|
199
|
+
| **Embeddings** | TF-IDF + FNV1a hashing | 256-dim vectors, pure TypeScript, no API calls |
|
|
200
|
+
| **Ranking** | Reciprocal Rank Fusion | Combines BM25 + vector scores |
|
|
201
|
+
| **Eviction** | LRU cache | 500MB default, protects decision/bugfix memories |
|
|
202
|
+
| **Privacy** | Auto-redact filter | `<private>...</private>` tags stripped before storage |
|
|
203
|
+
|
|
204
|
+
### Memory Types
|
|
205
|
+
|
|
206
|
+
| Type | When to Use |
|
|
207
|
+
|------|-------------|
|
|
208
|
+
| `decision` | Chose one approach over another |
|
|
209
|
+
| `bugfix` | Root cause and resolution |
|
|
210
|
+
| `feature` | What was built, key design choices |
|
|
211
|
+
| `discovery` | Codebase patterns, gotchas, constraints |
|
|
212
|
+
| `refactor` | Structural changes and reasoning |
|
|
213
|
+
| `change` | Configuration or dependency updates |
|
|
214
|
+
| `observation` | Session summaries, general notes |
|
|
215
|
+
|
|
216
|
+
### Auto-Capture
|
|
217
|
+
|
|
218
|
+
Tool interactions are captured automatically — when the AI creates a task, updates a status, enables a skill, etc., the memory system records it without any manual action.
|
|
219
|
+
|
|
220
|
+
For conversation context (decisions, discussions, user preferences), the AI saves manually following the mandatory directives in `CLAUDE.md` and `AGENTS.md`.
|
|
221
|
+
|
|
222
|
+
### Usage
|
|
223
|
+
|
|
224
|
+
**CLI Commands:**
|
|
225
|
+
```bash
|
|
226
|
+
rulebook memory search "authentication approach" # Hybrid BM25+vector search
|
|
227
|
+
rulebook memory save "Chose JWT over sessions" # Save manually
|
|
228
|
+
rulebook memory stats # DB size, count, health
|
|
229
|
+
rulebook memory cleanup # Evict old memories
|
|
230
|
+
rulebook memory export # Export as JSON/CSV
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**MCP Tools (used by AI agents):**
|
|
234
|
+
```
|
|
235
|
+
rulebook_memory_save — Save context with type, title, content, tags
|
|
236
|
+
rulebook_memory_search — Hybrid search (bm25/vector/hybrid modes)
|
|
237
|
+
rulebook_memory_get — Get full details by memory ID
|
|
238
|
+
rulebook_memory_timeline — Chronological context around a memory
|
|
239
|
+
rulebook_memory_stats — Database statistics and health
|
|
240
|
+
rulebook_memory_cleanup — Force eviction and cleanup
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Configuration
|
|
244
|
+
|
|
245
|
+
Memory is enabled in `.rulebook`:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"memory": {
|
|
250
|
+
"enabled": true,
|
|
251
|
+
"autoCapture": true,
|
|
252
|
+
"dbPath": ".rulebook-memory/memory.db",
|
|
253
|
+
"maxSizeBytes": 524288000,
|
|
254
|
+
"vectorDimensions": 256
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
> Add `.rulebook-memory/` to your `.gitignore` — memory is local per developer.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Key Features
|
|
264
|
+
|
|
265
|
+
- 🧠 **Persistent Memory**: Context that survives across AI sessions — hybrid BM25+HNSW search, auto-capture, zero native dependencies
|
|
266
|
+
- 🔍 **Auto-Detection**: Detects languages, frameworks, MCP modules, and services from your project files
|
|
267
|
+
- 📁 **Modular Architecture**: Templates in `/rulebook/` directory — smaller AGENTS.md, on-demand loading
|
|
268
|
+
- 🔗 **Git Hook Automation**: Pre-commit/pre-push hooks with language-aware quality checks
|
|
269
|
+
- 🔌 **19 MCP Functions**: Task management (7), skills (6), and persistent memory (6) via Model Context Protocol
|
|
270
|
+
- 📝 **106+ Templates**: 28 languages, 17 frameworks, 8 IDEs, 20 services, 15 CLI agents
|
|
271
|
+
- 🤖 **AI-Optimized**: Works with 23 AI assistants (Cursor, Claude, Gemini, etc.)
|
|
272
|
+
- 📦 **Publication Ready**: CI/CD pipelines for npm, crates.io, PyPI, Maven Central, and more
|
|
273
|
+
- 🔄 **Automatic Migration**: Existing projects automatically migrated to modular structure
|
|
274
|
+
|
|
275
|
+
## What It Does
|
|
276
|
+
|
|
277
|
+
**For New Projects:**
|
|
278
|
+
1. Detects your language(s), frameworks, MCP modules, and services
|
|
279
|
+
2. Asks setup questions (or use `--minimal` for defaults)
|
|
280
|
+
3. Generates AGENTS.md with AI assistant rules (modular structure)
|
|
281
|
+
4. Creates `/rulebook/` directory with language/framework/module/service templates
|
|
282
|
+
5. Creates/updates `.gitignore` automatically for detected languages
|
|
283
|
+
6. Auto-configures Claude Code integration (MCP + skills) if detected
|
|
284
|
+
7. Optionally installs Git hooks (pre-commit/pre-push)
|
|
285
|
+
8. Creates GitHub Actions workflows
|
|
286
|
+
9. Scaffolds README, LICENSE, /docs, and /tests
|
|
287
|
+
|
|
288
|
+
**For Existing Projects:**
|
|
289
|
+
```bash
|
|
290
|
+
npx @hivehub/rulebook update
|
|
291
|
+
```
|
|
292
|
+
- Automatically migrates embedded templates to modular `/rulebook/` structure
|
|
293
|
+
- Automatically migrates OpenSpec tasks to Rulebook format (if OpenSpec exists)
|
|
294
|
+
- Merges latest templates while preserving your customizations
|
|
295
|
+
- Updates AGENTS.md with references to modular files
|
|
296
|
+
- Updates `.gitignore` with missing patterns for detected languages
|
|
297
|
+
|
|
298
|
+
## Commands
|
|
299
|
+
|
|
300
|
+
### Core Commands
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
# Project Initialization & Updates
|
|
304
|
+
npx @hivehub/rulebook@latest init # Initialize new project (interactive)
|
|
305
|
+
npx @hivehub/rulebook@latest init --minimal # Minimal setup (essentials only)
|
|
306
|
+
npx @hivehub/rulebook@latest init --light # Light mode (no quality enforcement)
|
|
307
|
+
npx @hivehub/rulebook@latest init --yes # Skip prompts, use defaults
|
|
308
|
+
npx @hivehub/rulebook@latest update # Update AGENTS.md to latest version
|
|
309
|
+
npx @hivehub/rulebook@latest update --yes # Update without confirmation
|
|
310
|
+
npx @hivehub/rulebook@latest update --light # Update in light mode
|
|
311
|
+
|
|
312
|
+
# Workflow & CI/CD
|
|
313
|
+
npx @hivehub/rulebook@latest workflows # Generate GitHub Actions workflows
|
|
314
|
+
|
|
315
|
+
# Validation & Health
|
|
316
|
+
npx @hivehub/rulebook@latest validate # Check project standards
|
|
317
|
+
npx @hivehub/rulebook@latest health # Project health score (0-100)
|
|
318
|
+
npx @hivehub/rulebook@latest fix # Auto-fix common issues
|
|
319
|
+
|
|
320
|
+
# Documentation
|
|
321
|
+
npx @hivehub/rulebook@latest generate-docs # Create /docs structure
|
|
322
|
+
npx @hivehub/rulebook@latest generate-docs --yes # Skip prompts, use defaults
|
|
323
|
+
|
|
324
|
+
# Dependencies & Coverage
|
|
325
|
+
npx @hivehub/rulebook@latest check-deps # Check outdated/vulnerable dependencies
|
|
326
|
+
npx @hivehub/rulebook@latest check-coverage # Check test coverage (default: 95%)
|
|
327
|
+
npx @hivehub/rulebook@latest check-coverage -t 80 # Custom threshold
|
|
328
|
+
|
|
329
|
+
# Versioning
|
|
330
|
+
npx @hivehub/rulebook@latest version <type> # Bump version (major|minor|patch)
|
|
331
|
+
npx @hivehub/rulebook@latest changelog # Generate changelog from git commits
|
|
332
|
+
npx @hivehub/rulebook@latest changelog -v 1.0.0 # Specify version
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
> **Note**: If installed globally (`npm install -g @hivehub/rulebook`), you can use `rulebook` directly instead of `npx @hivehub/rulebook@latest`.
|
|
336
|
+
|
|
337
|
+
### Advanced Commands (Beta)
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Real-time Monitoring
|
|
341
|
+
npx @hivehub/rulebook@latest watcher # Full-screen task monitoring UI
|
|
342
|
+
# - Live task progress tracking
|
|
343
|
+
# - Activity log with timestamps
|
|
344
|
+
# - System status monitoring
|
|
345
|
+
# - Auto-refresh every 2 seconds
|
|
346
|
+
|
|
347
|
+
# Autonomous Agent
|
|
348
|
+
npx @hivehub/rulebook@latest agent # Start AI CLI workflow automation
|
|
349
|
+
npx @hivehub/rulebook@latest agent --dry-run # Simulate without changes
|
|
350
|
+
npx @hivehub/rulebook@latest agent --tool cursor-agent # Specify CLI tool
|
|
351
|
+
npx @hivehub/rulebook@latest agent --iterations 10 # Max iterations
|
|
352
|
+
npx @hivehub/rulebook@latest agent --watch # Enable watcher mode
|
|
353
|
+
|
|
354
|
+
# Task Management
|
|
355
|
+
npx @hivehub/rulebook@latest task create <task-id> # Create new task
|
|
356
|
+
npx @hivehub/rulebook@latest task list # List all tasks
|
|
357
|
+
npx @hivehub/rulebook@latest task list --archived # List including archived tasks
|
|
358
|
+
npx @hivehub/rulebook@latest task show <task-id> # Show task details
|
|
359
|
+
npx @hivehub/rulebook@latest task validate <task-id> # Validate task format
|
|
360
|
+
npx @hivehub/rulebook@latest task archive <task-id> # Archive completed task
|
|
361
|
+
npx @hivehub/rulebook@latest task archive --skip-validation <task-id> # Archive without validation
|
|
362
|
+
npx @hivehub/rulebook@latest tasks [options] # Legacy command (DEPRECATED - use 'task' commands)
|
|
363
|
+
|
|
364
|
+
# Skills Management (v2.0)
|
|
365
|
+
npx @hivehub/rulebook@latest skill list # List all available skills
|
|
366
|
+
npx @hivehub/rulebook@latest skill list --category languages # Filter by category
|
|
367
|
+
npx @hivehub/rulebook@latest skill list --enabled # Show only enabled skills
|
|
368
|
+
npx @hivehub/rulebook@latest skill add <skill-id> # Enable a skill
|
|
369
|
+
npx @hivehub/rulebook@latest skill remove <skill-id> # Disable a skill
|
|
370
|
+
npx @hivehub/rulebook@latest skill show <skill-id> # Show skill details
|
|
371
|
+
npx @hivehub/rulebook@latest skill search <query> # Search for skills
|
|
372
|
+
|
|
373
|
+
# Persistent Memory (v3.0)
|
|
374
|
+
npx @hivehub/rulebook@latest memory search <query> # Search memories (hybrid BM25+vector)
|
|
375
|
+
npx @hivehub/rulebook@latest memory save <text> # Save a memory
|
|
376
|
+
npx @hivehub/rulebook@latest memory list # List all memories
|
|
377
|
+
npx @hivehub/rulebook@latest memory stats # Database stats and health
|
|
378
|
+
npx @hivehub/rulebook@latest memory cleanup # Run cache eviction
|
|
379
|
+
npx @hivehub/rulebook@latest memory export # Export as JSON or CSV
|
|
380
|
+
|
|
381
|
+
# Configuration
|
|
382
|
+
npx @hivehub/rulebook@latest config --show # Show current config
|
|
383
|
+
npx @hivehub/rulebook@latest config --set key=value # Set config value
|
|
384
|
+
npx @hivehub/rulebook@latest config --feature watcher --enable # Enable feature
|
|
385
|
+
npx @hivehub/rulebook@latest config --feature agent --disable # Disable feature
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
## Setup Modes
|
|
389
|
+
|
|
390
|
+
### Full Mode (Default)
|
|
391
|
+
Complete setup with all features: Task management, Watcher, MCP modules, comprehensive workflows.
|
|
392
|
+
|
|
393
|
+
### Minimal Mode
|
|
394
|
+
```bash
|
|
395
|
+
npx @hivehub/rulebook@latest init --minimal
|
|
396
|
+
```
|
|
397
|
+
Essentials only: README, LICENSE, tests/, basic CI. Perfect for small teams or initial adoption.
|
|
398
|
+
|
|
399
|
+
### Light Mode
|
|
400
|
+
```bash
|
|
401
|
+
npx @hivehub/rulebook@latest init --light
|
|
402
|
+
```
|
|
403
|
+
Bare minimum rules: no quality enforcement, no testing requirements, no linting. Use for quick prototypes or non-production projects.
|
|
404
|
+
|
|
405
|
+
## Supported Languages & Frameworks
|
|
406
|
+
|
|
407
|
+
**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
|
|
408
|
+
|
|
409
|
+
**17 Frameworks** (auto-detected):
|
|
410
|
+
- Backend: NestJS, Spring Boot, Laravel, Django, Flask, Ruby on Rails, Symfony, Zend
|
|
411
|
+
- Frontend: Angular, React, Vue, Nuxt, Next.js, jQuery
|
|
412
|
+
- Mobile: React Native, Flutter
|
|
413
|
+
- Desktop: Electron
|
|
414
|
+
|
|
415
|
+
## MCP Modules (13)
|
|
416
|
+
|
|
417
|
+
**Core**: Vectorizer • Synap • Context7 • GitHub MCP • Playwright • Memory
|
|
418
|
+
|
|
419
|
+
**Services**: Supabase • Notion • Atlassian • Serena • Figma • Grafana
|
|
420
|
+
|
|
421
|
+
### MCP Server for Task Management
|
|
422
|
+
|
|
423
|
+
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.
|
|
424
|
+
|
|
425
|
+
**Benefits:**
|
|
426
|
+
- ✅ Direct MCP integration - no shell command execution needed
|
|
427
|
+
- ✅ Structured error handling with proper error codes and messages
|
|
428
|
+
- ✅ Consistent interface with other MCP operations
|
|
429
|
+
- ✅ Better automation capabilities for AI agents
|
|
430
|
+
- ✅ Improved reliability compared to terminal command execution
|
|
431
|
+
- ✅ Automatic project detection - finds `.rulebook` by walking up directories (like git)
|
|
432
|
+
- ✅ Zero configuration - works out of the box after `rulebook mcp init`
|
|
433
|
+
|
|
434
|
+
**Quick Setup:**
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
# Initialize MCP configuration in your project (one-time setup)
|
|
438
|
+
npx @hivehub/rulebook@latest mcp init
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
This command:
|
|
442
|
+
- Adds `mcp` block to your `.rulebook` file
|
|
443
|
+
- Creates/updates `.cursor/mcp.json` automatically
|
|
444
|
+
- Server uses stdio transport (MCP standard)
|
|
445
|
+
|
|
446
|
+
> **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.
|
|
447
|
+
|
|
448
|
+
**Available MCP Functions:**
|
|
449
|
+
|
|
450
|
+
- `rulebook_task_create` - Create a new task with OpenSpec-compatible format
|
|
451
|
+
- Input: `taskId` (string), optional `proposal` object
|
|
452
|
+
- Output: Task creation confirmation with path
|
|
453
|
+
- `rulebook_task_list` - List all tasks with optional filters
|
|
454
|
+
- Input: `includeArchived` (boolean), `status` (enum)
|
|
455
|
+
- Output: Array of tasks with metadata
|
|
456
|
+
- `rulebook_task_show` - Show detailed task information
|
|
457
|
+
- Input: `taskId` (string)
|
|
458
|
+
- Output: Complete task details including proposal, tasks, specs
|
|
459
|
+
- `rulebook_task_update` - Update task status or progress
|
|
460
|
+
- Input: `taskId` (string), optional `status`, `progress`
|
|
461
|
+
- Output: Update confirmation
|
|
462
|
+
- `rulebook_task_validate` - Validate task format against OpenSpec requirements
|
|
463
|
+
- Input: `taskId` (string)
|
|
464
|
+
- Output: Validation results with errors and warnings
|
|
465
|
+
- `rulebook_task_archive` - Archive completed task and apply spec deltas
|
|
466
|
+
- Input: `taskId` (string), optional `skipValidation`
|
|
467
|
+
- Output: Archive confirmation with archive path
|
|
468
|
+
- `rulebook_task_delete` - Delete a task permanently
|
|
469
|
+
- Input: `taskId` (string)
|
|
470
|
+
- Output: Deletion confirmation
|
|
471
|
+
|
|
472
|
+
**Total: 7 MCP functions** for complete task lifecycle management.
|
|
473
|
+
|
|
474
|
+
**Skills MCP Functions (v2.0):**
|
|
475
|
+
|
|
476
|
+
- `rulebook_skill_list` - List available skills with optional category filter
|
|
477
|
+
- `rulebook_skill_show` - Show detailed skill information
|
|
478
|
+
- `rulebook_skill_enable` - Enable a skill for the project
|
|
479
|
+
- `rulebook_skill_disable` - Disable a skill
|
|
480
|
+
- `rulebook_skill_search` - Search skills by name, description, or tags
|
|
481
|
+
- `rulebook_skill_validate` - Validate skills configuration
|
|
482
|
+
|
|
483
|
+
**Memory MCP Functions (v3.0):**
|
|
484
|
+
|
|
485
|
+
- `rulebook_memory_search` - Hybrid BM25+vector search with mode selection (hybrid/bm25/vector)
|
|
486
|
+
- `rulebook_memory_timeline` - Chronological context around a specific memory
|
|
487
|
+
- `rulebook_memory_get` - Full details for specific memory IDs
|
|
488
|
+
- `rulebook_memory_save` - Save new memories with type, title, content, and tags
|
|
489
|
+
- `rulebook_memory_stats` - Database statistics (size, count, usage, health)
|
|
490
|
+
- `rulebook_memory_cleanup` - Force eviction and cleanup
|
|
491
|
+
|
|
492
|
+
**Total: 19 MCP functions** (7 task + 6 skills + 6 memory).
|
|
493
|
+
|
|
494
|
+
## Skills System (v2.0)
|
|
495
|
+
|
|
496
|
+
Rulebook v2.0 introduces a modular skills system for AI-assisted development. Skills are pluggable capabilities that can be enabled or disabled per project.
|
|
497
|
+
|
|
498
|
+
### What are Skills?
|
|
499
|
+
|
|
500
|
+
Skills are YAML-frontmatter Markdown files that define specific capabilities or rules for AI assistants. Each skill has:
|
|
501
|
+
|
|
502
|
+
- **Metadata**: Name, description, version, category, tags, dependencies
|
|
503
|
+
- **Content**: Markdown content with rules, patterns, and examples
|
|
504
|
+
|
|
505
|
+
### Skill Categories
|
|
506
|
+
|
|
507
|
+
Skills are organized into 10 categories:
|
|
508
|
+
|
|
509
|
+
| Category | Description | Examples |
|
|
510
|
+
|----------|-------------|----------|
|
|
511
|
+
| `languages` | Language-specific rules | TypeScript, Rust, Python |
|
|
512
|
+
| `frameworks` | Framework conventions | NestJS, React, Django |
|
|
513
|
+
| `modules` | MCP module integration | Vectorizer, Context7 |
|
|
514
|
+
| `services` | Service integration | PostgreSQL, Redis |
|
|
515
|
+
| `workflows` | CI/CD patterns | GitHub Actions |
|
|
516
|
+
| `ides` | IDE configuration | Cursor, VS Code |
|
|
517
|
+
| `core` | Core rulebook standards | Quality gates |
|
|
518
|
+
| `cli` | AI CLI configuration | Claude Code, Codex |
|
|
519
|
+
| `git` | Git workflow rules | Branching, commits |
|
|
520
|
+
| `hooks` | Git hooks configuration | Pre-commit, pre-push |
|
|
521
|
+
|
|
522
|
+
### Using Skills
|
|
523
|
+
|
|
524
|
+
```bash
|
|
525
|
+
# List all available skills
|
|
526
|
+
rulebook skill list
|
|
527
|
+
|
|
528
|
+
# Filter by category
|
|
529
|
+
rulebook skill list --category languages
|
|
530
|
+
|
|
531
|
+
# Enable a skill
|
|
532
|
+
rulebook skill add languages/typescript
|
|
533
|
+
|
|
534
|
+
# Disable a skill
|
|
535
|
+
rulebook skill remove languages/typescript
|
|
536
|
+
|
|
537
|
+
# Show skill details
|
|
538
|
+
rulebook skill show languages/typescript
|
|
539
|
+
|
|
540
|
+
# Search for skills
|
|
541
|
+
rulebook skill search "testing"
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### Auto-Detection
|
|
545
|
+
|
|
546
|
+
During `rulebook init` and `rulebook update`, skills are automatically detected and enabled based on your project's:
|
|
547
|
+
|
|
548
|
+
- Detected languages (e.g., TypeScript → `languages/typescript`)
|
|
549
|
+
- Detected frameworks (e.g., NestJS → `frameworks/nestjs`)
|
|
550
|
+
- Detected modules (e.g., Vectorizer → `modules/vectorizer`)
|
|
551
|
+
- Detected services (e.g., PostgreSQL → `services/postgresql`)
|
|
552
|
+
|
|
553
|
+
### Creating Custom Skills
|
|
554
|
+
|
|
555
|
+
Create a `SKILL.md` file in `templates/skills/<category>/<skill-name>/`:
|
|
556
|
+
|
|
557
|
+
```markdown
|
|
558
|
+
---
|
|
559
|
+
name: My Custom Skill
|
|
560
|
+
description: Description of what this skill does
|
|
561
|
+
version: 1.0.0
|
|
562
|
+
category: core
|
|
563
|
+
tags: ["custom", "example"]
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
# My Custom Skill
|
|
567
|
+
|
|
568
|
+
Add your rules and patterns here.
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
## Service Integration Templates (20)
|
|
572
|
+
|
|
573
|
+
Rulebook provides comprehensive integration templates for popular backend services, including databases, caches, message queues, and object storage.
|
|
574
|
+
|
|
575
|
+
**Relational Databases**: PostgreSQL • MySQL • MariaDB • SQL Server • Oracle • SQLite
|
|
576
|
+
|
|
577
|
+
**NoSQL Databases**: MongoDB • Cassandra • DynamoDB
|
|
578
|
+
|
|
579
|
+
**Caches**: Redis • Memcached
|
|
580
|
+
|
|
581
|
+
**Search & Analytics**: Elasticsearch
|
|
582
|
+
|
|
583
|
+
**Graph Databases**: Neo4j
|
|
584
|
+
|
|
585
|
+
**Time-Series Databases**: InfluxDB
|
|
586
|
+
|
|
587
|
+
**Message Queues**: RabbitMQ • Kafka
|
|
588
|
+
|
|
589
|
+
**Object Storage**: AWS S3 • Azure Blob Storage • Google Cloud Storage • MinIO
|
|
590
|
+
|
|
591
|
+
### Automatic Service Detection
|
|
592
|
+
|
|
593
|
+
The CLI automatically detects services in your project by analyzing:
|
|
594
|
+
- **`package.json`**: Database drivers and client libraries (e.g., `pg`, `mongoose`, `redis`, `ioredis`)
|
|
595
|
+
- **`.env` files**: Connection strings and environment variables (e.g., `POSTGRES_*`, `REDIS_*`, `MONGODB_*`)
|
|
596
|
+
- **`docker-compose.yml`**: Service definitions in Docker Compose files
|
|
597
|
+
|
|
598
|
+
### Service Templates Include
|
|
599
|
+
|
|
600
|
+
Each service template provides:
|
|
601
|
+
- Connection setup and configuration
|
|
602
|
+
- Basic CRUD operations (where applicable)
|
|
603
|
+
- Advanced patterns and best practices
|
|
604
|
+
- Docker Compose examples
|
|
605
|
+
- Environment variable configuration
|
|
606
|
+
- Development and testing integration
|
|
607
|
+
- Common pitfalls and solutions
|
|
608
|
+
|
|
609
|
+
Templates are generated in `/rulebook/[SERVICE].md` and referenced in `AGENTS.md` for easy access during development.
|
|
610
|
+
|
|
611
|
+
**Server Details:**
|
|
612
|
+
- **Transport**: stdio only - stdout contains ONLY JSON-RPC 2.0 messages
|
|
613
|
+
- **Configuration**: Loaded from `.rulebook` file automatically
|
|
614
|
+
- **Project Detection**: Finds `.rulebook` by walking up directories (like git)
|
|
615
|
+
- **Protocol**: MCP over stdio (MCP-compliant, no stdout pollution)
|
|
616
|
+
|
|
617
|
+
**Configuration:**
|
|
618
|
+
|
|
619
|
+
The MCP server configuration lives in your `.rulebook` file:
|
|
620
|
+
|
|
621
|
+
```json
|
|
622
|
+
{
|
|
623
|
+
"mcp": {
|
|
624
|
+
"enabled": true,
|
|
625
|
+
"tasksDir": "rulebook/tasks",
|
|
626
|
+
"archiveDir": "rulebook/archive"
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
**Note:** The server uses stdio transport only (no configuration needed).
|
|
632
|
+
|
|
633
|
+
**Cursor Configuration (`.cursor/mcp.json`):**
|
|
634
|
+
|
|
635
|
+
After running `rulebook mcp init`, your `.cursor/mcp.json` will be automatically configured:
|
|
636
|
+
|
|
637
|
+
```json
|
|
638
|
+
{
|
|
639
|
+
"mcpServers": {
|
|
640
|
+
"rulebook": {
|
|
641
|
+
"command": "npx",
|
|
642
|
+
"args": ["-y", "@hivehub/rulebook@latest", "mcp-server"]
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
That's it! No need for `--project-root`, `--port`, or environment variables. The server automatically:
|
|
649
|
+
- Finds your `.rulebook` file by walking up directories
|
|
650
|
+
- Uses the `mcp` configuration from `.rulebook`
|
|
651
|
+
- Works from any subdirectory in your project
|
|
652
|
+
|
|
653
|
+
**Manual Override (if needed):**
|
|
654
|
+
|
|
655
|
+
If you need to override the `.rulebook` location:
|
|
656
|
+
|
|
657
|
+
```json
|
|
658
|
+
{
|
|
659
|
+
"mcpServers": {
|
|
660
|
+
"rulebook": {
|
|
661
|
+
"command": "npx",
|
|
662
|
+
"args": ["-y", "@hivehub/rulebook@latest", "mcp-server"],
|
|
663
|
+
"env": {
|
|
664
|
+
"RULEBOOK_CONFIG": "/path/to/.rulebook"
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
**Note:** After running `rulebook mcp init` or updating `.cursor/mcp.json`, restart Cursor for the changes to take effect.
|
|
672
|
+
|
|
673
|
+
**Troubleshooting:**
|
|
674
|
+
|
|
675
|
+
### Server Not Starting
|
|
676
|
+
|
|
677
|
+
If the MCP server fails to start:
|
|
678
|
+
|
|
679
|
+
1. **Verify `.rulebook` exists**: Run `rulebook mcp init` in your project root
|
|
680
|
+
2. **Check Node.js version**: Requires Node.js 20+ (`node --version`)
|
|
681
|
+
3. **Verify MCP configuration**: Check that `.cursor/mcp.json` exists and is valid JSON
|
|
682
|
+
4. **Debug mode**: Set `RULEBOOK_MCP_DEBUG=1` to see debug logs in stderr:
|
|
683
|
+
```bash
|
|
684
|
+
RULEBOOK_MCP_DEBUG=1 npx @hivehub/rulebook@latest mcp-server
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
### Empty Schemas or Missing Parameters
|
|
688
|
+
|
|
689
|
+
If tools don't show descriptions or parameters:
|
|
690
|
+
|
|
691
|
+
1. **Clear npm cache**:
|
|
692
|
+
```bash
|
|
693
|
+
# Clear npm cache
|
|
694
|
+
npm cache clean --force
|
|
695
|
+
|
|
696
|
+
# Or clear npx cache specifically
|
|
697
|
+
rm -rf ~/.npm/_npx
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
2. **Rebuild the project**:
|
|
701
|
+
```bash
|
|
702
|
+
npm run build
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
3. Restart your MCP client and try again.
|
|
706
|
+
|
|
707
|
+
### "Unexpected token" or "Invalid JSON" Errors
|
|
708
|
+
|
|
709
|
+
These errors occur when the server outputs non-JSON to stdout. This is fixed in v1.0.9+:
|
|
710
|
+
- Ensure you're using `@hivehub/rulebook@latest` (v1.0.9 or newer)
|
|
711
|
+
- stdout now contains ONLY JSON-RPC 2.0 messages
|
|
712
|
+
- All logs go to stderr (use `RULEBOOK_MCP_DEBUG=1` to see them)
|
|
713
|
+
|
|
714
|
+
### ".rulebook not found" Error
|
|
715
|
+
|
|
716
|
+
If you see this error:
|
|
717
|
+
1. Run `rulebook mcp init` in your project root
|
|
718
|
+
2. Or manually create `.rulebook` file with `mcp` block
|
|
719
|
+
3. Or set `RULEBOOK_CONFIG` environment variable to point to your `.rulebook` file
|
|
720
|
+
|
|
721
|
+
### "Received a response for an unknown message ID" Warning
|
|
722
|
+
|
|
723
|
+
If you see this warning in Cursor logs:
|
|
724
|
+
- **This is a cosmetic warning** - it does NOT affect functionality
|
|
725
|
+
- All tools work correctly despite this warning
|
|
726
|
+
- The server is responding correctly with valid JSON-RPC 2.0 messages
|
|
727
|
+
- This is a known issue with Cursor's MCP client ID tracking
|
|
728
|
+
- The warning can be safely ignored - all MCP tools function normally
|
|
729
|
+
|
|
730
|
+
### "Received a response for an unknown message ID" Warning
|
|
731
|
+
|
|
732
|
+
If you see this warning in the logs:
|
|
733
|
+
- This is usually harmless - the server is working correctly
|
|
734
|
+
- The warning appears during the initial handshake but doesn't affect functionality
|
|
735
|
+
- If you see "Successfully connected to stdio server" after the warning, everything is fine
|
|
736
|
+
- This is a known behavior with some MCP clients and can be safely ignored
|
|
737
|
+
|
|
738
|
+
**Automated Setup:**
|
|
739
|
+
|
|
740
|
+
```bash
|
|
741
|
+
# Initialize MCP in your project (recommended)
|
|
742
|
+
npx @hivehub/rulebook@latest mcp init
|
|
743
|
+
|
|
744
|
+
# Or use the setup script (for CI/CD)
|
|
745
|
+
npm run setup:mcp
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
## AI Tools Supported (23)
|
|
749
|
+
|
|
750
|
+
**IDEs**: Cursor, Windsurf, VS Code, GitHub Copilot, Tabnine, Replit, JetBrains AI, Zed
|
|
751
|
+
|
|
752
|
+
**CLI Agents**: Aider, Continue, Claude, Claude Code, Gemini, Cline, Amazon Q, Auggie, CodeBuddy, Factory, OpenCode, Kilo, Codex, Codeium, Cursor CLI
|
|
753
|
+
|
|
754
|
+
## Documentation
|
|
755
|
+
|
|
756
|
+
Full documentation available in `/docs`:
|
|
757
|
+
- [Getting Started](docs/guides/GETTING_STARTED.md)
|
|
758
|
+
- [Best Practices](docs/guides/BEST_PRACTICES.md)
|
|
759
|
+
- [CLI Agents](docs/CLI_AGENTS.md)
|
|
760
|
+
- [Roadmap](docs/ROADMAP.md)
|
|
761
|
+
- [Framework Templates](templates/frameworks/)
|
|
762
|
+
|
|
763
|
+
## Contributing
|
|
764
|
+
|
|
765
|
+
Contributions welcome! Node.js 18+ required.
|
|
766
|
+
|
|
767
|
+
```bash
|
|
768
|
+
npm install
|
|
769
|
+
npm test
|
|
770
|
+
npm run build
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
## License
|
|
774
|
+
|
|
775
|
+
Apache License 2.0 © HiveLLM Team
|
|
776
|
+
|
|
777
|
+
---
|
|
778
|
+
|
|
779
|
+
**Links**: [Issues](https://github.com/hivellm/rulebook/issues) • [Discussions](https://github.com/hivellm/rulebook/discussions)
|