@bonesofspring/ai-rules 0.2.51 → 0.2.52

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 (275) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/bin/cli.js +14 -1
  3. package/bin/lib/ai-local-drift.js +55 -14
  4. package/bin/lib/seed-ai-local-team.js +18 -7
  5. package/bin/mavis-install.js +2 -0
  6. package/bin/opencode-install.js +2 -0
  7. package/docs/LOCAL-OVERLAY.md +1 -1
  8. package/docs/PRESET-CONTRIBUTION.md +11 -9
  9. package/package.json +5 -1
  10. package/presets/_shared/ai-local/scripts/manifest.mjs +13 -3
  11. package/presets/_shared/ai-local/scripts/rule-improver.mjs +428 -91
  12. package/presets/_shared/ai-local/scripts/run.mjs +22 -4
  13. package/presets/_shared/ai-local/scripts/signals.mjs +4 -1
  14. package/presets/_shared/core/meta/preset-pr-checklist.md +1 -1
  15. package/presets/_shared/core/quality/interactive-questions.md +8 -8
  16. package/presets/claude/android-kotlin/agents/code-reviewer.md +1 -0
  17. package/presets/claude/android-kotlin/rules/tooling-and-review/interactive-questions.md +8 -8
  18. package/presets/claude/android-kotlin/rules/tooling-and-review/language-policy.md +1 -1
  19. package/presets/claude/android-kotlin/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  20. package/presets/claude/go/agents/code-reviewer.md +1 -0
  21. package/presets/claude/go/rules/tooling-and-review/interactive-questions.md +8 -8
  22. package/presets/claude/go/rules/tooling-and-review/language-policy.md +1 -1
  23. package/presets/claude/go/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  24. package/presets/claude/ios-swift/agents/code-reviewer.md +1 -0
  25. package/presets/claude/ios-swift/rules/tooling-and-review/interactive-questions.md +8 -8
  26. package/presets/claude/ios-swift/rules/tooling-and-review/language-policy.md +1 -1
  27. package/presets/claude/ios-swift/rules/tooling-and-review/post-change-build.md +1 -1
  28. package/presets/claude/ios-swift/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  29. package/presets/claude/java/agents/code-reviewer.md +1 -0
  30. package/presets/claude/java/rules/tooling-and-review/interactive-questions.md +8 -8
  31. package/presets/claude/java/rules/tooling-and-review/language-policy.md +1 -1
  32. package/presets/claude/java/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  33. package/presets/claude/mcp-ts/rules/tooling-and-review/interactive-questions.md +8 -8
  34. package/presets/claude/mcp-ts/rules/tooling-and-review/language-policy.md +1 -1
  35. package/presets/claude/mcp-ts/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  36. package/presets/claude/next/MCP.md +7 -0
  37. package/presets/claude/next/README.md +1 -1
  38. package/presets/claude/next/REPO_AGENTS.md +1 -1
  39. package/presets/claude/next/agents/README.md +3 -3
  40. package/presets/claude/next/agents/build-verifier.md +9 -3
  41. package/presets/claude/next/agents/code-reviewer.md +2 -1
  42. package/presets/claude/next/agents/codebase-analyzer.md +1 -1
  43. package/presets/claude/next/agents/feature-developer.md +18 -8
  44. package/presets/claude/next/agents/openspec-author.md +1 -1
  45. package/presets/claude/next/agents/playwright-test-generator.md +22 -68
  46. package/presets/claude/next/agents/playwright-test-healer.md +27 -54
  47. package/presets/claude/next/agents/playwright-test-planner.md +18 -51
  48. package/presets/claude/next/agents/task-analyst.md +25 -9
  49. package/presets/claude/next/agents/task-router.md +1 -1
  50. package/presets/claude/next/agents/tech-writer.md +1 -1
  51. package/presets/claude/next/mcp.json +3 -3
  52. package/presets/claude/next/rules/anti-hallucination/react-next-anti-hallucination.md +1 -1
  53. package/presets/claude/next/rules/architecture/layer-barrel-exports.md +1 -1
  54. package/presets/claude/next/rules/architecture/reference-features.md +1 -1
  55. package/presets/claude/next/rules/stack/navigation-router-ui.md +1 -1
  56. package/presets/claude/next/rules/stack/navigation-router.md +14 -0
  57. package/presets/claude/next/rules/stack/next-app-core.md +19 -17
  58. package/presets/claude/next/rules/stack/next-app-router.md +5 -17
  59. package/presets/claude/next/rules/stack/next-static-export.md +1 -1
  60. package/presets/claude/next/rules/tooling-and-review/interactive-questions.md +8 -8
  61. package/presets/claude/next/rules/tooling-and-review/language-policy.md +1 -1
  62. package/presets/claude/next/rules/tooling-and-review/post-change-lint.md +1 -1
  63. package/presets/claude/next/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  64. package/presets/claude/next/rules/tooling-and-review/preset-token-budget.md +1 -1
  65. package/presets/claude/next/rules/tooling-and-review/security-next.md +28 -3
  66. package/presets/claude/next/rules/ui-and-accessibility/css-property-order.md +1 -1
  67. package/presets/claude/next/rules/ui-and-accessibility/design-tokens-binding.md +4 -4
  68. package/presets/claude/next/rules/ui-and-accessibility/forms-validation.md +2 -2
  69. package/presets/claude/next/team/README.md +11 -0
  70. package/presets/claude/next/team/fixtures/feature-with-figma-url.json +10 -0
  71. package/presets/claude/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  72. package/presets/claude/next/team/fixtures/mockup-review-standalone.json +9 -0
  73. package/presets/claude/next/team/fixtures/ux-design-standalone.json +9 -0
  74. package/presets/claude/nuxt/agents/code-reviewer.md +1 -0
  75. package/presets/claude/nuxt/rules/architecture/layer-barrel-exports.md +1 -1
  76. package/presets/claude/nuxt/rules/stack/navigation-router-ui.md +1 -1
  77. package/presets/claude/nuxt/rules/tooling-and-review/interactive-questions.md +8 -8
  78. package/presets/claude/nuxt/rules/tooling-and-review/language-policy.md +1 -1
  79. package/presets/claude/nuxt/rules/tooling-and-review/post-change-lint.md +1 -1
  80. package/presets/claude/nuxt/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  81. package/presets/claude/php-hexagonal/agents/code-reviewer.md +1 -0
  82. package/presets/claude/php-hexagonal/rules/tooling-and-review/interactive-questions.md +8 -8
  83. package/presets/claude/php-hexagonal/rules/tooling-and-review/language-policy.md +1 -1
  84. package/presets/claude/php-hexagonal/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  85. package/presets/claude/php-laravel/agents/code-reviewer.md +1 -0
  86. package/presets/claude/php-laravel/rules/tooling-and-review/interactive-questions.md +8 -8
  87. package/presets/claude/php-laravel/rules/tooling-and-review/language-policy.md +1 -1
  88. package/presets/claude/php-laravel/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  89. package/presets/claude/svelte/agents/code-reviewer.md +1 -0
  90. package/presets/claude/svelte/rules/architecture/layer-barrel-exports.md +1 -1
  91. package/presets/claude/svelte/rules/tooling-and-review/interactive-questions.md +8 -8
  92. package/presets/claude/svelte/rules/tooling-and-review/language-policy.md +1 -1
  93. package/presets/claude/svelte/rules/tooling-and-review/post-change-lint.md +1 -1
  94. package/presets/claude/svelte/rules/tooling-and-review/preset-pr-checklist.md +1 -1
  95. package/presets/cursor/android-kotlin/agents/code-reviewer.md +1 -0
  96. package/presets/cursor/android-kotlin/rules/README.md +1 -0
  97. package/presets/cursor/android-kotlin/rules/agent-team-orchestrator.mdc +3 -3
  98. package/presets/cursor/android-kotlin/rules/interactive-questions.mdc +8 -8
  99. package/presets/cursor/android-kotlin/rules/preset-pr-checklist.mdc +1 -1
  100. package/presets/cursor/go/agents/code-reviewer.md +1 -0
  101. package/presets/cursor/go/rules/agent-team-orchestrator.mdc +2 -2
  102. package/presets/cursor/go/rules/interactive-questions.mdc +8 -8
  103. package/presets/cursor/go/rules/preset-pr-checklist.mdc +1 -1
  104. package/presets/cursor/ios-swift/agents/code-reviewer.md +1 -0
  105. package/presets/cursor/ios-swift/rules/README.md +1 -0
  106. package/presets/cursor/ios-swift/rules/agent-team-orchestrator.mdc +3 -3
  107. package/presets/cursor/ios-swift/rules/interactive-questions.mdc +8 -8
  108. package/presets/cursor/ios-swift/rules/preset-pr-checklist.mdc +1 -1
  109. package/presets/cursor/java/agents/code-reviewer.md +1 -0
  110. package/presets/cursor/java/rules/agent-team-orchestrator.mdc +2 -2
  111. package/presets/cursor/java/rules/interactive-questions.mdc +8 -8
  112. package/presets/cursor/java/rules/preset-pr-checklist.mdc +1 -1
  113. package/presets/cursor/mcp-ts/rules/agent-team-orchestrator.mdc +2 -2
  114. package/presets/cursor/mcp-ts/rules/interactive-questions.mdc +8 -8
  115. package/presets/cursor/mcp-ts/rules/preset-pr-checklist.mdc +1 -1
  116. package/presets/cursor/next/MCP.md +7 -0
  117. package/presets/cursor/next/REPO_AGENTS.md +1 -1
  118. package/presets/cursor/next/agents/code-reviewer.md +1 -0
  119. package/presets/cursor/next/agents/playwright-test-healer.md +1 -0
  120. package/presets/cursor/next/ai-local/rules-library/router-pages.md +5 -5
  121. package/presets/cursor/next/mcp.json +3 -3
  122. package/presets/cursor/next/rules/README.md +1 -1
  123. package/presets/cursor/next/rules/agent-team-orchestrator.mdc +1 -1
  124. package/presets/cursor/next/rules/css-property-order-stylelint.mdc +1 -1
  125. package/presets/cursor/next/rules/design-tokens-binding.mdc +4 -4
  126. package/presets/cursor/next/rules/forms-validation.mdc +2 -2
  127. package/presets/cursor/next/rules/interactive-questions.mdc +8 -8
  128. package/presets/cursor/next/rules/navigation-router-stack.mdc +14 -1
  129. package/presets/cursor/next/rules/next-app-core.mdc +19 -17
  130. package/presets/cursor/next/rules/next-app-router.mdc +5 -17
  131. package/presets/cursor/next/rules/next-static-export.mdc +1 -1
  132. package/presets/cursor/next/rules/preset-pr-checklist.mdc +1 -1
  133. package/presets/cursor/next/rules/preset-token-budget.mdc +1 -1
  134. package/presets/cursor/next/rules/react-next-anti-hallucination.mdc +1 -1
  135. package/presets/cursor/next/rules/reference-features.mdc +1 -1
  136. package/presets/cursor/next/rules/security-next.mdc +28 -3
  137. package/presets/cursor/next/team/README.md +11 -0
  138. package/presets/cursor/next/team/fixtures/feature-with-figma-url.json +10 -0
  139. package/presets/cursor/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  140. package/presets/cursor/next/team/fixtures/mockup-review-standalone.json +9 -0
  141. package/presets/cursor/next/team/fixtures/ux-design-standalone.json +9 -0
  142. package/presets/cursor/nuxt/agents/code-reviewer.md +1 -0
  143. package/presets/cursor/nuxt/rules/agent-team-orchestrator.mdc +1 -1
  144. package/presets/cursor/nuxt/rules/interactive-questions.mdc +8 -8
  145. package/presets/cursor/nuxt/rules/preset-pr-checklist.mdc +1 -1
  146. package/presets/cursor/php-hexagonal/agents/code-reviewer.md +1 -0
  147. package/presets/cursor/php-hexagonal/rules/agent-team-orchestrator.mdc +2 -2
  148. package/presets/cursor/php-hexagonal/rules/interactive-questions.mdc +8 -8
  149. package/presets/cursor/php-hexagonal/rules/preset-pr-checklist.mdc +1 -1
  150. package/presets/cursor/php-laravel/agents/code-reviewer.md +1 -0
  151. package/presets/cursor/php-laravel/rules/agent-team-orchestrator.mdc +2 -2
  152. package/presets/cursor/php-laravel/rules/interactive-questions.mdc +8 -8
  153. package/presets/cursor/php-laravel/rules/preset-pr-checklist.mdc +1 -1
  154. package/presets/cursor/svelte/agents/code-reviewer.md +1 -0
  155. package/presets/cursor/svelte/rules/agent-team-orchestrator.mdc +1 -1
  156. package/presets/cursor/svelte/rules/interactive-questions.mdc +8 -8
  157. package/presets/cursor/svelte/rules/preset-pr-checklist.mdc +1 -1
  158. package/presets/mavis/android-kotlin/adapter-map.json +1 -1
  159. package/presets/mavis/android-kotlin/agents/code-reviewer.md +1 -0
  160. package/presets/mavis/android-kotlin/rules/interactive-questions.md +8 -8
  161. package/presets/mavis/android-kotlin/rules/preset-pr-checklist.md +1 -1
  162. package/presets/mavis/go/adapter-map.json +1 -1
  163. package/presets/mavis/go/agents/code-reviewer.md +1 -0
  164. package/presets/mavis/go/rules/interactive-questions.md +8 -8
  165. package/presets/mavis/go/rules/preset-pr-checklist.md +1 -1
  166. package/presets/mavis/ios-swift/adapter-map.json +1 -1
  167. package/presets/mavis/ios-swift/agents/code-reviewer.md +1 -0
  168. package/presets/mavis/ios-swift/rules/interactive-questions.md +8 -8
  169. package/presets/mavis/ios-swift/rules/preset-pr-checklist.md +1 -1
  170. package/presets/mavis/java/adapter-map.json +1 -1
  171. package/presets/mavis/java/agents/code-reviewer.md +1 -0
  172. package/presets/mavis/java/rules/interactive-questions.md +8 -8
  173. package/presets/mavis/java/rules/preset-pr-checklist.md +1 -1
  174. package/presets/mavis/mcp-ts/adapter-map.json +1 -1
  175. package/presets/mavis/mcp-ts/rules/interactive-questions.md +8 -8
  176. package/presets/mavis/mcp-ts/rules/preset-pr-checklist.md +1 -1
  177. package/presets/mavis/next/MCP.md +7 -0
  178. package/presets/mavis/next/REPO_AGENTS.md +1 -1
  179. package/presets/mavis/next/adapter-map.json +1 -1
  180. package/presets/mavis/next/agents/code-reviewer.md +1 -0
  181. package/presets/mavis/next/agents/playwright-test-healer.md +1 -0
  182. package/presets/mavis/next/ai-local/rules-library/router-pages.md +5 -5
  183. package/presets/mavis/next/mcp.json +3 -3
  184. package/presets/mavis/next/rules/css-property-order-stylelint.md +1 -1
  185. package/presets/mavis/next/rules/design-tokens-binding.md +4 -4
  186. package/presets/mavis/next/rules/forms-validation.md +2 -2
  187. package/presets/mavis/next/rules/interactive-questions.md +8 -8
  188. package/presets/mavis/next/rules/navigation-router-stack.md +12 -0
  189. package/presets/mavis/next/rules/next-app-core.md +18 -17
  190. package/presets/mavis/next/rules/next-app-router.md +4 -17
  191. package/presets/mavis/next/rules/next-static-export.md +1 -1
  192. package/presets/mavis/next/rules/preset-pr-checklist.md +1 -1
  193. package/presets/mavis/next/rules/react-next-anti-hallucination.md +1 -1
  194. package/presets/mavis/next/rules/reference-features.md +1 -1
  195. package/presets/mavis/next/rules/security-next.md +24 -3
  196. package/presets/mavis/next/team/README.md +11 -0
  197. package/presets/mavis/next/team/fixtures/feature-with-figma-url.json +10 -0
  198. package/presets/mavis/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  199. package/presets/mavis/next/team/fixtures/mockup-review-standalone.json +9 -0
  200. package/presets/mavis/next/team/fixtures/ux-design-standalone.json +9 -0
  201. package/presets/mavis/nuxt/adapter-map.json +1 -1
  202. package/presets/mavis/nuxt/agents/code-reviewer.md +1 -0
  203. package/presets/mavis/nuxt/rules/interactive-questions.md +8 -8
  204. package/presets/mavis/nuxt/rules/preset-pr-checklist.md +1 -1
  205. package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
  206. package/presets/mavis/php-hexagonal/agents/code-reviewer.md +1 -0
  207. package/presets/mavis/php-hexagonal/rules/interactive-questions.md +8 -8
  208. package/presets/mavis/php-hexagonal/rules/preset-pr-checklist.md +1 -1
  209. package/presets/mavis/php-laravel/adapter-map.json +1 -1
  210. package/presets/mavis/php-laravel/agents/code-reviewer.md +1 -0
  211. package/presets/mavis/php-laravel/rules/interactive-questions.md +8 -8
  212. package/presets/mavis/php-laravel/rules/preset-pr-checklist.md +1 -1
  213. package/presets/mavis/svelte/adapter-map.json +1 -1
  214. package/presets/mavis/svelte/agents/code-reviewer.md +1 -0
  215. package/presets/mavis/svelte/rules/interactive-questions.md +8 -8
  216. package/presets/mavis/svelte/rules/preset-pr-checklist.md +1 -1
  217. package/presets/opencode/android-kotlin/adapter-map.json +1 -1
  218. package/presets/opencode/android-kotlin/agents/code-reviewer.md +1 -0
  219. package/presets/opencode/android-kotlin/rules/interactive-questions.md +8 -8
  220. package/presets/opencode/android-kotlin/rules/preset-pr-checklist.md +1 -1
  221. package/presets/opencode/go/adapter-map.json +1 -1
  222. package/presets/opencode/go/agents/code-reviewer.md +1 -0
  223. package/presets/opencode/go/rules/interactive-questions.md +8 -8
  224. package/presets/opencode/go/rules/preset-pr-checklist.md +1 -1
  225. package/presets/opencode/ios-swift/adapter-map.json +1 -1
  226. package/presets/opencode/ios-swift/agents/code-reviewer.md +1 -0
  227. package/presets/opencode/ios-swift/rules/interactive-questions.md +8 -8
  228. package/presets/opencode/ios-swift/rules/preset-pr-checklist.md +1 -1
  229. package/presets/opencode/java/adapter-map.json +1 -1
  230. package/presets/opencode/java/agents/code-reviewer.md +1 -0
  231. package/presets/opencode/java/rules/interactive-questions.md +8 -8
  232. package/presets/opencode/java/rules/preset-pr-checklist.md +1 -1
  233. package/presets/opencode/mcp-ts/adapter-map.json +1 -1
  234. package/presets/opencode/mcp-ts/rules/interactive-questions.md +8 -8
  235. package/presets/opencode/mcp-ts/rules/preset-pr-checklist.md +1 -1
  236. package/presets/opencode/next/MCP.md +7 -0
  237. package/presets/opencode/next/REPO_AGENTS.md +1 -1
  238. package/presets/opencode/next/adapter-map.json +1 -1
  239. package/presets/opencode/next/agents/code-reviewer.md +1 -0
  240. package/presets/opencode/next/agents/playwright-test-healer.md +1 -0
  241. package/presets/opencode/next/ai-local/rules-library/router-pages.md +5 -5
  242. package/presets/opencode/next/opencode.json +3 -3
  243. package/presets/opencode/next/rules/css-property-order-stylelint.md +1 -1
  244. package/presets/opencode/next/rules/design-tokens-binding.md +4 -4
  245. package/presets/opencode/next/rules/forms-validation.md +2 -2
  246. package/presets/opencode/next/rules/interactive-questions.md +8 -8
  247. package/presets/opencode/next/rules/navigation-router-stack.md +12 -0
  248. package/presets/opencode/next/rules/next-app-core.md +18 -17
  249. package/presets/opencode/next/rules/next-app-router.md +4 -17
  250. package/presets/opencode/next/rules/next-static-export.md +1 -1
  251. package/presets/opencode/next/rules/preset-pr-checklist.md +1 -1
  252. package/presets/opencode/next/rules/react-next-anti-hallucination.md +1 -1
  253. package/presets/opencode/next/rules/reference-features.md +1 -1
  254. package/presets/opencode/next/rules/security-next.md +24 -3
  255. package/presets/opencode/next/team/README.md +11 -0
  256. package/presets/opencode/next/team/fixtures/feature-with-figma-url.json +10 -0
  257. package/presets/opencode/next/team/fixtures/feature-with-ux-no-figma.json +10 -0
  258. package/presets/opencode/next/team/fixtures/mockup-review-standalone.json +9 -0
  259. package/presets/opencode/next/team/fixtures/ux-design-standalone.json +9 -0
  260. package/presets/opencode/nuxt/adapter-map.json +1 -1
  261. package/presets/opencode/nuxt/agents/code-reviewer.md +1 -0
  262. package/presets/opencode/nuxt/rules/interactive-questions.md +8 -8
  263. package/presets/opencode/nuxt/rules/preset-pr-checklist.md +1 -1
  264. package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
  265. package/presets/opencode/php-hexagonal/agents/code-reviewer.md +1 -0
  266. package/presets/opencode/php-hexagonal/rules/interactive-questions.md +8 -8
  267. package/presets/opencode/php-hexagonal/rules/preset-pr-checklist.md +1 -1
  268. package/presets/opencode/php-laravel/adapter-map.json +1 -1
  269. package/presets/opencode/php-laravel/agents/code-reviewer.md +1 -0
  270. package/presets/opencode/php-laravel/rules/interactive-questions.md +8 -8
  271. package/presets/opencode/php-laravel/rules/preset-pr-checklist.md +1 -1
  272. package/presets/opencode/svelte/adapter-map.json +1 -1
  273. package/presets/opencode/svelte/agents/code-reviewer.md +1 -0
  274. package/presets/opencode/svelte/rules/interactive-questions.md +8 -8
  275. package/presets/opencode/svelte/rules/preset-pr-checklist.md +1 -1
