@bonesofspring/ai-rules 0.2.23 → 0.2.24

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 (285) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +5 -1
  3. package/bin/cli.js +32 -9
  4. package/bin/opencode-install.js +531 -0
  5. package/package.json +10 -3
  6. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +2 -2
  7. package/presets/_shared/core/meta/preset-layering.md +3 -3
  8. package/presets/_shared/core/meta/preset-no-cross-stack-leakage.md +1 -1
  9. package/presets/_shared/core/meta/preset-pr-checklist.md +4 -3
  10. package/presets/_shared/core/meta/preset-token-budget.md +3 -0
  11. package/presets/_shared/core/meta/preset-twin-sync.md +16 -0
  12. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-layering.md +3 -3
  13. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  14. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  15. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-token-budget.md +3 -0
  16. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +16 -0
  17. package/presets/claude/go/rules/tooling-and-review/preset-layering.md +3 -3
  18. package/presets/claude/go/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  19. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  20. package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +3 -0
  21. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +16 -0
  22. package/presets/claude/ios-swift/rules/tooling-and-review/preset-layering.md +3 -3
  23. package/presets/claude/ios-swift/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  24. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  25. package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +3 -0
  26. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +16 -0
  27. package/presets/claude/java/rules/tooling-and-review/preset-layering.md +3 -3
  28. package/presets/claude/java/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  29. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  30. package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +3 -0
  31. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +16 -0
  32. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-layering.md +3 -3
  33. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  34. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  35. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-token-budget.md +3 -0
  36. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +16 -0
  37. package/presets/claude/next/REPO_AGENTS.md +10 -5
  38. package/presets/claude/next/agents/build-verifier.md +3 -1
  39. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +1 -1
  40. package/presets/claude/next/rules/tooling-and-review/preset-layering.md +3 -3
  41. package/presets/claude/next/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  42. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  43. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +3 -0
  44. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +16 -0
  45. package/presets/claude/nuxt/rules/tooling-and-review/preset-layering.md +3 -3
  46. package/presets/claude/nuxt/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  47. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  48. package/presets/claude/nuxt/rules/tooling-and-review/preset-token-budget.md +3 -0
  49. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +16 -0
  50. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-layering.md +3 -3
  51. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  52. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  53. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-token-budget.md +3 -0
  54. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +16 -0
  55. package/presets/claude/php-laravel/rules/tooling-and-review/preset-layering.md +3 -3
  56. package/presets/claude/php-laravel/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  57. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  58. package/presets/claude/php-laravel/rules/tooling-and-review/preset-token-budget.md +3 -0
  59. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +16 -0
  60. package/presets/claude/svelte/rules/tooling-and-review/preset-layering.md +3 -3
  61. package/presets/claude/svelte/rules/tooling-and-review/preset-no-cross-stack-leakage.md +1 -1
  62. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +4 -3
  63. package/presets/claude/svelte/rules/tooling-and-review/preset-token-budget.md +3 -0
  64. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +16 -0
  65. package/presets/cursor/android-kotlin/rules/preset-layering.mdc +3 -3
  66. package/presets/cursor/android-kotlin/rules/preset-no-cross-stack-leakage.mdc +1 -1
  67. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +4 -3
  68. package/presets/cursor/android-kotlin/rules/preset-token-budget.mdc +3 -0
  69. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +16 -0
  70. package/presets/cursor/go/rules/preset-layering.mdc +3 -3
  71. package/presets/cursor/go/rules/preset-no-cross-stack-leakage.mdc +1 -1
  72. package/presets/cursor/go/rules/preset-pr-checklist.mdc +4 -3
  73. package/presets/cursor/go/rules/preset-token-budget.mdc +3 -0
  74. package/presets/cursor/go/rules/preset-twin-sync.mdc +16 -0
  75. package/presets/cursor/ios-swift/rules/preset-layering.mdc +3 -3
  76. package/presets/cursor/ios-swift/rules/preset-no-cross-stack-leakage.mdc +1 -1
  77. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +4 -3
  78. package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +3 -0
  79. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +16 -0
  80. package/presets/cursor/java/rules/preset-layering.mdc +3 -3
  81. package/presets/cursor/java/rules/preset-no-cross-stack-leakage.mdc +1 -1
  82. package/presets/cursor/java/rules/preset-pr-checklist.mdc +4 -3
  83. package/presets/cursor/java/rules/preset-token-budget.mdc +3 -0
  84. package/presets/cursor/java/rules/preset-twin-sync.mdc +16 -0
  85. package/presets/cursor/mcp-ts/rules/preset-layering.mdc +3 -3
  86. package/presets/cursor/mcp-ts/rules/preset-no-cross-stack-leakage.mdc +1 -1
  87. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +4 -3
  88. package/presets/cursor/mcp-ts/rules/preset-token-budget.mdc +3 -0
  89. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +16 -0
  90. package/presets/cursor/next/REPO_AGENTS.md +10 -5
  91. package/presets/cursor/next/agents/build-verifier.md +3 -1
  92. package/presets/cursor/next/rules/ai-local-overlay.mdc +1 -1
  93. package/presets/cursor/next/rules/preset-layering.mdc +3 -3
  94. package/presets/cursor/next/rules/preset-no-cross-stack-leakage.mdc +1 -1
  95. package/presets/cursor/next/rules/preset-pr-checklist.mdc +4 -3
  96. package/presets/cursor/next/rules/preset-token-budget.mdc +3 -0
  97. package/presets/cursor/next/rules/preset-twin-sync.mdc +16 -0
  98. package/presets/cursor/nuxt/rules/preset-layering.mdc +3 -3
  99. package/presets/cursor/nuxt/rules/preset-no-cross-stack-leakage.mdc +1 -1
  100. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +4 -3
  101. package/presets/cursor/nuxt/rules/preset-token-budget.mdc +3 -0
  102. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +16 -0
  103. package/presets/cursor/php-hexagonal/rules/preset-layering.mdc +3 -3
  104. package/presets/cursor/php-hexagonal/rules/preset-no-cross-stack-leakage.mdc +1 -1
  105. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +4 -3
  106. package/presets/cursor/php-hexagonal/rules/preset-token-budget.mdc +3 -0
  107. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +16 -0
  108. package/presets/cursor/php-laravel/rules/preset-layering.mdc +3 -3
  109. package/presets/cursor/php-laravel/rules/preset-no-cross-stack-leakage.mdc +1 -1
  110. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +4 -3
  111. package/presets/cursor/php-laravel/rules/preset-token-budget.mdc +3 -0
  112. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +16 -0
  113. package/presets/cursor/svelte/rules/preset-layering.mdc +3 -3
  114. package/presets/cursor/svelte/rules/preset-no-cross-stack-leakage.mdc +1 -1
  115. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +4 -3
  116. package/presets/cursor/svelte/rules/preset-token-budget.mdc +3 -0
  117. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +16 -0
  118. package/presets/mavis/next/REPO_AGENTS.md +9 -7
  119. package/presets/mavis/next/adapter-map.json +1 -1
  120. package/presets/mavis/next/agents/build-verifier.md +3 -1
  121. package/presets/mavis/next/rules/agent-team-orchestrator.md +2 -2
  122. package/presets/mavis/next/rules/ai-local-overlay.md +1 -1
  123. package/presets/mavis/next/rules/preset-layering.md +3 -3
  124. package/presets/mavis/next/rules/preset-no-cross-stack-leakage.md +1 -1
  125. package/presets/mavis/next/rules/preset-pr-checklist.md +4 -3
  126. package/presets/mavis/next/rules/preset-token-budget.md +3 -0
  127. package/presets/mavis/next/rules/preset-twin-sync.md +16 -0
  128. package/presets/opencode/README.md +61 -0
  129. package/presets/opencode/next/MCP.md +36 -0
  130. package/presets/opencode/next/OPENCODE.md +65 -0
  131. package/presets/opencode/next/README.md +16 -0
  132. package/presets/opencode/next/REPO_AGENTS.md +97 -0
  133. package/presets/opencode/next/adapter-map.json +959 -0
  134. package/presets/opencode/next/agents/README.md +201 -0
  135. package/presets/opencode/next/agents/accessibility-reviewer.md +73 -0
  136. package/presets/opencode/next/agents/api-contract-reviewer.md +69 -0
  137. package/presets/opencode/next/agents/build-verifier.md +124 -0
  138. package/presets/opencode/next/agents/ci-investigator.md +71 -0
  139. package/presets/opencode/next/agents/code-reviewer.md +73 -0
  140. package/presets/opencode/next/agents/codebase-analyzer.md +33 -0
  141. package/presets/opencode/next/agents/debugger.md +88 -0
  142. package/presets/opencode/next/agents/feature-developer.md +109 -0
  143. package/presets/opencode/next/agents/migration-specialist.md +79 -0
  144. package/presets/opencode/next/agents/mockup-reviewer.md +65 -0
  145. package/presets/opencode/next/agents/openspec-author.md +169 -0
  146. package/presets/opencode/next/agents/performance-auditor.md +80 -0
  147. package/presets/opencode/next/agents/playwright-test-generator.md +36 -0
  148. package/presets/opencode/next/agents/playwright-test-healer.md +36 -0
  149. package/presets/opencode/next/agents/playwright-test-planner.md +33 -0
  150. package/presets/opencode/next/agents/qa-tester.md +60 -0
  151. package/presets/opencode/next/agents/security-reviewer.md +66 -0
  152. package/presets/opencode/next/agents/solution-architect.md +80 -0
  153. package/presets/opencode/next/agents/task-analyst.md +178 -0
  154. package/presets/opencode/next/agents/task-router.md +190 -0
  155. package/presets/opencode/next/agents/tech-writer.md +69 -0
  156. package/presets/opencode/next/agents/unit-test-generator.md +39 -0
  157. package/presets/opencode/next/agents/unit-test-healer.md +40 -0
  158. package/presets/opencode/next/agents/unit-test-planner.md +66 -0
  159. package/presets/opencode/next/commands/README.md +49 -0
  160. package/presets/opencode/next/commands/spec-start.md +32 -0
  161. package/presets/opencode/next/commands/task-continue.md +58 -0
  162. package/presets/opencode/next/commands/task.md +58 -0
  163. package/presets/opencode/next/commands/technical-retro.md +88 -0
  164. package/presets/opencode/next/hooks/README.md +22 -0
  165. package/presets/opencode/next/hooks/chain-team-phases.sh +845 -0
  166. package/presets/opencode/next/opencode.json +33 -0
  167. package/presets/opencode/next/rules/README.md +20 -0
  168. package/presets/opencode/next/rules/agent-team-intake.md +11 -0
  169. package/presets/opencode/next/rules/agent-team-orchestrator.md +214 -0
  170. package/presets/opencode/next/rules/ai-local-overlay.md +37 -0
  171. package/presets/opencode/next/rules/anti-sycophancy-discipline.md +23 -0
  172. package/presets/opencode/next/rules/api-services.md +72 -0
  173. package/presets/opencode/next/rules/architecture-boundaries-ui.md +9 -0
  174. package/presets/opencode/next/rules/architecture-boundaries.md +86 -0
  175. package/presets/opencode/next/rules/arrow-functions.md +25 -0
  176. package/presets/opencode/next/rules/code-quality-and-refactoring.md +40 -0
  177. package/presets/opencode/next/rules/code-review-mr.md +40 -0
  178. package/presets/opencode/next/rules/css-property-order-stylelint.md +5 -0
  179. package/presets/opencode/next/rules/design-guidance.md +99 -0
  180. package/presets/opencode/next/rules/feature-delivery-workflow.md +49 -0
  181. package/presets/opencode/next/rules/http-client.md +55 -0
  182. package/presets/opencode/next/rules/layer-barrel-exports.md +68 -0
  183. package/presets/opencode/next/rules/mcp-usage.md +86 -0
  184. package/presets/opencode/next/rules/mockup-review.md +107 -0
  185. package/presets/opencode/next/rules/navigation-router-stack.md +56 -0
  186. package/presets/opencode/next/rules/navigation-router-ui.md +10 -0
  187. package/presets/opencode/next/rules/next-app-core.md +29 -0
  188. package/presets/opencode/next/rules/next-app-router.md +44 -0
  189. package/presets/opencode/next/rules/no-props-spread.md +56 -0
  190. package/presets/opencode/next/rules/no-type-assertion-as-import-export.md +51 -0
  191. package/presets/opencode/next/rules/package-manager.md +11 -0
  192. package/presets/opencode/next/rules/playwright-agents.md +67 -0
  193. package/presets/opencode/next/rules/post-change-lint.md +35 -0
  194. package/presets/opencode/next/rules/preset-layering.md +27 -0
  195. package/presets/opencode/next/rules/preset-no-cross-stack-leakage.md +90 -0
  196. package/presets/opencode/next/rules/preset-pr-checklist.md +36 -0
  197. package/presets/opencode/next/rules/preset-token-budget.md +39 -0
  198. package/presets/opencode/next/rules/preset-twin-sync.md +81 -0
  199. package/presets/opencode/next/rules/product-specs-authoring.md +112 -0
  200. package/presets/opencode/next/rules/product-specs.md +56 -0
  201. package/presets/opencode/next/rules/public-imports.md +50 -0
  202. package/presets/opencode/next/rules/react-a11y-coding.md +31 -0
  203. package/presets/opencode/next/rules/react-next-anti-hallucination.md +60 -0
  204. package/presets/opencode/next/rules/react-ui.md +105 -0
  205. package/presets/opencode/next/rules/reference-features.md +45 -0
  206. package/presets/opencode/next/rules/security-next.md +45 -0
  207. package/presets/opencode/next/rules/store-rtk.md +78 -0
  208. package/presets/opencode/next/rules/technical-retro.md +11 -0
  209. package/presets/opencode/next/rules/tests-e2e-structure.md +72 -0
  210. package/presets/opencode/next/rules/tests-unit.md +72 -0
  211. package/presets/opencode/next/rules/types-jsdoc.md +43 -0
  212. package/presets/opencode/next/rules/ux-design.md +99 -0
  213. package/presets/opencode/next/skills/README.md +21 -0
  214. package/presets/opencode/next/skills/ci-investigation/SKILL.md +44 -0
  215. package/presets/opencode/next/skills/code-review/SKILL.md +44 -0
  216. package/presets/opencode/next/skills/debug-investigation/SKILL.md +59 -0
  217. package/presets/opencode/next/skills/feature-delivery/SKILL.md +39 -0
  218. package/presets/opencode/next/skills/mockup-review/SKILL.md +29 -0
  219. package/presets/opencode/next/skills/playwright-e2e/SKILL.md +33 -0
  220. package/presets/opencode/next/skills/react-performance/SKILL.md +44 -0
  221. package/presets/opencode/next/skills/spec-authoring/SKILL.md +26 -0
  222. package/presets/opencode/next/skills/spec-discovery/SKILL.md +58 -0
  223. package/presets/opencode/next/skills/technical-retro/SKILL.md +54 -0
  224. package/presets/opencode/next/skills/unit-testing/SKILL.md +34 -0
  225. package/presets/opencode/next/skills/ux-design/SKILL.md +36 -0
  226. package/presets/opencode/next/skills/write-adr/SKILL.md +41 -0
  227. package/presets/opencode/next/team/README.md +148 -0
  228. package/presets/opencode/next/team/conventions.md +21 -0
  229. package/presets/opencode/next/team/fixtures/artifact-manifest.example.json +79 -0
  230. package/presets/opencode/next/team/fixtures/bugfix-standard.json +25 -0
  231. package/presets/opencode/next/team/fixtures/feature-full.json +29 -0
  232. package/presets/opencode/next/team/fixtures/feature-light.json +27 -0
  233. package/presets/opencode/next/team/fixtures/feature-with-figma-url.json +17 -0
  234. package/presets/opencode/next/team/fixtures/feature-with-ux-no-figma.json +17 -0
  235. package/presets/opencode/next/team/fixtures/memlog.example.md +9 -0
  236. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/human-gate/metrics.json +69 -0
  237. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/missing-ledger/status.json +5 -0
  238. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/parallel-receipts/metrics.json +79 -0
  239. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/serial-retry/metrics.json +124 -0
  240. package/presets/opencode/next/team/fixtures/metrics-scenarios/tasks/validation-failed/metrics.json +124 -0
  241. package/presets/opencode/next/team/fixtures/metrics.example.json +54 -0
  242. package/presets/opencode/next/team/fixtures/mockup-review-fail-embedded-status.json +8 -0
  243. package/presets/opencode/next/team/fixtures/mockup-review-standalone.json +14 -0
  244. package/presets/opencode/next/team/fixtures/ux-design-standalone.json +15 -0
  245. package/presets/opencode/next/team/tasks/.gitkeep +0 -0
  246. package/presets/opencode/platform-contract.json +131 -0
  247. package/scripts/capture-cli-golden.mjs +5 -1
  248. package/scripts/check-chain-hook-coverage.sh +1 -0
  249. package/scripts/check-opencode-adapter-map.mjs +294 -0
  250. package/scripts/check-opencode-local-overlay.mjs +56 -0
  251. package/scripts/check-opencode-platform-contract.mjs +388 -0
  252. package/scripts/check-opencode-token-budget.mjs +48 -0
  253. package/scripts/check-preset-leakage.sh +30 -1
  254. package/scripts/check-preset-structure.sh +45 -0
  255. package/scripts/check-task-router-intents.sh +4 -4
  256. package/scripts/fixtures/cli-golden/claude/next.json +8 -8
  257. package/scripts/fixtures/cli-golden/cursor/next.json +8 -8
  258. package/scripts/fixtures/cli-golden/mavis/next.json +9 -9
  259. package/scripts/fixtures/cli-golden/opencode/next.json +125 -0
  260. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/cursor/AGENTS.md +1 -0
  261. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/cursor/rules/extra.mdc +1 -0
  262. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/cursor/rules/sample.mdc +2 -0
  263. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/opencode/OPENCODE.md +1 -0
  264. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/opencode/adapter-map.json +26 -0
  265. package/scripts/fixtures/opencode-adapter-map/invalid-unmapped/opencode/rules/sample.md +2 -0
  266. package/scripts/fixtures/opencode-adapter-map/valid/cursor/AGENTS.md +1 -0
  267. package/scripts/fixtures/opencode-adapter-map/valid/cursor/rules/sample.mdc +2 -0
  268. package/scripts/fixtures/opencode-adapter-map/valid/opencode/OPENCODE.md +1 -0
  269. package/scripts/fixtures/opencode-adapter-map/valid/opencode/adapter-map.json +26 -0
  270. package/scripts/fixtures/opencode-adapter-map/valid/opencode/rules/sample.md +2 -0
  271. package/scripts/fixtures/opencode-platform-contract/invalid-home-destination.json +131 -0
  272. package/scripts/fixtures/opencode-platform-contract/invalid-missing-capability.json +126 -0
  273. package/scripts/fixtures/opencode-platform-contract/invalid-released-unknown-stack.json +133 -0
  274. package/scripts/fixtures/opencode-platform-contract/invalid-unknown-native-path.json +131 -0
  275. package/scripts/fixtures/opencode-platform-contract/invalid-version-pin.json +132 -0
  276. package/scripts/fixtures/opencode-platform-contract/valid.json +131 -0
  277. package/scripts/generate-mavis-next.mjs +9 -7
  278. package/scripts/generate-opencode-next.mjs +831 -0
  279. package/scripts/lib/discover-hooks.mjs +23 -1
  280. package/scripts/sync-dogfood-mavis.sh +90 -0
  281. package/scripts/sync-dogfood-opencode.sh +85 -0
  282. package/scripts/test-agent-task-metrics-hooks.mjs +4 -1
  283. package/scripts/test-chain-team-phases-coverage.mjs +6 -1
  284. package/scripts/test-cli-init-clean.mjs +111 -0
  285. package/scripts/test-opencode-context-budget.mjs +53 -0
