@hivehub/rulebook 1.2.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 (379) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +539 -0
  3. package/dist/agents/claude-code.d.ts +69 -0
  4. package/dist/agents/claude-code.d.ts.map +1 -0
  5. package/dist/agents/claude-code.js +180 -0
  6. package/dist/agents/claude-code.js.map +1 -0
  7. package/dist/agents/cursor-agent.d.ts +184 -0
  8. package/dist/agents/cursor-agent.d.ts.map +1 -0
  9. package/dist/agents/cursor-agent.js +299 -0
  10. package/dist/agents/cursor-agent.js.map +1 -0
  11. package/dist/agents/gemini-cli.d.ts +69 -0
  12. package/dist/agents/gemini-cli.d.ts.map +1 -0
  13. package/dist/agents/gemini-cli.js +180 -0
  14. package/dist/agents/gemini-cli.js.map +1 -0
  15. package/dist/cli/commands.d.ts +57 -0
  16. package/dist/cli/commands.d.ts.map +1 -0
  17. package/dist/cli/commands.js +1370 -0
  18. package/dist/cli/commands.js.map +1 -0
  19. package/dist/cli/docs-prompts.d.ts +3 -0
  20. package/dist/cli/docs-prompts.d.ts.map +1 -0
  21. package/dist/cli/docs-prompts.js +45 -0
  22. package/dist/cli/docs-prompts.js.map +1 -0
  23. package/dist/cli/prompts.d.ts +6 -0
  24. package/dist/cli/prompts.d.ts.map +1 -0
  25. package/dist/cli/prompts.js +376 -0
  26. package/dist/cli/prompts.js.map +1 -0
  27. package/dist/core/agent-manager.d.ts +89 -0
  28. package/dist/core/agent-manager.d.ts.map +1 -0
  29. package/dist/core/agent-manager.js +546 -0
  30. package/dist/core/agent-manager.js.map +1 -0
  31. package/dist/core/auto-fixer.d.ts +14 -0
  32. package/dist/core/auto-fixer.d.ts.map +1 -0
  33. package/dist/core/auto-fixer.js +207 -0
  34. package/dist/core/auto-fixer.js.map +1 -0
  35. package/dist/core/changelog-generator.d.ts +44 -0
  36. package/dist/core/changelog-generator.d.ts.map +1 -0
  37. package/dist/core/changelog-generator.js +222 -0
  38. package/dist/core/changelog-generator.js.map +1 -0
  39. package/dist/core/cli-bridge.d.ts +113 -0
  40. package/dist/core/cli-bridge.d.ts.map +1 -0
  41. package/dist/core/cli-bridge.js +1094 -0
  42. package/dist/core/cli-bridge.js.map +1 -0
  43. package/dist/core/config-manager.d.ts +65 -0
  44. package/dist/core/config-manager.d.ts.map +1 -0
  45. package/dist/core/config-manager.js +266 -0
  46. package/dist/core/config-manager.js.map +1 -0
  47. package/dist/core/coverage-checker.d.ts +14 -0
  48. package/dist/core/coverage-checker.d.ts.map +1 -0
  49. package/dist/core/coverage-checker.js +176 -0
  50. package/dist/core/coverage-checker.js.map +1 -0
  51. package/dist/core/custom-templates.d.ts +27 -0
  52. package/dist/core/custom-templates.d.ts.map +1 -0
  53. package/dist/core/custom-templates.js +122 -0
  54. package/dist/core/custom-templates.js.map +1 -0
  55. package/dist/core/dependency-checker.d.ts +21 -0
  56. package/dist/core/dependency-checker.d.ts.map +1 -0
  57. package/dist/core/dependency-checker.js +247 -0
  58. package/dist/core/dependency-checker.js.map +1 -0
  59. package/dist/core/detector.d.ts +3 -0
  60. package/dist/core/detector.d.ts.map +1 -0
  61. package/dist/core/detector.js +1443 -0
  62. package/dist/core/detector.js.map +1 -0
  63. package/dist/core/docs-generator.d.ts +9 -0
  64. package/dist/core/docs-generator.d.ts.map +1 -0
  65. package/dist/core/docs-generator.js +531 -0
  66. package/dist/core/docs-generator.js.map +1 -0
  67. package/dist/core/generator.d.ts +16 -0
  68. package/dist/core/generator.d.ts.map +1 -0
  69. package/dist/core/generator.js +561 -0
  70. package/dist/core/generator.js.map +1 -0
  71. package/dist/core/gitignore-generator.d.ts +13 -0
  72. package/dist/core/gitignore-generator.d.ts.map +1 -0
  73. package/dist/core/gitignore-generator.js +307 -0
  74. package/dist/core/gitignore-generator.js.map +1 -0
  75. package/dist/core/health-scorer.d.ts +22 -0
  76. package/dist/core/health-scorer.d.ts.map +1 -0
  77. package/dist/core/health-scorer.js +395 -0
  78. package/dist/core/health-scorer.js.map +1 -0
  79. package/dist/core/logger.d.ts +116 -0
  80. package/dist/core/logger.d.ts.map +1 -0
  81. package/dist/core/logger.js +289 -0
  82. package/dist/core/logger.js.map +1 -0
  83. package/dist/core/merger.d.ts +6 -0
  84. package/dist/core/merger.d.ts.map +1 -0
  85. package/dist/core/merger.js +131 -0
  86. package/dist/core/merger.js.map +1 -0
  87. package/dist/core/migrator.d.ts +19 -0
  88. package/dist/core/migrator.d.ts.map +1 -0
  89. package/dist/core/migrator.js +102 -0
  90. package/dist/core/migrator.js.map +1 -0
  91. package/dist/core/minimal-scaffolder.d.ts +8 -0
  92. package/dist/core/minimal-scaffolder.d.ts.map +1 -0
  93. package/dist/core/minimal-scaffolder.js +51 -0
  94. package/dist/core/minimal-scaffolder.js.map +1 -0
  95. package/dist/core/modern-console-new.d.ts +81 -0
  96. package/dist/core/modern-console-new.d.ts.map +1 -0
  97. package/dist/core/modern-console-new.js +340 -0
  98. package/dist/core/modern-console-new.js.map +1 -0
  99. package/dist/core/modern-console.d.ts +99 -0
  100. package/dist/core/modern-console.d.ts.map +1 -0
  101. package/dist/core/modern-console.js +568 -0
  102. package/dist/core/modern-console.js.map +1 -0
  103. package/dist/core/openspec-manager.d.ts +133 -0
  104. package/dist/core/openspec-manager.d.ts.map +1 -0
  105. package/dist/core/openspec-manager.js +605 -0
  106. package/dist/core/openspec-manager.js.map +1 -0
  107. package/dist/core/openspec-migrator.d.ts +27 -0
  108. package/dist/core/openspec-migrator.d.ts.map +1 -0
  109. package/dist/core/openspec-migrator.js +255 -0
  110. package/dist/core/openspec-migrator.js.map +1 -0
  111. package/dist/core/task-manager.d.ts +65 -0
  112. package/dist/core/task-manager.d.ts.map +1 -0
  113. package/dist/core/task-manager.js +318 -0
  114. package/dist/core/task-manager.js.map +1 -0
  115. package/dist/core/test-task-manager.d.ts +49 -0
  116. package/dist/core/test-task-manager.d.ts.map +1 -0
  117. package/dist/core/test-task-manager.js +121 -0
  118. package/dist/core/test-task-manager.js.map +1 -0
  119. package/dist/core/validator.d.ts +21 -0
  120. package/dist/core/validator.d.ts.map +1 -0
  121. package/dist/core/validator.js +177 -0
  122. package/dist/core/validator.js.map +1 -0
  123. package/dist/core/version-bumper.d.ts +19 -0
  124. package/dist/core/version-bumper.d.ts.map +1 -0
  125. package/dist/core/version-bumper.js +180 -0
  126. package/dist/core/version-bumper.js.map +1 -0
  127. package/dist/core/watcher.d.ts +9 -0
  128. package/dist/core/watcher.d.ts.map +1 -0
  129. package/dist/core/watcher.js +22 -0
  130. package/dist/core/watcher.js.map +1 -0
  131. package/dist/core/workflow-generator.d.ts +10 -0
  132. package/dist/core/workflow-generator.d.ts.map +1 -0
  133. package/dist/core/workflow-generator.js +279 -0
  134. package/dist/core/workflow-generator.js.map +1 -0
  135. package/dist/index.d.ts +3 -0
  136. package/dist/index.d.ts.map +1 -0
  137. package/dist/index.js +159 -0
  138. package/dist/index.js.map +1 -0
  139. package/dist/mcp/handlers/archive-task.d.ts +17 -0
  140. package/dist/mcp/handlers/archive-task.d.ts.map +1 -0
  141. package/dist/mcp/handlers/archive-task.js +36 -0
  142. package/dist/mcp/handlers/archive-task.js.map +1 -0
  143. package/dist/mcp/handlers/create-task.d.ts +17 -0
  144. package/dist/mcp/handlers/create-task.d.ts.map +1 -0
  145. package/dist/mcp/handlers/create-task.js +56 -0
  146. package/dist/mcp/handlers/create-task.js.map +1 -0
  147. package/dist/mcp/handlers/list-tasks.d.ts +22 -0
  148. package/dist/mcp/handlers/list-tasks.d.ts.map +1 -0
  149. package/dist/mcp/handlers/list-tasks.js +42 -0
  150. package/dist/mcp/handlers/list-tasks.js.map +1 -0
  151. package/dist/mcp/handlers/show-task.d.ts +25 -0
  152. package/dist/mcp/handlers/show-task.d.ts.map +1 -0
  153. package/dist/mcp/handlers/show-task.js +43 -0
  154. package/dist/mcp/handlers/show-task.js.map +1 -0
  155. package/dist/mcp/handlers/update-task.d.ts +17 -0
  156. package/dist/mcp/handlers/update-task.d.ts.map +1 -0
  157. package/dist/mcp/handlers/update-task.js +35 -0
  158. package/dist/mcp/handlers/update-task.js.map +1 -0
  159. package/dist/mcp/handlers/validate-task.d.ts +15 -0
  160. package/dist/mcp/handlers/validate-task.d.ts.map +1 -0
  161. package/dist/mcp/handlers/validate-task.js +27 -0
  162. package/dist/mcp/handlers/validate-task.js.map +1 -0
  163. package/dist/mcp/rulebook-config.d.ts +22 -0
  164. package/dist/mcp/rulebook-config.d.ts.map +1 -0
  165. package/dist/mcp/rulebook-config.js +65 -0
  166. package/dist/mcp/rulebook-config.js.map +1 -0
  167. package/dist/mcp/rulebook-server.d.ts +4 -0
  168. package/dist/mcp/rulebook-server.d.ts.map +1 -0
  169. package/dist/mcp/rulebook-server.js +246 -0
  170. package/dist/mcp/rulebook-server.js.map +1 -0
  171. package/dist/types.d.ts +190 -0
  172. package/dist/types.d.ts.map +1 -0
  173. package/dist/types.js +2 -0
  174. package/dist/types.js.map +1 -0
  175. package/dist/utils/file-system.d.ts +9 -0
  176. package/dist/utils/file-system.d.ts.map +1 -0
  177. package/dist/utils/file-system.js +51 -0
  178. package/dist/utils/file-system.js.map +1 -0
  179. package/dist/utils/git-hooks.d.ts +8 -0
  180. package/dist/utils/git-hooks.d.ts.map +1 -0
  181. package/dist/utils/git-hooks.js +440 -0
  182. package/dist/utils/git-hooks.js.map +1 -0
  183. package/dist/utils/rulesignore.d.ts +9 -0
  184. package/dist/utils/rulesignore.d.ts.map +1 -0
  185. package/dist/utils/rulesignore.js +42 -0
  186. package/dist/utils/rulesignore.js.map +1 -0
  187. package/package.json +106 -0
  188. package/templates/cli/AIDER.md +49 -0
  189. package/templates/cli/AMAZON_Q.md +25 -0
  190. package/templates/cli/AUGGIE.md +32 -0
  191. package/templates/cli/CLAUDE.md +32 -0
  192. package/templates/cli/CLAUDE_CODE.md +35 -0
  193. package/templates/cli/CLINE.md +32 -0
  194. package/templates/cli/CODEBUDDY.md +20 -0
  195. package/templates/cli/CODEIUM.md +20 -0
  196. package/templates/cli/CODEX.md +21 -0
  197. package/templates/cli/CONTINUE.md +34 -0
  198. package/templates/cli/CURSOR_CLI.md +28 -0
  199. package/templates/cli/FACTORY.md +18 -0
  200. package/templates/cli/GEMINI.md +35 -0
  201. package/templates/cli/KILOCODE.md +18 -0
  202. package/templates/cli/OPENCODE.md +18 -0
  203. package/templates/cli/_GENERIC_TEMPLATE.md +29 -0
  204. package/templates/commands/rulebook-task-apply.md +67 -0
  205. package/templates/commands/rulebook-task-archive.md +70 -0
  206. package/templates/commands/rulebook-task-create.md +93 -0
  207. package/templates/commands/rulebook-task-list.md +42 -0
  208. package/templates/commands/rulebook-task-show.md +52 -0
  209. package/templates/commands/rulebook-task-validate.md +53 -0
  210. package/templates/core/AGENT_AUTOMATION.md +184 -0
  211. package/templates/core/DAG.md +304 -0
  212. package/templates/core/DOCUMENTATION_RULES.md +37 -0
  213. package/templates/core/QUALITY_ENFORCEMENT.md +68 -0
  214. package/templates/core/RULEBOOK.md +1874 -0
  215. package/templates/frameworks/ANGULAR.md +36 -0
  216. package/templates/frameworks/DJANGO.md +83 -0
  217. package/templates/frameworks/ELECTRON.md +147 -0
  218. package/templates/frameworks/FLASK.md +38 -0
  219. package/templates/frameworks/FLUTTER.md +55 -0
  220. package/templates/frameworks/JQUERY.md +32 -0
  221. package/templates/frameworks/LARAVEL.md +38 -0
  222. package/templates/frameworks/NESTJS.md +43 -0
  223. package/templates/frameworks/NEXTJS.md +127 -0
  224. package/templates/frameworks/NUXT.md +40 -0
  225. package/templates/frameworks/RAILS.md +66 -0
  226. package/templates/frameworks/REACT.md +38 -0
  227. package/templates/frameworks/REACT_NATIVE.md +47 -0
  228. package/templates/frameworks/SPRING.md +39 -0
  229. package/templates/frameworks/SYMFONY.md +36 -0
  230. package/templates/frameworks/VUE.md +36 -0
  231. package/templates/frameworks/ZEND.md +35 -0
  232. package/templates/git/CI_CD_PATTERNS.md +661 -0
  233. package/templates/git/GITHUB_ACTIONS.md +728 -0
  234. package/templates/git/GITLAB_CI.md +730 -0
  235. package/templates/git/GIT_WORKFLOW.md +1157 -0
  236. package/templates/git/SECRETS_MANAGEMENT.md +585 -0
  237. package/templates/hooks/COMMIT_MSG.md +530 -0
  238. package/templates/hooks/POST_CHECKOUT.md +546 -0
  239. package/templates/hooks/PREPARE_COMMIT_MSG.md +619 -0
  240. package/templates/hooks/PRE_COMMIT.md +414 -0
  241. package/templates/hooks/PRE_PUSH.md +601 -0
  242. package/templates/hooks/csharp-pre-commit.sh +23 -0
  243. package/templates/hooks/csharp-pre-push.sh +23 -0
  244. package/templates/hooks/dart-pre-commit.sh +30 -0
  245. package/templates/hooks/dart-pre-push.sh +25 -0
  246. package/templates/hooks/elixir-pre-commit.sh +32 -0
  247. package/templates/hooks/elixir-pre-push.sh +31 -0
  248. package/templates/hooks/erlang-pre-commit.sh +30 -0
  249. package/templates/hooks/erlang-pre-push.sh +37 -0
  250. package/templates/hooks/go-pre-commit.sh +40 -0
  251. package/templates/hooks/go-pre-push.sh +31 -0
  252. package/templates/hooks/haskell-pre-commit.sh +41 -0
  253. package/templates/hooks/haskell-pre-push.sh +37 -0
  254. package/templates/hooks/java-pre-commit.sh +34 -0
  255. package/templates/hooks/java-pre-push.sh +24 -0
  256. package/templates/hooks/kotlin-pre-commit.sh +32 -0
  257. package/templates/hooks/kotlin-pre-push.sh +16 -0
  258. package/templates/hooks/php-pre-commit.sh +36 -0
  259. package/templates/hooks/php-pre-push.sh +26 -0
  260. package/templates/hooks/python-pre-commit.sh +51 -0
  261. package/templates/hooks/python-pre-push.sh +25 -0
  262. package/templates/hooks/ruby-pre-commit.sh +33 -0
  263. package/templates/hooks/ruby-pre-push.sh +32 -0
  264. package/templates/hooks/rust-pre-commit.sh +30 -0
  265. package/templates/hooks/rust-pre-push.sh +30 -0
  266. package/templates/hooks/scala-pre-commit.sh +32 -0
  267. package/templates/hooks/scala-pre-push.sh +24 -0
  268. package/templates/hooks/swift-pre-commit.sh +25 -0
  269. package/templates/hooks/swift-pre-push.sh +23 -0
  270. package/templates/hooks/typescript-pre-commit.sh +37 -0
  271. package/templates/hooks/typescript-pre-push.sh +36 -0
  272. package/templates/ides/COPILOT.md +37 -0
  273. package/templates/ides/CURSOR.md +43 -0
  274. package/templates/ides/JETBRAINS_AI.md +35 -0
  275. package/templates/ides/REPLIT.md +36 -0
  276. package/templates/ides/TABNINE.md +29 -0
  277. package/templates/ides/VSCODE.md +40 -0
  278. package/templates/ides/WINDSURF.md +36 -0
  279. package/templates/ides/ZED.md +32 -0
  280. package/templates/languages/ADA.md +58 -0
  281. package/templates/languages/C.md +333 -0
  282. package/templates/languages/CPP.md +743 -0
  283. package/templates/languages/CSHARP.md +417 -0
  284. package/templates/languages/DART.md +332 -0
  285. package/templates/languages/ELIXIR.md +454 -0
  286. package/templates/languages/ERLANG.md +361 -0
  287. package/templates/languages/GO.md +645 -0
  288. package/templates/languages/HASKELL.md +177 -0
  289. package/templates/languages/JAVA.md +607 -0
  290. package/templates/languages/JAVASCRIPT.md +631 -0
  291. package/templates/languages/JULIA.md +97 -0
  292. package/templates/languages/KOTLIN.md +511 -0
  293. package/templates/languages/LISP.md +100 -0
  294. package/templates/languages/LUA.md +74 -0
  295. package/templates/languages/OBJECTIVEC.md +90 -0
  296. package/templates/languages/PHP.md +416 -0
  297. package/templates/languages/PYTHON.md +682 -0
  298. package/templates/languages/R.md +350 -0
  299. package/templates/languages/RUBY.md +421 -0
  300. package/templates/languages/RUST.md +477 -0
  301. package/templates/languages/SAS.md +73 -0
  302. package/templates/languages/SCALA.md +348 -0
  303. package/templates/languages/SOLIDITY.md +580 -0
  304. package/templates/languages/SQL.md +137 -0
  305. package/templates/languages/SWIFT.md +466 -0
  306. package/templates/languages/TYPESCRIPT.md +591 -0
  307. package/templates/languages/ZIG.md +265 -0
  308. package/templates/modules/ATLASSIAN.md +255 -0
  309. package/templates/modules/CONTEXT7.md +54 -0
  310. package/templates/modules/FIGMA.md +267 -0
  311. package/templates/modules/GITHUB_MCP.md +64 -0
  312. package/templates/modules/GRAFANA.md +328 -0
  313. package/templates/modules/NOTION.md +247 -0
  314. package/templates/modules/PLAYWRIGHT.md +90 -0
  315. package/templates/modules/RULEBOOK_MCP.md +156 -0
  316. package/templates/modules/SERENA.md +337 -0
  317. package/templates/modules/SUPABASE.md +223 -0
  318. package/templates/modules/SYNAP.md +69 -0
  319. package/templates/modules/VECTORIZER.md +63 -0
  320. package/templates/services/AZURE_BLOB.md +184 -0
  321. package/templates/services/CASSANDRA.md +239 -0
  322. package/templates/services/DYNAMODB.md +308 -0
  323. package/templates/services/ELASTICSEARCH.md +347 -0
  324. package/templates/services/GCS.md +178 -0
  325. package/templates/services/INFLUXDB.md +265 -0
  326. package/templates/services/KAFKA.md +341 -0
  327. package/templates/services/MARIADB.md +183 -0
  328. package/templates/services/MEMCACHED.md +242 -0
  329. package/templates/services/MINIO.md +201 -0
  330. package/templates/services/MONGODB.md +268 -0
  331. package/templates/services/MYSQL.md +358 -0
  332. package/templates/services/NEO4J.md +247 -0
  333. package/templates/services/ORACLE.md +290 -0
  334. package/templates/services/POSTGRESQL.md +326 -0
  335. package/templates/services/RABBITMQ.md +286 -0
  336. package/templates/services/REDIS.md +292 -0
  337. package/templates/services/S3.md +298 -0
  338. package/templates/services/SQLITE.md +294 -0
  339. package/templates/services/SQLSERVER.md +294 -0
  340. package/templates/workflows/codespell.yml +31 -0
  341. package/templates/workflows/cpp-lint.yml +47 -0
  342. package/templates/workflows/cpp-publish.yml +119 -0
  343. package/templates/workflows/cpp-test.yml +77 -0
  344. package/templates/workflows/dotnet-lint.yml +29 -0
  345. package/templates/workflows/dotnet-publish.yml +40 -0
  346. package/templates/workflows/dotnet-test.yml +41 -0
  347. package/templates/workflows/elixir-lint.yml +45 -0
  348. package/templates/workflows/elixir-publish.yml +49 -0
  349. package/templates/workflows/elixir-test.yml +54 -0
  350. package/templates/workflows/erlang-lint.yml +47 -0
  351. package/templates/workflows/erlang-test.yml +62 -0
  352. package/templates/workflows/go-lint.yml +39 -0
  353. package/templates/workflows/go-publish.yml +95 -0
  354. package/templates/workflows/go-test.yml +59 -0
  355. package/templates/workflows/java-lint.yml +60 -0
  356. package/templates/workflows/java-publish.yml +120 -0
  357. package/templates/workflows/java-test.yml +85 -0
  358. package/templates/workflows/kotlin-lint.yml +34 -0
  359. package/templates/workflows/kotlin-publish.yml +56 -0
  360. package/templates/workflows/kotlin-test.yml +48 -0
  361. package/templates/workflows/php-lint.yml +39 -0
  362. package/templates/workflows/php-publish.yml +50 -0
  363. package/templates/workflows/php-test.yml +54 -0
  364. package/templates/workflows/python-lint.yml +47 -0
  365. package/templates/workflows/python-publish.yml +91 -0
  366. package/templates/workflows/python-test.yml +59 -0
  367. package/templates/workflows/rust-lint.yml +54 -0
  368. package/templates/workflows/rust-publish.yml +66 -0
  369. package/templates/workflows/rust-test.yml +75 -0
  370. package/templates/workflows/solidity-lint.yml +41 -0
  371. package/templates/workflows/solidity-test.yml +47 -0
  372. package/templates/workflows/swift-lint.yml +32 -0
  373. package/templates/workflows/swift-publish.yml +58 -0
  374. package/templates/workflows/swift-test.yml +44 -0
  375. package/templates/workflows/typescript-lint.yml +61 -0
  376. package/templates/workflows/typescript-publish.yml +60 -0
  377. package/templates/workflows/typescript-test.yml +73 -0
  378. package/templates/workflows/zig-lint.yml +27 -0
  379. package/templates/workflows/zig-test.yml +40 -0