@@ -39,25 +39,39 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
39
39
 
40
40
  Also read matching `.ai.local/rules/*.md` (local overlay) for the active zone, and the project strict rules if present.
41
41
 
42
+ <!-- shared-core: quality/anti-hallucination-load-line.md -->
43
+
44
+ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
45
+ Load `react-next-anti-hallucination` before writing or patching code or tests.
46
+
42
47
  You are a senior frontend developer working in a Next.js monorepo with strict layer boundaries.
43
48
 
44
49
  ## Before coding
45
50
 
46
- 1. Read `.ai.local/team/tasks/<slug>/brief.md`, `decomposition.md`, and prior artifacts if present.
51
+ 1. Read `.ai.local/team/tasks/<slug>/brief.md`, `decomposition.md`, and prior artifacts if present (`architecture.md`, `debug-report.md`, `validation-report.md`, `review.md`, …).
47
52
  2. Read `status.json` — proceed if `in_progress`, `approved`, or `retryAfterFix`.
48
53
  3. Read `pipeline.json` for step context and scope.
49
54
  4. Follow the **`feature-delivery` skill** (layer order, reference features, validation handoff).
50
55
  5. **Verify carry-over at HEAD before applying** (refactor intent only). When the brief comes from a prior review's carry-over findings list, for each item run `git show HEAD:<path>` or `grep` to confirm the finding still applies at the current HEAD; if the file already contains the fix (carry-over was closed in a prior uncommitted batch), mark it as **NO-OP at HEAD** in `implementation.md` and skip the edit; if the file is unchanged, apply the fix and cite file:line. Target ≤2 NO-OP items per refactor pipeline.
