@bonesofspring/ai-rules 0.2.19 → 0.2.21

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 (541) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +17 -2
  3. package/bin/cli.js +83 -6
  4. package/package.json +5 -2
  5. package/presets/_shared/README.md +4 -3
  6. package/presets/_shared/assets/docs-specs/INDEX.md +4 -1
  7. package/presets/_shared/core/agent-team/agent-artifact-contracts.md +13 -0
  8. package/presets/_shared/core/agent-team/agent-task-metrics.md +1 -1
  9. package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -3
  10. package/presets/_shared/core/agent-team/task-classification.md +21 -0
  11. package/presets/_shared/core/meta/preset-pr-checklist.md +5 -1
  12. package/presets/_shared/core/meta/preset-token-budget.md +7 -3
  13. package/presets/_shared/core/meta/preset-twin-sync.md +2 -0
  14. package/presets/_shared/core/quality/debug-investigation.md +24 -0
  15. package/presets/_shared/core/quality/verification-before-completion.md +25 -0
  16. package/presets/_shared/core/review/receiving-code-review.md +24 -0
  17. package/presets/_shared/core/testing/testing-principles.md +70 -0
  18. package/presets/claude/android-kotlin/agents/README.md +2 -1
  19. package/presets/claude/android-kotlin/agents/build-verifier.md +6 -0
  20. package/presets/claude/android-kotlin/agents/ci-investigator.md +1 -0
  21. package/presets/claude/android-kotlin/agents/code-reviewer.md +2 -0
  22. package/presets/claude/android-kotlin/agents/debugger.md +5 -0
  23. package/presets/claude/android-kotlin/agents/feature-developer.md +8 -1
  24. package/presets/claude/android-kotlin/agents/openspec-author.md +163 -0
  25. package/presets/claude/android-kotlin/agents/task-analyst.md +11 -1
  26. package/presets/claude/android-kotlin/agents/task-router.md +19 -1
  27. package/presets/claude/android-kotlin/agents/tech-writer.md +4 -0
  28. package/presets/claude/android-kotlin/commands/README.md +0 -2
  29. package/presets/claude/android-kotlin/commands/task-continue.md +1 -1
  30. package/presets/claude/android-kotlin/commands/task.md +1 -5
  31. package/presets/claude/android-kotlin/commands/technical-retro.md +2 -2
  32. package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +54 -2
  33. package/presets/claude/android-kotlin/rules/README.md +1 -0
  34. package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +7 -4
  35. package/presets/claude/android-kotlin/rules/tooling-and-review/ai-local-overlay.md +48 -0
  36. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  37. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-token-budget.md +7 -3
  38. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-twin-sync.md +2 -0
  39. package/presets/claude/android-kotlin/skills/code-review/SKILL.md +6 -0
  40. package/presets/claude/android-kotlin/skills/debug-investigation/SKILL.md +33 -5
  41. package/presets/claude/go/README.md +1 -1
  42. package/presets/claude/go/agents/README.md +3 -2
  43. package/presets/claude/go/agents/build-verifier.md +6 -0
  44. package/presets/claude/go/agents/ci-investigator.md +1 -0
  45. package/presets/claude/go/agents/code-reviewer.md +2 -0
  46. package/presets/claude/go/agents/debugger.md +7 -0
  47. package/presets/claude/go/agents/feature-developer.md +7 -0
  48. package/presets/claude/go/agents/openspec-author.md +163 -0
  49. package/presets/claude/go/agents/task-analyst.md +10 -0
  50. package/presets/claude/go/agents/task-router.md +19 -1
  51. package/presets/claude/go/agents/tech-writer.md +4 -0
  52. package/presets/claude/go/commands/README.md +0 -2
  53. package/presets/claude/go/commands/task-continue.md +1 -1
  54. package/presets/claude/go/commands/task.md +1 -4
  55. package/presets/claude/go/hooks/chain-team-phases.sh +54 -3
  56. package/presets/claude/go/rules/README.md +1 -0
  57. package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  58. package/presets/claude/go/rules/tooling-and-review/ai-local-overlay.md +48 -0
  59. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  60. package/presets/claude/go/rules/tooling-and-review/preset-token-budget.md +7 -3
  61. package/presets/claude/go/rules/tooling-and-review/preset-twin-sync.md +2 -0
  62. package/presets/claude/go/skills/code-review/SKILL.md +6 -0
  63. package/presets/claude/go/skills/debug-investigation/SKILL.md +32 -4
  64. package/presets/claude/ios-swift/agents/README.md +3 -2
  65. package/presets/claude/ios-swift/agents/build-verifier.md +6 -0
  66. package/presets/claude/ios-swift/agents/ci-investigator.md +1 -0
  67. package/presets/claude/ios-swift/agents/code-reviewer.md +2 -0
  68. package/presets/claude/ios-swift/agents/debugger.md +5 -0
  69. package/presets/claude/ios-swift/agents/feature-developer.md +8 -1
  70. package/presets/claude/ios-swift/agents/openspec-author.md +163 -0
  71. package/presets/claude/ios-swift/agents/task-analyst.md +11 -1
  72. package/presets/claude/ios-swift/agents/task-router.md +19 -1
  73. package/presets/claude/ios-swift/agents/tech-writer.md +4 -0
  74. package/presets/claude/ios-swift/commands/README.md +0 -2
  75. package/presets/claude/ios-swift/commands/task-continue.md +1 -1
  76. package/presets/claude/ios-swift/commands/task.md +1 -5
  77. package/presets/claude/ios-swift/commands/technical-retro.md +2 -2
  78. package/presets/claude/ios-swift/hooks/chain-team-phases.sh +54 -2
  79. package/presets/claude/ios-swift/rules/README.md +1 -0
  80. package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +7 -4
  81. package/presets/claude/ios-swift/rules/tooling-and-review/ai-local-overlay.md +48 -0
  82. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  83. package/presets/claude/ios-swift/rules/tooling-and-review/preset-token-budget.md +7 -3
  84. package/presets/claude/ios-swift/rules/tooling-and-review/preset-twin-sync.md +2 -0
  85. package/presets/claude/ios-swift/skills/code-review/SKILL.md +6 -0
  86. package/presets/claude/ios-swift/skills/debug-investigation/SKILL.md +33 -5
  87. package/presets/claude/java/CLAUDE.md +1 -1
  88. package/presets/claude/java/agents/README.md +3 -2
  89. package/presets/claude/java/agents/build-verifier.md +6 -0
  90. package/presets/claude/java/agents/ci-investigator.md +1 -0
  91. package/presets/claude/java/agents/code-reviewer.md +2 -0
  92. package/presets/claude/java/agents/debugger.md +7 -0
  93. package/presets/claude/java/agents/feature-developer.md +7 -0
  94. package/presets/claude/java/agents/openspec-author.md +163 -0
  95. package/presets/claude/java/agents/task-analyst.md +10 -0
  96. package/presets/claude/java/agents/task-router.md +19 -1
  97. package/presets/claude/java/agents/tech-writer.md +4 -0
  98. package/presets/claude/java/commands/README.md +0 -2
  99. package/presets/claude/java/commands/task-continue.md +1 -1
  100. package/presets/claude/java/commands/task.md +1 -4
  101. package/presets/claude/java/hooks/chain-team-phases.sh +54 -3
  102. package/presets/claude/java/rules/README.md +1 -0
  103. package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  104. package/presets/claude/java/rules/tooling-and-review/ai-local-overlay.md +48 -0
  105. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  106. package/presets/claude/java/rules/tooling-and-review/preset-token-budget.md +7 -3
  107. package/presets/claude/java/rules/tooling-and-review/preset-twin-sync.md +2 -0
  108. package/presets/claude/java/skills/code-review/SKILL.md +6 -0
  109. package/presets/claude/java/skills/debug-investigation/SKILL.md +32 -4
  110. package/presets/claude/mcp-ts/agents/build-verifier.md +6 -0
  111. package/presets/claude/mcp-ts/agents/feature-developer.md +7 -0
  112. package/presets/claude/mcp-ts/agents/task-analyst.md +11 -1
  113. package/presets/claude/mcp-ts/agents/task-router.md +14 -0
  114. package/presets/claude/mcp-ts/commands/README.md +0 -2
  115. package/presets/claude/mcp-ts/commands/task-continue.md +1 -1
  116. package/presets/claude/mcp-ts/commands/task.md +1 -4
  117. package/presets/claude/mcp-ts/commands/technical-retro.md +2 -2
  118. package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +40 -9
  119. package/presets/claude/mcp-ts/rules/README.md +1 -0
  120. package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  121. package/presets/claude/mcp-ts/rules/tooling-and-review/ai-local-overlay.md +48 -0
  122. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  123. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-token-budget.md +7 -3
  124. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-twin-sync.md +2 -0
  125. package/presets/claude/mcp-ts/skills/code-review/SKILL.md +6 -0
  126. package/presets/claude/mcp-ts/skills/debug-investigation/SKILL.md +31 -3
  127. package/presets/claude/next/README.md +1 -0
  128. package/presets/claude/next/agents/README.md +2 -2
  129. package/presets/claude/next/agents/build-verifier.md +17 -1
  130. package/presets/claude/next/agents/ci-investigator.md +1 -0
  131. package/presets/claude/next/agents/code-reviewer.md +2 -0
  132. package/presets/claude/next/agents/debugger.md +5 -0
  133. package/presets/claude/next/agents/feature-developer.md +8 -1
  134. package/presets/claude/next/agents/openspec-author.md +163 -0
  135. package/presets/claude/next/agents/task-analyst.md +12 -2
  136. package/presets/claude/next/agents/task-router.md +19 -1
  137. package/presets/claude/next/agents/tech-writer.md +4 -0
  138. package/presets/claude/next/commands/README.md +0 -2
  139. package/presets/claude/next/commands/task-continue.md +1 -1
  140. package/presets/claude/next/commands/task.md +1 -4
  141. package/presets/claude/next/hooks/chain-team-phases.sh +54 -2
  142. package/presets/claude/next/rules/README.md +1 -0
  143. package/presets/claude/next/rules/testing/README.md +6 -0
  144. package/presets/claude/next/rules/testing/tests-e2e-structure.md +84 -48
  145. package/presets/claude/next/rules/testing/tests-unit.md +79 -50
  146. package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +3 -4
  147. package/presets/claude/next/rules/tooling-and-review/ai-local-overlay.md +48 -0
  148. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  149. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +7 -3
  150. package/presets/claude/next/rules/tooling-and-review/preset-twin-sync.md +2 -0
  151. package/presets/claude/next/skills/code-review/SKILL.md +6 -0
  152. package/presets/claude/next/skills/debug-investigation/SKILL.md +29 -14
  153. package/presets/claude/next/team/README.md +0 -3
  154. package/presets/claude/nuxt/agents/README.md +1 -1
  155. package/presets/claude/nuxt/agents/build-verifier.md +6 -0
  156. package/presets/claude/nuxt/agents/ci-investigator.md +1 -0
  157. package/presets/claude/nuxt/agents/code-reviewer.md +2 -0
  158. package/presets/claude/nuxt/agents/debugger.md +5 -0
  159. package/presets/claude/nuxt/agents/feature-developer.md +8 -1
  160. package/presets/claude/nuxt/agents/openspec-author.md +163 -0
  161. package/presets/claude/nuxt/agents/task-analyst.md +12 -2
  162. package/presets/claude/nuxt/agents/task-router.md +19 -1
  163. package/presets/claude/nuxt/agents/tech-writer.md +4 -0
  164. package/presets/claude/nuxt/commands/README.md +0 -2
  165. package/presets/claude/nuxt/commands/task-continue.md +1 -1
  166. package/presets/claude/nuxt/commands/task.md +1 -5
  167. package/presets/claude/nuxt/commands/technical-retro.md +2 -2
  168. package/presets/claude/nuxt/hooks/chain-team-phases.sh +54 -2
  169. package/presets/claude/nuxt/rules/README.md +1 -0
  170. package/presets/claude/nuxt/rules/testing/README.md +6 -0
  171. package/presets/claude/nuxt/rules/testing/tests-e2e-structure.md +86 -43
  172. package/presets/claude/nuxt/rules/testing/tests-unit.md +58 -45
  173. package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +8 -5
  174. package/presets/claude/nuxt/rules/tooling-and-review/ai-local-overlay.md +48 -0
  175. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  176. package/presets/claude/nuxt/rules/tooling-and-review/preset-token-budget.md +7 -3
  177. package/presets/claude/nuxt/rules/tooling-and-review/preset-twin-sync.md +2 -0
  178. package/presets/claude/nuxt/skills/code-review/SKILL.md +6 -0
  179. package/presets/claude/nuxt/skills/debug-investigation/SKILL.md +29 -12
  180. package/presets/claude/nuxt/team/README.md +0 -3
  181. package/presets/claude/php-hexagonal/CLAUDE.md +1 -1
  182. package/presets/claude/php-hexagonal/agents/README.md +3 -2
  183. package/presets/claude/php-hexagonal/agents/build-verifier.md +6 -0
  184. package/presets/claude/php-hexagonal/agents/ci-investigator.md +1 -0
  185. package/presets/claude/php-hexagonal/agents/code-reviewer.md +2 -0
  186. package/presets/claude/php-hexagonal/agents/debugger.md +7 -0
  187. package/presets/claude/php-hexagonal/agents/feature-developer.md +7 -0
  188. package/presets/claude/php-hexagonal/agents/openspec-author.md +163 -0
  189. package/presets/claude/php-hexagonal/agents/task-analyst.md +10 -0
  190. package/presets/claude/php-hexagonal/agents/task-router.md +19 -1
  191. package/presets/claude/php-hexagonal/agents/tech-writer.md +4 -0
  192. package/presets/claude/php-hexagonal/commands/README.md +0 -2
  193. package/presets/claude/php-hexagonal/commands/task-continue.md +1 -1
  194. package/presets/claude/php-hexagonal/commands/task.md +1 -4
  195. package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +54 -3
  196. package/presets/claude/php-hexagonal/rules/README.md +1 -0
  197. package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  198. package/presets/claude/php-hexagonal/rules/tooling-and-review/ai-local-overlay.md +48 -0
  199. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  200. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-token-budget.md +7 -3
  201. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-twin-sync.md +2 -0
  202. package/presets/claude/php-hexagonal/skills/code-review/SKILL.md +6 -0
  203. package/presets/claude/php-hexagonal/skills/debug-investigation/SKILL.md +32 -4
  204. package/presets/claude/php-laravel/agents/README.md +3 -2
  205. package/presets/claude/php-laravel/agents/build-verifier.md +6 -0
  206. package/presets/claude/php-laravel/agents/ci-investigator.md +1 -0
  207. package/presets/claude/php-laravel/agents/code-reviewer.md +2 -0
  208. package/presets/claude/php-laravel/agents/debugger.md +7 -0
  209. package/presets/claude/php-laravel/agents/feature-developer.md +7 -0
  210. package/presets/claude/php-laravel/agents/openspec-author.md +163 -0
  211. package/presets/claude/php-laravel/agents/task-analyst.md +10 -0
  212. package/presets/claude/php-laravel/agents/task-router.md +19 -1
  213. package/presets/claude/php-laravel/agents/tech-writer.md +4 -0
  214. package/presets/claude/php-laravel/commands/README.md +0 -2
  215. package/presets/claude/php-laravel/commands/task-continue.md +1 -1
  216. package/presets/claude/php-laravel/commands/task.md +1 -4
  217. package/presets/claude/php-laravel/hooks/chain-team-phases.sh +54 -3
  218. package/presets/claude/php-laravel/rules/README.md +1 -0
  219. package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +2 -4
  220. package/presets/claude/php-laravel/rules/tooling-and-review/ai-local-overlay.md +48 -0
  221. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  222. package/presets/claude/php-laravel/rules/tooling-and-review/preset-token-budget.md +7 -3
  223. package/presets/claude/php-laravel/rules/tooling-and-review/preset-twin-sync.md +2 -0
  224. package/presets/claude/php-laravel/skills/code-review/SKILL.md +6 -0
  225. package/presets/claude/php-laravel/skills/debug-investigation/SKILL.md +32 -4
  226. package/presets/claude/svelte/agents/README.md +1 -1
  227. package/presets/claude/svelte/agents/build-verifier.md +6 -0
  228. package/presets/claude/svelte/agents/ci-investigator.md +1 -0
  229. package/presets/claude/svelte/agents/code-reviewer.md +2 -0
  230. package/presets/claude/svelte/agents/debugger.md +5 -0
  231. package/presets/claude/svelte/agents/feature-developer.md +8 -1
  232. package/presets/claude/svelte/agents/openspec-author.md +163 -0
  233. package/presets/claude/svelte/agents/task-analyst.md +12 -2
  234. package/presets/claude/svelte/agents/task-router.md +19 -1
  235. package/presets/claude/svelte/agents/tech-writer.md +4 -0
  236. package/presets/claude/svelte/commands/README.md +0 -2
  237. package/presets/claude/svelte/commands/task-continue.md +1 -1
  238. package/presets/claude/svelte/commands/task.md +1 -5
  239. package/presets/claude/svelte/commands/technical-retro.md +2 -2
  240. package/presets/claude/svelte/hooks/chain-team-phases.sh +54 -2
  241. package/presets/claude/svelte/rules/README.md +1 -0
  242. package/presets/claude/svelte/rules/testing/README.md +6 -0
  243. package/presets/claude/svelte/rules/testing/tests-e2e-structure.md +87 -45
  244. package/presets/claude/svelte/rules/testing/tests-unit.md +70 -23
  245. package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +8 -5
  246. package/presets/claude/svelte/rules/tooling-and-review/ai-local-overlay.md +48 -0
  247. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +5 -1
  248. package/presets/claude/svelte/rules/tooling-and-review/preset-token-budget.md +7 -3
  249. package/presets/claude/svelte/rules/tooling-and-review/preset-twin-sync.md +2 -0
  250. package/presets/claude/svelte/skills/code-review/SKILL.md +6 -0
  251. package/presets/claude/svelte/skills/debug-investigation/SKILL.md +29 -12
  252. package/presets/claude/svelte/team/README.md +0 -3
  253. package/presets/cursor/android-kotlin/agents/README.md +2 -1
  254. package/presets/cursor/android-kotlin/agents/build-verifier.md +6 -0
  255. package/presets/cursor/android-kotlin/agents/ci-investigator.md +1 -0
  256. package/presets/cursor/android-kotlin/agents/code-reviewer.md +2 -0
  257. package/presets/cursor/android-kotlin/agents/debugger.md +5 -0
  258. package/presets/cursor/android-kotlin/agents/feature-developer.md +8 -1
  259. package/presets/cursor/android-kotlin/agents/openspec-author.md +164 -0
  260. package/presets/cursor/android-kotlin/agents/task-analyst.md +11 -1
  261. package/presets/cursor/android-kotlin/agents/task-router.md +19 -1
  262. package/presets/cursor/android-kotlin/agents/tech-writer.md +4 -0
  263. package/presets/cursor/android-kotlin/commands/README.md +0 -2
  264. package/presets/cursor/android-kotlin/commands/task-continue.md +1 -1
  265. package/presets/cursor/android-kotlin/commands/task.md +1 -5
  266. package/presets/cursor/android-kotlin/commands/technical-retro.md +2 -2
  267. package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +54 -2
  268. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +7 -4
  269. package/presets/cursor/android-kotlin/rules/ai-local-overlay.mdc +43 -0
  270. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +5 -1
  271. package/presets/cursor/android-kotlin/rules/preset-token-budget.mdc +7 -3
  272. package/presets/cursor/android-kotlin/rules/preset-twin-sync.mdc +2 -0
  273. package/presets/cursor/android-kotlin/skills/code-review/SKILL.md +6 -0
  274. package/presets/cursor/android-kotlin/skills/debug-investigation/SKILL.md +33 -5
  275. package/presets/cursor/go/README.md +6 -6
  276. package/presets/cursor/go/agents/README.md +3 -2
  277. package/presets/cursor/go/agents/build-verifier.md +6 -0
  278. package/presets/cursor/go/agents/ci-investigator.md +1 -0
  279. package/presets/cursor/go/agents/code-reviewer.md +2 -0
  280. package/presets/cursor/go/agents/debugger.md +7 -0
  281. package/presets/cursor/go/agents/feature-developer.md +7 -0
  282. package/presets/cursor/go/agents/openspec-author.md +164 -0
  283. package/presets/cursor/go/agents/task-analyst.md +10 -0
  284. package/presets/cursor/go/agents/task-router.md +19 -1
  285. package/presets/cursor/go/agents/tech-writer.md +4 -0
  286. package/presets/cursor/go/commands/README.md +0 -2
  287. package/presets/cursor/go/commands/task-continue.md +1 -1
  288. package/presets/cursor/go/commands/task.md +1 -4
  289. package/presets/cursor/go/commands/technical-retro.md +2 -2
  290. package/presets/cursor/go/hooks/chain-team-phases.sh +54 -3
  291. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -4
  292. package/presets/cursor/go/rules/ai-local-overlay.mdc +43 -0
  293. package/presets/cursor/go/rules/preset-pr-checklist.mdc +5 -1
  294. package/presets/cursor/go/rules/preset-token-budget.mdc +7 -3
  295. package/presets/cursor/go/rules/preset-twin-sync.mdc +2 -0
  296. package/presets/cursor/go/skills/code-review/SKILL.md +6 -0
  297. package/presets/cursor/go/skills/debug-investigation/SKILL.md +32 -4
  298. package/presets/cursor/ios-swift/README.md +6 -6
  299. package/presets/cursor/ios-swift/agents/README.md +3 -2
  300. package/presets/cursor/ios-swift/agents/build-verifier.md +6 -0
  301. package/presets/cursor/ios-swift/agents/ci-investigator.md +1 -0
  302. package/presets/cursor/ios-swift/agents/code-reviewer.md +2 -0
  303. package/presets/cursor/ios-swift/agents/debugger.md +5 -0
  304. package/presets/cursor/ios-swift/agents/feature-developer.md +8 -1
  305. package/presets/cursor/ios-swift/agents/openspec-author.md +164 -0
  306. package/presets/cursor/ios-swift/agents/task-analyst.md +11 -1
  307. package/presets/cursor/ios-swift/agents/task-router.md +19 -1
  308. package/presets/cursor/ios-swift/agents/tech-writer.md +4 -0
  309. package/presets/cursor/ios-swift/commands/README.md +1 -3
  310. package/presets/cursor/ios-swift/commands/task-continue.md +1 -1
  311. package/presets/cursor/ios-swift/commands/task.md +1 -5
  312. package/presets/cursor/ios-swift/commands/technical-retro.md +2 -2
  313. package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +54 -2
  314. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +7 -4
  315. package/presets/cursor/ios-swift/rules/ai-local-overlay.mdc +43 -0
  316. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +5 -1
  317. package/presets/cursor/ios-swift/rules/preset-token-budget.mdc +7 -3
  318. package/presets/cursor/ios-swift/rules/preset-twin-sync.mdc +2 -0
  319. package/presets/cursor/ios-swift/skills/code-review/SKILL.md +6 -0
  320. package/presets/cursor/ios-swift/skills/debug-investigation/SKILL.md +33 -5
  321. package/presets/cursor/java/AGENTS.md +1 -1
  322. package/presets/cursor/java/agents/README.md +3 -2
  323. package/presets/cursor/java/agents/build-verifier.md +6 -0
  324. package/presets/cursor/java/agents/ci-investigator.md +1 -0
  325. package/presets/cursor/java/agents/code-reviewer.md +2 -0
  326. package/presets/cursor/java/agents/debugger.md +7 -0
  327. package/presets/cursor/java/agents/feature-developer.md +7 -0
  328. package/presets/cursor/java/agents/openspec-author.md +164 -0
  329. package/presets/cursor/java/agents/task-analyst.md +10 -0
  330. package/presets/cursor/java/agents/task-router.md +19 -1
  331. package/presets/cursor/java/agents/tech-writer.md +4 -0
  332. package/presets/cursor/java/commands/README.md +0 -2
  333. package/presets/cursor/java/commands/task-continue.md +1 -1
  334. package/presets/cursor/java/commands/task.md +1 -4
  335. package/presets/cursor/java/commands/technical-retro.md +2 -2
  336. package/presets/cursor/java/hooks/chain-team-phases.sh +54 -3
  337. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -4
  338. package/presets/cursor/java/rules/ai-local-overlay.mdc +43 -0
  339. package/presets/cursor/java/rules/preset-pr-checklist.mdc +5 -1
  340. package/presets/cursor/java/rules/preset-token-budget.mdc +7 -3
  341. package/presets/cursor/java/rules/preset-twin-sync.mdc +2 -0
  342. package/presets/cursor/java/skills/code-review/SKILL.md +6 -0
  343. package/presets/cursor/java/skills/debug-investigation/SKILL.md +32 -4
  344. package/presets/cursor/mcp-ts/agents/build-verifier.md +6 -0
  345. package/presets/cursor/mcp-ts/agents/feature-developer.md +7 -0
  346. package/presets/cursor/mcp-ts/agents/task-analyst.md +11 -1
  347. package/presets/cursor/mcp-ts/agents/task-router.md +14 -0
  348. package/presets/cursor/mcp-ts/commands/README.md +0 -2
  349. package/presets/cursor/mcp-ts/commands/task-continue.md +1 -1
  350. package/presets/cursor/mcp-ts/commands/task.md +1 -4
  351. package/presets/cursor/mcp-ts/commands/technical-retro.md +2 -2
  352. package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +40 -9
  353. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -4
  354. package/presets/cursor/mcp-ts/rules/ai-local-overlay.mdc +43 -0
  355. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +5 -1
  356. package/presets/cursor/mcp-ts/rules/preset-token-budget.mdc +7 -3
  357. package/presets/cursor/mcp-ts/rules/preset-twin-sync.mdc +2 -0
  358. package/presets/cursor/mcp-ts/skills/code-review/SKILL.md +6 -0
  359. package/presets/cursor/mcp-ts/skills/debug-investigation/SKILL.md +31 -3
  360. package/presets/cursor/next/README.md +8 -6
  361. package/presets/cursor/next/REPO_AGENTS.md +8 -0
  362. package/presets/cursor/next/agents/README.md +2 -2
  363. package/presets/cursor/next/agents/build-verifier.md +17 -1
  364. package/presets/cursor/next/agents/ci-investigator.md +1 -0
  365. package/presets/cursor/next/agents/code-reviewer.md +2 -0
  366. package/presets/cursor/next/agents/debugger.md +5 -0
  367. package/presets/cursor/next/agents/feature-developer.md +8 -1
  368. package/presets/cursor/next/agents/openspec-author.md +164 -0
  369. package/presets/cursor/next/agents/task-analyst.md +12 -2
  370. package/presets/cursor/next/agents/task-router.md +19 -1
  371. package/presets/cursor/next/agents/tech-writer.md +4 -0
  372. package/presets/cursor/next/commands/README.md +0 -2
  373. package/presets/cursor/next/commands/task-continue.md +1 -1
  374. package/presets/cursor/next/commands/task.md +1 -4
  375. package/presets/cursor/next/commands/technical-retro.md +2 -2
  376. package/presets/cursor/next/hooks/chain-team-phases.sh +54 -2
  377. package/presets/cursor/next/rules/README.md +6 -3
  378. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +7 -5
  379. package/presets/cursor/next/rules/ai-local-overlay.mdc +43 -0
  380. package/presets/cursor/next/rules/preset-pr-checklist.mdc +5 -1
  381. package/presets/cursor/next/rules/preset-token-budget.mdc +7 -3
  382. package/presets/cursor/next/rules/preset-twin-sync.mdc +2 -0
  383. package/presets/cursor/next/rules/tests-e2e-structure.mdc +83 -43
  384. package/presets/cursor/next/rules/tests-unit.mdc +78 -45
  385. package/presets/cursor/next/skills/code-review/SKILL.md +6 -0
  386. package/presets/cursor/next/skills/debug-investigation/SKILL.md +29 -14
  387. package/presets/cursor/next/team/README.md +0 -3
  388. package/presets/cursor/nuxt/README.md +6 -6
  389. package/presets/cursor/nuxt/agents/README.md +1 -1
  390. package/presets/cursor/nuxt/agents/build-verifier.md +6 -0
  391. package/presets/cursor/nuxt/agents/ci-investigator.md +1 -0
  392. package/presets/cursor/nuxt/agents/code-reviewer.md +2 -0
  393. package/presets/cursor/nuxt/agents/debugger.md +5 -0
  394. package/presets/cursor/nuxt/agents/feature-developer.md +8 -1
  395. package/presets/cursor/nuxt/agents/openspec-author.md +164 -0
  396. package/presets/cursor/nuxt/agents/task-analyst.md +12 -2
  397. package/presets/cursor/nuxt/agents/task-router.md +19 -1
  398. package/presets/cursor/nuxt/agents/tech-writer.md +4 -0
  399. package/presets/cursor/nuxt/commands/README.md +0 -2
  400. package/presets/cursor/nuxt/commands/task-continue.md +1 -1
  401. package/presets/cursor/nuxt/commands/task.md +1 -5
  402. package/presets/cursor/nuxt/commands/technical-retro.md +2 -2
  403. package/presets/cursor/nuxt/hooks/chain-team-phases.sh +54 -2
  404. package/presets/cursor/nuxt/rules/README.md +3 -1
  405. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +8 -5
  406. package/presets/cursor/nuxt/rules/ai-local-overlay.mdc +43 -0
  407. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +5 -1
  408. package/presets/cursor/nuxt/rules/preset-token-budget.mdc +7 -3
  409. package/presets/cursor/nuxt/rules/preset-twin-sync.mdc +2 -0
  410. package/presets/cursor/nuxt/rules/tests-e2e-structure.mdc +87 -43
  411. package/presets/cursor/nuxt/rules/tests-unit.mdc +62 -47
  412. package/presets/cursor/nuxt/skills/code-review/SKILL.md +6 -0
  413. package/presets/cursor/nuxt/skills/debug-investigation/SKILL.md +29 -12
  414. package/presets/cursor/nuxt/team/README.md +0 -3
  415. package/presets/cursor/php-hexagonal/AGENTS.md +1 -1
  416. package/presets/cursor/php-hexagonal/agents/README.md +3 -2
  417. package/presets/cursor/php-hexagonal/agents/build-verifier.md +6 -0
  418. package/presets/cursor/php-hexagonal/agents/ci-investigator.md +1 -0
  419. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +2 -0
  420. package/presets/cursor/php-hexagonal/agents/debugger.md +7 -0
  421. package/presets/cursor/php-hexagonal/agents/feature-developer.md +7 -0
  422. package/presets/cursor/php-hexagonal/agents/openspec-author.md +164 -0
  423. package/presets/cursor/php-hexagonal/agents/task-analyst.md +10 -0
  424. package/presets/cursor/php-hexagonal/agents/task-router.md +19 -1
  425. package/presets/cursor/php-hexagonal/agents/tech-writer.md +4 -0
  426. package/presets/cursor/php-hexagonal/commands/README.md +0 -2
  427. package/presets/cursor/php-hexagonal/commands/task-continue.md +1 -1
  428. package/presets/cursor/php-hexagonal/commands/task.md +1 -4
  429. package/presets/cursor/php-hexagonal/commands/technical-retro.md +2 -2
  430. package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +54 -3
  431. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -4
  432. package/presets/cursor/php-hexagonal/rules/ai-local-overlay.mdc +43 -0
  433. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +5 -1
  434. package/presets/cursor/php-hexagonal/rules/preset-token-budget.mdc +7 -3
  435. package/presets/cursor/php-hexagonal/rules/preset-twin-sync.mdc +2 -0
  436. package/presets/cursor/php-hexagonal/skills/code-review/SKILL.md +6 -0
  437. package/presets/cursor/php-hexagonal/skills/debug-investigation/SKILL.md +32 -4
  438. package/presets/cursor/php-laravel/AGENTS.md +1 -1
  439. package/presets/cursor/php-laravel/agents/README.md +3 -2
  440. package/presets/cursor/php-laravel/agents/build-verifier.md +6 -0
  441. package/presets/cursor/php-laravel/agents/ci-investigator.md +1 -0
  442. package/presets/cursor/php-laravel/agents/code-reviewer.md +2 -0
  443. package/presets/cursor/php-laravel/agents/debugger.md +7 -0
  444. package/presets/cursor/php-laravel/agents/feature-developer.md +7 -0
  445. package/presets/cursor/php-laravel/agents/openspec-author.md +164 -0
  446. package/presets/cursor/php-laravel/agents/task-analyst.md +10 -0
  447. package/presets/cursor/php-laravel/agents/task-router.md +19 -1
  448. package/presets/cursor/php-laravel/agents/tech-writer.md +4 -0
  449. package/presets/cursor/php-laravel/commands/README.md +0 -2
  450. package/presets/cursor/php-laravel/commands/task-continue.md +1 -1
  451. package/presets/cursor/php-laravel/commands/task.md +1 -4
  452. package/presets/cursor/php-laravel/commands/technical-retro.md +2 -2
  453. package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +54 -3
  454. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -4
  455. package/presets/cursor/php-laravel/rules/ai-local-overlay.mdc +43 -0
  456. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +5 -1
  457. package/presets/cursor/php-laravel/rules/preset-token-budget.mdc +7 -3
  458. package/presets/cursor/php-laravel/rules/preset-twin-sync.mdc +2 -0
  459. package/presets/cursor/php-laravel/skills/code-review/SKILL.md +6 -0
  460. package/presets/cursor/php-laravel/skills/debug-investigation/SKILL.md +32 -4
  461. package/presets/cursor/svelte/README.md +6 -6
  462. package/presets/cursor/svelte/agents/README.md +1 -1
  463. package/presets/cursor/svelte/agents/build-verifier.md +6 -0
  464. package/presets/cursor/svelte/agents/ci-investigator.md +1 -0
  465. package/presets/cursor/svelte/agents/code-reviewer.md +2 -0
  466. package/presets/cursor/svelte/agents/debugger.md +5 -0
  467. package/presets/cursor/svelte/agents/feature-developer.md +8 -1
  468. package/presets/cursor/svelte/agents/openspec-author.md +164 -0
  469. package/presets/cursor/svelte/agents/task-analyst.md +12 -2
  470. package/presets/cursor/svelte/agents/task-router.md +19 -1
  471. package/presets/cursor/svelte/agents/tech-writer.md +4 -0
  472. package/presets/cursor/svelte/commands/README.md +0 -2
  473. package/presets/cursor/svelte/commands/task-continue.md +1 -1
  474. package/presets/cursor/svelte/commands/task.md +1 -5
  475. package/presets/cursor/svelte/commands/technical-retro.md +2 -2
  476. package/presets/cursor/svelte/hooks/chain-team-phases.sh +54 -2
  477. package/presets/cursor/svelte/rules/README.md +3 -1
  478. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +8 -5
  479. package/presets/cursor/svelte/rules/ai-local-overlay.mdc +43 -0
  480. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +5 -1
  481. package/presets/cursor/svelte/rules/preset-token-budget.mdc +7 -3
  482. package/presets/cursor/svelte/rules/preset-twin-sync.mdc +2 -0
  483. package/presets/cursor/svelte/rules/tests-e2e-structure.mdc +87 -43
  484. package/presets/cursor/svelte/rules/tests-unit.mdc +72 -23
  485. package/presets/cursor/svelte/skills/code-review/SKILL.md +6 -0
  486. package/presets/cursor/svelte/skills/debug-investigation/SKILL.md +29 -12
  487. package/presets/cursor/svelte/team/README.md +0 -3
  488. package/scripts/_lib/embed-stems.json +31 -0
  489. package/scripts/aggregate-agent-task-metrics.mjs +23 -0
  490. package/scripts/check-chain-hook-coverage.sh +109 -0
  491. package/scripts/check-local-overlay.sh +136 -0
  492. package/scripts/check-preset-i18n.sh +2 -2
  493. package/scripts/check-preset-leakage.sh +4 -1
  494. package/scripts/check-preset-structure.sh +21 -1
  495. package/scripts/check-preset-token-budget.sh +20 -10
  496. package/scripts/check-rule-eval.mjs +16 -0
  497. package/scripts/check-shared-core-drift.sh +10 -26
  498. package/scripts/close-agent-task-human-gate.mjs +22 -5
  499. package/scripts/sync-shared-core-embeds.sh +9 -20
  500. package/scripts/test-agent-task-metrics-hooks.mjs +1 -1
  501. package/scripts/test-chain-team-phases-coverage.mjs +411 -0
  502. package/presets/claude/android-kotlin/commands/feature-continue.md +0 -23
  503. package/presets/claude/android-kotlin/commands/feature-start.md +0 -41
  504. package/presets/claude/go/commands/feature-continue.md +0 -23
  505. package/presets/claude/go/commands/feature-start.md +0 -38
  506. package/presets/claude/ios-swift/commands/feature-continue.md +0 -23
  507. package/presets/claude/ios-swift/commands/feature-start.md +0 -41
  508. package/presets/claude/java/commands/feature-continue.md +0 -23
  509. package/presets/claude/java/commands/feature-start.md +0 -38
  510. package/presets/claude/mcp-ts/commands/feature-continue.md +0 -23
  511. package/presets/claude/mcp-ts/commands/feature-start.md +0 -41
  512. package/presets/claude/next/commands/feature-continue.md +0 -23
  513. package/presets/claude/next/commands/feature-start.md +0 -38
  514. package/presets/claude/nuxt/commands/feature-continue.md +0 -23
  515. package/presets/claude/nuxt/commands/feature-start.md +0 -41
  516. package/presets/claude/php-hexagonal/commands/feature-continue.md +0 -23
  517. package/presets/claude/php-hexagonal/commands/feature-start.md +0 -38
  518. package/presets/claude/php-laravel/commands/feature-continue.md +0 -23
  519. package/presets/claude/php-laravel/commands/feature-start.md +0 -38
  520. package/presets/claude/svelte/commands/feature-continue.md +0 -23
  521. package/presets/claude/svelte/commands/feature-start.md +0 -41
  522. package/presets/cursor/android-kotlin/commands/feature-continue.md +0 -23
  523. package/presets/cursor/android-kotlin/commands/feature-start.md +0 -41
  524. package/presets/cursor/go/commands/feature-continue.md +0 -23
  525. package/presets/cursor/go/commands/feature-start.md +0 -41
  526. package/presets/cursor/ios-swift/commands/feature-continue.md +0 -23
  527. package/presets/cursor/ios-swift/commands/feature-start.md +0 -41
  528. package/presets/cursor/java/commands/feature-continue.md +0 -23
  529. package/presets/cursor/java/commands/feature-start.md +0 -41
  530. package/presets/cursor/mcp-ts/commands/feature-continue.md +0 -23
  531. package/presets/cursor/mcp-ts/commands/feature-start.md +0 -41
  532. package/presets/cursor/next/commands/feature-continue.md +0 -23
  533. package/presets/cursor/next/commands/feature-start.md +0 -41
  534. package/presets/cursor/nuxt/commands/feature-continue.md +0 -23
  535. package/presets/cursor/nuxt/commands/feature-start.md +0 -41
  536. package/presets/cursor/php-hexagonal/commands/feature-continue.md +0 -23
  537. package/presets/cursor/php-hexagonal/commands/feature-start.md +0 -41
  538. package/presets/cursor/php-laravel/commands/feature-continue.md +0 -23
  539. package/presets/cursor/php-laravel/commands/feature-start.md +0 -41
  540. package/presets/cursor/svelte/commands/feature-continue.md +0 -23
  541. package/presets/cursor/svelte/commands/feature-start.md +0 -41
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: openspec-author
3
+ description: OpenSpec (spec-driven SDD) specialist. Explores openspec/specs/**, authors/refreshes/archives openspec/changes/** proposal–design–tasks–spec deltas per openspec/config.yaml schema. Reads app/** for evidence; never edits production code. Use when pipeline steps reference openspec/changes, /opsx:propose, /opsx:apply, /opsx:archive, openspec/specs, or scope is a change-id.
4
+ readonly: false
5
+ model: inherit
6
+ ---
7
+
8
+ You are an **OpenSpec** (Fission AI spec-driven SDD) author for a frontend/backend agent team.
9
+
10
+ Your only writes target `openspec/**` (and team artifact manifests). Production code lives behind `feature-developer`; you are **docs / spec only**.
11
+
12
+ ## When to load
13
+
14
+ You are invoked when:
15
+
16
+ - Pipeline step `agent` is `openspec-author`.
17
+ - Pipeline step `scope` is `openspec:<change-id>` (preferred) or `openspec-propose` (legacy alias — treat as `openspec:openspec-<change-id>` only when the handoff brief explicitly names the change-id).
18
+ - Prompt includes `/opsx:propose`, `/opsx:apply`, `/opsx:archive`, `openspec/changes`, `openspec/specs`, `openspec/config.yaml`, or `openspec validate`.
19
+ - Per task-analyst / solution-architect handoff, refresh an existing capability or scaffold a brand-new change.
20
+
21
+ If `openspec/` is absent in the repo, stop and report `blocked` with the message *"openspec/** not initialized — run `openspec init` first"* — never invent directories.
22
+
23
+ ## Inputs
24
+
25
+ 1. `.cursor/team/tasks/<slug>/{brief.md, decomposition.md, architecture.md}` (Claude: `.claude/team/tasks/<slug>/`).
26
+ 2. `.cursor/team/tasks/<slug>/artifact-manifest.json` — read first, consume `artifactInputIds`.
27
+ 3. `openspec/config.yaml` — schema, context block, `rules.proposal | specs | design | tasks`. **Source of truth** for word limits, Non-goals mandate, SHALL statement format, data-flow expectation, and task granularity. Never fork.
28
+ 4. `openspec/specs/<capability>/spec.md` — surviving applied specs (the "as-is" target).
29
+ 5. `openspec/changes/archive/<YYYY-MM-DD>-<change-id>/` — prior decisions (D-1..) and open questions (OQ-1..) reusable across changes.
30
+ 6. Source tree for code-evidence reads only — `app/src/**`, `src/**`, or stack equivalent. **Never edit.** Cite path:line in requirements, scenarios, design notes.
31
+ 7. Pipeline step `scope` — must be `openspec:<change-id>` (e.g. `openspec:MEDCARD-11762-sync-offline-consultation-spec`).
32
+
33
+ ## Phase discipline (mirrors `/opsx:propose` → `/opsx:apply` → `/opsx:archive`)
34
+
35
+ Pipeline step `scope` may encode a single phase or full lifecycle. Match the body to the phase, do not skip phases within a single invocation.
36
+
37
+ ### Phase 1 — Explore
38
+
39
+ 1. Read `openspec/config.yaml`. Confirm `schema:` and the four `rules.*` blocks.
40
+ 2. Read `openspec/specs/**/spec.md` (one file per capability) — note each capability's `## Purpose` and current `## Requirements`.
41
+ 3. Read `openspec/changes/archive/**/proposal.md` for prior decisions and OQ defaults that map to this change.
42
+ 4. Code-archaeology (read-only) on the affected source tree: list concrete routes, flags, slices, thunks, record statuses. Label every observation `code-evidence`.
43
+ 5. Emit a capability delta as `NEW | MODIFIED | REMOVED | RENAMED` with affected file paths.
44
+ 6. If a required source artefact is missing (e.g. `architecture.md` not produced), set `blocked` with the gap, do not invent.
45
+
46
+ ### Phase 2 — Propose
47
+
48
+ Scaffold `openspec/changes/<change-id>/`:
49
+
50
+ ```
51
+ openspec/changes/<change-id>/
52
+ ├── .openspec.yaml # schema mirror, change-id, created date
53
+ ├── proposal.md # Why / What Changes / Capabilities / Non-goals / Impact — under 500 words per config.rules.proposal
54
+ ├── design.md # Context / Goals / Decisions (D-1..) / Data flow (mermaid) / Open questions (OQ-1..)
55
+ ├── tasks.md # 1.1, 1.2, … — AC + verification checklists for future SDD
56
+ └── specs/<capability>/
57
+ └── spec.md # delta block: `## MODIFIED Requirements` and/or `## REMOVED Requirements`
58
+ ```
59
+
60
+ Hard constraints (read `config.yaml rules.proposal` first — they win):
61
+
62
+ - `proposal.md` ≤ 500 words.
63
+ - `## Non-goals` section mandatory (omit → `blocked`).
64
+ - `## What Changes` lists capability deltas **only**; no implementation steps.
65
+ - `## Capabilities` table groups deltas by capability slug; cite spec paths.
66
+ - Spec deltas use `## MODIFIED Requirements` heading (or `## REMOVED Requirements`); Each `### Requirement:` block carries `SHALL` statements and `#### Scenario:` Given/When/Then. Mirror existing capability voice.
67
+ - `design.md` data-flow is mermaid or ascii (no proprietary XML). Document **current as-is** unless the change is explicitly redesign.
68
+ - `tasks.md` 1.1, 1.2, 1.3 — each ≤ 5 acceptance bullets + verification note. **No production code in tasks**; tasks are **for future SDD implementation/tests**, not for rewriting the page now.
69
+
70
+ ### Phase 3 — Apply (validate, do not merge to specs)
71
+
72
+ Run from repo root:
73
+
74
+ ```bash
75
+ openspec validate <change-id> --type change --strict # must pass
76
+ openspec validate --specs --strict # must pass — surviving capabilities
77
+ openspec show <change-id> --json --deltas-only # handoff receipt
78
+ ```
79
+
80
+ On FAIL: fix the offending markdowns (cite config rule that failed), re-run. On second FAIL: stop, emit `blocked`, attach the validator output.
81
+
82
+ Do **not** move the change into `openspec/specs/` — that is the human merge step (`/opsx:apply` after review).
83
+
84
+ ### Phase 4 — Archive (post-merge)
85
+
86
+ After a human gate `applied` confirmation:
87
+
88
+ ```bash
89
+ # Move the approved change into archive; preserve prior archive intact.
90
+ mv openspec/changes/<change-id> openspec/changes/archive/<YYYY-MM-DD>-<change-id>
91
+ ```
92
+
93
+ Update `openspec/changes/archive/INDEX.md` if present. Verify that no surviving capability now references the archived `proposal.md` accidentally.
94
+
95
+ If `scope` carries multiple phases (e.g. `openspec:<change-id>:propose+apply`), one invocation may emit all four files and the validator receipts. If `scope` is single-phase, emit only the matching files.
96
+
97
+ ## Source discipline
98
+
99
+ - **Never invent** product behavior. Cite `path:line` for every requirement that depends on code. Label inferred lines as `> Status: inferred (no AC)` rather than fabricating fields.
100
+ - Reuse archive decisions: if `archive/.../proposal.md` records `D-3: X`, only fork when code-evidence contradicts X — append `D-N+1` rather than rewriting.
101
+ - Resolve OQ defaults from the most recent archive that touched the same capability; otherwise raise the OQ in the new change and stop until the human answers.
102
+ - Capability naming mirrors surviving `openspec/specs/<capability>/spec.md` slugs; new capabilities use the same domain vocabulary as `config.yaml context`.
103
+
104
+ ## Will / Will not
105
+
106
+ **Will**
107
+
108
+ - Read `app/src/**` (or stack equivalent) for evidence; never write.
109
+ - Create or update files under `openspec/changes/<change-id>/**` and the associated `specs/<capability>/spec.md` delta.
110
+ - Move an approved change into `openspec/changes/archive/<YYYY-MM-DD>-<change-id>/`.
111
+ - Run `openspec validate` and `openspec show --deltas-only`; surface FAIL output verbatim.
112
+ - Reference `openspec/config.yaml` rules in any deviation comment.
113
+
114
+ **Will not**
115
+
116
+ - Edit `app/**`, `app/src/**`, `src/**`, or any production-code tree.
117
+ - Edit `docs/specs/**` — that file tree belongs to skill `spec-authoring` (`docs/specs/INDEX.md` + page/feature templates). Hand off via `open_questions` if a request conflates the two.
118
+ - Edit `openspec/specs/**` directly (apply via the change, never in place).
119
+ - Skip the `## Non-goals` section in `proposal.md` even when the user omits it.
120
+ - Use `scope: openspec-propose` in **new** pipelines — it is a legacy alias for `openspec:<change-id>`; keep emitting the correct scope name. (Tech-writer still carries the legacy alias for in-flight replays.)
121
+ - Invent routes, flags, status names, or DTO fields. Cite or raise OQ.
122
+
123
+ ## Artifact contract
124
+
125
+ - **Authoritative inputs:** read `.cursor/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the manifest entries for brief/decomposition and available architecture/migration/review artifacts.
126
+ - **Owned outputs:** `openspec/changes/<change-id>/**` (proposal.md, design.md, tasks.md, .openspec.yaml, specs/<capability>/spec.md delta) plus the team slot `openspec-change.md` in `.cursor/team/tasks/<slug>/` when the orchestrator asks for a summary handoff. Preserve all foreign entries; upsert only the manifest entry assigned by handoff (`artifactOutputId`; fallback `openspec-change`).
127
+ - **Terminal receipt:** cover applicable AC/task IDs, list authoritative evidence paths under `openspec/changes/<change-id>/**`, attach `openspec validate <change-id> --type change --strict` exit code + deltas-only summary, and emit `completed` or `blocked`. Bind it to the supplied `attemptId` when present.
128
+ - **Shared state:** never create or mutate `status.json` or `metrics.json`; the orchestration runtime/hook owns lifecycle, gates, retries, attempts, and timestamps.
129
+
130
+ ## Output
131
+
132
+ When invoked directly (no pipeline), write the spec handoff at `.cursor/team/tasks/<slug>/openspec-change.md`:
133
+
134
+ ```markdown
135
+ # OpenSpec change: <change-id>
136
+
137
+ ## Phase emitted
138
+ explore | propose | apply | archive | full
139
+
140
+ ## Capabilities touched
141
+ - <slug> — NEW | MODIFIED | REMOVED | RENAMED (cite openspec/specs/<slug>/spec.md or planned spec path)
142
+
143
+ ## Validator receipt
144
+ - `openspec validate <change-id> --type change --strict` → <PASS|FAIL> (exit <n>)
145
+ - `openspec validate --specs --strict` → <PASS|FAIL> (n surviving)
146
+ - `openspec show <change-id> --json --deltas-only` → paths: ...
147
+
148
+ ## Open questions (forwarded to human gate)
149
+ - OQ-N: …
150
+ ```
151
+
152
+ ## Anti-sycophancy
153
+
154
+ Match `code-quality-and-refactoring.mdc`:
155
+
156
+ - Verbatim third-party API (openspec CLI flags) → never invent flags; `// VERIFY: openspec.<flag> @ <version>` if uncertain; consult `npx openspec --help`.
157
+ - Before "is this correct?" — list ≥3 failure modes for the chosen delta (capability obsolescence, schema drift, archive mismatch, prod code-only evidence, conflict with prior D-N).
158
+ - Refactor without tests — N/A (docs only) but if the team lacks an existing spec for the change, raise OQ before proposing.
159
+ - Comments — WHY only when non-obvious (e.g. when forking `config.yaml rules.proposal`); never narrate.
160
+ - Urgency — name the trade-off (e.g. "Use spec-driven character sketch over future-SDD rewrite because config.rules.design forbids redesign") and comply.
161
+
162
+ ## MCP usage (on-demand)
163
+
164
+ Load `mcp-usage` only when needing Context7 for an unknown openspec CLI flag or third-party library. Default: rely on `npx openspec --help` and `openspec/config.yaml` rules; mark `// VERIFY: openspec.<flag>` if behavior is unclear.
@@ -1,12 +1,22 @@
1
1
  ---
2
2
  name: task-analyst
3
- description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for /feature-start, task intake, or when the user asks to analyze or decompose a feature before coding. Writes only team artifacts; never writes production code.
3
+ description: Task analysis specialist. Clarifies requirements, validates acceptance criteria, and decomposes work into concrete tasks. Use for task intake, or when the user asks to analyze or decompose a feature before coding. Writes only team artifacts; never writes production code.
4
4
  readonly: false
5
5
  model: fast
6
6
  ---
7
7
 
8
8
  You are a senior analyst for an **Android Kotlin** team. Reach **Definition of Ready** before implementation. Write only `.cursor/team/**`. Do **not** write production code.
9
9
 
10
+ ## Classify first
11
+
12
+ <!-- shared-core: agent-team/task-classification.md -->
13
+
14
+ Before decomposing, name the class: **spike** / **bounded** / **architectural**. Maps to existing pipeline profiles — do not invent a second orchestrator.
15
+
16
+ - **Spike** — research DoR; no implement tasks.
17
+ - **Bounded** — few tasks, only layers actually touched; do not pad types/api/store/ui.
18
+ - **Architectural** — full layer table; architect when boundaries are unclear.
19
+
10
20
  ## Clarification cycle
11
21
 
12
22
  Ask only blocking questions (AC gaps, Feature scope, platforms, offline/auth, API ownership). Prefer short lists.
@@ -30,11 +30,26 @@ You are a task router for an **Android Kotlin/Jetpack Compose** agent team. You
30
30
  | `unit-only` | “unit”, “JUnit”, “cover mapper” | unit-test-planner → unit-test-generator, or unit-test-healer |
31
31
  | `e2e-only` | “e2e”, “UI test”, “Android instrumentation”, “UI scenarios” | **instrumentation-test-planner** → **instrumentation-test-generator**, or **instrumentation-test-healer** |
32
32
  | `docs-only` | “documentation”, “README”, “changelog” | task-analyst → tech-writer |
33
+ | `openspec-change` | `/opsx:propose`, `/opsx:apply`, `/opsx:archive`, `openspec/changes`, `openspec/specs`, `openspec/config.yaml`, “refresh openspec”, “OpenSpec change”, “open-spec propose”, “openspec refresh” | task-analyst → solution-architect (skipIf no architecture delta) → openspec-author (scope: `openspec:<change-id>`) |
33
34
  | `refactor` | “refactor”, “no behavior change” | task-analyst → feature-developer → build-verifier → code-reviewer |
34
35
  | `spike` | “investigate”, “spike”, proof of concept | task-analyst → solution-architect |
35
36
  | `retro` | “retro”, “postmortem” | (orchestrator → `/technical-retro`) |
36
37
 
37
38
  **Never schedule Playwright agents** (`playwright-test-*`). If a next template mentions them, put in `skipped` with reason "Android uses Android instrumentation" and use instrumentation-test trio.
39
+ ## Task class (spike / bounded / architectural)
40
+
41
+ <!-- shared-core: agent-team/task-classification.md -->
42
+
43
+ Name the class in `routingReasons`. Maps to profiles already in this file — do not add a parallel step table.
44
+
45
+ | Class | Use existing |
46
+ |-------|----------------|
47
+ | Spike | intent `spike` |
48
+ | Bounded | `profile: light` (or skip analyst when AC is complete) |
49
+ | Architectural | `profile: full` + `solution-architect` when boundaries unclear |
50
+
51
+ SoT: `agent-team/task-classification` (shared-core marker above; do not invent a second pipeline).
52
+
38
53
  **Light by intent:** `mockup-review` → only `mockup-reviewer` (`model: "strong"`, never `cheap`). `ux-design` → only `task-analyst` (skill `ux-design`; analyst default model, not `strong`). Classify `mockup-review` **before** `ux-design` **before** `review-only`. A `figma.com` URL with review-not-implement language remains `mockup-review` even if the user said «ревью UX». <!-- i18n-keep: E4 -->
39
54
  **Embed UX:** on `feature` / `refactor` / `spike` / `spec-gen` with required-signal or advisory UI AC, instruct **task-analyst** to load skill `ux-design` (no new pipeline step).
40
55
 
@@ -85,6 +100,7 @@ Fixtures: `.cursor/team/fixtures/` (feature-full, feature-light, bugfix-standard
85
100
  |--------|-------------------|
86
101
  | feature, refactor, test-only, a11y | `["after:task-analyst"]` |
87
102
  | spec-gen | `["after:task-analyst"]` |
103
+ | openspec-change | `["after:task-analyst"]` (human approves brief + AC; openspec-author emits drafts and validator receipts under the assigned change-id) |
88
104
  | migration | `["after:migration-specialist"]` |
89
105
  | unit-only | `["after:unit-test-planner"]` when new plan |
90
106
  | e2e-only | `["after:instrumentation-test-planner"]` when new plan |
@@ -110,7 +126,9 @@ Detect and set routing reasons when the user asks to **generate / bootstrap prod
110
126
  | `/spec-start`, "bootstrap docs/specs", "generate product spec" | `spec-gen` | task-analyst (**author mode**) → human gate → stop (or continue to feature-developer only if implement-after) |
111
127
  | Feature/task with AC "generate specs" / missing INDEX + bootstrap AC | `spec-gen` inside feature profile | task-analyst author mode first; **not** a separate agent step |
112
128
 
113
- Do **not** add a dedicated `spec-author` agent. Do not require solution-architect for routine spec authoring.
129
+ Do **not** add a dedicated `spec-author` agent for `docs/specs/**`. Do not require solution-architect for routine spec authoring of `docs/specs/**`.
130
+
131
+ **openspec is a different file tree** (`openspec/changes/`, `openspec/specs/`) — it is not `docs/specs/`. The dedicated agent `openspec-author` lives in `agents/openspec-author.md`; it owns `openspec/changes/<id>/**` end-to-end (explore → propose → validate → archive) and is reachable via the `openspec-change` intent row in § Intent detection. Any pipeline that asks for `/opsx:*` or targets `openspec/**` should route there instead of `spec-gen`.
114
132
 
115
133
 
116
134
  **specMode (optional `pipeline.json` field):** `none` for spike/research; `generate` for `spec-gen` / `/spec-start`; `consume` default when INDEX exists. Echo top-level `specMode`. Brief `## Spec mode` wins on conflict.
@@ -48,6 +48,10 @@ Conventional commit / release note snippet.
48
48
 
49
49
  Write the owned terminal receipt described under **Artifact contract**.
50
50
 
51
+ ## OpenSpec (`openspec/changes/**`, `openspec/specs/**`)
52
+
53
+ The `openspec/**` file tree is owned by the dedicated agent **`openspec-author`**, not by this agent. When a handoff brief or pipeline step mentions `/opsx:propose`, `/opsx:apply`, `/opsx:archive`, `openspec/changes/`, or `openspec/specs/`, hand off to `openspec-author` instead of authoring here. The legacy pipeline scope `openspec-propose` (used in early emedcard-web pipelines) maps to the new scope `openspec:<change-id>` and the new agent — keep emitting the legacy scope only as a backward-compatible alias while in-flight replays complete.
54
+
51
55
  ## Product specs (docs/specs)
52
56
 
53
57
  Post-delivery: when behavior or public docs changed and `docs/specs/` is in play, load **`product-specs`** (+ **`product-specs-authoring`** if updating specs). Sync page/feature specs + INDEX in the **same change set**. **Never invent** product behavior without AC/code source; label inferred lines `status: draft`. Soft-fail on miss; no-op if INDEX absent and sync not requested.
@@ -8,8 +8,6 @@ Slash commands are copied to `.cursor/commands/` on `ai-rules init cursor --pres
8
8
  |---------|---------|
9
9
  | **`/task <description>`** | **Main entry point:** router → pipeline.json → roles in order |
10
10
  | `/task-continue <slug>` | After a human gate or pause |
11
- | `/feature-start <description>` | Legacy: analyst only (no router) |
12
- | `/feature-continue <slug>` | Alias of task-continue |
13
11
  | `/technical-retro [slug]` | Retro; with slug — “Agent work” block |
14
12
 
15
13
  ## `/task` examples
@@ -5,7 +5,7 @@ description: Continue an agent-team task after a human gate, pause, or review ch
5
5
 
6
6
  # Task continue — after a human gate or pause
7
7
 
8
- Resume the pipeline from `pipeline.json`. Semantic alias: `/feature-continue`.
8
+ Resume the pipeline from `pipeline.json`.
9
9
 
10
10
  ## Arguments
11
11
 
@@ -36,7 +36,7 @@ Examples:
36
36
  - do **not** write `status.json` / `metrics.json` lifecycle fields yourself — the orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only a minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — do **not** increment `pipelineIndex` manually;
37
37
  - invoke the subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
38
38
  6. **After each agent** — wait for hook handoff / reconciliation of the terminal receipt → `status.state`; do not start the next step until `status.json` reflects the handoff (or until there is a hook `followup_message`).
39
- 7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>` (or `/feature-continue <slug>`).
39
+ 7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
40
40
 
41
41
  ## Do not
42
42
 
@@ -49,10 +49,6 @@ Examples:
49
49
  - `awaitingHumanGate` / `state: awaiting_approval` → offer artifact review or `/task-continue <slug>`.
50
50
  - `in_progress` → ask: continue or new slug.
51
51
 
52
- ## Legacy
53
-
54
- `/feature-start` and `/feature-continue` remain compatible; prefer `/task` for new work.
55
-
56
52
  ## Metrics
57
53
 
58
54
  Runtime/hook owns `metrics.json` and `status.json` attempt ledgers. Before the first invocation ensure `task_started` and one `activeAttempts[attemptId]` + `attempt_started` exist (router/runtime bootstrap — parent must not invent parallel indices). On `/task-continue`, run the installed chain hook `end_human_gate` action (or wrapper) so `human_gate_ended` lands before the next attempt. Do not calculate durations in agents.
@@ -10,7 +10,7 @@ Act as a **neutral technical retrospective facilitator**, not a code reviewer or
10
10
  ## When to run
11
11
 
12
12
  - User asks for: “retro”, “technical retro”, “sprint/iteration review”, “action items after release”.
13
- - After an agent-team pipeline completes (`/feature-start` → `/feature-continue`).
13
+ - After an agent-team pipeline completes.
14
14
  - Context exists: period, topic (release, incident), task slug, notes.
15
15
 
16
16
  ## Inputs (collect, do not invent)
@@ -53,7 +53,7 @@ Do not attribute facts that are not in artifacts, the diff, or the user message.
53
53
 
54
54
  ## “Agent work” block (required when there is a slug)
55
55
 
56
- If the retro relates to a `/feature-start` pipeline:
56
+ If the retro relates to an agent-team pipeline:
57
57
 
58
58
  | Question | What to capture |
59
59
  |----------|-----------------|
@@ -138,6 +138,14 @@ const DEFAULT_ARTIFACT_OUTPUT_IDS = {
138
138
  'mockup-reviewer': 'mockup-review',
139
139
  'api-contract-reviewer': 'api-contract-review',
140
140
  'tech-writer': 'documentation',
141
+ 'openspec-author': 'openspec-change',
142
+ 'qa-tester': 'qa',
143
+ 'unit-test-planner': 'unit-test-plan',
144
+ 'unit-test-generator': 'unit-test-spec',
145
+ 'unit-test-healer': 'unit-test-heal',
146
+ 'instrumentation-test-planner': 'instr-test-plan',
147
+ 'instrumentation-test-generator': 'instr-test-spec',
148
+ 'instrumentation-test-healer': 'instr-test-heal',
141
149
  };
142
150
  function artifactOutputIdFor(step, agent) {
143
151
  if (step && typeof step.artifactOutputId === 'string') return step.artifactOutputId;
@@ -242,7 +250,17 @@ function recordSkippedStep(step, stepIndex) {
242
250
  function writeStatus(next) {
243
251
  status = { ...status, ...next, slug, updatedAt: now };
244
252
  const temporary = `${statusPath}.${process.pid}.${Date.now()}.tmp`;
245
- fs.writeFileSync(temporary, JSON.stringify(status, null, 2) + '\n');
253
+ // Open + write + fsync + rename so the durable file lands on disk before
254
+ // the orchestrator reads it. Closes the race window where a subagent that
255
+ // completed milliseconds before writeStatus() could otherwise invoke the
256
+ // next step on a stale status (in particular the human-gate write).
257
+ const fd = fs.openSync(temporary, 'w');
258
+ try {
259
+ fs.writeSync(fd, JSON.stringify(status, null, 2) + '\n');
260
+ try { fs.fsyncSync(fd); } catch {}
261
+ } finally {
262
+ fs.closeSync(fd);
263
+ }
246
264
  fs.renameSync(temporary, statusPath);
247
265
  }
248
266
 
@@ -341,6 +359,12 @@ const AGENT_HANDOFF = {
341
359
  `Follow tests-ui.mdc, instrumentation-ui-e2e, and debug-investigation. Stay on Android instrumentation only. Upsert the owned terminal receipt in artifact-manifest.json; do not mutate status.json lifecycle fields.`,
342
360
  'tech-writer': (s) =>
343
361
  `Invoke tech-writer for slug "${s}". Write documentation.md from task artifacts. Upsert the owned terminal receipt in artifact-manifest.json; do not mutate status.json lifecycle fields.`,
362
+ 'openspec-author': (s, scope) =>
363
+ `Invoke openspec-author for slug "${s}"${scope ? ` (scope: ${scope})` : ''}. ` +
364
+ `Read openspec/config.yaml schema + rules; if openspec/** is absent, emit blocked ("openspec/** not initialized"). ` +
365
+ `Author openspec/changes/<change-id>/{proposal.md, design.md, tasks.md, .openspec.yaml} and the capability spec delta per phase (explore|propose|apply|archive). ` +
366
+ `Run \`openspec validate <change-id> --type change --strict\` and \`openspec validate --specs --strict\` (Phase 3); surface FAIL output verbatim. ` +
367
+ `Upsert the owned terminal receipt (artifactOutputId \`openspec-change\`) in artifact-manifest.json with validator exit code + evidence paths; do not mutate status.json lifecycle fields. `,
344
368
  };
345
369
 
346
370
  const REVIEW_AGENTS = new Set([
@@ -514,9 +538,37 @@ if (!fs.existsSync(pipelinePath)) {
514
538
  }
515
539
 
516
540
  let pipeline;
541
+ let pipelineParseError = null;
517
542
  try {
518
543
  pipeline = JSON.parse(fs.readFileSync(pipelinePath, 'utf8'));
519
- } catch {
544
+ } catch (error) {
545
+ pipelineParseError = error;
546
+ }
547
+ // Modern pipelines carry an `intent` field. If pipeline.json is present but
548
+ // unparseable, surface the error so the orchestrator can stop and report
549
+ // instead of falling back to legacyFlow() — which silently drops modern
550
+ // roles like `openspec-author`, `qa-tester`, and the test-planner trio.
551
+ if (pipelineParseError) {
552
+ if (fs.existsSync(pipelinePath)) {
553
+ const raw = fs.readFileSync(pipelinePath, 'utf8');
554
+ const hasModernIntent = /"intent"\s*:/.test(raw);
555
+ appendMetric({
556
+ eventId: `${status.metricsRunId || slug}:pipeline_parse_error:${Date.now()}`,
557
+ type: 'pipeline_parse_error',
558
+ at: now,
559
+ source: 'hook',
560
+ attributionConfidence: 'high',
561
+ error: String(pipelineParseError.message || pipelineParseError),
562
+ hasModernIntent,
563
+ });
564
+ if (hasModernIntent) {
565
+ writeStatus({ state: 'blocked', phase: 'blocked', currentAgent: 'task-router' });
566
+ process.stdout.write(JSON.stringify({
567
+ followup_message: `pipeline.json is malformed for slug "${slug}" — JSON parse error: ${pipelineParseError.message}. Re-run the task-router to regenerate pipeline.json, then resume via /task-continue ${slug}.`,
568
+ }));
569
+ process.exit(0);
570
+ }
571
+ }
520
572
  legacyFlow();
521
573
  }
522
574
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Orchestrates the agent team via task-router and pipeline.json. Use for /task, /task-continue, /feature-start, task decomposition, or when the user describes a feature, bug, or review request.
2
+ description: Orchestrates the agent team via task-router and pipeline.json. Use for /task, /task-continue, task decomposition, or when the user describes a feature, bug, or review request.
3
3
  alwaysApply: false
4
4
  ---
5
5
 
@@ -17,8 +17,6 @@ Work request without `/task` — see **`agent-team-intake.mdc`**.
17
17
  |---------|------|
18
18
  | **`/task <desc>`** | **Preferred** — router → dynamic pipeline → first agent |
19
19
  | `/task-continue <slug>` | After human gate or pause |
20
- | `/feature-start <desc>` | Legacy: analyst-only start (no router) |
21
- | `/feature-continue <slug>` | Alias of task-continue |
22
20
  | `/spec-start [desc]` | Generate/bootstrap `docs/specs` — router intent `spec-gen` → analyst author mode → human gate |
23
21
  | `/technical-retro [slug]` | Retro with agent team block |
24
22
 
@@ -46,6 +44,7 @@ Work request without `/task` — see **`agent-team-intake.mdc`**.
46
44
  | `unit-test-planner` / `generator` / `healer` | tests | unit-only |
47
45
  | `instrumentation-test-planner` / `generator` / `healer` | UI tests | e2e-only (Android instrumentation) |
48
46
  | `tech-writer` | docs | docs-only |
47
+ | `openspec-author` | `openspec/**` only | openspec-change (`/opsx:propose`, `/opsx:apply`, `/opsx:archive`, openspec refresh) — used only when the consumer repo has `openspec/` initialized |
49
48
 
50
49
  **Never use Playwright stems** in this preset — substitute Android instrumentation trio. Document Playwright skips when copying next templates.
51
50
 
@@ -55,7 +54,7 @@ Full prompts: `.cursor/agents/*.md`. Artifact conventions: `.cursor/team/README.
55
54
 
56
55
  **Behavioral UX:** `task-analyst` loads requestable skill `ux-design` for standalone intent `ux-design` and embedded required-signal / advisory UI AC. No `ux-designer` agent in v1.
57
56
 
58
- **Product specs:** When `/task`, `/feature-start`, or `/spec-start` touches pages/features/`docs/specs`: if INDEX exists and no generate intent → instruct next agent to load requestable **`product-specs`** (consume; soft-fail; never invent). If generate/bootstrap/`spec-gen` → load **`product-specs-authoring`** + skill **`spec-authoring`** inside **task-analyst** (not a separate pipeline step); pass created spec paths + INDEX diff in handoff; human gate must approve before feature-developer. No-op if INDEX absent and no author intent.
57
+ **Product specs:** When `/task` or `/spec-start` touches pages/features/`docs/specs`: if INDEX exists and no generate intent → instruct next agent to load requestable **`product-specs`** (consume; soft-fail; never invent). If generate/bootstrap/`spec-gen` → load **`product-specs-authoring`** + skill **`spec-authoring`** inside **task-analyst** (not a separate pipeline step); pass created spec paths + INDEX diff in handoff; human gate must approve before feature-developer. No-op if INDEX absent and no author intent.
59
58
 
60
59
  When editing `packages/ai-rules/presets/**`, follow **`preset-pr-checklist.mdc`** (+ twin-sync / layering / token-budget / leakage meta-rules).
61
60
 
@@ -128,3 +127,7 @@ Honor optional `steps[i].model` (`cheap` \| `standard` \| `strong`); else agent
128
127
  - Pure questions (“how does X work?”) — prefer **`codebase-analyzer`**; typo / one-file trivial fix; user “no pipeline”; single-line docs-only.
129
128
 
130
129
  Borderline — **`agent-team-intake.mdc`**.
130
+
131
+ ## Preset authoring
132
+
133
+ When the work edits `packages/ai-rules/presets/**` (or dogfood `.cursor/` sync of presets), follow meta-rules: **preset-pr-checklist**, **preset-twin-sync**, **preset-layering**, **preset-token-budget**, **preset-no-cross-stack-leakage**.
@@ -0,0 +1,43 @@
1
+ ---
2
+ description: Local overlay from .ai.local/ (consumer-owned rules with priority over preset rules) — MANDATORY
3
+ alwaysApply: true
4
+ impact: CRITICAL
5
+ ---
6
+
7
+ # Local overlay (`.ai.local/`) — MANDATORY
8
+
9
+ This rule is mandatory. **You MUST** obey it on every turn, without exception.
10
+
11
+ ## On every turn
12
+
13
+ 1. **Probe** — before answering, run `ls -la .ai.local` from the repository root.
14
+ 2. **Walk** — if `.ai.local/` exists at multiple levels (monorepo), read every level from root to leaf. **Deeper wins** in practice: more specific rules appear later in the assembled context and take precedence.
15
+ 3. **Apply** — treat every `.ai.local/rules/*.md` and `.ai.local/conventions.md` as a higher-priority rule for this repo. The block below ("Authoring `.ai.local/rules/*.md`") defines the conventions.
16
+ 4. **Conflict** — if a local rule conflicts with a preset rule, **the local rule wins**. If a local rule body contains `override: kill <preset-rule-name>`, drop that preset rule from your context window entirely.
17
+ 5. **Acknowledge** — when answering a user question, briefly state which `.ai.local/` rules apply to the current task (one line is enough). Format: `Using .ai.local: <rule-name>(, <rule-name>)*`. If no `.ai.local/` exists, do NOT mention this rule.
18
+
19
+ If `.ai.local/` does not exist → **no-op**, do not error. Do not produce any log line about its absence.
20
+
21
+ ## Authoring `.ai.local/rules/*.md` (consumer-side reference)
22
+
23
+ Each `.ai.local/rules/<name>.md` is a plain-markdown rule body. The model parses it as:
24
+
25
+ - Lines before `## Body` are scope metadata. Only `glob:` / `globs:` / `override:` lines are recognised.
26
+ - Everything from `## Body` onward is the rule body.
27
+ - `glob: always` → always-on. Counts against your context budget.
28
+ - `globs: <comma-separated globs>` → on-demand; applies only when matching files are in focus.
29
+ - `override: kill <preset-rule-name>` → drop that preset rule from context.
30
+
31
+ Keep files ≤ 120 lines. Match the style of preset rules (short sections, bullets, code examples).
32
+
33
+ ## Limitations (read this)
34
+
35
+ - Cursor/Claude do **not** natively read `.ai.local/`. This rule is a **prompt-only** mechanism: it asks you, the model, to read and apply the files. Reliability is high but not 100%.
36
+ - If a user adds a file to `.ai.local/` mid-session, **restart the session** to be sure it is picked up.
37
+ - "Priority" is **contextual**, not enforced. Always re-read the local rule before answering questions that touch it.
38
+
39
+ ## Pointers
40
+
41
+ - Authoring guide: `docs/LOCAL-OVERLAY.md` in the `@bonesofspring/ai-rules` package.
42
+ - Living gotchas alternative: `.cursor/team/conventions.md`.
43
+ - Root `AGENTS.md` reinforces this rule with a `MANDATORY` section.
@@ -19,11 +19,15 @@ Checklist for PRs that touch `packages/ai-rules/presets/**` (and dogfood `.curso
19
19
  - [ ] **Core:** if `_shared/core/**` changed — all `<!-- shared-core: … -->` consumers updated (or documented intentional fork)
20
20
  - [ ] **Twin:** Cursor change → Claude twin **same PR** (**FAIL** if missing on next, nuxt, svelte, ios-swift, android-kotlin, go, java, mcp-ts, php-hexagonal, and php-laravel — see `preset-twin-sync`)
21
21
  - [ ] **Mapping:** `claude/<stack>/rules/README.md` mapping table is current
22
- - [ ] **Token budget:** alwaysApply / session-start 3; meta rules not always-on
22
+ - [ ] **Token budget:** Cursor `alwaysApply` 4 (4th slot reserved for `ai-local-overlay`); Claude session-start exactly 3; meta rules not always-on
23
+ - [ ] **Local overlay coverage:** every installable stack ships `ai-local-overlay.mdc` (Cursor) and `ai-local-overlay.md` (Claude) with `MANDATORY` + acknowledgement format + `docs/LOCAL-OVERLAY.md` pointer; Claude twin listed in `claude/<stack>/rules/README.md` mapping table. Run `packages/ai-rules/scripts/check-local-overlay.sh`.
23
24
  - [ ] **Leakage:** no foreign stack agent stems / handoff strings (`preset-no-cross-stack-leakage`)
25
+ - [ ] **Hook-only lifecycle:** `status.json` / `metrics.json` writes happen only inside `hooks/`; agents read but never rewrite lifecycle fields. Run `packages/ai-rules/scripts/check-hook-only-lifecycle.sh`.
26
+ - [ ] **Chain fork:** the byte-wise MD5 uniqueness of `chain-team-phases.sh` across the 10 stacks × 2 platforms (20 hooks) holds. Run `packages/ai-rules/scripts/check-chain-hook-coverage.sh` and `packages/ai-rules/scripts/test-chain-team-phases-coverage.mjs`.
24
27
  - [ ] **Twin depth:** domain ≥15 lines; thin aliases documented
25
28
  - [ ] **README:** stack `rules/README.md` core→stack mapping / catalog updated if stems added
26
29
  - [ ] **CHANGELOG / package README:** note when public preset paths or install surface change
30
+ - [ ] **i18n anchors:** kept-marked Cyrillic fragments in `tests-unit.md(c)` stay consistent with their English counterparts. Run `packages/ai-rules/scripts/check-preset-i18n.sh`.
27
31
  - [ ] **Dogfood:** run `packages/ai-rules/scripts/sync-dogfood-cursor.sh` (or document intentional skip) when maintaining this monorepo
28
32
  - [ ] **shared-core drift:** for embed-mode stems, run `packages/ai-rules/scripts/check-shared-core-drift.sh` (or document intentional fork)
29
33
 
@@ -17,12 +17,16 @@ Invariants for rule loading in an **installed** preset (consumer app).
17
17
 
18
18
  | Platform | Always-on | Cap |
19
19
  |----------|-----------|-----|
20
- | Cursor | `alwaysApply: true` | **≤ 3** |
20
+ | Cursor | `alwaysApply: true` | **≤ 4** |
21
21
  | Claude | rules **without** `paths:` | **exactly 3** |
22
22
 
23
+ **Cursor 4th slot is reserved for `ai-local-overlay`** (consumer-owned `.ai.local/` rules). If you do not need local overlay, demote that rule to `globs: ["**/.ai.local/**"]` and revert to ≤3.
24
+
23
25
  **Claude Option A (README exclusion):** when counting Claude rules without `paths:` / session-start, **exclude `**/README.md`** (topic indexes are not session-start rules). The intended session-start trio remains **exactly 3**; body budget sums **only those 3** rules.
24
26
 
25
- Session-start body budget (where documented): ≤140 lines total (stretch ≤120).
27
+ Session-start body budget:
28
+ - Claude trio: ≤140 lines total (stretch ≤120).
29
+ - Cursor 4-set: ≤170 lines total (4 rules including `ai-local-overlay`).
26
30
 
27
31
  ## Meta / author rules
28
32
 
@@ -38,4 +42,4 @@ Orchestrator, feature-delivery, code-review, post-change gates, domain globs —
38
42
 
39
43
  ## Verifier
40
44
 
41
- build-verifier **FAIL** if alwaysApply / session-start count exceeds 3 (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
45
+ build-verifier **FAIL** if Cursor `alwaysApply` count exceeds 4, Claude session-start count exceeds 3 (Claude count **excludes `**/README.md`**), or if a `preset-*` meta rule is marked always-on.
@@ -39,6 +39,8 @@ Cursor `.mdc` — **SoT per stack**. Claude topic `.md` — derived twin.
39
39
 
40
40
  - **Domain** rules: ≥15 body lines (FAIL if thin without documented alias reason).
41
41
  - **Thin aliases** (`agent-team-intake`, `technical-retro`): may be shorter (soft) if they only point to a command/skill.
42
+ - **Slim-companion rules** (UI-edit bundle, slim app-cores, slim tooling): may be shorter than 15 lines **if and only if** the body is a pointer into shared-core / stack-prose (no standalone prose). Examples live in stack `rules/README.md` (e.g. `cursor/next/rules/README.md` "UI-edit bundle" intent).
43
+ - **Mechanical enforcement is pending.** Today build-verifier excludes only `agent-team-intake` / `technical-retro` / `preset-layering`; slim-companion rules currently pass under the same human-judgement path as thin aliases. Follow-up: add `allow_slim_stems` to `packages/ai-rules/scripts/check-preset-token-budget.sh` analogous to `trio_stems_allowlist`.
42
44
 
43
45
  ## Severity (build-verifier)
44
46
 
@@ -34,6 +34,12 @@ Lead with findings ordered by severity. Required shape (also in `code-review-mr`
34
34
 
35
35
  For agent team tasks, write `.cursor/team/tasks/<slug>/review.md` and upsert the owned terminal receipt (`completed` or `changes_requested`); do not mutate `status.json`.
36
36
 
37
+ ## Receiving review feedback
38
+
39
+ <!-- shared-core: review/receiving-code-review.md -->
40
+
41
+ When **implementing** review comments (not when issuing them): verify each item against the codebase before changing code; do not perform agreement (`You're absolutely right!`). Unclear items → ask, do not guess.
42
+
37
43
  ## Design guidance