@@ -0,0 +1,22 @@
1
+ import { createModernConsole } from './modern-console.js';
2
+ import { AgentManager } from './agent-manager.js';
3
+ /**
4
+ * Create and start modern console watcher
5
+ */
6
+ export async function startWatcher(projectRoot) {
7
+ // Create agent manager for watcher integration
8
+ const agentManager = new AgentManager(projectRoot);
9
+ const modernConsole = createModernConsole({
10
+ projectRoot,
11
+ refreshInterval: 100,
12
+ agentManager,
13
+ });
14
+ await modernConsole.start();
15
+ }
16
+ /**
17
+ * Create and start modern console watcher (alias)
18
+ */
19
+ export async function startModernWatcher(projectRoot) {
20
+ await startWatcher(projectRoot);
21
+ }
22
+ //# sourceMappingURL=watcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watcher.js","sourceRoot":"","sources":["../../src/core/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,WAAmB;IACpD,+CAA+C;IAC/C,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,WAAW,CAAC,CAAC;IAEnD,MAAM,aAAa,GAAG,mBAAmB,CAAC;QACxC,WAAW;QACX,eAAe,EAAE,GAAG;QACpB,YAAY;KACb,CAAC,CAAC;IAEH,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC;AAC9B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,WAAmB;IAC1D,MAAM,YAAY,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ProjectConfig } from '../types.js';
2
+ export declare function generateWorkflows(config: ProjectConfig, targetDir?: string, options?: {
3
+ mode?: 'full' | 'minimal';
4
+ }): Promise<string[]>;
5
+ export declare function generateIDEFiles(config: ProjectConfig, targetDir?: string): Promise<string[]>;
6
+ /**
7
+ * Generate Cursor commands from templates
8
+ */
9
+ export declare function generateCursorCommands(targetDir: string): Promise<string[]>;
10
+ //# sourceMappingURL=workflow-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-generator.d.ts","sourceRoot":"","sources":["../../src/core/workflow-generator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAWjD,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,aAAa,EACrB,SAAS,GAAE,MAAsB,EACjC,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAO,GAC1C,OAAO,CAAC,MAAM,EAAE,CAAC,CA4DnB;AAsBD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EACrB,SAAS,GAAE,MAAsB,GAChC,OAAO,CAAC,MAAM,EAAE,CAAC,CAuBnB;AAsKD;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAmCjF"}
@@ -0,0 +1,279 @@
1
+ import path from 'path';
2
+ import { readFile, writeFile, ensureDir, fileExists } from '../utils/file-system.js';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname } from 'path';
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+ function getTemplatesDir() {
8
+ return path.join(__dirname, '..', '..', 'templates');
9
+ }
10
+ export async function generateWorkflows(config, targetDir = process.cwd(), options = {}) {
11
+ const generatedFiles = [];
12
+ const workflowsDir = path.join(targetDir, '.github', 'workflows');
13
+ await ensureDir(workflowsDir);
14
+ const templatesDir = path.join(getTemplatesDir(), 'workflows');
15
+ const mode = options.mode ?? 'full';
16
+ // Generate language-specific workflows
17
+ for (const language of config.languages) {
18
+ if (language === 'rust') {
19
+ // Copy Rust workflows
20
+ const rustTest = await copyWorkflow(templatesDir, 'rust-test.yml', workflowsDir);
21
+ generatedFiles.push(rustTest);
22
+ if (mode === 'full') {
23
+ const rustLint = await copyWorkflow(templatesDir, 'rust-lint.yml', workflowsDir);
24
+ generatedFiles.push(rustLint);
25
+ }
26
+ }
27
+ else if (language === 'typescript') {
28
+ // Copy TypeScript workflows
29
+ const tsTest = await copyWorkflow(templatesDir, 'typescript-test.yml', workflowsDir);
30
+ generatedFiles.push(tsTest);
31
+ if (mode === 'full') {
32
+ const tsLint = await copyWorkflow(templatesDir, 'typescript-lint.yml', workflowsDir);
33
+ generatedFiles.push(tsLint);
34
+ }
35
+ }
36
+ else if (language === 'python') {
37
+ // Copy Python workflows
38
+ const pyTest = await copyWorkflow(templatesDir, 'python-test.yml', workflowsDir);
39
+ generatedFiles.push(pyTest);
40
+ if (mode === 'full') {
41
+ const pyLint = await copyWorkflow(templatesDir, 'python-lint.yml', workflowsDir);
42
+ generatedFiles.push(pyLint);
43
+ }
44
+ }
45
+ else if (language === 'go') {
46
+ // Copy Go workflows
47
+ const goTest = await copyWorkflow(templatesDir, 'go-test.yml', workflowsDir);
48
+ generatedFiles.push(goTest);
49
+ if (mode === 'full') {
50
+ const goLint = await copyWorkflow(templatesDir, 'go-lint.yml', workflowsDir);
51
+ generatedFiles.push(goLint);
52
+ }
53
+ }
54
+ else if (language === 'java') {
55
+ // Copy Java workflows
56
+ const javaTest = await copyWorkflow(templatesDir, 'java-test.yml', workflowsDir);
57
+ generatedFiles.push(javaTest);
58
+ if (mode === 'full') {
59
+ const javaLint = await copyWorkflow(templatesDir, 'java-lint.yml', workflowsDir);
60
+ generatedFiles.push(javaLint);
61
+ }
62
+ }
63
+ }
64
+ if (mode === 'full') {
65
+ // Always add codespell in full mode
66
+ const codespell = await copyWorkflow(templatesDir, 'codespell.yml', workflowsDir);
67
+ generatedFiles.push(codespell);
68
+ }
69
+ return generatedFiles;
70
+ }
71
+ async function copyWorkflow(templatesDir, workflowFile, targetDir) {
72
+ const sourcePath = path.join(templatesDir, workflowFile);
73
+ const targetPath = path.join(targetDir, workflowFile);
74
+ // Check if workflow already exists
75
+ if (await fileExists(targetPath)) {
76
+ // Skip if exists, don't overwrite
77
+ return targetPath;
78
+ }
79
+ const content = await readFile(sourcePath);
80
+ await writeFile(targetPath, content);
81
+ return targetPath;
82
+ }
83
+ export async function generateIDEFiles(config, targetDir = process.cwd()) {
84
+ const generatedFiles = [];
85
+ for (const ide of config.ides) {
86
+ if (ide === 'cursor') {
87
+ const cursorRulesPath = await generateCursorRules(config, targetDir);
88
+ if (cursorRulesPath)
89
+ generatedFiles.push(cursorRulesPath);
90
+ // Generate Cursor commands
91
+ const cursorCommands = await generateCursorCommands(targetDir);
92
+ generatedFiles.push(...cursorCommands);
93
+ }
94
+ else if (ide === 'windsurf') {
95
+ const windsurfRulesPath = await generateWindsurfRules(config, targetDir);
96
+ if (windsurfRulesPath)
97
+ generatedFiles.push(windsurfRulesPath);
98
+ }
99
+ else if (ide === 'vscode') {
100
+ const vscodeFiles = await generateVSCodeConfig(config, targetDir);
101
+ generatedFiles.push(...vscodeFiles);
102
+ }
103
+ else if (ide === 'copilot') {
104
+ const copilotPath = await generateCopilotInstructions(config, targetDir);
105
+ if (copilotPath)
106
+ generatedFiles.push(copilotPath);
107
+ }
108
+ }
109
+ return generatedFiles;
110
+ }
111
+ async function generateCursorRules(config, targetDir) {
112
+ const targetPath = path.join(targetDir, '.cursorrules');
113
+ // Don't overwrite if exists
114
+ if (await fileExists(targetPath)) {
115
+ return null;
116
+ }
117
+ const content = `This project uses @hivellm/rulebook standards.
118
+
119
+ CRITICAL RULES:
120
+ 1. Always reference @AGENTS.md before coding
121
+ 2. Write tests first (${config.coverageThreshold}%+ coverage required)
122
+ 3. Run quality checks before committing:
123
+ - Type check / Compiler check
124
+ - Linter (no warnings allowed)
125
+ - All tests (100% pass rate)
126
+ - Coverage check
127
+ 4. Update docs/ when implementing features
128
+ 5. Follow strict documentation structure
129
+
130
+ Language-specific rules are in @AGENTS.md.
131
+ Module-specific patterns are in @AGENTS.md.
132
+
133
+ When in doubt, ask to review @AGENTS.md first.
134
+ `;
135
+ await writeFile(targetPath, content);
136
+ return targetPath;
137
+ }
138
+ async function generateWindsurfRules(config, targetDir) {
139
+ const targetPath = path.join(targetDir, '.windsurfrules');
140
+ if (await fileExists(targetPath)) {
141
+ return null;
142
+ }
143
+ const content = `# Project Standards
144
+
145
+ This project uses @hivellm/rulebook for standardization.
146
+
147
+ ## Critical Rules
148
+
149
+ 1. **Always check @AGENTS.md** before generating code
150
+ 2. **Tests first**: Minimum ${config.coverageThreshold}% coverage required
151
+ 3. **Quality gates**: All must pass before commit
152
+ - Type checking
153
+ - Linting (zero warnings)
154
+ - All tests (100% pass)
155
+ - Coverage verification
156
+ 4. **Documentation**: Update /docs/ with all changes
157
+ 5. **Structure**: Follow strict documentation layout
158
+
159
+ ## Language Rules
160
+
161
+ See @AGENTS.md for:
162
+ ${config.languages.map((lang) => `- ${lang.charAt(0).toUpperCase() + lang.slice(1)}: Language-specific standards`).join('\n')}
163
+
164
+ ## Module Patterns
165
+
166
+ ${config.modules.length > 0 ? `See @AGENTS.md for:\n${config.modules.map((mod) => `- ${mod.charAt(0).toUpperCase() + mod.slice(1)}: Module-specific patterns`).join('\n')}` : 'No modules configured'}
167
+ `;
168
+ await writeFile(targetPath, content);
169
+ return targetPath;
170
+ }
171
+ async function generateVSCodeConfig(config, targetDir) {
172
+ const vscodeDir = path.join(targetDir, '.vscode');
173
+ await ensureDir(vscodeDir);
174
+ const generatedFiles = [];
175
+ // Generate settings.json
176
+ const settingsPath = path.join(vscodeDir, 'settings.json');
177
+ if (!(await fileExists(settingsPath))) {
178
+ const settings = {
179
+ 'editor.formatOnSave': true,
180
+ 'editor.codeActionsOnSave': {
181
+ 'source.fixAll.eslint': true,
182
+ 'source.organizeImports': true,
183
+ },
184
+ 'editor.rulers': [100],
185
+ 'files.eol': '\n',
186
+ 'github.copilot.enable': {
187
+ '*': true,
188
+ },
189
+ };
190
+ await writeFile(settingsPath, JSON.stringify(settings, null, 2));
191
+ generatedFiles.push(settingsPath);
192
+ }
193
+ // Generate copilot-instructions.md
194
+ const copilotPath = path.join(vscodeDir, 'copilot-instructions.md');
195
+ if (!(await fileExists(copilotPath))) {
196
+ const instructions = `# GitHub Copilot Instructions
197
+
198
+ This project follows @hivellm/rulebook standards defined in AGENTS.md.
199
+
200
+ Read and follow AGENTS.md for all code generation.
201
+
202
+ Minimum test coverage: ${config.coverageThreshold}%
203
+ `;
204
+ await writeFile(copilotPath, instructions);
205
+ generatedFiles.push(copilotPath);
206
+ }
207
+ return generatedFiles;
208
+ }
209
+ async function generateCopilotInstructions(config, targetDir) {
210
+ const githubDir = path.join(targetDir, '.github');
211
+ await ensureDir(githubDir);
212
+ const targetPath = path.join(githubDir, 'copilot-instructions.md');
213
+ if (await fileExists(targetPath)) {
214
+ return null;
215
+ }
216
+ const content = `# GitHub Copilot Instructions
217
+
218
+ This project follows @hivellm/rulebook standards defined in AGENTS.md.
219
+
220
+ ## Code Generation Rules
221
+
222
+ 1. **Always follow AGENTS.md** for all code generation
223
+ 2. **Tests required**: Minimum ${config.coverageThreshold}% coverage for all new code
224
+ 3. **Quality checks**: Code must pass all checks before commit:
225
+ - Type checking / Compilation
226
+ - Linting (zero warnings)
227
+ - All tests passing
228
+ - Coverage threshold met
229
+ 4. **Documentation**: Update /docs/ with all changes
230
+ 5. **Structure**: Follow project structure from AGENTS.md
231
+
232
+ ## Language-Specific Standards
233
+
234
+ ${config.languages.map((lang) => `### ${lang.charAt(0).toUpperCase() + lang.slice(1)}\nSee AGENTS.md for ${lang} standards`).join('\n\n')}
235
+
236
+ ## Testing Patterns
237
+
238
+ - Tests in /tests directory
239
+ - Test-driven development
240
+ - Edge cases and error paths
241
+ - Integration tests where appropriate
242
+ `;
243
+ await writeFile(targetPath, content);
244
+ return targetPath;
245
+ }
246
+ /**
247
+ * Generate Cursor commands from templates
248
+ */
249
+ export async function generateCursorCommands(targetDir) {
250
+ const commandsDir = path.join(targetDir, '.cursor', 'commands');
251
+ await ensureDir(commandsDir);
252
+ const templatesDir = path.join(getTemplatesDir(), 'commands');
253
+ const generatedFiles = [];
254
+ // List of command templates to copy
255
+ const commandTemplates = [
256
+ 'rulebook-task-create.md',
257
+ 'rulebook-task-list.md',
258
+ 'rulebook-task-show.md',
259
+ 'rulebook-task-validate.md',
260
+ 'rulebook-task-archive.md',
261
+ 'rulebook-task-apply.md',
262
+ ];
263
+ for (const template of commandTemplates) {
264
+ const sourcePath = path.join(templatesDir, template);
265
+ const targetPath = path.join(commandsDir, template);
266
+ // Skip if already exists (don't overwrite user customizations)
267
+ if (await fileExists(targetPath)) {
268
+ continue;
269
+ }
270
+ // Check if template exists
271
+ if (await fileExists(sourcePath)) {
272
+ const content = await readFile(sourcePath);
273
+ await writeFile(targetPath, content);
274
+ generatedFiles.push(targetPath);
275
+ }
276
+ }
277
+ return generatedFiles;
278
+ }
279
+ //# sourceMappingURL=workflow-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-generator.js","sourceRoot":"","sources":["../../src/core/workflow-generator.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,eAAe;IACtB,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,MAAqB,EACrB,YAAoB,OAAO,CAAC,GAAG,EAAE,EACjC,UAAyC,EAAE;IAE3C,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAClE,MAAM,SAAS,CAAC,YAAY,CAAC,CAAC;IAE9B,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,WAAW,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC;IAEpC,uCAAuC;IACvC,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACxC,IAA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,CAAC,IAAI,CAAC,eAAe,EAAE,EAAE,UAAU,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,oCAAoC;IACpC,MAAM,gBAAgB,GAAG;QACvB,yBAAyB;QACzB,uBAAuB;QACvB,uBAAuB;QACvB,2BAA2B;QAC3B,0BAA0B;QAC1B,wBAAwB;KACzB,CAAC;IAEF,KAAK,MAAM,QAAQ,IAAI,gBAAgB,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QACrD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QAEpD,+DAA+D;QAC/D,IAAI,MAAM,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,SAAS;QACX,CAAC;QAED,2BAA2B;QAC3B,IAAI,MAAM,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,CAAC;YAC3C,MAAM,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACrC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,159 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { initCommand, validateCommand, workflowsCommand, checkDepsCommand, checkCoverageCommand, generateDocsCommand, versionCommand, changelogCommand, healthCommand, fixCommand, watcherCommand, agentCommand, configCommand, tasksCommand, taskCreateCommand, taskListCommand, taskShowCommand, taskValidateCommand, taskArchiveCommand, updateCommand, mcpServerCommand, mcpInitCommand, } from './cli/commands.js';
4
+ import { readFileSync } from 'fs';
5
+ import { fileURLToPath } from 'url';
6
+ import path from 'path';
7
+ // Get version from package.json
8
+ function getVersion() {
9
+ try {
10
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
11
+ const packagePath = path.join(__dirname, '..', 'package.json');
12
+ const packageJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
13
+ return packageJson.version;
14
+ }
15
+ catch {
16
+ return '0.12.1'; // Fallback version
17
+ }
18
+ }
19
+ const program = new Command();
20
+ program
21
+ .name('rulebook')
22
+ .description('CLI tool to standardize AI-generated projects with templates and rules')
23
+ .version(getVersion());
24
+ program
25
+ .command('init')
26
+ .description('Initialize rulebook for current project')
27
+ .option('-y, --yes', 'Skip prompts and use detected defaults')
28
+ .option('--minimal', 'Enable essentials-only setup mode')
29
+ .option('--light', 'Light mode: bare minimum rules (no tests, no linting)')
30
+ .action(initCommand);
31
+ program
32
+ .command('workflows')
33
+ .description('Generate GitHub Actions workflows for detected languages')
34
+ .action(workflowsCommand);
35
+ program
36
+ .command('validate')
37
+ .description('Validate project structure against rulebook standards')
38
+ .action(validateCommand);
39
+ program
40
+ .command('check-deps')
41
+ .description('Check for outdated and vulnerable dependencies')
42
+ .action(checkDepsCommand);
43
+ program
44
+ .command('check-coverage')
45
+ .description('Check test coverage against threshold')
46
+ .option('-t, --threshold <number>', 'Coverage threshold percentage', '95')
47
+ .action((options) => checkCoverageCommand({ threshold: parseInt(options.threshold) }));
48
+ program
49
+ .command('generate-docs')
50
+ .description('Generate documentation structure and standard files')
51
+ .option('-y, --yes', 'Skip prompts and use defaults')
52
+ .action(generateDocsCommand);
53
+ program
54
+ .command('version')
55
+ .description('Bump project version (semantic versioning)')
56
+ .argument('<type>', 'Version bump type: major, minor, or patch')
57
+ .action((type) => {
58
+ if (!['major', 'minor', 'patch'].includes(type)) {
59
+ console.error('Error: type must be major, minor, or patch');
60
+ process.exit(1);
61
+ }
62
+ versionCommand({ type: type });
63
+ });
64
+ program
65
+ .command('changelog')
66
+ .description('Generate changelog from git commits')
67
+ .option('-v, --version <version>', 'Specify version (default: auto-detect)')
68
+ .action(changelogCommand);
69
+ program.command('health').description('Check project health score').action(healthCommand);
70
+ program.command('fix').description('Auto-fix common project issues').action(fixCommand);
71
+ // New advanced commands (BETA)
72
+ program
73
+ .command('watcher')
74
+ .description('Start modern full-screen console watcher for OpenSpec tasks and agent progress [BETA]')
75
+ .action(watcherCommand);
76
+ program
77
+ .command('agent')
78
+ .description('Start autonomous agent for managing AI CLI workflows [BETA]')
79
+ .option('--dry-run', 'Simulate execution without making changes')
80
+ .option('--tool <name>', 'Specify CLI tool to use (cursor-agent, claude-code, gemini-cli)')
81
+ .option('--iterations <number>', 'Maximum number of iterations', '10')
82
+ .option('--watch', 'Enable watcher mode for real-time monitoring')
83
+ .action((options) => agentCommand({
84
+ dryRun: options.dryRun,
85
+ tool: options.tool,
86
+ iterations: parseInt(options.iterations),
87
+ watch: options.watch,
88
+ }));
89
+ program
90
+ .command('config')
91
+ .description('Manage rulebook configuration')
92
+ .option('--show', 'Show current configuration')
93
+ .option('--set <key=value>', 'Set configuration value')
94
+ .option('--feature <name>', 'Feature name for enable/disable')
95
+ .option('--enable', 'Enable feature')
96
+ .option('--disable', 'Disable feature')
97
+ .action((options) => configCommand({
98
+ show: options.show,
99
+ set: options.set,
100
+ feature: options.feature,
101
+ enable: options.enable,
102
+ }));
103
+ // Task management commands
104
+ const taskCommand = program.command('task').description('Manage Rulebook tasks');
105
+ taskCommand
106
+ .command('create <task-id>')
107
+ .description('Create a new task')
108
+ .action((taskId) => taskCreateCommand(taskId));
109
+ taskCommand
110
+ .command('list')
111
+ .description('List all tasks')
112
+ .option('--archived', 'Include archived tasks')
113
+ .action((options) => taskListCommand(options.archived || false));
114
+ taskCommand
115
+ .command('show <task-id>')
116
+ .description('Show task details')
117
+ .action((taskId) => taskShowCommand(taskId));
118
+ taskCommand
119
+ .command('validate <task-id>')
120
+ .description('Validate task format')
121
+ .action((taskId) => taskValidateCommand(taskId));
122
+ taskCommand
123
+ .command('archive <task-id>')
124
+ .description('Archive a completed task')
125
+ .option('--skip-validation', 'Skip validation before archiving')
126
+ .action((taskId, options) => taskArchiveCommand(taskId, options.skipValidation || false));
127
+ // Legacy tasks command (deprecated)
128
+ program
129
+ .command('tasks')
130
+ .description('Manage OpenSpec tasks (DEPRECATED - use "task" commands)')
131
+ .option('--tree', 'Show task dependency tree')
132
+ .option('--current', 'Show current active task')
133
+ .option('--status <taskId>', 'Update task status')
134
+ .action((options) => tasksCommand({
135
+ tree: options.tree,
136
+ current: options.current,
137
+ status: options.status,
138
+ }));
139
+ program
140
+ .command('update')
141
+ .description('Update AGENTS.md and .rulebook to latest version')
142
+ .option('-y, --yes', 'Skip confirmation prompt')
143
+ .option('--minimal', 'Regenerate using minimal mode (essentials only)')
144
+ .option('--light', 'Light mode: bare minimum rules (no tests, no linting)')
145
+ .action(updateCommand);
146
+ // MCP commands
147
+ const mcpCommand = program.command('mcp').description('Manage Rulebook MCP server');
148
+ mcpCommand
149
+ .command('init')
150
+ .description('Initialize MCP configuration in .rulebook and .cursor/mcp.json')
151
+ .action(() => mcpInitCommand());
152
+ program
153
+ .command('mcp-server')
154
+ .description('Start Rulebook MCP server for task management via MCP protocol (stdio transport)')
155
+ .action(() => {
156
+ mcpServerCommand();
157
+ });
158
+ program.parse(process.argv);
159
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,iB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,IAAI,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { TaskManager } from '../../core/task-manager.js';
2
+ export declare function archiveTaskHandler(taskManager: TaskManager, args: {
3
+ taskId: string;
4
+ skipValidation?: boolean;
5
+ }): Promise<{
6
+ content: Array<{
7
+ type: 'text';
8
+ text: string;
9
+ }>;
10
+ structuredContent: {
11
+ success: boolean;
12
+ taskId: string;
13
+ archivePath: string;
14
+ message: string;
15
+ };
16
+ }>;
17
+ //# sourceMappingURL=archive-task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-task.d.ts","sourceRoot":"","sources":["../../../src/mcp/handlers/archive-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,GACjD,OAAO,CAAC;IACT,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,iBAAiB,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC,CAqCD"}
@@ -0,0 +1,36 @@
1
+ import { join } from 'path';
2
+ export async function archiveTaskHandler(taskManager, args) {
3
+ try {
4
+ await taskManager.archiveTask(args.taskId, args.skipValidation || false);
5
+ const archiveDate = new Date().toISOString().split('T')[0];
6
+ const archiveName = `${archiveDate}-${args.taskId}`;
7
+ const archivePath = join('rulebook', 'tasks', 'archive', archiveName);
8
+ const output = {
9
+ success: true,
10
+ taskId: args.taskId,
11
+ archivePath,
12
+ message: `Task ${args.taskId} archived successfully`,
13
+ };
14
+ return {
15
+ content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
16
+ structuredContent: output,
17
+ };
18
+ }
19
+ catch (error) {
20
+ const errorMessage = error instanceof Error ? error.message : String(error);
21
+ const archiveDate = new Date().toISOString().split('T')[0];
22
+ const archiveName = `${archiveDate}-${args.taskId}`;
23
+ const archivePath = join('rulebook', 'tasks', 'archive', archiveName);
24
+ const output = {
25
+ success: false,
26
+ taskId: args.taskId,
27
+ archivePath,
28
+ message: `Failed to archive task: ${errorMessage}`,
29
+ };
30
+ return {
31
+ content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
32
+ structuredContent: output,
33
+ };
34
+ }
35
+ }
36
+ //# sourceMappingURL=archive-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archive-task.js","sourceRoot":"","sources":["../../../src/mcp/handlers/archive-task.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,WAAwB,EACxB,IAAkD;IAUlD,IAAI,CAAC;QACH,MAAM,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,IAAI,KAAK,CAAC,CAAC;QAEzE,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,WAAW,GAAG,GAAG,WAAW,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACpD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAEtE,MAAM,MAAM,GAAG;YACb,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW;YACX,OAAO,EAAE,QAAQ,IAAI,CAAC,MAAM,wBAAwB;SACrD,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;YAClE,iBAAiB,EAAE,MAAM;SAC1B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,WAAW,GAAG,GAAG,WAAW,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACpD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAEtE,MAAM,MAAM,GAAG;YACb,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,WAAW;YACX,OAAO,EAAE,2BAA2B,YAAY,EAAE;SACnD,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;YAClE,iBAAiB,EAAE,MAAM;SAC1B,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { TaskManager } from '../../core/task-manager.js';
2
+ export declare function createTaskHandler(taskManager: TaskManager, args: {
3
+ taskId: string;
4
+ proposal?: string;
5
+ }): Promise<{
6
+ content: Array<{
7
+ type: 'text';
8
+ text: string;
9
+ }>;
10
+ structuredContent: {
11
+ success: boolean;
12
+ taskId: string;
13
+ message: string;
14
+ path?: string;
15
+ };
16
+ }>;
17
+ //# sourceMappingURL=create-task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-task.d.ts","sourceRoot":"","sources":["../../../src/mcp/handlers/create-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIzD,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1C,OAAO,CAAC;IACT,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C,iBAAiB,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzF,CAAC,CA0DD"}