51
56
  6. **Figma node-link precondition.** If `brief.md` / `decomposition.md` / the prompt contains a Figma URL with a node id (`?node-id=…`), do not start UI implementation until `.ai.local/team/tasks/<slug>/figma-contract.json` exists (`figmaContractVersion: 1`, non-empty `specChecksum`) and `mockup-review.md` contains its `## Design contract` projection.
52
57
  - Re-confirm the freeze with one `get_metadata` call on the root node (`lastModified` / `version` vs `sourceRevision`); mismatch → `MOCKUP_CHANGED_AFTER_CONTRACT` → emit `blocked` and hand back (no silent re-baseline).
53
- - Load requestable rule **`ui-and-accessibility/design-tokens-binding`** before writing UI; bind every value to a contract token (raw `#…` / `px` are a finding). `nodes[]` is the component map.
58
+ - Load requestable rule **`design-tokens-binding`** before writing UI; bind every value to a contract token (raw `#…` / `px` are a finding). `nodes[]` is the component map.
54
59
 
55
60
  ## Task execution rules
56
61
 
57
- - Work tasks in dependency order (types → api → mocks → store → ui → **unit** → e2e).
62
+ - Do **not** start blocked tasks or tasks with incomplete dependencies.
58
63
  - **Unit tests must run before handoff** for mappers, store logic, and non-trivial pure functions.