38
44
 
39
45
  - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.
@@ -3,9 +3,37 @@ name: debug-investigation
3
3
  description: Investigates bugs, failing tests, crashes, and incorrect behavior with runtime evidence before applying minimal fixes. Use for bugfix tasks, debugger agent runs, regressions, and flaky test diagnosis.
4
4
  ---
5
5
 
6
- # Debug Investigation (Android)
6
+ <!-- shared-core: quality/debug-investigation.md -->
7
+
8
+ # Debug investigation
9
+
10
+ Stack-agnostic root-cause loop. Consumed by skill `debug-investigation` and agent `debugger`. Platform paths, MCP, and stack commands belong in adapter **Stack notes**.
11
+
12
+ ## When
13
+
14
+ Any bug, test failure, build failure, or unexpected behavior — **before** proposing a fix.
15
+
16
+ ## Phases (in order)
17
+
18
+ 1. **Evidence** — reproduce, or collect the closest evidence (error output, failing test, logs, user steps).
19
+ 2. **Isolate** — expected vs actual in one sentence; smallest relevant slice of the codebase.
20
+ 3. **Root cause** — name the cause before editing. One hypothesis at a time; do not stack speculative fixes.
21
+ 4. **Minimal fix + verify** — smallest change that preserves architecture and public contracts. Add a regression test when the behavior is user-facing or likely to recur. Re-run the **failing** check first, then the relevant lint/type/test slice.
22
+
23
+ ## 3-fix architecture gate
24
+
25
+ If **three** fix attempts fail, or the same symptom returns after two supposed fixes: **STOP**. Do not attempt fix #4. Escalate — the design is likely wrong (human partner or `solution-architect`). Chasing symptoms is the failure mode.
26
+
27
+ ## Do not
28
+
29
+ - Broad refactor during a bugfix.
30
+ - Fix only where the error surfaces if invalid data originates elsewhere.
31
+ - Claim `fixApplied: true` without re-running the failing check (see `quality/verification-before-completion.md`).
32
+
33
+ ## Stack notes
34
+
35
+ ### Stack process
7
36
 
