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