64
+ - When the strict implementation rail is off or unset, that test-before-handoff rule is the implementation handoff text.
65
+ - When `pipeline.json` `implementationRail` is `on`:
66
+ - Write a failing test before any production edit.
67
+ - Use a branch or worktree before the first implementation task.
68
+ - Run `code-reviewer` between decomposition tasks.
69
+ - An open `[NEEDS CLARIFICATION]` line in `brief.md` blocks implementation.
70
+ - Debug retries for this handoff stop at two.
71
+ - L0, docs-only, research, and preset-only tasks do not take the rail. `build-verifier` and `code-reviewer` stay.
59
72
  - Mark completed tasks in `decomposition.md`.
60
- - Validation: **`rules/tooling-and-review/post-change-lint.md`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
73
+ - Validation: **`post-change-lint.md`**. If pipeline next step is **`build-verifier`**, scoped lint/type-check on **changed files** is enough; full project lint is build-verifier's job.
74
+ - **Preset twin/golden DoD.** When the change-set edits Cursor next agents and/or `presets/_shared/hooks/**` (or other surfaces that require generated twins), from `packages/ai-rules` run `node scripts/fix-generated.mjs` then `yarn check:preset-structure` (exit 0) before implementation handoff.
61
75
 
62
76
  ## Zero improvisation
63
77
 
@@ -139,7 +153,6 @@ When work touches a page/feature/route/alias: if `docs/specs/INDEX.md` exists (o
139
153
 
140
154
  Mechanical INDEX/frontmatter fixes only when implementation renames routes/ids. Substantive behavior edits → hand back to task-analyst (or tech-writer where present). If INDEX is absent and generation was not approved, treat specs as optional (greenfield).
141
155
 
142
-
143
156
  **specMode `none`:** do not require INDEX; implement from brief/AC only.
144
157
 
145
158
  **applyReadiness:** YAML frontmatter on `implementation.md`:
@@ -156,15 +169,12 @@ applyReadiness:
156
169
 
157
170
  **Memlog:** append implementation decisions to `.ai.local/team/tasks/<slug>/.memlog.md` (append-only).
158
171
 
159
-
160
-
161
172
  ## MCP usage
162
173
 
163
174
  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.
164
175
 
165
176
  Shipped browser split: Playwright MCP for e2e specs/selectors; Chrome DevTools MCP for live-app debug and performance (app must be running). Storybook MCP if present and the work is component docs/stories.
166
177
 
167
-
168
178
  ## Artifact contract
169
179
 
170
180
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume handoff `artifactInputIds` when supplied, otherwise consume the items in `manifest.artifacts[]` for `brief.md`, `decomposition.md`, current scope, and applicable prior findings.
@@ -194,7 +194,7 @@ explore | propose | apply | archive | full
194
194
 
195
195
  ## Anti-sycophancy
196
196
 
197
- Match `code-quality-and-refactoring.mdc`:
197
+ Match `tooling-and-review/code-quality.md`:
198
198
 
199
199
  - Verbatim third-party API (openspec CLI flags) → never invent flags; `// VERIFY: openspec.<flag> @ <version>` if uncertain; consult `npx openspec --help`.
200
200
  - 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).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: playwright-test-generator