@@ -0,0 +1,133 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "opencode",
4
+ "runtimeExecutable": "opencode",
5
+ "sourceRoot": "presets/opencode",
6
+ "managedRoot": ".opencode",
7
+ "releasedStacks": [
8
+ "not-a-stack"
9
+ ],
10
+ "entryFiles": [
11
+ {
12
+ "source": "REPO_AGENTS.md",
13
+ "destination": "AGENTS.md"
14
+ },
15
+ {
16
+ "source": "OPENCODE.md",
17
+ "destination": ".opencode/AGENTS.md"
18
+ }
19
+ ],
20
+ "directoryMappings": [
21
+ {
22
+ "source": "rules",
23
+ "destination": ".opencode/rules"
24
+ },
25
+ {
26
+ "source": "agents",
27
+ "destination": ".opencode/agents"
28
+ },
29
+ {
30
+ "source": "skills",
31
+ "destination": ".opencode/skills"
32
+ },
33
+ {
34
+ "source": "commands",
35
+ "destination": ".opencode/commands"
36
+ },
37
+ {
38
+ "source": "hooks",
39
+ "destination": ".opencode/hooks"
40
+ },
41
+ {
42
+ "source": "team",
43
+ "destination": ".opencode/team"
44
+ }
45
+ ],
46
+ "mcp": {
47
+ "source": "opencode.json",
48
+ "fallbackDestination": "opencode.json",
49
+ "mode": "merge-opencode-json"
50
+ },
51
+ "docsSeed": {
52
+ "source": "presets/_shared/assets/docs-specs",
53
+ "behavior": "absent-only"
54
+ },
55
+ "cleanStrategy": "manifest-owned",
56
+ "nativeCapabilities": {
57
+ "cliVersion": {
58
+ "status": "unknown",
59
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
60
+ "nativePath": null
61
+ },
62
+ "rootAgents": {
63
+ "status": "confirmed",
64
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
65
+ "nativePath": "AGENTS.md"
66
+ },
67
+ "explicitAgentFile": {
68
+ "status": "confirmed",
69
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
70
+ "nativePath": ".opencode/agents"
71
+ },
72
+ "structuredOutput": {
73
+ "status": "unknown",
74
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
75
+ "nativePath": null
76
+ },
77
+ "referencedRule": {
78
+ "status": "confirmed",
79
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
80
+ "nativePath": "AGENTS.md"
81
+ },
82
+ "referencedSkill": {
83
+ "status": "confirmed",
84
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
85
+ "nativePath": ".opencode/skills"
86
+ },
87
+ "freshInit": {
88
+ "status": "unknown",
89
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
90
+ "nativePath": null
91
+ },
92
+ "nativeProjectRules": {
93
+ "status": "no-equivalent",
94
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
95
+ "nativePath": null
96
+ },
97
+ "nativeWorkspaceSkills": {
98
+ "status": "confirmed",
99
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
100
+ "nativePath": ".opencode/skills"
101
+ },
102
+ "nativeWorkspaceAgents": {
103
+ "status": "confirmed",
104
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
105
+ "nativePath": ".opencode/agents"
106
+ },
107
+ "projectMcp": {
108
+ "status": "confirmed",
109
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
110
+ "nativePath": "opencode.json"
111
+ },
112
+ "projectHooks": {
113
+ "status": "unknown",
114
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
115
+ "nativePath": null
116
+ },
117
+ "slashCommands": {
118
+ "status": "confirmed",
119
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
120
+ "nativePath": ".opencode/commands"
121
+ },
122
+ "pluginSkillMcp": {
123
+ "status": "confirmed",
124
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
125
+ "nativePath": "opencode.json"
126
+ },
127
+ "nativeTeam": {
128
+ "status": "partial",
129
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
130
+ "nativePath": ".opencode/team"
131
+ }
132
+ }
133
+ }
@@ -0,0 +1,131 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "opencode",
4
+ "runtimeExecutable": "opencode",
5
+ "sourceRoot": "presets/opencode",
6
+ "managedRoot": ".opencode",
7
+ "releasedStacks": [],
8
+ "entryFiles": [
9
+ {
10
+ "source": "REPO_AGENTS.md",
11
+ "destination": "AGENTS.md"
12
+ },
13
+ {
14
+ "source": "OPENCODE.md",
15
+ "destination": ".opencode/AGENTS.md"
16
+ }
17
+ ],
18
+ "directoryMappings": [
19
+ {
20
+ "source": "rules",
21
+ "destination": ".opencode/rules"
22
+ },
23
+ {
24
+ "source": "agents",
25
+ "destination": ".opencode/agents"
26
+ },
27
+ {
28
+ "source": "skills",
29
+ "destination": ".opencode/skills"
30
+ },
31
+ {
32
+ "source": "commands",
33
+ "destination": ".opencode/commands"
34
+ },
35
+ {
36
+ "source": "hooks",
37
+ "destination": ".opencode/hooks"
38
+ },
39
+ {
40
+ "source": "team",
41
+ "destination": ".opencode/team"
42
+ }
43
+ ],
44
+ "mcp": {
45
+ "source": "opencode.json",
46
+ "fallbackDestination": "opencode.json",
47
+ "mode": "merge-opencode-json"
48
+ },
49
+ "docsSeed": {
50
+ "source": "presets/_shared/assets/docs-specs",
51
+ "behavior": "absent-only"
52
+ },
53
+ "cleanStrategy": "manifest-owned",
54
+ "nativeCapabilities": {
55
+ "cliVersion": {
56
+ "status": "unknown",
57
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
58
+ "nativePath": null
59
+ },
60
+ "rootAgents": {
61
+ "status": "confirmed",
62
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
63
+ "nativePath": "AGENTS.md"
64
+ },
65
+ "explicitAgentFile": {
66
+ "status": "confirmed",
67
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
68
+ "nativePath": ".opencode/agents"
69
+ },
70
+ "structuredOutput": {
71
+ "status": "unknown",
72
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
73
+ "nativePath": null
74
+ },
75
+ "referencedRule": {
76
+ "status": "confirmed",
77
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
78
+ "nativePath": "AGENTS.md"
79
+ },
80
+ "referencedSkill": {
81
+ "status": "confirmed",
82
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
83
+ "nativePath": ".opencode/skills"
84
+ },
85
+ "freshInit": {
86
+ "status": "unknown",
87
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
88
+ "nativePath": null
89
+ },
90
+ "nativeProjectRules": {
91
+ "status": "unknown",
92
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
93
+ "nativePath": "docs/imagined-native-rules"
94
+ },
95
+ "nativeWorkspaceSkills": {
96
+ "status": "confirmed",
97
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
98
+ "nativePath": ".opencode/skills"
99
+ },
100
+ "nativeWorkspaceAgents": {
101
+ "status": "confirmed",
102
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
103
+ "nativePath": ".opencode/agents"
104
+ },
105
+ "projectMcp": {
106
+ "status": "confirmed",
107
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
108
+ "nativePath": "opencode.json"
109
+ },
110
+ "projectHooks": {
111
+ "status": "unknown",
112
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
113
+ "nativePath": null
114
+ },
115
+ "slashCommands": {
116
+ "status": "confirmed",
117
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
118
+ "nativePath": ".opencode/commands"
119
+ },
120
+ "pluginSkillMcp": {
121
+ "status": "confirmed",
122
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
123
+ "nativePath": "opencode.json"
124
+ },
125
+ "nativeTeam": {
126
+ "status": "partial",
127
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
128
+ "nativePath": ".opencode/team"
129
+ }
130
+ }
131
+ }
@@ -0,0 +1,132 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "opencode",
4
+ "runtimeExecutable": "opencode",
5
+ "sourceRoot": "presets/opencode",
6
+ "managedRoot": ".opencode",
7
+ "releasedStacks": [],
8
+ "entryFiles": [
9
+ {
10
+ "source": "REPO_AGENTS.md",
11
+ "destination": "AGENTS.md"
12
+ },
13
+ {
14
+ "source": "OPENCODE.md",
15
+ "destination": ".opencode/AGENTS.md"
16
+ }
17
+ ],
18
+ "directoryMappings": [
19
+ {
20
+ "source": "rules",
21
+ "destination": ".opencode/rules"
22
+ },
23
+ {
24
+ "source": "agents",
25
+ "destination": ".opencode/agents"
26
+ },
27
+ {
28
+ "source": "skills",
29
+ "destination": ".opencode/skills"
30
+ },
31
+ {
32
+ "source": "commands",
33
+ "destination": ".opencode/commands"
34
+ },
35
+ {
36
+ "source": "hooks",
37
+ "destination": ".opencode/hooks"
38
+ },
39
+ {
40
+ "source": "team",
41
+ "destination": ".opencode/team"
42
+ }
43
+ ],
44
+ "mcp": {
45
+ "source": "opencode.json",
46
+ "fallbackDestination": "opencode.json",
47
+ "mode": "merge-opencode-json"
48
+ },
49
+ "docsSeed": {
50
+ "source": "presets/_shared/assets/docs-specs",
51
+ "behavior": "absent-only"
52
+ },
53
+ "cleanStrategy": "manifest-owned",
54
+ "nativeCapabilities": {
55
+ "cliVersion": {
56
+ "status": "unknown",
57
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
58
+ "nativePath": null
59
+ },
60
+ "rootAgents": {
61
+ "status": "confirmed",
62
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
63
+ "nativePath": "AGENTS.md"
64
+ },
65
+ "explicitAgentFile": {
66
+ "status": "confirmed",
67
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
68
+ "nativePath": ".opencode/agents"
69
+ },
70
+ "structuredOutput": {
71
+ "status": "unknown",
72
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
73
+ "nativePath": null
74
+ },
75
+ "referencedRule": {
76
+ "status": "confirmed",
77
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
78
+ "nativePath": "AGENTS.md"
79
+ },
80
+ "referencedSkill": {
81
+ "status": "confirmed",
82
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
83
+ "nativePath": ".opencode/skills"
84
+ },
85
+ "freshInit": {
86
+ "status": "unknown",
87
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
88
+ "nativePath": null
89
+ },
90
+ "nativeProjectRules": {
91
+ "status": "no-equivalent",
92
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
93
+ "nativePath": null
94
+ },
95
+ "nativeWorkspaceSkills": {
96
+ "status": "confirmed",
97
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
98
+ "nativePath": ".opencode/skills"
99
+ },
100
+ "nativeWorkspaceAgents": {
101
+ "status": "confirmed",
102
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
103
+ "nativePath": ".opencode/agents"
104
+ },
105
+ "projectMcp": {
106
+ "status": "confirmed",
107
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
108
+ "nativePath": "opencode.json"
109
+ },
110
+ "projectHooks": {
111
+ "status": "unknown",
112
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
113
+ "nativePath": null
114
+ },
115
+ "slashCommands": {
116
+ "status": "confirmed",
117
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
118
+ "nativePath": ".opencode/commands"
119
+ },
120
+ "pluginSkillMcp": {
121
+ "status": "confirmed",
122
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
123
+ "nativePath": "opencode.json"
124
+ },
125
+ "nativeTeam": {
126
+ "status": "partial",
127
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
128
+ "nativePath": ".opencode/team"
129
+ }
130
+ },
131
+ "requiredCliVersion": "1.0.0"
132
+ }
@@ -0,0 +1,131 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "opencode",
4
+ "runtimeExecutable": "opencode",
5
+ "sourceRoot": "presets/opencode",
6
+ "managedRoot": ".opencode",
7
+ "releasedStacks": [],
8
+ "entryFiles": [
9
+ {
10
+ "source": "REPO_AGENTS.md",
11
+ "destination": "AGENTS.md"
12
+ },
13
+ {
14
+ "source": "OPENCODE.md",
15
+ "destination": ".opencode/AGENTS.md"
16
+ }
17
+ ],
18
+ "directoryMappings": [
19
+ {
20
+ "source": "rules",
21
+ "destination": ".opencode/rules"
22
+ },
23
+ {
24
+ "source": "agents",
25
+ "destination": ".opencode/agents"
26
+ },
27
+ {
28
+ "source": "skills",
29
+ "destination": ".opencode/skills"
30
+ },
31
+ {
32
+ "source": "commands",
33
+ "destination": ".opencode/commands"
34
+ },
35
+ {
36
+ "source": "hooks",
37
+ "destination": ".opencode/hooks"
38
+ },
39
+ {
40
+ "source": "team",
41
+ "destination": ".opencode/team"
42
+ }
43
+ ],
44
+ "mcp": {
45
+ "source": "opencode.json",
46
+ "fallbackDestination": "opencode.json",
47
+ "mode": "merge-opencode-json"
48
+ },
49
+ "docsSeed": {
50
+ "source": "presets/_shared/assets/docs-specs",
51
+ "behavior": "absent-only"
52
+ },
53
+ "cleanStrategy": "manifest-owned",
54
+ "nativeCapabilities": {
55
+ "cliVersion": {
56
+ "status": "unknown",
57
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
58
+ "nativePath": null
59
+ },
60
+ "rootAgents": {
61
+ "status": "confirmed",
62
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
63
+ "nativePath": "AGENTS.md"
64
+ },
65
+ "explicitAgentFile": {
66
+ "status": "confirmed",
67
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
68
+ "nativePath": ".opencode/agents"
69
+ },
70
+ "structuredOutput": {
71
+ "status": "unknown",
72
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
73
+ "nativePath": null
74
+ },
75
+ "referencedRule": {
76
+ "status": "confirmed",
77
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
78
+ "nativePath": "AGENTS.md"
79
+ },
80
+ "referencedSkill": {
81
+ "status": "confirmed",
82
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
83
+ "nativePath": ".opencode/skills"
84
+ },
85
+ "freshInit": {
86
+ "status": "unknown",
87
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
88
+ "nativePath": null
89
+ },
90
+ "nativeProjectRules": {
91
+ "status": "no-equivalent",
92
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
93
+ "nativePath": null
94
+ },
95
+ "nativeWorkspaceSkills": {
96
+ "status": "confirmed",
97
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
98
+ "nativePath": ".opencode/skills"
99
+ },
100
+ "nativeWorkspaceAgents": {
101
+ "status": "confirmed",
102
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
103
+ "nativePath": ".opencode/agents"
104
+ },
105
+ "projectMcp": {
106
+ "status": "confirmed",
107
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
108
+ "nativePath": "opencode.json"
109
+ },
110
+ "projectHooks": {
111
+ "status": "unknown",
112
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
113
+ "nativePath": null
114
+ },
115
+ "slashCommands": {
116
+ "status": "confirmed",
117
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
118
+ "nativePath": ".opencode/commands"
119
+ },
120
+ "pluginSkillMcp": {
121
+ "status": "confirmed",
122
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
123
+ "nativePath": "opencode.json"
124
+ },
125
+ "nativeTeam": {
126
+ "status": "partial",
127
+ "evidence": "docs/OPENCODE-COMPATIBILITY.md",
128
+ "nativePath": ".opencode/team"
129
+ }
130
+ }
131
+ }
@@ -411,7 +411,7 @@ function buildRepoAgents(_sourceText) {
411
411
  return `# Next.js — agent instructions
412
412
 
413
413
  Cross-tool repo-root guide. Tool-specific maps stay under \`.cursor/AGENTS.md\`,
414
- \`.claude/CLAUDE.md\`, and \`.mavis/AGENTS.md\`.
414
+ \`.claude/CLAUDE.md\`, \`.mavis/AGENTS.md\`, and \`.opencode/AGENTS.md\`.
415
415
 
416
416
  **.mavis/** is an ai-rules-owned namespace, not a MiniMax-native discovery path.
417
417
  When this Mavis preset is installed, read \`.mavis/AGENTS.md\` on every turn.
@@ -422,13 +422,14 @@ owns those files.
422
422
  ## Cross-tool setup
423
423
 
424
424
  - Treat this file as the **shared** entry for any agent (Cursor, Claude Code,
425
- Mavis / MiniMax Code, or other).
425
+ Mavis / MiniMax Code, OpenCode, or other).
426
426
  - Install:
427
427
 
428
428
  \`\`\`bash
429
429
  npx @bonesofspring/ai-rules init cursor --preset next
430
430
  npx @bonesofspring/ai-rules init claude --preset next
431
431
  npx @bonesofspring/ai-rules init mavis --preset next
432
+ npx @bonesofspring/ai-rules init opencode --preset next
432
433
  \`\`\`
433
434
 
434
435
  \`init\` overwrites this file from the preset (\`REPO_AGENTS.md\` → \`AGENTS.md\`).
@@ -476,16 +477,17 @@ After code edits: invoke **\`post-change-lint\`** (requestable). Full gate: agen
476
477
  | Cursor | \`.cursor/AGENTS.md\` (optional if Cursor not installed) |
477
478
  | Claude Code | \`.claude/CLAUDE.md\` (optional if Claude Code not installed) |
478
479
  | Mavis | \`.mavis/AGENTS.md\` (optional if Mavis not installed) |
480
+ | OpenCode | \`.opencode/AGENTS.md\` (optional if OpenCode not installed) |
479
481
 
480
- Rules: \`.cursor/rules/\`, \`.claude/rules/\`, or \`.mavis/rules/\`.
481
- Skills: \`.cursor/skills/\`, \`.claude/skills/\`, or \`.mavis/skills/\`.
482
+ Rules: \`.cursor/rules/\`, \`.claude/rules/\`, \`.mavis/rules/\`, or \`.opencode/rules/\`.
483
+ Skills: \`.cursor/skills/\`, \`.claude/skills/\`, \`.mavis/skills/\`, or \`.opencode/skills/\`.
482
484
 
483
485
  ## Living conventions
484
486
 
485
487
  Gotchas, local patterns, and team decisions:
486
- **\`.cursor/team/conventions.md\`**, **\`.claude/team/conventions.md\`**, and/or
487
- **\`.mavis/team/conventions.md\`** (fill after init; not overwritten on every
488
- dogfood sync when already present).
488
+ **\`.cursor/team/conventions.md\`**, **\`.claude/team/conventions.md\`**,
489
+ **\`.mavis/team/conventions.md\`**, and/or **\`.opencode/team/conventions.md\`**
490
+ (fill after init; not overwritten on every dogfood sync when already present).
489
491
 
490
492
  ## Local overlay (\`.ai.local/\`) — MANDATORY
491
493