@hivehub/rulebook 5.5.2 → 5.7.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 (325) hide show
  1. package/.claude/commands/rulebook-learn-capture.md +41 -48
  2. package/.claude/commands/rulebook-learn-list.md +13 -13
  3. package/README.md +332 -394
  4. package/dist/cli/commands/context-intelligence.d.ts +0 -1
  5. package/dist/cli/commands/context-intelligence.d.ts.map +1 -1
  6. package/dist/cli/commands/context-intelligence.js +12 -33
  7. package/dist/cli/commands/context-intelligence.js.map +1 -1
  8. package/dist/cli/commands/index.d.ts +4 -7
  9. package/dist/cli/commands/index.d.ts.map +1 -1
  10. package/dist/cli/commands/index.js +4 -7
  11. package/dist/cli/commands/index.js.map +1 -1
  12. package/dist/cli/commands/init.d.ts.map +1 -1
  13. package/dist/cli/commands/init.js +40 -81
  14. package/dist/cli/commands/init.js.map +1 -1
  15. package/dist/cli/commands/mcp.d.ts +0 -1
  16. package/dist/cli/commands/mcp.d.ts.map +1 -1
  17. package/dist/cli/commands/mcp.js +1 -7
  18. package/dist/cli/commands/mcp.js.map +1 -1
  19. package/dist/cli/commands/memory.d.ts +7 -1
  20. package/dist/cli/commands/memory.d.ts.map +1 -1
  21. package/dist/cli/commands/memory.js +51 -57
  22. package/dist/cli/commands/memory.js.map +1 -1
  23. package/dist/cli/commands/misc.d.ts +1 -15
  24. package/dist/cli/commands/misc.d.ts.map +1 -1
  25. package/dist/cli/commands/misc.js +36 -215
  26. package/dist/cli/commands/misc.js.map +1 -1
  27. package/dist/cli/commands/plans.d.ts +0 -6
  28. package/dist/cli/commands/plans.d.ts.map +1 -1
  29. package/dist/cli/commands/plans.js +9 -77
  30. package/dist/cli/commands/plans.js.map +1 -1
  31. package/dist/cli/commands/skills.js +6 -6
  32. package/dist/cli/commands/skills.js.map +1 -1
  33. package/dist/cli/commands/task.js +4 -4
  34. package/dist/cli/commands/task.js.map +1 -1
  35. package/dist/cli/commands/update.d.ts.map +1 -1
  36. package/dist/cli/commands/update.js +122 -52
  37. package/dist/cli/commands/update.js.map +1 -1
  38. package/dist/cli/prompts.d.ts.map +1 -1
  39. package/dist/cli/prompts.js +1 -78
  40. package/dist/cli/prompts.js.map +1 -1
  41. package/dist/core/claude/claude-mcp.d.ts +59 -0
  42. package/dist/core/claude/claude-mcp.d.ts.map +1 -0
  43. package/dist/core/claude/claude-mcp.js +220 -0
  44. package/dist/core/claude/claude-mcp.js.map +1 -0
  45. package/dist/core/claude/claude-md-generator.d.ts +52 -0
  46. package/dist/core/claude/claude-md-generator.d.ts.map +1 -0
  47. package/dist/core/claude/claude-md-generator.js +104 -0
  48. package/dist/core/claude/claude-md-generator.js.map +1 -0
  49. package/dist/core/claude/claude-settings-manager.d.ts +44 -0
  50. package/dist/core/claude/claude-settings-manager.d.ts.map +1 -0
  51. package/dist/core/claude/claude-settings-manager.js +194 -0
  52. package/dist/core/claude/claude-settings-manager.js.map +1 -0
  53. package/dist/core/console/cli-bridge.d.ts +113 -0
  54. package/dist/core/console/cli-bridge.d.ts.map +1 -0
  55. package/dist/core/console/cli-bridge.js +1094 -0
  56. package/dist/core/console/cli-bridge.js.map +1 -0
  57. package/dist/core/detect/detector.d.ts +35 -0
  58. package/dist/core/detect/detector.d.ts.map +1 -0
  59. package/dist/core/detect/detector.js +541 -0
  60. package/dist/core/detect/detector.js.map +1 -0
  61. package/dist/core/docs/docs-generator.d.ts +9 -0
  62. package/dist/core/docs/docs-generator.d.ts.map +1 -0
  63. package/dist/core/docs/docs-generator.js +531 -0
  64. package/dist/core/docs/docs-generator.js.map +1 -0
  65. package/dist/core/docs/mcp-reference-generator.d.ts +13 -0
  66. package/dist/core/docs/mcp-reference-generator.d.ts.map +1 -0
  67. package/dist/core/docs/mcp-reference-generator.js +66 -0
  68. package/dist/core/docs/mcp-reference-generator.js.map +1 -0
  69. package/dist/core/generators/generator.d.ts +54 -0
  70. package/dist/core/generators/generator.d.ts.map +1 -0
  71. package/dist/core/generators/generator.js +1041 -0
  72. package/dist/core/generators/generator.js.map +1 -0
  73. package/dist/core/generators/gitignore-generator.d.ts +13 -0
  74. package/dist/core/generators/gitignore-generator.d.ts.map +1 -0
  75. package/dist/core/generators/gitignore-generator.js +307 -0
  76. package/dist/core/generators/gitignore-generator.js.map +1 -0
  77. package/dist/core/generators/minimal-scaffolder.d.ts +8 -0
  78. package/dist/core/generators/minimal-scaffolder.d.ts.map +1 -0
  79. package/dist/core/generators/minimal-scaffolder.js +51 -0
  80. package/dist/core/generators/minimal-scaffolder.js.map +1 -0
  81. package/dist/core/generators/rules-generator.d.ts +73 -0
  82. package/dist/core/generators/rules-generator.d.ts.map +1 -0
  83. package/dist/core/generators/rules-generator.js +202 -0
  84. package/dist/core/generators/rules-generator.js.map +1 -0
  85. package/dist/core/generators/workflow-generator.d.ts +15 -0
  86. package/dist/core/generators/workflow-generator.d.ts.map +1 -0
  87. package/dist/core/generators/workflow-generator.js +390 -0
  88. package/dist/core/generators/workflow-generator.js.map +1 -0
  89. package/dist/core/ide/multi-tool-generator.d.ts +59 -0
  90. package/dist/core/ide/multi-tool-generator.d.ts.map +1 -0
  91. package/dist/core/ide/multi-tool-generator.js +157 -0
  92. package/dist/core/ide/multi-tool-generator.js.map +1 -0
  93. package/dist/core/ide/opencode-generator.d.ts +72 -0
  94. package/dist/core/ide/opencode-generator.d.ts.map +1 -0
  95. package/dist/core/ide/opencode-generator.js +450 -0
  96. package/dist/core/ide/opencode-generator.js.map +1 -0
  97. package/dist/core/merger.d.ts +1 -1
  98. package/dist/core/merger.d.ts.map +1 -1
  99. package/dist/core/merger.js +5 -5
  100. package/dist/core/merger.js.map +1 -1
  101. package/dist/core/migrator.d.ts +0 -1
  102. package/dist/core/migrator.d.ts.map +1 -1
  103. package/dist/core/migrator.js +4 -29
  104. package/dist/core/migrator.js.map +1 -1
  105. package/dist/core/quality/coverage-checker.d.ts +14 -0
  106. package/dist/core/quality/coverage-checker.d.ts.map +1 -0
  107. package/dist/core/quality/coverage-checker.js +176 -0
  108. package/dist/core/quality/coverage-checker.js.map +1 -0
  109. package/dist/core/quality/dependency-checker.d.ts +21 -0
  110. package/dist/core/quality/dependency-checker.d.ts.map +1 -0
  111. package/dist/core/quality/dependency-checker.js +247 -0
  112. package/dist/core/quality/dependency-checker.js.map +1 -0
  113. package/dist/core/quality/doctor.d.ts +19 -0
  114. package/dist/core/quality/doctor.d.ts.map +1 -0
  115. package/dist/core/quality/doctor.js +163 -0
  116. package/dist/core/quality/doctor.js.map +1 -0
  117. package/dist/core/quality/validator.d.ts +21 -0
  118. package/dist/core/quality/validator.d.ts.map +1 -0
  119. package/dist/core/quality/validator.js +177 -0
  120. package/dist/core/quality/validator.js.map +1 -0
  121. package/dist/core/skills/skills-manager.d.ts +126 -0
  122. package/dist/core/skills/skills-manager.d.ts.map +1 -0
  123. package/dist/core/skills/skills-manager.js +630 -0
  124. package/dist/core/skills/skills-manager.js.map +1 -0
  125. package/dist/core/state/config-manager.d.ts +86 -0
  126. package/dist/core/state/config-manager.d.ts.map +1 -0
  127. package/dist/core/state/config-manager.js +562 -0
  128. package/dist/core/state/config-manager.js.map +1 -0
  129. package/dist/core/state/override-manager.d.ts +23 -0
  130. package/dist/core/state/override-manager.d.ts.map +1 -0
  131. package/dist/core/state/override-manager.js +82 -0
  132. package/dist/core/state/override-manager.js.map +1 -0
  133. package/dist/core/state/state-writer.d.ts +34 -0
  134. package/dist/core/state/state-writer.d.ts.map +1 -0
  135. package/dist/core/state/state-writer.js +78 -0
  136. package/dist/core/state/state-writer.js.map +1 -0
  137. package/dist/core/state/version-bumper.d.ts +19 -0
  138. package/dist/core/state/version-bumper.d.ts.map +1 -0
  139. package/dist/core/state/version-bumper.js +180 -0
  140. package/dist/core/state/version-bumper.js.map +1 -0
  141. package/dist/core/tasks/decision-manager.d.ts +25 -0
  142. package/dist/core/tasks/decision-manager.d.ts.map +1 -0
  143. package/dist/core/tasks/decision-manager.js +183 -0
  144. package/dist/core/tasks/decision-manager.js.map +1 -0
  145. package/dist/core/tasks/knowledge-manager.d.ts +24 -0
  146. package/dist/core/tasks/knowledge-manager.d.ts.map +1 -0
  147. package/dist/core/tasks/knowledge-manager.js +173 -0
  148. package/dist/core/tasks/knowledge-manager.js.map +1 -0
  149. package/dist/core/tasks/learn-manager.d.ts +27 -0
  150. package/dist/core/tasks/learn-manager.d.ts.map +1 -0
  151. package/dist/core/tasks/learn-manager.js +121 -0
  152. package/dist/core/tasks/learn-manager.js.map +1 -0
  153. package/dist/core/tasks/plans-manager.d.ts +46 -0
  154. package/dist/core/tasks/plans-manager.d.ts.map +1 -0
  155. package/dist/core/tasks/plans-manager.js +158 -0
  156. package/dist/core/tasks/plans-manager.js.map +1 -0
  157. package/dist/core/tasks/task-manager.d.ts +127 -0
  158. package/dist/core/tasks/task-manager.d.ts.map +1 -0
  159. package/dist/core/tasks/task-manager.js +607 -0
  160. package/dist/core/tasks/task-manager.js.map +1 -0
  161. package/dist/core/workspace/project-worker.d.ts +6 -6
  162. package/dist/core/workspace/project-worker.d.ts.map +1 -1
  163. package/dist/core/workspace/project-worker.js +6 -6
  164. package/dist/core/workspace/project-worker.js.map +1 -1
  165. package/dist/index.d.ts +1 -1
  166. package/dist/index.d.ts.map +1 -1
  167. package/dist/index.js +19 -176
  168. package/dist/index.js.map +1 -1
  169. package/dist/mcp/rulebook-server.d.ts.map +1 -1
  170. package/dist/mcp/rulebook-server.js +16 -960
  171. package/dist/mcp/rulebook-server.js.map +1 -1
  172. package/dist/memory/file-search.d.ts +43 -0
  173. package/dist/memory/file-search.d.ts.map +1 -0
  174. package/dist/memory/file-search.js +228 -0
  175. package/dist/memory/file-search.js.map +1 -0
  176. package/dist/memory/file-store.d.ts +99 -0
  177. package/dist/memory/file-store.d.ts.map +1 -0
  178. package/dist/memory/file-store.js +615 -0
  179. package/dist/memory/file-store.js.map +1 -0
  180. package/dist/memory/legacy-migrator.d.ts +27 -0
  181. package/dist/memory/legacy-migrator.d.ts.map +1 -0
  182. package/dist/memory/legacy-migrator.js +185 -0
  183. package/dist/memory/legacy-migrator.js.map +1 -0
  184. package/dist/memory/memory-manager.d.ts +25 -24
  185. package/dist/memory/memory-manager.d.ts.map +1 -1
  186. package/dist/memory/memory-manager.js +97 -140
  187. package/dist/memory/memory-manager.js.map +1 -1
  188. package/dist/memory/memory-types.d.ts +1 -1
  189. package/dist/memory/memory-types.d.ts.map +1 -1
  190. package/dist/types.d.ts +8 -119
  191. package/dist/types.d.ts.map +1 -1
  192. package/package.json +1 -6
  193. package/templates/agents/context-intelligence.md +50 -52
  194. package/templates/cli/OPENCODE.md +85 -18
  195. package/templates/commands/rulebook-learn-capture.md +41 -48
  196. package/templates/commands/rulebook-learn-list.md +13 -13
  197. package/templates/core/AGENTS_LEAN.md +0 -14
  198. package/templates/hooks/check-context-and-handoff.sh +8 -10
  199. package/templates/hooks/enforce-pre-tool.sh +70 -0
  200. package/templates/hooks/terse-mode-tracker.sh +146 -143
  201. package/templates/ides/OPENCODE.md +63 -0
  202. package/templates/skills/cli/opencode/SKILL.md +82 -28
  203. package/.claude/commands/ralph-config.md +0 -112
  204. package/.claude/commands/ralph-history.md +0 -110
  205. package/.claude/commands/ralph-init.md +0 -72
  206. package/.claude/commands/ralph-pause-resume.md +0 -105
  207. package/.claude/commands/ralph-run.md +0 -101
  208. package/.claude/commands/ralph-status.md +0 -76
  209. package/templates/core/RALPH.md +0 -471
  210. package/templates/frameworks/ANGULAR.md +0 -36
  211. package/templates/frameworks/DJANGO.md +0 -83
  212. package/templates/frameworks/ELECTRON.md +0 -147
  213. package/templates/frameworks/FLASK.md +0 -38
  214. package/templates/frameworks/FLUTTER.md +0 -55
  215. package/templates/frameworks/JQUERY.md +0 -32
  216. package/templates/frameworks/LARAVEL.md +0 -38
  217. package/templates/frameworks/NESTJS.md +0 -43
  218. package/templates/frameworks/NEXTJS.md +0 -127
  219. package/templates/frameworks/NUXT.md +0 -40
  220. package/templates/frameworks/RAILS.md +0 -66
  221. package/templates/frameworks/REACT.md +0 -38
  222. package/templates/frameworks/REACT_NATIVE.md +0 -47
  223. package/templates/frameworks/SPRING.md +0 -39
  224. package/templates/frameworks/SYMFONY.md +0 -36
  225. package/templates/frameworks/VUE.md +0 -36
  226. package/templates/frameworks/ZEND.md +0 -35
  227. package/templates/hooks/enforce-mcp-for-tasks.sh +0 -31
  228. package/templates/hooks/enforce-no-deferred.sh +0 -21
  229. package/templates/hooks/enforce-no-shortcuts.sh +0 -31
  230. package/templates/ides/COPILOT.md +0 -37
  231. package/templates/ides/CURSOR.md +0 -43
  232. package/templates/ides/JETBRAINS_AI.md +0 -35
  233. package/templates/ides/REPLIT.md +0 -36
  234. package/templates/ides/TABNINE.md +0 -29
  235. package/templates/ides/VSCODE.md +0 -40
  236. package/templates/ides/WINDSURF.md +0 -36
  237. package/templates/ides/ZED.md +0 -32
  238. package/templates/ides/cursor-mdc/go.mdc +0 -24
  239. package/templates/ides/cursor-mdc/python.mdc +0 -24
  240. package/templates/ides/cursor-mdc/quality.mdc +0 -25
  241. package/templates/ides/cursor-mdc/ralph.mdc +0 -39
  242. package/templates/ides/cursor-mdc/rulebook.mdc +0 -38
  243. package/templates/ides/cursor-mdc/rust.mdc +0 -24
  244. package/templates/ides/cursor-mdc/typescript.mdc +0 -25
  245. package/templates/ralph/ralph-history.bat +0 -4
  246. package/templates/ralph/ralph-history.sh +0 -5
  247. package/templates/ralph/ralph-init.bat +0 -5
  248. package/templates/ralph/ralph-init.sh +0 -5
  249. package/templates/ralph/ralph-pause.bat +0 -5
  250. package/templates/ralph/ralph-pause.sh +0 -5
  251. package/templates/ralph/ralph-run.bat +0 -5
  252. package/templates/ralph/ralph-run.sh +0 -5
  253. package/templates/ralph/ralph-status.bat +0 -4
  254. package/templates/ralph/ralph-status.sh +0 -5
  255. package/templates/services/AZURE_BLOB.md +0 -184
  256. package/templates/services/CASSANDRA.md +0 -239
  257. package/templates/services/DATADOG.md +0 -26
  258. package/templates/services/DOCKER.md +0 -124
  259. package/templates/services/DOCKER_COMPOSE.md +0 -168
  260. package/templates/services/DYNAMODB.md +0 -308
  261. package/templates/services/ELASTICSEARCH.md +0 -347
  262. package/templates/services/GCS.md +0 -178
  263. package/templates/services/HELM.md +0 -194
  264. package/templates/services/INFLUXDB.md +0 -265
  265. package/templates/services/KAFKA.md +0 -341
  266. package/templates/services/KUBERNETES.md +0 -208
  267. package/templates/services/MARIADB.md +0 -183
  268. package/templates/services/MEMCACHED.md +0 -242
  269. package/templates/services/MINIO.md +0 -201
  270. package/templates/services/MONGODB.md +0 -268
  271. package/templates/services/MYSQL.md +0 -358
  272. package/templates/services/NEO4J.md +0 -247
  273. package/templates/services/OPENTELEMETRY.md +0 -25
  274. package/templates/services/ORACLE.md +0 -290
  275. package/templates/services/PINO.md +0 -24
  276. package/templates/services/POSTGRESQL.md +0 -326
  277. package/templates/services/PROMETHEUS.md +0 -33
  278. package/templates/services/RABBITMQ.md +0 -286
  279. package/templates/services/REDIS.md +0 -292
  280. package/templates/services/S3.md +0 -298
  281. package/templates/services/SENTRY.md +0 -23
  282. package/templates/services/SQLITE.md +0 -294
  283. package/templates/services/SQLSERVER.md +0 -294
  284. package/templates/services/WINSTON.md +0 -30
  285. package/templates/skills/frameworks/angular/SKILL.md +0 -46
  286. package/templates/skills/frameworks/django/SKILL.md +0 -93
  287. package/templates/skills/frameworks/electron/SKILL.md +0 -157
  288. package/templates/skills/frameworks/flask/SKILL.md +0 -48
  289. package/templates/skills/frameworks/flutter/SKILL.md +0 -65
  290. package/templates/skills/frameworks/jquery/SKILL.md +0 -42
  291. package/templates/skills/frameworks/laravel/SKILL.md +0 -48
  292. package/templates/skills/frameworks/nestjs/SKILL.md +0 -53
  293. package/templates/skills/frameworks/nextjs/SKILL.md +0 -137
  294. package/templates/skills/frameworks/nuxt/SKILL.md +0 -50
  295. package/templates/skills/frameworks/rails/SKILL.md +0 -76
  296. package/templates/skills/frameworks/react/SKILL.md +0 -48
  297. package/templates/skills/frameworks/react-native/SKILL.md +0 -57
  298. package/templates/skills/frameworks/spring/SKILL.md +0 -49
  299. package/templates/skills/frameworks/symfony/SKILL.md +0 -46
  300. package/templates/skills/frameworks/vue/SKILL.md +0 -46
  301. package/templates/skills/frameworks/zend/SKILL.md +0 -45
  302. package/templates/skills/services/azure-blob/SKILL.md +0 -194
  303. package/templates/skills/services/cassandra/SKILL.md +0 -249
  304. package/templates/skills/services/dynamodb/SKILL.md +0 -318
  305. package/templates/skills/services/elasticsearch/SKILL.md +0 -357
  306. package/templates/skills/services/gcs/SKILL.md +0 -188
  307. package/templates/skills/services/influxdb/SKILL.md +0 -275
  308. package/templates/skills/services/kafka/SKILL.md +0 -351
  309. package/templates/skills/services/mariadb/SKILL.md +0 -193
  310. package/templates/skills/services/memcached/SKILL.md +0 -252
  311. package/templates/skills/services/minio/SKILL.md +0 -211
  312. package/templates/skills/services/mongodb/SKILL.md +0 -278
  313. package/templates/skills/services/mysql/SKILL.md +0 -368
  314. package/templates/skills/services/neo4j/SKILL.md +0 -257
  315. package/templates/skills/services/oracle/SKILL.md +0 -300
  316. package/templates/skills/services/postgresql/SKILL.md +0 -336
  317. package/templates/skills/services/rabbitmq/SKILL.md +0 -296
  318. package/templates/skills/services/redis/SKILL.md +0 -302
  319. package/templates/skills/services/s3/SKILL.md +0 -308
  320. package/templates/skills/services/sqlite/SKILL.md +0 -304
  321. package/templates/skills/services/sqlserver/SKILL.md +0 -304
  322. package/templates/skills/workflows/ralph/SETUP.md +0 -228
  323. package/templates/skills/workflows/ralph/SKILL.md +0 -309
  324. package/templates/skills/workflows/ralph/install.sh +0 -87
  325. package/templates/skills/workflows/ralph/manifest.json +0 -158
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Multi-Tool Config Generator
3
+ *
4
+ * Generates IDE/AI-tool configuration files for detected tools:
5
+ * - GEMINI.md for Gemini CLI
6
+ * - .continue/rules/RULEBOOK.md for Continue.dev
7
+ * - .windsurfrules for Windsurf IDE
8
+ * - .github/copilot-instructions.md for GitHub Copilot
9
+ *
10
+ * Each generator is idempotent: if the file already contains the
11
+ * RULEBOOK marker it gets updated; if it exists without the marker
12
+ * (user-owned file) it is skipped.
13
+ */
14
+ import type { DetectionResult } from '../../types.js';
15
+ /** Result of multi-tool config generation. Each field is the path written, or undefined if skipped. */
16
+ export interface MultiToolGeneratorResult {
17
+ geminiMd?: string;
18
+ continueRules?: string;
19
+ windsurfRules?: string;
20
+ copilotInstructions?: string;
21
+ }
22
+ /**
23
+ * Generate GEMINI.md in the project root for Gemini CLI.
24
+ *
25
+ * @param projectRoot - Absolute path to the project root.
26
+ * @returns The path written, or null if skipped.
27
+ */
28
+ export declare function generateGeminiMd(projectRoot: string): Promise<string | null>;
29
+ /**
30
+ * Generate .continue/rules/RULEBOOK.md for the Continue.dev IDE extension.
31
+ *
32
+ * @param projectRoot - Absolute path to the project root.
33
+ * @returns The path written, or null if skipped.
34
+ */
35
+ export declare function generateContinueRules(projectRoot: string): Promise<string | null>;
36
+ /**
37
+ * Generate .windsurfrules in the project root for Windsurf IDE.
38
+ *
39
+ * @param projectRoot - Absolute path to the project root.
40
+ * @returns The path written, or null if skipped.
41
+ */
42
+ export declare function generateWindsurfRules(projectRoot: string): Promise<string | null>;
43
+ /**
44
+ * Generate .github/copilot-instructions.md for GitHub Copilot.
45
+ *
46
+ * @param projectRoot - Absolute path to the project root.
47
+ * @returns The path written, or null if skipped.
48
+ */
49
+ export declare function generateCopilotInstructions(projectRoot: string): Promise<string | null>;
50
+ /**
51
+ * Generate configuration files for all detected AI tools.
52
+ * Only generates files for tools that are actually detected in the project.
53
+ *
54
+ * @param projectRoot - Absolute path to the project root.
55
+ * @param detection - The project detection result containing tool detection flags.
56
+ * @returns An object with paths of all generated files (undefined for skipped tools).
57
+ */
58
+ export declare function generateMultiToolConfigs(projectRoot: string, detection: DetectionResult): Promise<MultiToolGeneratorResult>;
59
+ //# sourceMappingURL=multi-tool-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-tool-generator.d.ts","sourceRoot":"","sources":["../../../src/core/ide/multi-tool-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAQtD,uGAAuG;AACvG,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAiDD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQlF;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQvF;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQvF;AAED;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ7F;AAED;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,eAAe,GACzB,OAAO,CAAC,wBAAwB,CAAC,CAgCnC"}
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Multi-Tool Config Generator
3
+ *
4
+ * Generates IDE/AI-tool configuration files for detected tools:
5
+ * - GEMINI.md for Gemini CLI
6
+ * - .continue/rules/RULEBOOK.md for Continue.dev
7
+ * - .windsurfrules for Windsurf IDE
8
+ * - .github/copilot-instructions.md for GitHub Copilot
9
+ *
10
+ * Each generator is idempotent: if the file already contains the
11
+ * RULEBOOK marker it gets updated; if it exists without the marker
12
+ * (user-owned file) it is skipped.
13
+ */
14
+ import path from 'path';
15
+ import { existsSync } from 'fs';
16
+ import { readFile, writeFile, mkdir } from 'fs/promises';
17
+ import { fileURLToPath } from 'url';
18
+ import { dirname } from 'path';
19
+ const __filename = fileURLToPath(import.meta.url);
20
+ const __dirname = dirname(__filename);
21
+ /** Marker used to identify rulebook-managed content in generated files. */
22
+ const RULEBOOK_MARKER = '<!-- RULEBOOK:START -->';
23
+ /**
24
+ * Resolve the templates/ides/ directory relative to the compiled dist/ output.
25
+ * Uses the same __dirname strategy as cursor-mdc-generator.ts.
26
+ */
27
+ function getTemplatesDir() {
28
+ return path.join(__dirname, '..', '..', '..', 'templates', 'ides');
29
+ }
30
+ /**
31
+ * Read a template file from templates/ides/.
32
+ * Returns the template content or null if the template does not exist.
33
+ */
34
+ async function readTemplate(templateName) {
35
+ const templatePath = path.join(getTemplatesDir(), templateName);
36
+ if (!existsSync(templatePath)) {
37
+ return null;
38
+ }
39
+ return readFile(templatePath, 'utf-8');
40
+ }
41
+ /**
42
+ * Write content to a destination file following the idempotent pattern:
43
+ * - If the file does not exist, create it with the template content.
44
+ * - If the file exists and contains the RULEBOOK marker, update it.
45
+ * - If the file exists without the marker (user-owned), skip and return null.
46
+ *
47
+ * Returns the absolute path written, or null if skipped.
48
+ */
49
+ async function writeIdempotent(destPath, content) {
50
+ if (existsSync(destPath)) {
51
+ const existing = await readFile(destPath, 'utf-8');
52
+ if (!existing.includes(RULEBOOK_MARKER)) {
53
+ // User-owned file — do not overwrite
54
+ return null;
55
+ }
56
+ }
57
+ // Ensure the parent directory exists
58
+ const parentDir = path.dirname(destPath);
59
+ if (!existsSync(parentDir)) {
60
+ await mkdir(parentDir, { recursive: true });
61
+ }
62
+ await writeFile(destPath, content, 'utf-8');
63
+ return destPath;
64
+ }
65
+ /**
66
+ * Generate GEMINI.md in the project root for Gemini CLI.
67
+ *
68
+ * @param projectRoot - Absolute path to the project root.
69
+ * @returns The path written, or null if skipped.
70
+ */
71
+ export async function generateGeminiMd(projectRoot) {
72
+ const template = await readTemplate('GEMINI_RULES.md');
73
+ if (!template) {
74
+ return null;
75
+ }
76
+ const destPath = path.join(projectRoot, 'GEMINI.md');
77
+ return writeIdempotent(destPath, template);
78
+ }
79
+ /**
80
+ * Generate .continue/rules/RULEBOOK.md for the Continue.dev IDE extension.
81
+ *
82
+ * @param projectRoot - Absolute path to the project root.
83
+ * @returns The path written, or null if skipped.
84
+ */
85
+ export async function generateContinueRules(projectRoot) {
86
+ const template = await readTemplate('CONTINUE_RULES.md');
87
+ if (!template) {
88
+ return null;
89
+ }
90
+ const destPath = path.join(projectRoot, '.continue', 'rules', 'RULEBOOK.md');
91
+ return writeIdempotent(destPath, template);
92
+ }
93
+ /**
94
+ * Generate .windsurfrules in the project root for Windsurf IDE.
95
+ *
96
+ * @param projectRoot - Absolute path to the project root.
97
+ * @returns The path written, or null if skipped.
98
+ */
99
+ export async function generateWindsurfRules(projectRoot) {
100
+ const template = await readTemplate('WINDSURF_RULES.md');
101
+ if (!template) {
102
+ return null;
103
+ }
104
+ const destPath = path.join(projectRoot, '.windsurfrules');
105
+ return writeIdempotent(destPath, template);
106
+ }
107
+ /**
108
+ * Generate .github/copilot-instructions.md for GitHub Copilot.
109
+ *
110
+ * @param projectRoot - Absolute path to the project root.
111
+ * @returns The path written, or null if skipped.
112
+ */
113
+ export async function generateCopilotInstructions(projectRoot) {
114
+ const template = await readTemplate('COPILOT_INSTRUCTIONS.md');
115
+ if (!template) {
116
+ return null;
117
+ }
118
+ const destPath = path.join(projectRoot, '.github', 'copilot-instructions.md');
119
+ return writeIdempotent(destPath, template);
120
+ }
121
+ /**
122
+ * Generate configuration files for all detected AI tools.
123
+ * Only generates files for tools that are actually detected in the project.
124
+ *
125
+ * @param projectRoot - Absolute path to the project root.
126
+ * @param detection - The project detection result containing tool detection flags.
127
+ * @returns An object with paths of all generated files (undefined for skipped tools).
128
+ */
129
+ export async function generateMultiToolConfigs(projectRoot, detection) {
130
+ const result = {};
131
+ if (detection.geminiCli?.detected) {
132
+ const written = await generateGeminiMd(projectRoot);
133
+ if (written) {
134
+ result.geminiMd = written;
135
+ }
136
+ }
137
+ if (detection.continueDev?.detected) {
138
+ const written = await generateContinueRules(projectRoot);
139
+ if (written) {
140
+ result.continueRules = written;
141
+ }
142
+ }
143
+ if (detection.windsurf?.detected) {
144
+ const written = await generateWindsurfRules(projectRoot);
145
+ if (written) {
146
+ result.windsurfRules = written;
147
+ }
148
+ }
149
+ if (detection.githubCopilot?.detected) {
150
+ const written = await generateCopilotInstructions(projectRoot);
151
+ if (written) {
152
+ result.copilotInstructions = written;
153
+ }
154
+ }
155
+ return result;
156
+ }
157
+ //# sourceMappingURL=multi-tool-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-tool-generator.js","sourceRoot":"","sources":["../../../src/core/ide/multi-tool-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,2EAA2E;AAC3E,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAUlD;;;GAGG;AACH,SAAS,eAAe;IACtB,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;AACrE,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,YAAY,CAAC,YAAoB;IAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,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AC;QAClC,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACpD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,IAAI,SAAS,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,WAAW,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC;QACjC,CAAC;IACH,CAAC;IAED,IAAI,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,WAAW,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,aAAa,GAAG,OAAO,CAAC;QACjC,CAAC;IACH,CAAC;IAED,IAAI,SAAS,CAAC,aAAa,EAAE,QAAQ,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,MAAM,2BAA2B,CAAC,WAAW,CAAC,CAAC;QAC/D,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,CAAC,mBAAmB,GAAG,OAAO,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * OpenCode Integration Generator
3
+ *
4
+ * Generates the OpenCode-specific surface area for a Rulebook-managed project:
5
+ * - opencode.json with $schema, mcp.rulebook, and instructions
6
+ * - .opencode/commands/<name>.md mirroring user-invocable Rulebook slash commands
7
+ * - .opencode/agents/<role>.md mirroring Rulebook role agents
8
+ * - .opencode/skills/<name>/SKILL.md normalized to OpenCode's frontmatter schema
9
+ * - .opencode/.rulebook-managed.json listing managed keys for safe future updates
10
+ *
11
+ * Idempotency: every generator preserves user-owned files. A managed file is
12
+ * identified by either the `<!-- RULEBOOK:START -->` marker (markdown) or by
13
+ * the `_rulebook_managed: true` JSON key (managed-keys file).
14
+ */
15
+ import type { DetectionResult } from '../../types.js';
16
+ export interface OpencodeGenerationResult {
17
+ configPath?: string;
18
+ managedKeysPath?: string;
19
+ commands: string[];
20
+ agents: string[];
21
+ skills: string[];
22
+ preserved: string[];
23
+ }
24
+ /**
25
+ * Generate or update opencode.json with $schema, mcp.rulebook, and
26
+ * instructions. Preserves all unrelated user keys. Writes a sibling
27
+ * .opencode/.rulebook-managed.json listing the managed keys so future runs
28
+ * know what may be safely refreshed.
29
+ */
30
+ export declare function generateOpencodeConfig(projectRoot: string, _detection?: DetectionResult): Promise<{
31
+ configPath: string;
32
+ managedKeysPath: string;
33
+ }>;
34
+ /**
35
+ * Generate .opencode/commands/<name>.md from each user-invocable Rulebook
36
+ * slash-command template under templates/commands/.
37
+ */
38
+ export declare function generateOpencodeCommands(projectRoot: string): Promise<{
39
+ written: string[];
40
+ preserved: string[];
41
+ }>;
42
+ /**
43
+ * Generate .opencode/agents/<role>.md from each Rulebook role agent.
44
+ * Sources are templates/agents/<role>.md; we emit one OpenCode agent per
45
+ * source role.
46
+ */
47
+ export declare function generateOpencodeAgents(projectRoot: string): Promise<{
48
+ written: string[];
49
+ preserved: string[];
50
+ }>;
51
+ /**
52
+ * Normalize a skill name to OpenCode's regex `[a-z0-9](-[a-z0-9])*` with a
53
+ * 64-char limit. Sequences of non-alphanumerics collapse into single hyphens
54
+ * and any leading/trailing hyphens are stripped.
55
+ */
56
+ export declare function normalizeOpencodeSkillName(raw: string): string;
57
+ /**
58
+ * Generate .opencode/skills/<normalized-name>/SKILL.md for every dev skill
59
+ * under templates/skills/dev/. Throws on a name collision so two source
60
+ * skills never silently overwrite each other.
61
+ */
62
+ export declare function generateOpencodeSkills(projectRoot: string): Promise<{
63
+ written: string[];
64
+ preserved: string[];
65
+ orphaned: string[];
66
+ }>;
67
+ /**
68
+ * Run all four OpenCode generators in sequence and aggregate the results.
69
+ * This is the entry point used by `init` and `update`.
70
+ */
71
+ export declare function generateOpencodeIntegration(projectRoot: string, detection?: DetectionResult): Promise<OpencodeGenerationResult>;
72
+ //# sourceMappingURL=opencode-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode-generator.d.ts","sourceRoot":"","sources":["../../../src/core/ide/opencode-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAoDtD,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AA8FD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,eAAe,GAC3B,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC,CAwC1D;AAyFD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAoCrD;AA4BD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAgCrD;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK9D;AAWD;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,GACl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