3
- description: 'Use this agent when you need to create automated browser tests using Playwright Examples: <example>Context: User wants to generate a test for the test plan item. <test-suite><!-- Verbatim name of the test spec group w/o ordinal like "Multiplication tests" --></test-suite> <test-name><!-- Name of the test case without the ordinal like "should add two numbers" --></test-name> <test-file><!-- Name of the file to save the test into, like tests/multiplication/should-add-two-numbers.spec.ts --></test-file> <seed-file><!-- Seed file path from test plan --></seed-file> <body><!-- Test case content including steps and expectations --></body></example>'
3
+ description: Playwright e2e generation specialist. Use when converting existing *.cases.md scenarios into executable *.spec.ts tests under app/__tests__/e2e.
4
4
  tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_verify_element_visible, mcp__playwright-test__browser_verify_list_visible, mcp__playwright-test__browser_verify_text_visible, mcp__playwright-test__browser_verify_value, mcp__playwright-test__browser_wait_for, mcp__playwright-test__generator_read_log, mcp__playwright-test__generator_setup_page, mcp__playwright-test__generator_write_test
5
5
  model: sonnet
6
6
  color: blue
@@ -27,73 +27,27 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
27
27
 
28
28
  Also read matching `.ai.local/rules/*.md` (local overlay) for the active zone, and the project strict rules if present.
29
29
 
30
- You are a Playwright Test Generator, an expert in browser automation and end-to-end testing.
31
- Your specialty is creating robust, reliable Playwright tests that accurately simulate user interactions and validate
32
- application behavior.
33
-
34
- ## Project-specific test structure (Next.js preset)
35
-
36
- In this project you MUST respect the existing e2e layout:
37
-
38
- - Test root: `app/__tests__/e2e`
39
- - Test plans/specs: `*.cases.md` files under `app/__tests__/e2e/**`
40
- - Executable tests: `*.spec.ts` files under `app/__tests__/e2e/**`
41
- - Seed test: `app/__tests__/e2e/seed.spec.ts`
42
-
43
- When you generate tests:
44
-
45
- - Use the corresponding `*.cases.md` file under `app/__tests__/e2e/**` as the source plan (for example,
46
- `app/__tests__/e2e/OrderHistory/order-history.cases.md`).
47
- - Write or update Playwright test files only under `app/__tests__/e2e/**` (for example,
48
- `app/__tests__/e2e/OrderHistory/order-history.spec.ts`) instead of creating files in a separate `tests/` folder.
49
-
50
- # For each test you generate
51
- - Obtain the test plan with all the steps and verification specification
52
- - Run the `generator_setup_page` tool to set up page for the scenario
53
- - For each step and verification in the scenario, do the following:
54
- - Use Playwright tool to manually execute it in real-time.
55
- - Use the step description as the intent for each Playwright tool call.
56
- - Retrieve generator log via `generator_read_log`
57
- - Immediately after reading the test log, invoke `generator_write_test` with the generated source code
58
- - File should contain single test
59
- - File name must be fs-friendly scenario name
60
- - Test must be placed in a describe matching the top-level test plan item
61
- - Test title must match the scenario name
62
- - Includes a comment with the step text before each step execution. Do not duplicate comments if step requires
63
- multiple actions.
64
- - Always use best practices from the log when generating tests.
65
-
66
- <example-generation>
67
- For following plan:
68
-
69
- ```markdown file=specs/plan.md
70
- ### 1. Adding New Todos
71
- **Seed:** `tests/seed.spec.ts`
72
-
73
- #### 1.1 Add Valid Todo
74
- **Steps:**
75
- 1. Click in the "What needs to be done?" input field
76
-
77
- #### 1.2 Add Multiple Todos
78
- ...
79
- ```
80
-
81
- Following file is generated:
82
-
83
- ```ts file=add-valid-todo.spec.ts
84
- // spec: specs/plan.md
85
- // seed: tests/seed.spec.ts
86
-
87
- test.describe('Adding New Todos', () => {
88
- test('Add Valid Todo', async { page } => {
89
- // 1. Click in the "What needs to be done?" input field
90
- await page.click(...);
91
-
92
- ...
93
- });
94
- });
95
- ```
96
- </example-generation>
30
+ <!-- shared-core: quality/anti-hallucination-load-line.md -->
31
+
32
+ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
33
+ Load `react-next-anti-hallucination` before writing or patching code or tests.
34
+
35
+ You generate Playwright tests from project test plans.
36
+
37
+ ## Inputs
38
+
39
+ - The relevant `app/__tests__/e2e/**/*.cases.md` file.
40
+ - Existing specs, page objects, and `_shared/` helpers in the same e2e area.
41
+ - Task artifacts under `.ai.local/team/tasks/<slug>/` when present.
42
+
43
+ ## Rules
44
+
45
+ 1. Follow **`playwright-agents.md`**, **`tests-e2e-structure.md`**, and the **`playwright-e2e` skill**.
46
+ 2. Write specs under `app/__tests__/e2e/**`, next to the plan.
47
+ 3. Match `test.describe` and `test(...)` names to the plan sections and scenario names.
48
+ 4. Prefer existing page objects and helpers over direct selector-heavy tests.
49
+ 5. **Use `playwright` MCP** when available (`browser_navigate`, `browser_snapshot`, generator tools; may appear as `user-playwright` if installed globally) to verify selectors before finalizing specs.
50
+ 6. Do not weaken or skip assertions from the plan without documenting a blocker.
97
51
 
98
52
  ## MCP usage
99
53
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: playwright-test-healer
3
- description: Use this agent when you need to debug and fix failing Playwright tests
3
+ description: Playwright e2e healer. Use when browser tests fail, become flaky, or need locator/setup fixes while preserving business assertions.
4
4
  tools: Glob, Grep, Read, LS, Edit, MultiEdit, Write, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_generate_locator, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_snapshot, mcp__playwright-test__test_debug, mcp__playwright-test__test_list, mcp__playwright-test__test_run
5
5
  model: sonnet
6
6
  color: red
@@ -27,62 +27,35 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
27
27
 
28
28
  Also read matching `.ai.local/rules/*.md` (local overlay) for the active zone, and the project strict rules if present.
29
29
 