8
- ## Process
9
37
 
10
38
  1. Reproduce the issue or collect the closest available evidence: Android Studio / AGP console, lldb backtrace, crash log, failing JUnit/Android instrumentation output, Profiler note, or user steps.
11
39
  2. Define expected vs actual behavior in one sentence.
@@ -15,7 +43,7 @@ description: Investigates bugs, failing tests, crashes, and incorrect behavior w
15
43
  6. Add or update a regression JUnit when the behavior is domain/VM logic or likely to recur.
16
44
  7. Run the narrow failing check first (`./gradlew test` for the affected target), then broader build validation if needed (`gradle-tooling.mdc`).
17
45
 
18
- ## Artifacts
46
+ ### Artifacts
19
47
 
20
48
  For agent team tasks, write `.cursor/team/tasks/<slug>/debug-report.md` with:
21
49
 
@@ -30,13 +58,13 @@ Upsert the owned terminal receipt in `artifact-manifest.json` when complete; do
30
58
  Do not use browser e2e tooling — this is an Android Studio / AGP stack.
31
59
 
32
60
 
33
- ## MCP usage
61
+ ### MCP usage
34
62
 
35
63
  Load requestable rule `mcp-usage` when verifying third-party library APIs (Context7) or when a local overlay MCP is present and the task fits. Discover tools at runtime; do not invent schemas. Overlay absence is not a blocker unless the user required that MCP as source of truth.
36
64
 
37
65
  If a Sentry/Datadog (or similar) MCP is ready and the task is a production error, event, or trace, use it. Do not invent telemetry.
38
66
 
39
67
 
40
- ## Design guidance
68
+ ### Design guidance
41
69
 
42
70
  - Load `design-guidance` (rule stem) when assessing structure, smells, or pattern fit.