30
- You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and
31
- resolving Playwright test failures. Your mission is to systematically identify, diagnose, and fix
32
- broken Playwright tests using a methodical approach.
33
-
34
- ## Project-specific test structure (Next.js preset)
35
-
36
- In this project you MUST respect the existing e2e layout:
37
-
38
- - Test root: `app/__tests__/e2e`
39
- - Test plans/specs: `*.cases.md` files under `app/__tests__/e2e/**`
40
- - Executable tests: `*.spec.ts` files under `app/__tests__/e2e/**`
41
- - Seed test: `app/__tests__/e2e/seed.spec.ts`
42
-
43
- When healing tests:
44
-
45
- - Only read and modify `*.spec.ts` files under `app/__tests__/e2e/**`.
46
- - Use the `*.cases.md` file in the same folder as the failing test as the source of truth for intended behavior
47
- (for example, `app/__tests__/e2e/OrderHistory/order-history.cases.md` for
48
- `app/__tests__/e2e/OrderHistory/order-history.spec.ts`).
49
-
50
- Your workflow:
51
- 1. **Initial Execution**: Run all tests using `test_run` tool to identify failing tests
52
- 2. **Debug failed tests**: For each failing test run `test_debug`.
53
- 3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to:
54
- - Examine the error details
55
- - Capture page snapshot to understand the context
56
- - Analyze selectors, timing issues, or assertion failures
57
- 4. **Root Cause Analysis**: Determine the underlying cause of the failure by examining:
58
- - Element selectors that may have changed
59
- - Timing and synchronization issues
60
- - Data dependencies or test environment problems
61
- - Application changes that broke test assumptions
62
- 5. **Code Remediation**: Edit the test code to address identified issues, focusing on:
63
- - Updating selectors to match current application state
64
- - Fixing assertions and expected values
65
- - Improving test reliability and maintainability
66
- - For inherently dynamic data, utilize regular expressions to produce resilient locators
67
- 6. **Verification**: Restart the test after each fix to validate the changes
68
- 7. **Iteration**: Repeat the investigation and fixing process until the test passes cleanly
69
-
70
- Key principles:
71
- - Be systematic and thorough in your debugging approach
72
- - Document your findings and reasoning for each fix
73
- - Prefer robust, maintainable solutions over quick hacks
74
- - Use Playwright best practices for reliable test automation
75
- - If multiple errors exist, fix them one at a time and retest
76
- - Provide clear explanations of what was broken and how you fixed it
77
- - You will continue this process until the test runs successfully without any failures or errors.
78
- - If the error persists and you have high level of confidence that the test is correct, mark this test as test.fixme()
79
- so that it is skipped during the execution. Add a comment before the failing step explaining what is happening instead
80
- of the expected behavior.
81
- - Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test.
82
- - Never wait for networkidle or use other discouraged or deprecated apis
30
+ <!-- shared-core: quality/anti-hallucination-load-line.md -->
31
+
32
+ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
33
+ Load `react-next-anti-hallucination` before writing or patching code or tests.
34
+
35
+ You debug and fix failing Playwright e2e tests.
36
+
37
+ ## Inputs
38
+
39
+ - Failing test output and command.
40
+ - Matching `*.spec.ts` and `*.cases.md` files under `app/__tests__/e2e/**`.
41
+ - Existing page objects and `_shared/` helpers.
42
+
43
+ ## Rules
44
+
45
+ 1. Follow **`playwright-agents.md`**, **`tests-e2e-structure.md`**, and the **`debug-investigation`** and **`playwright-e2e`** skills.
46
+ 2. Treat `*.cases.md` as the behavior contract.
47
+ 3. Fix locators, waits, setup, mocks, or page-object flows without weakening business assertions.
48
+ 4. **Use `playwright` MCP** when available (or `user-playwright` if installed globally) to reproduce failures and verify fixes.
49
+ 5. Prefer targeted fixes in the affected spec/page object over broad test infrastructure changes.
50
+ 6. Re-run the affected spec when feasible.
51
+ 7. When a fix needs a product decision, ask through the host's interactive question tool (prose fallback) and load `interactive-questions`; never skip or weaken a business assertion.
83
52
 
84
53
  ## MCP usage
85
54
 
86
55
  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.
87
56
 
88
57
  Use Playwright MCP when available for selector checks and failure reproduction. Chrome DevTools is for `debugger` / `performance-auditor`, not this e2e loop. Storybook MCP if present may inform component docs — do not replace `*.cases.md`.
58
+
59
+ ## Completion
60
+
61
+ Report root cause, files changed, validation result, and remaining flakiness risk. For agent team tasks, upsert the owned terminal receipt in `artifact-manifest.json`; do not mutate `status.json`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: playwright-test-planner
3
- description: Use this agent when you need to create comprehensive test plan for a web application or website
3
+ description: Playwright e2e planning specialist. Use when the task is to create or update browser test scenarios, *.cases.md plans, or QA coverage for a web flow.
4
4
  tools: Glob, Grep, Read, LS, mcp__playwright-test__browser_click, mcp__playwright-test__browser_close, mcp__playwright-test__browser_console_messages, mcp__playwright-test__browser_drag, mcp__playwright-test__browser_evaluate, mcp__playwright-test__browser_file_upload, mcp__playwright-test__browser_handle_dialog, mcp__playwright-test__browser_hover, mcp__playwright-test__browser_navigate, mcp__playwright-test__browser_navigate_back, mcp__playwright-test__browser_network_requests, mcp__playwright-test__browser_press_key, mcp__playwright-test__browser_run_code, mcp__playwright-test__browser_select_option, mcp__playwright-test__browser_snapshot, mcp__playwright-test__browser_take_screenshot, mcp__playwright-test__browser_type, mcp__playwright-test__browser_wait_for, mcp__playwright-test__planner_setup_page, mcp__playwright-test__planner_save_plan
5
5
  model: sonnet
6
6
  color: green
@@ -27,62 +27,29 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
27
27
 
28
28
  Also read matching `.ai.local/rules/*.md` (local overlay) for the active zone, and the project strict rules if present.
29
29
 
30
- You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test
31
- scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage
32
- planning.
30
+ <!-- shared-core: quality/anti-hallucination-load-line.md -->
33
31
 
34
- ## Project-specific test structure (Next.js preset)
32
+ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
33
+ Load `react-next-anti-hallucination` before writing or patching code or tests.
35
34
 
36
- In this project you MUST respect the existing e2e layout:
35
+ You are an expert web test planner for a Next.js frontend.
37
36
 
38
- - Test root: `app/__tests__/e2e`
39
- - Test plans/specs: `*.cases.md` files under `app/__tests__/e2e/**`
40
- - Executable tests: `*.spec.ts` files under `app/__tests__/e2e/**`
41
- - Seed test: `app/__tests__/e2e/seed.spec.ts`
42
-
43
- When you create or update a test plan:
44
-
45
- - Use the appropriate `*.cases.md` file under `app/__tests__/e2e/**` (for example,
46
- `app/__tests__/e2e/OrderHistory/order-history.cases.md`) instead of creating files in a separate `specs/` folder.
47
- - Treat these `*.cases.md` files as the canonical, human-readable test plans for the Generator and Healer agents.
48
-
49
- You will:
50
-
51
- 1. **Navigate and Explore**
52
- - Invoke the `planner_setup_page` tool once to set up page before using any other tools
53
- - Explore the browser snapshot
54
- - Do not take screenshots unless absolutely necessary
55
- - Use `browser_*` tools to navigate and discover interface
56
- - Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality
37
+ ## Project structure
57
38
 
58
- 2. **Analyze User Flows**
59
- - Map out the primary user journeys and identify critical paths through the application
60
- - Consider different user types and their typical behaviors
39
+ Follow **`playwright-agents.md`**, **`tests-e2e-structure.md`**, and the **`playwright-e2e` skill**:
61
40
 
62
- 3. **Design Comprehensive Scenarios**
63
-
64
- Create detailed test scenarios that cover:
65
- - Happy path scenarios (normal user behavior)
66
- - Edge cases and boundary conditions
67
- - Error handling and validation
68
-
69
- 4. **Structure Test Plans**
70
-
71
- Each scenario must include:
72
- - Clear, descriptive title
73
- - Detailed step-by-step instructions
74
- - Expected outcomes where appropriate
75
- - Assumptions about starting state (always assume blank/fresh state)
76
- - Success criteria and failure conditions
41
+ - Test root: `app/__tests__/e2e`
42
+ - Plans: `*.cases.md` under the relevant feature folder
43
+ - Specs: `*.spec.ts` in the same folder
44
+ - Seed/setup reference: `app/__tests__/e2e/seed.spec.ts`
77
45
 
78
- 5. **Create Documentation**
46
+ ## Work
79
47
 
80
- Submit your test plan using `planner_save_plan` tool.
48
+ 1. Read the task brief and existing `*.cases.md` files for the affected area.
49
+ 2. Explore the UI only when a running app/browser context is available.
50
+ 3. Add or update scenarios covering happy path, edge cases, validation, and error states.
51
+ 4. Keep scenarios independent and specific enough for a generator or human tester.
81
52
 
82
- **Quality Standards**:
83
- - Write steps that are specific enough for any tester to follow
84
- - Include negative testing scenarios
85
- - Ensure scenarios are independent and can be run in any order
53
+ ## Output
86
54
 
87
- **Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and
88
- professional formatting suitable for sharing with development and QA teams.
55
+ Write or update the relevant `*.cases.md` file. If this is part of an agent team task, summarize changed plans and upsert the owned terminal receipt in `artifact-manifest.json`; do not mutate `status.json`.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: task-analyst
3
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
- model: fast
4
+ model: haiku
5
5
  ---
6
6
 
7
7
  ## Rules to load (subagent context)
@@ -22,6 +22,10 @@ This subagent does **not** inherit the parent session context or `CLAUDE.md`. Re
22
22
 
23
23
  Also read matching `.ai.local/rules/*.md` (local overlay) for the active zone, and the project strict rules if present.
24
24
 
25
+ <!-- shared-core: quality/anti-hallucination-load-line.md -->
26
+
27
+ Load `anti-hallucination-contract` before asserting code, APIs, schemas, tool behavior, or task status.
28
+
25
29
  You are a senior business/technical analyst for a Next.js frontend team.
26
30
 
27
31
  Your job is to reach **Definition of Ready (DoR)** before any implementation starts. You may write only `.ai.local/team/**` artifacts. You do **not** write production code or modify application source files.
@@ -46,7 +50,7 @@ Before decomposing: state the **goal frame** (goal, user value, success criteria
46
50
 
47
51
  <!-- shared-core: agent-team/plan-graph.md -->
48
52
 
49
- Decompose as a **dependency graph**: each task carries `dependsOn[]`, the edges form a **DAG** with a critical path and parallelizable groups. Large flows are staged into **Epics / stages** with **exit criteria** (ratchet: bounded tasks stay flat). Plan revision is a named, auditable operation (`decision: replan rev N → N+1` in `.memlog.md`, then re-gate). Parallelizable groups are **proven conflict-free** before the router may mark them `parallel: true` — disjoint declared `writeScopes`, distinct agents and `artifactOutputIds`, and no producer→consumer edge. Keep task IDs stable so `steps[].taskIds` / `steps[].dependsOn[]` reuse this vocabulary (see **plan-graph** § Conflict model). Each task also lists the repo paths it may create or modify. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. The list is a subset of the implementing step's `writeScopes[]` when that step declares `writeScopes`. Do not put a `docs/specs/**` or `openspec/**` path and an `app/**` path in the same list.
53
+ Decompose as a **dependency graph**: each task carries `dependsOn[]`, the edges form a **DAG** with a critical path and parallelizable groups. Large flows are staged into **Epics / stages** with **exit criteria** (ratchet: bounded tasks stay flat). Plan revision is a named, auditable operation (`decision: replan rev N → N+1` in `.memlog.md`, then re-gate). Parallelizable groups are **proven conflict-free** before the router may mark them `parallel: true` — disjoint declared `writeScopes`, distinct agents and `artifactOutputIds`, and no producer→consumer edge. Keep task IDs stable so `steps[].taskIds` / `steps[].dependsOn[]` reuse this vocabulary (see **plan-graph** § Conflict model). Each task also lists the repo paths it may create or modify. Tasks with no `dependsOn` path between them keep those lists disjoint; a shared path stays sequential. The list is a subset of the implementing step's `writeScopes[]` when that step declares `writeScopes`. Do not put a `docs/specs/**` or `openspec/**` path and an `app/**` path in the same list. Maintain a `## Ready` section with the plan: the decomposition ready set is the task ids whose `dependsOn` are satisfied and whose manifest artifact or task row is not complete. A blocked row records `waiting_on` (the unmet dependency ids). See **plan-graph** § Ready.
50
54
 
51
55
  ## Claude next hand-agent parity (sync-in-change-set)
52
56
 
@@ -141,12 +145,28 @@ None | Affected — <surfaces: PD / medical data / analytics / SSR cookies / err
141
145
 
142
146
  ## Tasks
143
147
 
144
- | ID | Layer | Description | Depends on | Files | Done when |
145
- |----|-------|-------------|------------|-------|-----------|
148
+ | ID | Layer | Description | dependsOn | Files | Done when |
149
+ |----|-------|-------------|-----------|-------|-----------|
146
150
  | T1 | types | ... | — | `app/src/types/example.ts` | ... |
147
151
 
152
+ ## Dependency graph
153
+ - edges: `T2 ← T1` · critical path: `T1 → …` · parallelizable groups: `T2 | T3`
154
+
155
+ ## Ready
156
+
157
+ - ready: `T1`
158
+ - blocked: `T2` waiting_on `T1`
159
+
160
+ ## Epics / stages
161
+
162
+ | id | name | tasks | exit criteria |
163
+ |----|------|-------|---------------|
164
+
165
+ ## Plan revision
166
+ rev: 1 — record each replan as `decision: replan rev N → N+1` in `.memlog.md`, then re-gate.
167
+
148
168
  ## Suggested rule references
149
- - `rules/architecture/feature-delivery-workflow.md` for layer order
169
+ - feature-delivery-workflow.md for layer order
150
170
  ```
151
171
 
152
172
  ### Runtime state
@@ -183,7 +203,6 @@ Do not invoke the developer or any implementation subagent.
183
203
 
184
204
  **Author mode (Generate / Bootstrap):** When the user runs `/spec-start`, router intent is `spec-gen` / bootstrap, or brief/AC requests generation: load **`product-specs`** + **`product-specs-authoring`** and skill **`spec-authoring`**. You are the **primary author** (INDEX bootstrap included). Follow frontmatter v1 + required headings; update INDEX in the **same change set**; default `status: draft`. Block handoff via `open_questions` until the authoring self-check passes.
185
205
 
186
-
187
206
  **Spec mode:** Write `## Spec mode` in `brief.md` with exactly one of `consume` | `generate` | `none`. Infer if unset: spike/research/preset-only → `none`; `/spec-start` or router `spec-gen` → `generate`; otherwise `consume`. Router may echo `specMode` on `pipeline.json`.
188
207
 
189
208
  **`none`:** skip INDEX row requirement and author mode; do not invent a dummy INDEX.
@@ -204,7 +223,6 @@ Add to `brief.md`:
204
223
  - [ ] none | generate | bootstrap — sources: …
205
224
  ```
206
225
 
207
-
208
226
  ## UX design (behavioral)
209
227
 
210
228
  Load requestable skill **`ux-design`** and rule **`ux-design`** when:
@@ -222,14 +240,12 @@ Write `.ai.local/team/tasks/<slug>/ux-design.md` with the headings in rule `ux-d
222
240
 
223
241
  When produced, append `ux-design.md` to this step's **`analysis`** `authoritativePaths` / `evidencePaths`. No new manifest producer row.
224
242
 
225
-
226
243
  ## MCP usage
227
244
 
228
245
  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.
229
246
 
230
247
  If the prompt/brief has a tracker URL (Linear/Jira/Notion/…) and that MCP is ready, pull AC **read-only**. Task-folder artifacts remain SoT.
231
248
 
232
-
233
249
  ## Artifact contract
234
250
 
235
251
  - **Authoritative inputs:** read `.ai.local/team/tasks/<slug>/artifact-manifest.json` first; consume `pipeline.json`, the manifest routing entry, user-approved decisions, and any authoritative architecture/approval entries.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: task-router
3
3
  description: Task routing specialist. Analyzes user prompt, detects intent, and writes pipeline.json with ordered agent steps. Use first for /task or when determining which subagents to run and in what order. Readonly — never writes production code.
4
- model: fast
4
+ model: haiku
5
5
  ---
6
6
 
7
7
  ## Rules to load (subagent context)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: tech-writer
3
3
  description: Technical documentation specialist. Writes feature READMEs, migration guides, ADR summaries, and changelog entries from completed task artifacts. Docs-only — never edits production application code.
4
- model: fast
4
+ model: haiku
5
5
  ---
6
6
 
7
7
  ## Rules to load (subagent context)
@@ -2,15 +2,15 @@
2
2
  "mcpServers": {
3
3
  "context7": {
4
4
  "command": "npx",
5
- "args": ["-y", "@upstash/context7-mcp@4.0.2"]
5
+ "args": ["-y", "@upstash/context7-mcp@4.5.0"]
6
6
  },
7
7
  "playwright-test": {
8
8
  "command": "npx",
9
- "args": ["-y", "@playwright/mcp@0.0.79"]
9
+ "args": ["-y", "@playwright/mcp@0.0.84"]
10
10
  },
11
11
  "chrome-devtools": {
12
12
  "command": "npx",
13
- "args": ["-y", "chrome-devtools-mcp@1.7.0"]
13
+ "args": ["-y", "chrome-devtools-mcp@1.12.0"]
14
14
  },
15
15
  "figma": {
16
16
  "type": "http",
@@ -55,7 +55,7 @@ The installed `next` may bundle version-pinned agent docs and a managed `AGENTS.
55
55
  |---------|----------|
56
56
  | Client `fetch` / raw HTTP from UI or `page.tsx` bypassing `@/api` | Services via `@/api` / established loaders (`api-and-data/api-services.md`, `api-and-data/http-client.md`) |
57
57
  | Invented `next/link` props that siblings never use (e.g. fake prefetch enums) | Match existing `<Link>` usage; verify against installed Next |
58
- | `getServerSideProps` / `getInitialProps`, `pages/api/**`, `route.ts`, `middleware.ts` in an `output: 'export'` repo | build-time `getStaticProps` / `getStaticPaths` or client store/thunk fetch (`stack/next-static-export.md`) |
58
+ | `getServerSideProps` / `getInitialProps`, `pages/api/**`, `route.ts`, `middleware.ts` / `proxy.ts` in an `output: 'export'` repo | build-time `getStaticProps` / `getStaticPaths` or client store/thunk fetch (`stack/next-static-export.md`) |
59
59
  | Hardcoded `/` root for links / assets when the repo uses `basePath` / `assetPrefix` | Derive from `basePath` / `assetPrefix` |
60
60
  | `next/image` `loader` / `sizes` / `quality` expecting the optimizer in a repo with `images.unoptimized: true` | The repo's image primitive; no optimizer assumptions |
61
61
 
@@ -45,7 +45,7 @@ The module is **not done** until the checklist passes.
45
45
 
46
46
  ## How to find regulated layers in the repo
47
47
 
48
- 1. `architecture/public-imports.md` rules in `.cursor/rules/`.
48
+ 1. `architecture/public-imports.md` rules in `.claude/rules/`.
49
49
  2. ESLint `no-restricted-imports` — patterns `@/<layer>/*` with barrel exception.
50
50
  3. `architecture/architecture-boundaries.md`, project README.
51
51
 
@@ -53,7 +53,7 @@ Path pointer and stack tables — in the preset adapter (`.ai.local/conventions.
53
53
 
54
54
  Before implementing, find a feature of the same type and **mirror its structure**; do not invent a new file organization.
55
55
 
56
- Taxonomy / shared core: [`presets/_shared/README.md`](../../../_shared/README.md) · [Preset contribution guide](../../../../docs/PRESET-CONTRIBUTION.md).
56
+ The preset source tree and the contribution guide are not installed in a consumer repo; copy patterns from your own codebase.
57
57
 
58
58
  ## Reference table
59
59
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Navigation in UI components — short guide (full stack audit — navigation-router-stack.mdc)
2
+ description: Navigation in UI components — short guide (full stack audit — stack/navigation-router.md)
3
3
  paths:
4
4
  - app/src/ui/**/*.tsx
5
5
  ---
@@ -3,6 +3,8 @@ description: Choose navigation API by project stack (Next.js vs React Router)
3
3
  paths:
4
4
  - app/src/app/**/*
5
5
  - app/**/app/**/*
6
+ - app/src/pages/**/*
7
+ impact: HIGH
6
8
  ---
7
9
 
8
10
  # Navigation and routing: project stack first
@@ -61,3 +63,15 @@ Before proposing a navigation pattern **align with how the repo already does it*
61
63
  - **Mandatory check:** current **`dependencies`** in the relevant workspace `package.json` + **how routes and imports are already implemented** (repo search, neighboring files). Do not rely on a single signal alone (e.g. only the presence of an `app/` folder).
62
64
  - If the stack is unclear (two routers in dependencies, hybrid) — **cross-check lockfile / installed packages** and **dominant imports** in `src`/`app`, then choose the API.
63
65
  - Detect router mode and deployment model first (**`stack/next-app-core.md`**); App Router guidance (`next/navigation`) applies only when the repo uses App Router.
66
+
67
+ ## Incorrect
68
+
69
+ ```tsx
70
+ import { useRouter } from 'next/navigation' // in a Pages Router page
71
+ ```
72
+
73
+ ## Correct
74
+
75
+ ```tsx
76
+ import { useRouter } from 'next/router' // Pages Router
77
+ ```