@uniqbit/mate-core 1.0.0-canary.5 → 1.0.0-canary.7

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 (477) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/claude-capability-plugins/companion-mentions/hooks/register.ts +1 -1
  3. package/claude-plugin/hooks/hooks.json +41 -1
  4. package/claude-plugin/hooks/rtk-worktree-git.mjs +58 -0
  5. package/claude-plugin/hooks/workflow-turn.mjs +68 -0
  6. package/opencode-plugin/src/companion.ts +6 -0
  7. package/opencode-plugin/src/server.ts +33 -2
  8. package/package.json +5 -2
  9. package/src/cli/commands/artifact/apply-context.ts +1 -0
  10. package/src/cli/commands/artifact/artifact.ts +16 -0
  11. package/src/cli/commands/artifact/delivery/archive.ts +37 -112
  12. package/src/cli/commands/artifact/delivery/branch-flags.ts +19 -1
  13. package/src/cli/commands/artifact/delivery/environment.ts +32 -72
  14. package/src/cli/commands/artifact/delivery/link.ts +53 -34
  15. package/src/cli/commands/artifact/delivery/output.ts +25 -4
  16. package/src/cli/commands/artifact/delivery/resolve.ts +101 -0
  17. package/src/cli/commands/artifact/delivery/submit.ts +164 -0
  18. package/src/cli/commands/artifact/delivery/take.ts +45 -0
  19. package/src/cli/commands/artifact/extract-repo-name.ts +1 -1
  20. package/src/cli/commands/artifact/finish/command.ts +455 -43
  21. package/src/cli/commands/artifact/finish/engine.ts +79 -61
  22. package/src/cli/commands/artifact/finish/finisher.ts +5 -12
  23. package/src/cli/commands/artifact/finish/git.ts +9 -10
  24. package/src/cli/commands/artifact/finish/openspec.ts +21 -174
  25. package/src/cli/commands/artifact/finish/secret-scan.ts +5 -43
  26. package/src/cli/commands/artifact/finish/worktree-cleanup.ts +57 -7
  27. package/src/cli/commands/artifact/pending/command.ts +119 -6
  28. package/src/cli/commands/artifact/pending/discovery.ts +7 -11
  29. package/src/cli/commands/artifact/project/command.ts +60 -0
  30. package/src/cli/commands/companion/list.ts +70 -14
  31. package/src/cli/commands/companion/sync.ts +18 -0
  32. package/src/cli/commands/companion/update.ts +4 -19
  33. package/src/cli/commands/doctor.ts +51 -0
  34. package/src/cli/commands/friction.ts +558 -0
  35. package/src/cli/commands/install.ts +48 -36
  36. package/src/cli/commands/launch/claude.ts +2 -0
  37. package/src/cli/commands/launch/shared.ts +33 -6
  38. package/src/cli/commands/plugin/install.ts +27 -11
  39. package/src/cli/commands/report/index.ts +180 -184
  40. package/src/cli/commands/report/markdown.ts +67 -72
  41. package/src/cli/commands/shared/companion-selection.ts +3 -1
  42. package/src/cli/commands/studio/access.ts +6 -14
  43. package/src/cli/commands/studio/areas.ts +112 -33
  44. package/src/cli/commands/studio/companion-add.ts +72 -0
  45. package/src/cli/commands/studio/companion-removal.ts +15 -8
  46. package/src/cli/commands/studio/connection.ts +53 -0
  47. package/src/cli/commands/studio/graph-model.ts +61 -0
  48. package/src/cli/commands/studio/graph.ts +336 -0
  49. package/src/cli/commands/studio/index.ts +4 -4
  50. package/src/{lib/factory/outcomes/sessions.ts → cli/commands/studio/live-sessions.ts} +26 -2
  51. package/src/cli/commands/studio/payload.ts +214 -32
  52. package/src/cli/commands/studio/reports.ts +19 -18
  53. package/src/cli/commands/studio/routes.ts +8 -18
  54. package/src/cli/commands/studio/selection.ts +21 -5
  55. package/src/cli/commands/studio/server.ts +322 -191
  56. package/src/cli/commands/studio/service-host.ts +266 -0
  57. package/src/cli/commands/studio/services.ts +59 -16
  58. package/src/cli/commands/studio/studio-app.ts +1 -0
  59. package/src/cli/commands/studio/terminal.ts +45 -3
  60. package/src/cli/commands/studio/vault.ts +41 -40
  61. package/src/cli/commands/studio/views/model.ts +1 -9
  62. package/src/cli/commands/studio/views/vault/markdown-tree.ts +90 -8
  63. package/src/cli/commands/triage.ts +151 -0
  64. package/src/cli/commands/unwrap.ts +3 -0
  65. package/src/cli/commands/update.ts +2 -0
  66. package/src/cli/commands/vscode/release-vsix.json +4 -0
  67. package/src/cli/commands/vscode/setup.ts +71 -13
  68. package/src/cli/commands/vscode/vsix.ts +48 -7
  69. package/src/cli/commands/workflow/workflow.ts +516 -0
  70. package/src/cli/commands/working/cleanup.ts +40 -8
  71. package/src/cli/commands/working/worktree.ts +176 -35
  72. package/src/cli/main.ts +61 -10
  73. package/src/cli/plugin-commands.ts +6 -1
  74. package/src/cli/repo-list-table.tsx +73 -37
  75. package/src/cli/usage.ts +29 -8
  76. package/src/create-mate.ts +11 -5
  77. package/src/distribution.ts +2 -0
  78. package/src/factory-host.ts +69 -0
  79. package/src/hooks/companion-instructions.ts +19 -8
  80. package/src/hooks/hook-io.ts +3 -1
  81. package/src/hooks/rtk-worktree-git.ts +48 -0
  82. package/src/hooks/session-banner.ts +25 -0
  83. package/src/hooks/validate-artifact-path.ts +108 -26
  84. package/src/hooks/workflow-turn.ts +219 -0
  85. package/src/lib/apply-context/fingerprint.ts +2 -1
  86. package/src/lib/apply-context/protocol.ts +2 -2
  87. package/src/lib/artifact-trailer.ts +27 -0
  88. package/src/lib/change-layout.ts +83 -38
  89. package/src/lib/delivery/branch-template.ts +114 -0
  90. package/src/lib/delivery/branches.ts +21 -16
  91. package/src/lib/delivery/checkout.ts +103 -0
  92. package/src/lib/delivery/environment.ts +131 -7
  93. package/src/lib/delivery/merge-git.ts +282 -26
  94. package/src/lib/delivery/overlap.ts +68 -16
  95. package/src/lib/delivery/record-delivery.ts +178 -37
  96. package/src/lib/delivery/record.ts +201 -27
  97. package/src/lib/delivery/refresh.ts +212 -151
  98. package/src/lib/delivery/remote.ts +66 -0
  99. package/src/lib/delivery/repository-access.ts +19 -60
  100. package/src/lib/delivery/resolve-branch.ts +157 -110
  101. package/src/lib/delivery/stages.ts +83 -50
  102. package/src/lib/delivery/staging/apply-chain.ts +164 -0
  103. package/src/lib/delivery/staging/artifact-type.ts +101 -0
  104. package/src/lib/delivery/staging/declared-type.ts +277 -0
  105. package/src/lib/delivery/staging/naming.ts +64 -0
  106. package/src/lib/delivery/staging/openspec-type.ts +135 -0
  107. package/src/lib/delivery/staging/pending-edit.ts +291 -0
  108. package/src/lib/delivery/staging/pending.ts +780 -0
  109. package/src/lib/delivery/staging/project.ts +373 -0
  110. package/src/lib/delivery/staging/publish.ts +1024 -0
  111. package/src/lib/delivery/staging/refs.ts +258 -0
  112. package/src/lib/delivery/staging/registry.ts +73 -0
  113. package/src/lib/delivery/staging/replay.ts +308 -0
  114. package/src/lib/delivery/staging/requirement-blocks.ts +10 -0
  115. package/src/lib/delivery/staging/resolve.ts +264 -0
  116. package/src/lib/delivery/staging/settle-linked.ts +290 -0
  117. package/src/lib/delivery/staging/submit.ts +929 -0
  118. package/src/lib/delivery/staging/worktree.ts +130 -0
  119. package/src/lib/delivery/submit-change.ts +443 -0
  120. package/src/lib/friction/describe.ts +42 -0
  121. package/src/lib/friction/fields.ts +60 -0
  122. package/src/lib/friction/mark.ts +156 -0
  123. package/src/lib/friction/view/model.ts +67 -0
  124. package/src/lib/friction/view/read.ts +136 -0
  125. package/src/lib/friction/view/select.ts +54 -0
  126. package/src/lib/git-key.ts +15 -0
  127. package/src/lib/install.ts +2 -0
  128. package/src/lib/openspec-canonical-frontmatter.ts +159 -0
  129. package/src/lib/orchestrator/adapters/base.ts +31 -20
  130. package/src/lib/orchestrator/adapters/claude.ts +21 -7
  131. package/src/lib/orchestrator/adapters/opencode.ts +4 -0
  132. package/src/lib/orchestrator/companion-git-sync.ts +152 -16
  133. package/src/lib/orchestrator/companion-hub.ts +6 -1
  134. package/src/lib/orchestrator/engine-floor.ts +48 -0
  135. package/src/lib/orchestrator/framework-context.ts +15 -1
  136. package/src/lib/orchestrator/launcher.ts +34 -1
  137. package/src/lib/orchestrator/projection-claude-commands.ts +2 -2
  138. package/src/lib/orchestrator/projection-claude-entry.ts +42 -21
  139. package/src/lib/orchestrator/projection-claude-links.ts +33 -8
  140. package/src/lib/orchestrator/projection-claude-skills.ts +2 -2
  141. package/src/lib/orchestrator/projection-entries.ts +22 -18
  142. package/src/lib/orchestrator/projection-opencode-copies.ts +65 -21
  143. package/src/lib/orchestrator/projection-runtime-documents.ts +66 -43
  144. package/src/lib/orchestrator/projection-types.ts +28 -1
  145. package/src/lib/orchestrator/refresh-working-claude-links.ts +4 -1
  146. package/src/lib/orchestrator/root-context.ts +23 -6
  147. package/src/lib/orchestrator/session-prepare.ts +17 -2
  148. package/src/lib/orchestrator/setup-compatibilities.ts +1 -1
  149. package/src/lib/orchestrator/types.ts +4 -0
  150. package/src/lib/orchestrator/umbrella-checkouts.ts +102 -0
  151. package/src/lib/orchestrator/working-repo-projection.ts +24 -4
  152. package/src/lib/orchestrator/wrap-pass.ts +1 -0
  153. package/src/lib/package-paths.ts +23 -15
  154. package/src/lib/prebuilt-workspace-prepare.ts +2 -1
  155. package/src/lib/prebuilt-workspace.ts +1 -0
  156. package/src/lib/public-npm.ts +95 -50
  157. package/src/lib/session-attribution.ts +3 -7
  158. package/src/lib/session-state.ts +74 -3
  159. package/src/lib/triage/context.ts +186 -0
  160. package/src/lib/triage/launch.ts +52 -0
  161. package/src/lib/triage/prepare.ts +97 -0
  162. package/src/lib/triage/session.ts +126 -0
  163. package/src/lib/update-checker.ts +7 -1
  164. package/src/lib/usage/aggregate.ts +202 -0
  165. package/src/lib/usage/cache.ts +87 -0
  166. package/src/lib/usage/claude-pricing.ts +71 -0
  167. package/src/lib/usage/claude.ts +189 -0
  168. package/src/lib/usage/collect.ts +56 -0
  169. package/src/lib/usage/opencode.ts +188 -0
  170. package/src/lib/usage/records.ts +80 -0
  171. package/src/lib/usage/rtk-database.ts +72 -0
  172. package/src/lib/usage/savings.ts +209 -0
  173. package/src/lib/usage/scope.ts +182 -0
  174. package/src/lib/usage/source.ts +102 -0
  175. package/src/lib/usage/types.ts +143 -0
  176. package/src/lib/usage/window.ts +37 -0
  177. package/src/lib/workflow/declaration.ts +6 -0
  178. package/src/lib/workflow/handoff.ts +90 -0
  179. package/src/lib/workflow/hook-trust.ts +108 -0
  180. package/src/lib/workflow/position.ts +524 -0
  181. package/src/lib/workflow/report.ts +79 -0
  182. package/src/lib/workflow/work.ts +106 -0
  183. package/src/lib/workset/factory-local.ts +157 -0
  184. package/src/lib/workset/record.ts +25 -11
  185. package/src/lib/workset/repositories.ts +118 -25
  186. package/src/lib/workset/stage.ts +4 -2
  187. package/src/lib/workset/stages.ts +64 -4
  188. package/src/lib/workset/worktree-include.ts +161 -0
  189. package/src/lib/workset/worktree-index.ts +6 -2
  190. package/src/lib/workset/worktree.ts +622 -114
  191. package/src/opencode/companion-hooks.ts +105 -18
  192. package/src/opencode/companion-policy.ts +18 -5
  193. package/src/opencode/enter-worktree.ts +254 -6
  194. package/src/opencode/projected-guidance.ts +7 -2
  195. package/src/opencode/session-register.ts +2 -2
  196. package/src/opencode/turn-hook.ts +241 -0
  197. package/src/playbooks/companion-guidance.ts +7 -4
  198. package/src/plugin-api.ts +47 -0
  199. package/src/runtime/artifact-trailers.ts +63 -0
  200. package/src/runtime/claude-bg-isolation.ts +138 -0
  201. package/src/runtime/claude-hook-group.ts +2 -0
  202. package/src/runtime/command-friction.ts +97 -0
  203. package/src/runtime/companion-git-state.ts +155 -10
  204. package/src/runtime/companion-git.ts +96 -13
  205. package/src/runtime/companion-guidance.ts +136 -20
  206. package/src/runtime/companion-instructions.ts +1 -1
  207. package/src/runtime/companion-sync.ts +109 -21
  208. package/src/runtime/current-branch.ts +16 -2
  209. package/src/runtime/entered-worktree.ts +24 -0
  210. package/src/runtime/env-names.ts +2 -2
  211. package/src/runtime/env.ts +7 -6
  212. package/src/runtime/forge-remote.ts +48 -0
  213. package/src/runtime/friction-fingerprint.ts +35 -0
  214. package/src/runtime/friction-log.ts +352 -0
  215. package/src/runtime/friction-recorder.ts +199 -0
  216. package/src/runtime/friction-retention.ts +1 -0
  217. package/src/runtime/friction-state.ts +110 -0
  218. package/src/runtime/friction-switch.ts +26 -0
  219. package/src/runtime/friction-vocabulary.ts +42 -0
  220. package/src/runtime/git-layout.ts +21 -7
  221. package/src/runtime/git-tracked.ts +60 -0
  222. package/src/runtime/json-fields.ts +8 -0
  223. package/src/runtime/pending-records.ts +533 -0
  224. package/src/runtime/projected-guidance.ts +8 -3
  225. package/src/runtime/publication-secret-scan.ts +45 -0
  226. package/src/runtime/repo-destination.ts +72 -0
  227. package/src/runtime/repo-local.ts +25 -3
  228. package/src/runtime/rtk-git-guard.ts +66 -0
  229. package/src/runtime/runtime-document-manifest.ts +229 -19
  230. package/src/runtime/runtime-document-manifest.typecheck.ts +10 -0
  231. package/src/runtime/secret-guard.ts +9 -2
  232. package/src/runtime/secret-patterns.ts +3 -2
  233. package/src/runtime/secret-policy-weakening.ts +122 -0
  234. package/src/runtime/secret-values.ts +16 -0
  235. package/src/runtime/serving-claude-wrap.ts +15 -2
  236. package/src/runtime/session-id.ts +24 -0
  237. package/src/runtime/session-prepare-runner.ts +3 -0
  238. package/src/runtime/skill-prefix.ts +75 -0
  239. package/src/runtime/submitted-arrivals.ts +547 -0
  240. package/src/runtime/turn-state.d.mts +14 -0
  241. package/src/runtime/turn-state.mjs +93 -0
  242. package/src/runtime/umbrella-children.ts +52 -0
  243. package/src/runtime/umbrella-folder.ts +84 -0
  244. package/src/runtime/workflow/change-folders.ts +66 -0
  245. package/src/runtime/workflow/declaration.ts +720 -0
  246. package/src/runtime/workflow/globs.ts +85 -0
  247. package/src/runtime/workflow/next-handoff-process.ts +99 -0
  248. package/src/runtime/workflow/turn.ts +309 -0
  249. package/src/runtime/workflow/workflow.ts +262 -0
  250. package/src/runtime/wrap-state.ts +5 -13
  251. package/src/studio.ts +112 -19
  252. package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/schema.yaml +3 -3
  253. package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/templates/design.md +1 -1
  254. package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/templates/proposal.md +1 -1
  255. package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/templates/tasks.md +1 -1
  256. package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +3 -3
  257. package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +103 -30
  258. package/src/templates/mate-skills/agents/mate-apply-change/references/openspec-apply-change.md +1 -1
  259. package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +7 -70
  260. package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +13 -7
  261. package/src/templates/mate-skills/agents/mate-domain-modeling/SKILL.md +10 -0
  262. package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +46 -14
  263. package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +50 -31
  264. package/src/templates/mate-skills/agents/mate-propose-change/references/mate-revise.md +13 -7
  265. package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-update-change.md +1 -1
  266. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +114 -86
  267. package/src/templates/mate-skills/agents/mate-publish-artifact/references/openspec.md +111 -100
  268. package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +11 -5
  269. package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +16 -6
  270. package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +114 -0
  271. package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +103 -30
  272. package/src/templates/mate-skills/claude/mate-apply-change/references/openspec-apply-change.md +1 -1
  273. package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +7 -70
  274. package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +13 -7
  275. package/src/templates/mate-skills/claude/mate-domain-modeling/SKILL.md +10 -0
  276. package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +46 -14
  277. package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +50 -31
  278. package/src/templates/mate-skills/claude/mate-propose-change/references/mate-revise.md +13 -7
  279. package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-update-change.md +1 -1
  280. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +114 -86
  281. package/src/templates/mate-skills/claude/mate-publish-artifact/references/openspec.md +111 -100
  282. package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +11 -5
  283. package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +16 -6
  284. package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +114 -0
  285. package/src/templates/mate-skills/openspec-references.ts +3 -2
  286. package/src/templates/triage/PLAYBOOK.md +112 -0
  287. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +912 -139
  288. package/src/tools/setup/capabilities/openspec.ts +54 -15
  289. package/src/tools/setup/capabilities/rtk.ts +113 -9
  290. package/src/tools/setup/capabilities/tokensave.ts +3 -2
  291. package/src/tools/setup/dynamic-plugins/api.ts +38 -0
  292. package/src/tools/setup/dynamic-plugins/audiences.ts +65 -21
  293. package/src/tools/setup/dynamic-plugins/frozen.ts +32 -13
  294. package/src/tools/setup/dynamic-plugins/host.ts +2 -32
  295. package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -4
  296. package/src/tools/setup/dynamic-plugins/install.ts +24 -22
  297. package/src/tools/setup/dynamic-plugins/loader.ts +11 -7
  298. package/src/tools/setup/dynamic-plugins/paths.ts +30 -10
  299. package/src/tools/setup/dynamic-plugins/verify.ts +10 -7
  300. package/src/tools/setup/dynamic-plugins/workspaces.ts +153 -0
  301. package/src/tools/setup/engine.ts +20 -1
  302. package/src/tools/setup/mate.ts +5 -3
  303. package/src/tools/setup/package-managers/bun.ts +8 -8
  304. package/src/tools/setup/plugin.ts +14 -1
  305. package/src/tools/setup/plugins/gitignore.ts +15 -9
  306. package/src/tools/setup/plugins/guidance.ts +4 -2
  307. package/src/tools/setup/providers/claude-plugin-hooks.ts +30 -0
  308. package/src/tools/setup/providers/claude.ts +43 -6
  309. package/src/tools/setup/service-registry.ts +69 -0
  310. package/src/tools/setup/service.ts +237 -0
  311. package/src/tools/setup/utils.ts +28 -5
  312. package/src/tools/setup/working-repo-cleanup.ts +2 -2
  313. package/src/tools/setup/working-repo-local-state.ts +2 -0
  314. package/src/tools/setup.ts +41 -16
  315. package/studio-dist/client/assets/app-aIwDxf48.css +2 -0
  316. package/studio-dist/client/assets/button-CX0sWAJl.js +1 -0
  317. package/studio-dist/client/assets/combobox-BmA8RjOc.js +1 -0
  318. package/studio-dist/client/assets/companion-view-DINdPF-b.js +1 -0
  319. package/studio-dist/client/assets/fields-BobQ7zRF.js +1 -0
  320. package/studio-dist/client/assets/friction-YdYd3zaz.js +1 -0
  321. package/studio-dist/client/assets/getting-started-CY7NEtTw.js +1 -0
  322. package/studio-dist/client/assets/getting-started-djaQeWlu.js +1 -0
  323. package/studio-dist/client/assets/getting-started._topic-DVB8e5R9.js +1 -0
  324. package/studio-dist/client/assets/getting-started.index-DQvLHEr1.js +1 -0
  325. package/studio-dist/client/assets/graph-DbNnR884.js +2 -0
  326. package/studio-dist/client/assets/graph-canvas-DIcAqwtK.js +3242 -0
  327. package/studio-dist/client/assets/guides-D6T6W_jV.js +1 -0
  328. package/studio-dist/client/assets/index-CysBCSxM.js +40 -0
  329. package/studio-dist/client/assets/jsx-runtime-MZURdZre.js +1 -0
  330. package/studio-dist/client/assets/markdown-view-jMiaBTSO.js +1 -0
  331. package/studio-dist/client/assets/panel-Csr49lBo.js +1 -0
  332. package/studio-dist/client/assets/plugins._service._view-CEA_CcPe.js +1 -0
  333. package/studio-dist/client/assets/{prepaint-CwSrpdFA.js → prepaint-CKsXyJOR.js} +3 -3
  334. package/studio-dist/client/assets/queries-Dfp5deWj.js +1 -0
  335. package/studio-dist/client/assets/react-BYUSgtBs.js +1 -0
  336. package/studio-dist/client/assets/reports-CLdgxxkg.js +1 -0
  337. package/studio-dist/client/assets/routes-DGilWbDE.js +1 -0
  338. package/studio-dist/client/assets/search-CXosfvYh.js +1 -0
  339. package/studio-dist/client/assets/select-DdebbX7K.js +1 -0
  340. package/studio-dist/client/assets/skills-C3zNkU8g.js +1 -0
  341. package/studio-dist/client/assets/specs-Dl8HfGlU.js +1 -0
  342. package/studio-dist/client/assets/specs-view-B_n0Pekv.js +1 -0
  343. package/studio-dist/client/assets/steps-CKUno4lh.js +1 -0
  344. package/studio-dist/client/assets/store-DyXbi6o9.js +1 -0
  345. package/studio-dist/client/assets/studio-0ueISxwP.js +100 -0
  346. package/studio-dist/client/assets/studio-queries-BflKt9va.js +2 -0
  347. package/studio-dist/client/assets/usage-Blcl8kA_.js +55 -0
  348. package/studio-dist/client/assets/useAnchoredPopupScrollLock-BBXJpX5L.js +1 -0
  349. package/studio-dist/client/assets/useBaseQuery-C2cjmeH2.js +1 -0
  350. package/studio-dist/client/assets/useMutation-DI6LbvVa.js +1 -0
  351. package/studio-dist/client/assets/useSelector-AYcH7lB0.js +2 -0
  352. package/studio-dist/client/assets/vault-Cb9DmM1i.js +1 -0
  353. package/studio-dist/client/assets/warnings-B-rvoW8q.js +1 -0
  354. package/studio-dist/client/assets/workflow-DN5T19jd.js +1 -0
  355. package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-JoHQ5ihx.js +122 -0
  356. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +100 -39
  357. package/studio-dist/server/assets/{button-CIJqAhni.js → button-B7e1fRyW.js} +63 -3574
  358. package/studio-dist/server/assets/combobox--S_OmUfh.js +483 -0
  359. package/studio-dist/server/assets/{companion-view-DISASvdJ.js → companion-view-D-vGM55e.js} +3 -3
  360. package/studio-dist/server/assets/companions-Dr6IpNAb.js +31 -0
  361. package/studio-dist/server/assets/{createServerRpc-tK2lE9R2.js → createServerRpc-bFKFpGFG.js} +1 -1
  362. package/studio-dist/server/assets/fields-B4qM2ZwC.js +1190 -0
  363. package/studio-dist/server/assets/friction-CWOTjpCV.js +62 -0
  364. package/studio-dist/server/assets/friction-sLxaWY-H.js +903 -0
  365. package/studio-dist/server/assets/getting-started-B136TP57.js +4 -0
  366. package/studio-dist/server/assets/getting-started-Cq5Pcnsr.js +67 -0
  367. package/studio-dist/server/assets/getting-started._topic-CmWdl3u3.js +13 -0
  368. package/studio-dist/server/assets/getting-started.index-AB8xpTFY.js +13 -0
  369. package/studio-dist/server/assets/graph-B11ITte0.js +16 -0
  370. package/studio-dist/server/assets/graph-C_Hn-Wf_.js +800 -0
  371. package/studio-dist/server/assets/graph-canvas-BthrSmPS.js +21066 -0
  372. package/studio-dist/server/assets/graph-wire-BdSUx0G5.js +58 -0
  373. package/studio-dist/server/assets/guides-B8HdeK_C.js +13 -0
  374. package/studio-dist/server/assets/guides-BVQ4pt5B.js +5 -0
  375. package/studio-dist/server/assets/guides.server-DqFQAStf.js +66 -0
  376. package/studio-dist/server/assets/jsx-runtime-Bt0s0YKS.js +451 -0
  377. package/studio-dist/server/assets/{markdown-view-Bn7xPdks.js → markdown-view-rwiiVcPC.js} +28 -9
  378. package/studio-dist/server/assets/{panel-3Jmn4awF.js → panel-CUxRIpYL.js} +5 -5
  379. package/studio-dist/server/assets/plugins._service._view-BSvGnlhU.js +94 -0
  380. package/studio-dist/server/assets/{prepaint-DJfTQ_VH.js → prepaint-B28ClcPN.js} +1 -1
  381. package/studio-dist/server/assets/queries-S_Pl90IG.js +32 -0
  382. package/studio-dist/server/assets/{react-Ce6dj15C.js → react-CiBZPDs8.js} +3 -4
  383. package/studio-dist/server/assets/redirect-BaZ_QyqF.js +39 -0
  384. package/studio-dist/server/assets/{reports-C06RXVE2.js → reports-B9k98oE6.js} +3 -3
  385. package/studio-dist/server/assets/{reports-D6YMqhnO.js → reports-CJpAItPk.js} +14 -10
  386. package/studio-dist/server/assets/{router-C8MGqlAY.js → router-DF0etoNa.js} +1322 -3127
  387. package/studio-dist/server/assets/{routes-BcFgvqf7.js → routes-6ylCLkyg.js} +221 -76
  388. package/studio-dist/server/assets/search-b-yQesv3.js +78 -0
  389. package/studio-dist/server/assets/select-CjuKScan.js +1609 -0
  390. package/studio-dist/server/assets/{shell-DS3wUexh.js → shell-DLkP7wG9.js} +15 -6
  391. package/studio-dist/server/assets/{skills-CtrBAtX3.js → skills-DGg0mWDM.js} +3 -3
  392. package/studio-dist/server/assets/{skills-BEnOxiDl.js → skills-zeU80A9S.js} +8 -8
  393. package/studio-dist/server/assets/specs-DDBNT_v1.js +51 -0
  394. package/studio-dist/server/assets/specs-view-exvmWdg0.js +425 -0
  395. package/studio-dist/server/assets/{steps-Dq_CwY_s.js → steps-D1tYAyWZ.js} +88 -45
  396. package/studio-dist/server/assets/store-kS7zk0Hr.js +93 -0
  397. package/studio-dist/server/assets/studio-qRvQjRpz.js +10482 -0
  398. package/studio-dist/server/assets/studio-queries-qOXOYoPt.js +1393 -0
  399. package/studio-dist/server/assets/usage-C2um7YiV.js +25553 -0
  400. package/studio-dist/server/assets/usage-Cwle9-xY.js +24 -0
  401. package/studio-dist/server/assets/useAnchoredPopupScrollLock-kQBB3y_b.js +756 -0
  402. package/studio-dist/server/assets/useBaseQuery--iH3rd-T.js +2051 -0
  403. package/studio-dist/server/assets/useMutation-C-WO6hCM.js +690 -0
  404. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-M2GBs8s3.js → useSelector-DUmCUXAs.js} +4 -668
  405. package/studio-dist/server/assets/{vault-Fvxt2Tzl.js → vault-B8vgVIH9.js} +10 -7
  406. package/studio-dist/server/assets/{vault-BmWnryh3.js → vault-CEBBRLMb.js} +3 -3
  407. package/studio-dist/server/assets/{views-BgYa-za2.js → views-UgO0Qz_g.js} +9 -6
  408. package/studio-dist/server/assets/{warnings-DzR6fyZh.js → warnings-BxK4VfV5.js} +2 -2
  409. package/studio-dist/server/assets/{delivery-path-C29fBynY.js → workflow-BrTK632u.js} +152 -120
  410. package/studio-dist/server/server.js +582 -8
  411. package/src/cli/commands/factory/factory.ts +0 -301
  412. package/src/cli/commands/report/collector.ts +0 -288
  413. package/src/cli/commands/studio/factory-credential.ts +0 -49
  414. package/src/cli/commands/studio/workset-session.ts +0 -131
  415. package/src/lib/delivery/archive-change.ts +0 -165
  416. package/src/lib/delivery/forge.ts +0 -279
  417. package/src/lib/delivery/token.ts +0 -24
  418. package/src/lib/factory/attach-client.ts +0 -113
  419. package/src/lib/factory/attach.ts +0 -178
  420. package/src/lib/factory/broker.ts +0 -190
  421. package/src/lib/factory/bun-commands.ts +0 -39
  422. package/src/lib/factory/client.ts +0 -92
  423. package/src/lib/factory/command.ts +0 -61
  424. package/src/lib/factory/credential-store.ts +0 -153
  425. package/src/lib/factory/frames.ts +0 -77
  426. package/src/lib/factory/ids.ts +0 -58
  427. package/src/lib/factory/outcomes/actions.ts +0 -114
  428. package/src/lib/factory/outcomes/index.ts +0 -391
  429. package/src/lib/factory/outcomes/lifecycle.ts +0 -205
  430. package/src/lib/factory/outcomes/runs.ts +0 -81
  431. package/src/lib/factory/prepare.ts +0 -49
  432. package/src/lib/factory/pty.ts +0 -103
  433. package/src/lib/factory/runner/companion-context.ts +0 -178
  434. package/src/lib/factory/runner/control.ts +0 -92
  435. package/src/lib/factory/runner/harness-agent.ts +0 -250
  436. package/src/lib/factory/runner/live.ts +0 -159
  437. package/src/lib/factory/runner/questions.ts +0 -22
  438. package/src/lib/factory/runner/rank.ts +0 -26
  439. package/src/lib/factory/runner/run-policy.ts +0 -12
  440. package/src/lib/factory/runner/run.ts +0 -199
  441. package/src/lib/factory/runner/scheduler.ts +0 -416
  442. package/src/lib/factory/runner/state.ts +0 -233
  443. package/src/lib/factory/runner/workflow.ts +0 -542
  444. package/src/lib/factory/runtime.ts +0 -981
  445. package/src/lib/factory/sandbox.ts +0 -292
  446. package/src/lib/factory/worktree-branch.ts +0 -17
  447. package/src/templates/capabilities/openspec-cap/mate-v1/templates/explore-brief.md +0 -25
  448. package/studio-dist/client/assets/app-CdPiFv59.css +0 -2
  449. package/studio-dist/client/assets/button-BIIHE0EQ.js +0 -3
  450. package/studio-dist/client/assets/companion-view-DM6YyXaR.js +0 -1
  451. package/studio-dist/client/assets/delivery-path-DELxj0Av.js +0 -1
  452. package/studio-dist/client/assets/factory-BZy0E8ty.js +0 -4
  453. package/studio-dist/client/assets/index-B3wkMzjA.js +0 -40
  454. package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +0 -1
  455. package/studio-dist/client/assets/panel-CbajlC3p.js +0 -1
  456. package/studio-dist/client/assets/react-CN2GSx7x.js +0 -1
  457. package/studio-dist/client/assets/reports-DllhYQ5_.js +0 -1
  458. package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
  459. package/studio-dist/client/assets/routes-COm-G3mK.js +0 -1
  460. package/studio-dist/client/assets/skills-DmWAy-jZ.js +0 -1
  461. package/studio-dist/client/assets/specs-BG3Wi3ln.js +0 -1
  462. package/studio-dist/client/assets/steps-DFsH3Neu.js +0 -1
  463. package/studio-dist/client/assets/vault-B2q1nBY5.js +0 -1
  464. package/studio-dist/client/assets/warnings-BSXIyuSQ.js +0 -1
  465. package/studio-dist/client/assets/workflow-DlsQD6Hc.js +0 -1
  466. package/studio-dist/server/assets/actions-Bvgj9eb8.js +0 -54
  467. package/studio-dist/server/assets/companions-BYbHWKOZ.js +0 -15
  468. package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +0 -459
  469. package/studio-dist/server/assets/factory-DGPmNGbo.js +0 -69
  470. package/studio-dist/server/assets/factory-DUTa0eDs.js +0 -2172
  471. package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +0 -34
  472. package/studio-dist/server/assets/search-JAKurDNh.js +0 -36
  473. package/studio-dist/server/assets/specs-C8rv34-5.js +0 -211
  474. package/studio-dist/server/assets/studio-BeltxxKt.js +0 -216
  475. package/studio-dist/server/assets/workflow-liRYecHk.js +0 -73
  476. /package/src/lib/{factory/keyed-serial.ts → keyed-serial.ts} +0 -0
  477. /package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/templates/spec.md +0 -0
@@ -53,6 +53,9 @@ exports[`runtime surface golden fixtures setup graphify × claude 1`] = `
53
53
  "Read(<root>/companion/**)",
54
54
  "Skill(graphify)",
55
55
  ],
56
+ "ask": [
57
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
58
+ ],
56
59
  "deny": [
57
60
  "EnterPlanMode",
58
61
  "DesignSync",
@@ -140,9 +143,8 @@ exports[`runtime surface golden fixtures setup graphify × claude 2`] = `
140
143
  <linked-repository id="app" />
141
144
  </context>
142
145
  <mandatory-rules>
143
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
146
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
144
147
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
145
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
146
148
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
147
149
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
148
150
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -204,6 +206,15 @@ exports[`runtime surface golden fixtures setup graphify × claude 3`] = `
204
206
  ],
205
207
  "matcher": "mcp__tokensave__.*",
206
208
  },
209
+ {
210
+ "hooks": [
211
+ {
212
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
213
+ "type": "command",
214
+ },
215
+ ],
216
+ "matcher": "Bash",
217
+ },
207
218
  ],
208
219
  },
209
220
  {
@@ -291,6 +302,58 @@ exports[`runtime surface golden fixtures setup graphify × claude 3`] = `
291
302
  },
292
303
  ],
293
304
  },
305
+ {
306
+ "at": [
307
+ "hooks",
308
+ "UserPromptSubmit",
309
+ ],
310
+ "kind": "list",
311
+ "values": [
312
+ {
313
+ "hooks": [
314
+ {
315
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
316
+ "type": "command",
317
+ },
318
+ ],
319
+ },
320
+ ],
321
+ },
322
+ {
323
+ "at": [
324
+ "hooks",
325
+ "PostToolUse",
326
+ ],
327
+ "kind": "list",
328
+ "values": [
329
+ {
330
+ "hooks": [
331
+ {
332
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
333
+ "type": "command",
334
+ },
335
+ ],
336
+ "matcher": "Skill|Bash",
337
+ },
338
+ ],
339
+ },
340
+ {
341
+ "at": [
342
+ "hooks",
343
+ "Stop",
344
+ ],
345
+ "kind": "list",
346
+ "values": [
347
+ {
348
+ "hooks": [
349
+ {
350
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
351
+ "type": "command",
352
+ },
353
+ ],
354
+ },
355
+ ],
356
+ },
294
357
  {
295
358
  "at": [
296
359
  "env",
@@ -359,6 +422,16 @@ exports[`runtime surface golden fixtures setup graphify × claude 3`] = `
359
422
  "Edit(**/.npmrc)",
360
423
  ],
361
424
  },
425
+ {
426
+ "at": [
427
+ "permissions",
428
+ "ask",
429
+ ],
430
+ "kind": "list",
431
+ "values": [
432
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
433
+ ],
434
+ },
362
435
  {
363
436
  "at": [
364
437
  "enableArtifact",
@@ -487,9 +560,8 @@ exports[`runtime surface golden fixtures setup graphify × opencode 2`] = `
487
560
  <linked-repository id="$MATE_REPO_ID" />
488
561
  </context>
489
562
  <mandatory-rules>
490
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
563
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
491
564
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
492
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
493
565
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
494
566
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
495
567
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -800,6 +872,9 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 1`] =
800
872
  "Read(<root>/companion/**)",
801
873
  "Skill(graphify)",
802
874
  ],
875
+ "ask": [
876
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
877
+ ],
803
878
  "deny": [
804
879
  "EnterPlanMode",
805
880
  "DesignSync",
@@ -924,9 +999,8 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 2`] =
924
999
  <linked-repository id="app" />
925
1000
  </context>
926
1001
  <mandatory-rules>
927
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
1002
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
928
1003
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
929
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
930
1004
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
931
1005
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
932
1006
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -992,9 +1066,8 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 2`] =
992
1066
  <linked-repository id="$MATE_REPO_ID" />
993
1067
  </context>
994
1068
  <mandatory-rules>
995
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
1069
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
996
1070
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
997
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
998
1071
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
999
1072
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
1000
1073
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -1042,6 +1115,15 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
1042
1115
  ],
1043
1116
  "matcher": "mcp__tokensave__.*",
1044
1117
  },
1118
+ {
1119
+ "hooks": [
1120
+ {
1121
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
1122
+ "type": "command",
1123
+ },
1124
+ ],
1125
+ "matcher": "Bash",
1126
+ },
1045
1127
  ],
1046
1128
  },
1047
1129
  {
@@ -1129,6 +1211,58 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
1129
1211
  },
1130
1212
  ],
1131
1213
  },
1214
+ {
1215
+ "at": [
1216
+ "hooks",
1217
+ "UserPromptSubmit",
1218
+ ],
1219
+ "kind": "list",
1220
+ "values": [
1221
+ {
1222
+ "hooks": [
1223
+ {
1224
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
1225
+ "type": "command",
1226
+ },
1227
+ ],
1228
+ },
1229
+ ],
1230
+ },
1231
+ {
1232
+ "at": [
1233
+ "hooks",
1234
+ "PostToolUse",
1235
+ ],
1236
+ "kind": "list",
1237
+ "values": [
1238
+ {
1239
+ "hooks": [
1240
+ {
1241
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
1242
+ "type": "command",
1243
+ },
1244
+ ],
1245
+ "matcher": "Skill|Bash",
1246
+ },
1247
+ ],
1248
+ },
1249
+ {
1250
+ "at": [
1251
+ "hooks",
1252
+ "Stop",
1253
+ ],
1254
+ "kind": "list",
1255
+ "values": [
1256
+ {
1257
+ "hooks": [
1258
+ {
1259
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
1260
+ "type": "command",
1261
+ },
1262
+ ],
1263
+ },
1264
+ ],
1265
+ },
1132
1266
  {
1133
1267
  "at": [
1134
1268
  "env",
@@ -1197,6 +1331,16 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
1197
1331
  "Edit(**/.npmrc)",
1198
1332
  ],
1199
1333
  },
1334
+ {
1335
+ "at": [
1336
+ "permissions",
1337
+ "ask",
1338
+ ],
1339
+ "kind": "list",
1340
+ "values": [
1341
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
1342
+ ],
1343
+ },
1200
1344
  {
1201
1345
  "at": [
1202
1346
  "enableArtifact",
@@ -1543,6 +1687,9 @@ exports[`runtime surface golden fixtures setup tokensave × claude 1`] = `
1543
1687
  "Read(<root>/companion/**)",
1544
1688
  "mcp__tokensave__*",
1545
1689
  ],
1690
+ "ask": [
1691
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
1692
+ ],
1546
1693
  "deny": [
1547
1694
  "EnterPlanMode",
1548
1695
  "DesignSync",
@@ -1614,9 +1761,8 @@ exports[`runtime surface golden fixtures setup tokensave × claude 2`] = `
1614
1761
  <linked-repository id="app" />
1615
1762
  </context>
1616
1763
  <mandatory-rules>
1617
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
1764
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
1618
1765
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
1619
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
1620
1766
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
1621
1767
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
1622
1768
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -1675,6 +1821,15 @@ exports[`runtime surface golden fixtures setup tokensave × claude 3`] = `
1675
1821
  ],
1676
1822
  "matcher": "mcp__tokensave__.*",
1677
1823
  },
1824
+ {
1825
+ "hooks": [
1826
+ {
1827
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
1828
+ "type": "command",
1829
+ },
1830
+ ],
1831
+ "matcher": "Bash",
1832
+ },
1678
1833
  {
1679
1834
  "hooks": [
1680
1835
  {
@@ -1781,6 +1936,14 @@ exports[`runtime surface golden fixtures setup tokensave × claude 3`] = `
1781
1936
  ],
1782
1937
  "kind": "list",
1783
1938
  "values": [
1939
+ {
1940
+ "hooks": [
1941
+ {
1942
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
1943
+ "type": "command",
1944
+ },
1945
+ ],
1946
+ },
1784
1947
  {
1785
1948
  "hooks": [
1786
1949
  {
@@ -1794,6 +1957,24 @@ exports[`runtime surface golden fixtures setup tokensave × claude 3`] = `
1794
1957
  },
1795
1958
  ],
1796
1959
  },
1960
+ {
1961
+ "at": [
1962
+ "hooks",
1963
+ "PostToolUse",
1964
+ ],
1965
+ "kind": "list",
1966
+ "values": [
1967
+ {
1968
+ "hooks": [
1969
+ {
1970
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
1971
+ "type": "command",
1972
+ },
1973
+ ],
1974
+ "matcher": "Skill|Bash",
1975
+ },
1976
+ ],
1977
+ },
1797
1978
  {
1798
1979
  "at": [
1799
1980
  "hooks",
@@ -1801,6 +1982,14 @@ exports[`runtime surface golden fixtures setup tokensave × claude 3`] = `
1801
1982
  ],
1802
1983
  "kind": "list",
1803
1984
  "values": [
1985
+ {
1986
+ "hooks": [
1987
+ {
1988
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
1989
+ "type": "command",
1990
+ },
1991
+ ],
1992
+ },
1804
1993
  {
1805
1994
  "hooks": [
1806
1995
  {
@@ -1879,6 +2068,16 @@ exports[`runtime surface golden fixtures setup tokensave × claude 3`] = `
1879
2068
  "Edit(**/.npmrc)",
1880
2069
  ],
1881
2070
  },
2071
+ {
2072
+ "at": [
2073
+ "permissions",
2074
+ "ask",
2075
+ ],
2076
+ "kind": "list",
2077
+ "values": [
2078
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
2079
+ ],
2080
+ },
1882
2081
  {
1883
2082
  "at": [
1884
2083
  "enableArtifact",
@@ -2016,9 +2215,8 @@ exports[`runtime surface golden fixtures setup tokensave × opencode 2`] = `
2016
2215
  <linked-repository id="$MATE_REPO_ID" />
2017
2216
  </context>
2018
2217
  <mandatory-rules>
2019
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
2218
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
2020
2219
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
2021
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
2022
2220
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
2023
2221
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
2024
2222
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -2379,6 +2577,9 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 1`]
2379
2577
  "Read(<root>/companion/**)",
2380
2578
  "mcp__tokensave__*",
2381
2579
  ],
2580
+ "ask": [
2581
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
2582
+ ],
2382
2583
  "deny": [
2383
2584
  "EnterPlanMode",
2384
2585
  "DesignSync",
@@ -2478,9 +2679,8 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 2`]
2478
2679
  <linked-repository id="app" />
2479
2680
  </context>
2480
2681
  <mandatory-rules>
2481
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
2682
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
2482
2683
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
2483
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
2484
2684
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
2485
2685
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
2486
2686
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -2540,9 +2740,8 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 2`]
2540
2740
  <linked-repository id="$MATE_REPO_ID" />
2541
2741
  </context>
2542
2742
  <mandatory-rules>
2543
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
2743
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
2544
2744
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
2545
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
2546
2745
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
2547
2746
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
2548
2747
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -2590,6 +2789,15 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
2590
2789
  ],
2591
2790
  "matcher": "mcp__tokensave__.*",
2592
2791
  },
2792
+ {
2793
+ "hooks": [
2794
+ {
2795
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
2796
+ "type": "command",
2797
+ },
2798
+ ],
2799
+ "matcher": "Bash",
2800
+ },
2593
2801
  {
2594
2802
  "hooks": [
2595
2803
  {
@@ -2696,6 +2904,14 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
2696
2904
  ],
2697
2905
  "kind": "list",
2698
2906
  "values": [
2907
+ {
2908
+ "hooks": [
2909
+ {
2910
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
2911
+ "type": "command",
2912
+ },
2913
+ ],
2914
+ },
2699
2915
  {
2700
2916
  "hooks": [
2701
2917
  {
@@ -2709,6 +2925,24 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
2709
2925
  },
2710
2926
  ],
2711
2927
  },
2928
+ {
2929
+ "at": [
2930
+ "hooks",
2931
+ "PostToolUse",
2932
+ ],
2933
+ "kind": "list",
2934
+ "values": [
2935
+ {
2936
+ "hooks": [
2937
+ {
2938
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
2939
+ "type": "command",
2940
+ },
2941
+ ],
2942
+ "matcher": "Skill|Bash",
2943
+ },
2944
+ ],
2945
+ },
2712
2946
  {
2713
2947
  "at": [
2714
2948
  "hooks",
@@ -2716,6 +2950,14 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
2716
2950
  ],
2717
2951
  "kind": "list",
2718
2952
  "values": [
2953
+ {
2954
+ "hooks": [
2955
+ {
2956
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
2957
+ "type": "command",
2958
+ },
2959
+ ],
2960
+ },
2719
2961
  {
2720
2962
  "hooks": [
2721
2963
  {
@@ -2794,6 +3036,16 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
2794
3036
  "Edit(**/.npmrc)",
2795
3037
  ],
2796
3038
  },
3039
+ {
3040
+ "at": [
3041
+ "permissions",
3042
+ "ask",
3043
+ ],
3044
+ "kind": "list",
3045
+ "values": [
3046
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
3047
+ ],
3048
+ },
2797
3049
  {
2798
3050
  "at": [
2799
3051
  "enableArtifact",
@@ -3130,6 +3382,9 @@ exports[`runtime surface golden fixtures setup context-mode × claude 1`] = `
3130
3382
  "Skill(context-mode:context-mode)",
3131
3383
  "mcp__plugin_context-mode_context-mode__*",
3132
3384
  ],
3385
+ "ask": [
3386
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
3387
+ ],
3133
3388
  "deny": [
3134
3389
  "EnterPlanMode",
3135
3390
  "DesignSync",
@@ -3201,9 +3456,8 @@ exports[`runtime surface golden fixtures setup context-mode × claude 2`] = `
3201
3456
  <linked-repository id="app" />
3202
3457
  </context>
3203
3458
  <mandatory-rules>
3204
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
3459
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
3205
3460
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
3206
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
3207
3461
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
3208
3462
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
3209
3463
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -3256,6 +3510,15 @@ exports[`runtime surface golden fixtures setup context-mode × claude 3`] = `
3256
3510
  ],
3257
3511
  "matcher": "mcp__tokensave__.*",
3258
3512
  },
3513
+ {
3514
+ "hooks": [
3515
+ {
3516
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
3517
+ "type": "command",
3518
+ },
3519
+ ],
3520
+ "matcher": "Bash",
3521
+ },
3259
3522
  ],
3260
3523
  },
3261
3524
  {
@@ -3343,6 +3606,58 @@ exports[`runtime surface golden fixtures setup context-mode × claude 3`] = `
3343
3606
  },
3344
3607
  ],
3345
3608
  },
3609
+ {
3610
+ "at": [
3611
+ "hooks",
3612
+ "UserPromptSubmit",
3613
+ ],
3614
+ "kind": "list",
3615
+ "values": [
3616
+ {
3617
+ "hooks": [
3618
+ {
3619
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
3620
+ "type": "command",
3621
+ },
3622
+ ],
3623
+ },
3624
+ ],
3625
+ },
3626
+ {
3627
+ "at": [
3628
+ "hooks",
3629
+ "PostToolUse",
3630
+ ],
3631
+ "kind": "list",
3632
+ "values": [
3633
+ {
3634
+ "hooks": [
3635
+ {
3636
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
3637
+ "type": "command",
3638
+ },
3639
+ ],
3640
+ "matcher": "Skill|Bash",
3641
+ },
3642
+ ],
3643
+ },
3644
+ {
3645
+ "at": [
3646
+ "hooks",
3647
+ "Stop",
3648
+ ],
3649
+ "kind": "list",
3650
+ "values": [
3651
+ {
3652
+ "hooks": [
3653
+ {
3654
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
3655
+ "type": "command",
3656
+ },
3657
+ ],
3658
+ },
3659
+ ],
3660
+ },
3346
3661
  {
3347
3662
  "at": [
3348
3663
  "env",
@@ -3409,6 +3724,16 @@ exports[`runtime surface golden fixtures setup context-mode × claude 3`] = `
3409
3724
  "Edit(**/.npmrc)",
3410
3725
  ],
3411
3726
  },
3727
+ {
3728
+ "at": [
3729
+ "permissions",
3730
+ "ask",
3731
+ ],
3732
+ "kind": "list",
3733
+ "values": [
3734
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
3735
+ ],
3736
+ },
3412
3737
  {
3413
3738
  "at": [
3414
3739
  "enableArtifact",
@@ -3516,9 +3841,8 @@ exports[`runtime surface golden fixtures setup context-mode × opencode 2`] = `
3516
3841
  <linked-repository id="$MATE_REPO_ID" />
3517
3842
  </context>
3518
3843
  <mandatory-rules>
3519
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
3844
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
3520
3845
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
3521
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
3522
3846
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
3523
3847
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
3524
3848
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -3823,6 +4147,9 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
3823
4147
  "Skill(context-mode:context-mode)",
3824
4148
  "mcp__plugin_context-mode_context-mode__*",
3825
4149
  ],
4150
+ "ask": [
4151
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
4152
+ ],
3826
4153
  "deny": [
3827
4154
  "EnterPlanMode",
3828
4155
  "DesignSync",
@@ -3913,9 +4240,8 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 2
3913
4240
  <linked-repository id="app" />
3914
4241
  </context>
3915
4242
  <mandatory-rules>
3916
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
4243
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
3917
4244
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
3918
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
3919
4245
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
3920
4246
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
3921
4247
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -3961,9 +4287,8 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 2
3961
4287
  <linked-repository id="$MATE_REPO_ID" />
3962
4288
  </context>
3963
4289
  <mandatory-rules>
3964
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
4290
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
3965
4291
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
3966
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
3967
4292
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
3968
4293
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
3969
4294
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -4011,6 +4336,15 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
4011
4336
  ],
4012
4337
  "matcher": "mcp__tokensave__.*",
4013
4338
  },
4339
+ {
4340
+ "hooks": [
4341
+ {
4342
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
4343
+ "type": "command",
4344
+ },
4345
+ ],
4346
+ "matcher": "Bash",
4347
+ },
4014
4348
  ],
4015
4349
  },
4016
4350
  {
@@ -4098,6 +4432,58 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
4098
4432
  },
4099
4433
  ],
4100
4434
  },
4435
+ {
4436
+ "at": [
4437
+ "hooks",
4438
+ "UserPromptSubmit",
4439
+ ],
4440
+ "kind": "list",
4441
+ "values": [
4442
+ {
4443
+ "hooks": [
4444
+ {
4445
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
4446
+ "type": "command",
4447
+ },
4448
+ ],
4449
+ },
4450
+ ],
4451
+ },
4452
+ {
4453
+ "at": [
4454
+ "hooks",
4455
+ "PostToolUse",
4456
+ ],
4457
+ "kind": "list",
4458
+ "values": [
4459
+ {
4460
+ "hooks": [
4461
+ {
4462
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
4463
+ "type": "command",
4464
+ },
4465
+ ],
4466
+ "matcher": "Skill|Bash",
4467
+ },
4468
+ ],
4469
+ },
4470
+ {
4471
+ "at": [
4472
+ "hooks",
4473
+ "Stop",
4474
+ ],
4475
+ "kind": "list",
4476
+ "values": [
4477
+ {
4478
+ "hooks": [
4479
+ {
4480
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
4481
+ "type": "command",
4482
+ },
4483
+ ],
4484
+ },
4485
+ ],
4486
+ },
4101
4487
  {
4102
4488
  "at": [
4103
4489
  "env",
@@ -4164,6 +4550,16 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
4164
4550
  "Edit(**/.npmrc)",
4165
4551
  ],
4166
4552
  },
4553
+ {
4554
+ "at": [
4555
+ "permissions",
4556
+ "ask",
4557
+ ],
4558
+ "kind": "list",
4559
+ "values": [
4560
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
4561
+ ],
4562
+ },
4167
4563
  {
4168
4564
  "at": [
4169
4565
  "enableArtifact",
@@ -4463,6 +4859,9 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 1`] = `
4463
4859
  "Read(<root>/companion/**)",
4464
4860
  "Skill(mate-react-doctor)",
4465
4861
  ],
4862
+ "ask": [
4863
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
4864
+ ],
4466
4865
  "deny": [
4467
4866
  "EnterPlanMode",
4468
4867
  "DesignSync",
@@ -4537,9 +4936,8 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 2`] = `
4537
4936
  <linked-repository id="app" />
4538
4937
  </context>
4539
4938
  <mandatory-rules>
4540
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
4939
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
4541
4940
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
4542
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
4543
4941
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
4544
4942
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
4545
4943
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -4590,6 +4988,15 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 3`] = `
4590
4988
  ],
4591
4989
  "matcher": "mcp__tokensave__.*",
4592
4990
  },
4991
+ {
4992
+ "hooks": [
4993
+ {
4994
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
4995
+ "type": "command",
4996
+ },
4997
+ ],
4998
+ "matcher": "Bash",
4999
+ },
4593
5000
  ],
4594
5001
  },
4595
5002
  {
@@ -4636,7 +5043,58 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 3`] = `
4636
5043
  {
4637
5044
  "hooks": [
4638
5045
  {
4639
- "command": "node "<runtime-claude-plugin>/hooks/companion-instructions.mjs" --projected",
5046
+ "command": "node "<runtime-claude-plugin>/hooks/companion-instructions.mjs" --projected",
5047
+ "type": "command",
5048
+ },
5049
+ ],
5050
+ },
5051
+ ],
5052
+ },
5053
+ {
5054
+ "at": [
5055
+ "hooks",
5056
+ "SessionEnd",
5057
+ ],
5058
+ "kind": "list",
5059
+ "values": [
5060
+ {
5061
+ "hooks": [
5062
+ {
5063
+ "command": "node "<runtime-claude-plugin>/hooks/session-end.mjs" --projected",
5064
+ "type": "command",
5065
+ },
5066
+ ],
5067
+ },
5068
+ ],
5069
+ },
5070
+ {
5071
+ "at": [
5072
+ "hooks",
5073
+ "Notification",
5074
+ ],
5075
+ "kind": "list",
5076
+ "values": [
5077
+ {
5078
+ "hooks": [
5079
+ {
5080
+ "command": "node "<runtime-claude-plugin>/hooks/session-attention.mjs" --projected",
5081
+ "type": "command",
5082
+ },
5083
+ ],
5084
+ },
5085
+ ],
5086
+ },
5087
+ {
5088
+ "at": [
5089
+ "hooks",
5090
+ "UserPromptSubmit",
5091
+ ],
5092
+ "kind": "list",
5093
+ "values": [
5094
+ {
5095
+ "hooks": [
5096
+ {
5097
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
4640
5098
  "type": "command",
4641
5099
  },
4642
5100
  ],
@@ -4646,31 +5104,32 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 3`] = `
4646
5104
  {
4647
5105
  "at": [
4648
5106
  "hooks",
4649
- "SessionEnd",
5107
+ "PostToolUse",
4650
5108
  ],
4651
5109
  "kind": "list",
4652
5110
  "values": [
4653
5111
  {
4654
5112
  "hooks": [
4655
5113
  {
4656
- "command": "node "<runtime-claude-plugin>/hooks/session-end.mjs" --projected",
5114
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
4657
5115
  "type": "command",
4658
5116
  },
4659
5117
  ],
5118
+ "matcher": "Skill|Bash",
4660
5119
  },
4661
5120
  ],
4662
5121
  },
4663
5122
  {
4664
5123
  "at": [
4665
5124
  "hooks",
4666
- "Notification",
5125
+ "Stop",
4667
5126
  ],
4668
5127
  "kind": "list",
4669
5128
  "values": [
4670
5129
  {
4671
5130
  "hooks": [
4672
5131
  {
4673
- "command": "node "<runtime-claude-plugin>/hooks/session-attention.mjs" --projected",
5132
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
4674
5133
  "type": "command",
4675
5134
  },
4676
5135
  ],
@@ -4743,6 +5202,16 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 3`] = `
4743
5202
  "Edit(**/.npmrc)",
4744
5203
  ],
4745
5204
  },
5205
+ {
5206
+ "at": [
5207
+ "permissions",
5208
+ "ask",
5209
+ ],
5210
+ "kind": "list",
5211
+ "values": [
5212
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
5213
+ ],
5214
+ },
4746
5215
  {
4747
5216
  "at": [
4748
5217
  "enableArtifact",
@@ -4842,9 +5311,8 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 2`] = `
4842
5311
  <linked-repository id="$MATE_REPO_ID" />
4843
5312
  </context>
4844
5313
  <mandatory-rules>
4845
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
5314
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
4846
5315
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
4847
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
4848
5316
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
4849
5317
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
4850
5318
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -5140,6 +5608,9 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1
5140
5608
  "Read(<root>/companion/**)",
5141
5609
  "Skill(mate-react-doctor)",
5142
5610
  ],
5611
+ "ask": [
5612
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
5613
+ ],
5143
5614
  "deny": [
5144
5615
  "EnterPlanMode",
5145
5616
  "DesignSync",
@@ -5233,9 +5704,8 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 2
5233
5704
  <linked-repository id="app" />
5234
5705
  </context>
5235
5706
  <mandatory-rules>
5236
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
5707
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
5237
5708
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
5238
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
5239
5709
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
5240
5710
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
5241
5711
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -5279,9 +5749,8 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 2
5279
5749
  <linked-repository id="$MATE_REPO_ID" />
5280
5750
  </context>
5281
5751
  <mandatory-rules>
5282
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
5752
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
5283
5753
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
5284
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
5285
5754
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
5286
5755
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
5287
5756
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -5329,6 +5798,15 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
5329
5798
  ],
5330
5799
  "matcher": "mcp__tokensave__.*",
5331
5800
  },
5801
+ {
5802
+ "hooks": [
5803
+ {
5804
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
5805
+ "type": "command",
5806
+ },
5807
+ ],
5808
+ "matcher": "Bash",
5809
+ },
5332
5810
  ],
5333
5811
  },
5334
5812
  {
@@ -5416,6 +5894,58 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
5416
5894
  },
5417
5895
  ],
5418
5896
  },
5897
+ {
5898
+ "at": [
5899
+ "hooks",
5900
+ "UserPromptSubmit",
5901
+ ],
5902
+ "kind": "list",
5903
+ "values": [
5904
+ {
5905
+ "hooks": [
5906
+ {
5907
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
5908
+ "type": "command",
5909
+ },
5910
+ ],
5911
+ },
5912
+ ],
5913
+ },
5914
+ {
5915
+ "at": [
5916
+ "hooks",
5917
+ "PostToolUse",
5918
+ ],
5919
+ "kind": "list",
5920
+ "values": [
5921
+ {
5922
+ "hooks": [
5923
+ {
5924
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
5925
+ "type": "command",
5926
+ },
5927
+ ],
5928
+ "matcher": "Skill|Bash",
5929
+ },
5930
+ ],
5931
+ },
5932
+ {
5933
+ "at": [
5934
+ "hooks",
5935
+ "Stop",
5936
+ ],
5937
+ "kind": "list",
5938
+ "values": [
5939
+ {
5940
+ "hooks": [
5941
+ {
5942
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
5943
+ "type": "command",
5944
+ },
5945
+ ],
5946
+ },
5947
+ ],
5948
+ },
5419
5949
  {
5420
5950
  "at": [
5421
5951
  "env",
@@ -5482,6 +6012,16 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
5482
6012
  "Edit(**/.npmrc)",
5483
6013
  ],
5484
6014
  },
6015
+ {
6016
+ "at": [
6017
+ "permissions",
6018
+ "ask",
6019
+ ],
6020
+ "kind": "list",
6021
+ "values": [
6022
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
6023
+ ],
6024
+ },
5485
6025
  {
5486
6026
  "at": [
5487
6027
  "enableArtifact",
@@ -5794,6 +6334,10 @@ exports[`runtime surface golden fixtures setup openspec × claude 1`] = `
5794
6334
  "Skill(mate-publish-artifact)",
5795
6335
  "Skill(mate-show-me)",
5796
6336
  "Skill(mate-simplify-code)",
6337
+ "Skill(mate-submit-change)",
6338
+ ],
6339
+ "ask": [
6340
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
5797
6341
  ],
5798
6342
  "deny": [
5799
6343
  "EnterPlanMode",
@@ -5835,30 +6379,31 @@ exports[`runtime surface golden fixtures setup openspec × claude 1`] = `
5835
6379
  },
5836
6380
  },
5837
6381
  "claudeSkills": {
5838
- "mate-apply-change/SKILL.md": "898e51f592f8",
6382
+ "mate-apply-change/SKILL.md": "6c3f42b0ace2",
5839
6383
  "mate-apply-change/references/mate-compact-apply.md": "3f20c80a4d78",
5840
- "mate-apply-change/references/openspec-apply-change.md": "d11b6fc25bf4",
5841
- "mate-archive-change/SKILL.md": "a231ddabb438",
6384
+ "mate-apply-change/references/openspec-apply-change.md": "fa61cbd0bc83",
6385
+ "mate-archive-change/SKILL.md": "675ef32ae065",
5842
6386
  "mate-backfill-spec/SKILL.md": "d07cd4a60169",
5843
- "mate-clarify-intent/SKILL.md": "a2e38ae50f05",
5844
- "mate-create-report/SKILL.md": "7db1adecbc1a",
5845
- "mate-domain-modeling/SKILL.md": "722d0e5a972d",
6387
+ "mate-clarify-intent/SKILL.md": "7f7d768be634",
6388
+ "mate-create-report/SKILL.md": "b4d92b44719a",
6389
+ "mate-domain-modeling/SKILL.md": "92f3e1f5faa2",
5846
6390
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
5847
6391
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
5848
- "mate-explore-change/SKILL.md": "dcc6ec66b74f",
6392
+ "mate-explore-change/SKILL.md": "66158c617ed4",
5849
6393
  "mate-explore-change/references/openspec-explore.md": "3cf63d55e3d2",
5850
6394
  "mate-grill-me/SKILL.md": "ab55b002ba24",
5851
6395
  "mate-grill-with-docs/SKILL.md": "b542b610c484",
5852
6396
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
5853
6397
  "mate-interview-me/SKILL.md": "b48d9804c423",
5854
- "mate-propose-change/SKILL.md": "b5e1eb6e0b0c",
5855
- "mate-propose-change/references/mate-revise.md": "fab04cde133f",
6398
+ "mate-propose-change/SKILL.md": "371e31803cc5",
6399
+ "mate-propose-change/references/mate-revise.md": "1f90002ee95d",
5856
6400
  "mate-propose-change/references/openspec-propose.md": "dbd00207ffa4",
5857
- "mate-propose-change/references/openspec-update-change.md": "678af6ec1889",
5858
- "mate-publish-artifact/SKILL.md": "532edb58212d",
5859
- "mate-publish-artifact/references/openspec.md": "d004aed5cf3f",
5860
- "mate-show-me/SKILL.md": "908f009299ac",
5861
- "mate-simplify-code/SKILL.md": "a728118654f8",
6401
+ "mate-propose-change/references/openspec-update-change.md": "0b0f6dee9f1e",
6402
+ "mate-publish-artifact/SKILL.md": "4332053cc80d",
6403
+ "mate-publish-artifact/references/openspec.md": "83196c70960c",
6404
+ "mate-show-me/SKILL.md": "4cb867ba9740",
6405
+ "mate-simplify-code/SKILL.md": "740c2b533c6a",
6406
+ "mate-submit-change/SKILL.md": "4595ca11960e",
5862
6407
  },
5863
6408
  "opencodeConfig": null,
5864
6409
  "opencodePlugins": {},
@@ -5891,9 +6436,8 @@ exports[`runtime surface golden fixtures setup openspec × claude 2`] = `
5891
6436
  <linked-repository id="app" />
5892
6437
  </context>
5893
6438
  <mandatory-rules>
5894
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
6439
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
5895
6440
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
5896
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
5897
6441
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
5898
6442
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
5899
6443
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -5901,7 +6445,7 @@ exports[`runtime surface golden fixtures setup openspec × claude 2`] = `
5901
6445
  <rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
5902
6446
  <rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
5903
6447
  <rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
5904
- <rule id="openspec-publish" severity="critical">Archiving an OpenSpec change is local and publishes nothing. Publish only through the mate-publish-artifact skill, whose sanctioned command is mate artifact publish "<name>" --json: only after an explicit user selection and confirmation of the commit, tag, and push, and only for an archive whose delivery branch is merged; never hand-commit or hand-tag one. Publish never archives and never applies delta specs itself: archiving is a precondition (mate-archive-change, allowed before the merge), and publishing a still-active change is an error. Publish refuses to run anywhere but the companion's default branch.</rule>
6448
+ <rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
5905
6449
  </mandatory-rules>
5906
6450
  </companion-policy>"
5907
6451
  ,
@@ -5946,6 +6490,15 @@ exports[`runtime surface golden fixtures setup openspec × claude 3`] = `
5946
6490
  ],
5947
6491
  "matcher": "mcp__tokensave__.*",
5948
6492
  },
6493
+ {
6494
+ "hooks": [
6495
+ {
6496
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
6497
+ "type": "command",
6498
+ },
6499
+ ],
6500
+ "matcher": "Bash",
6501
+ },
5949
6502
  ],
5950
6503
  },
5951
6504
  {
@@ -6033,6 +6586,58 @@ exports[`runtime surface golden fixtures setup openspec × claude 3`] = `
6033
6586
  },
6034
6587
  ],
6035
6588
  },
6589
+ {
6590
+ "at": [
6591
+ "hooks",
6592
+ "UserPromptSubmit",
6593
+ ],
6594
+ "kind": "list",
6595
+ "values": [
6596
+ {
6597
+ "hooks": [
6598
+ {
6599
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
6600
+ "type": "command",
6601
+ },
6602
+ ],
6603
+ },
6604
+ ],
6605
+ },
6606
+ {
6607
+ "at": [
6608
+ "hooks",
6609
+ "PostToolUse",
6610
+ ],
6611
+ "kind": "list",
6612
+ "values": [
6613
+ {
6614
+ "hooks": [
6615
+ {
6616
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
6617
+ "type": "command",
6618
+ },
6619
+ ],
6620
+ "matcher": "Skill|Bash",
6621
+ },
6622
+ ],
6623
+ },
6624
+ {
6625
+ "at": [
6626
+ "hooks",
6627
+ "Stop",
6628
+ ],
6629
+ "kind": "list",
6630
+ "values": [
6631
+ {
6632
+ "hooks": [
6633
+ {
6634
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
6635
+ "type": "command",
6636
+ },
6637
+ ],
6638
+ },
6639
+ ],
6640
+ },
6036
6641
  {
6037
6642
  "at": [
6038
6643
  "env",
@@ -6055,6 +6660,7 @@ exports[`runtime surface golden fixtures setup openspec × claude 3`] = `
6055
6660
  "Skill(mate-explore-change)",
6056
6661
  "Skill(mate-propose-change)",
6057
6662
  "Skill(mate-apply-change)",
6663
+ "Skill(mate-submit-change)",
6058
6664
  "Skill(mate-archive-change)",
6059
6665
  "Skill(mate-publish-artifact)",
6060
6666
  "Skill(mate-backfill-spec)",
@@ -6114,6 +6720,16 @@ exports[`runtime surface golden fixtures setup openspec × claude 3`] = `
6114
6720
  "Edit(**/.npmrc)",
6115
6721
  ],
6116
6722
  },
6723
+ {
6724
+ "at": [
6725
+ "permissions",
6726
+ "ask",
6727
+ ],
6728
+ "kind": "list",
6729
+ "values": [
6730
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
6731
+ ],
6732
+ },
6117
6733
  {
6118
6734
  "at": [
6119
6735
  "enableArtifact",
@@ -6179,30 +6795,31 @@ exports[`runtime surface golden fixtures setup openspec × opencode 1`] = `
6179
6795
  "opencodeSkills": {},
6180
6796
  "opencodeTui": null,
6181
6797
  "sharedSkills": {
6182
- "mate-apply-change/SKILL.md": "898e51f592f8",
6798
+ "mate-apply-change/SKILL.md": "6c3f42b0ace2",
6183
6799
  "mate-apply-change/references/mate-compact-apply.md": "3f20c80a4d78",
6184
- "mate-apply-change/references/openspec-apply-change.md": "de22021f4daa",
6185
- "mate-archive-change/SKILL.md": "a231ddabb438",
6800
+ "mate-apply-change/references/openspec-apply-change.md": "c132265690b4",
6801
+ "mate-archive-change/SKILL.md": "675ef32ae065",
6186
6802
  "mate-backfill-spec/SKILL.md": "d07cd4a60169",
6187
- "mate-clarify-intent/SKILL.md": "a2e38ae50f05",
6188
- "mate-create-report/SKILL.md": "7db1adecbc1a",
6189
- "mate-domain-modeling/SKILL.md": "722d0e5a972d",
6803
+ "mate-clarify-intent/SKILL.md": "7f7d768be634",
6804
+ "mate-create-report/SKILL.md": "b4d92b44719a",
6805
+ "mate-domain-modeling/SKILL.md": "92f3e1f5faa2",
6190
6806
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
6191
6807
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
6192
- "mate-explore-change/SKILL.md": "dcc6ec66b74f",
6808
+ "mate-explore-change/SKILL.md": "66158c617ed4",
6193
6809
  "mate-explore-change/references/openspec-explore.md": "5bfcc2eefbd8",
6194
6810
  "mate-grill-me/SKILL.md": "ab55b002ba24",
6195
6811
  "mate-grill-with-docs/SKILL.md": "b542b610c484",
6196
6812
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
6197
6813
  "mate-interview-me/SKILL.md": "b48d9804c423",
6198
- "mate-propose-change/SKILL.md": "b5e1eb6e0b0c",
6199
- "mate-propose-change/references/mate-revise.md": "fab04cde133f",
6814
+ "mate-propose-change/SKILL.md": "371e31803cc5",
6815
+ "mate-propose-change/references/mate-revise.md": "1f90002ee95d",
6200
6816
  "mate-propose-change/references/openspec-propose.md": "c1f1d1291283",
6201
- "mate-propose-change/references/openspec-update-change.md": "cdb8d6c17526",
6202
- "mate-publish-artifact/SKILL.md": "532edb58212d",
6203
- "mate-publish-artifact/references/openspec.md": "d004aed5cf3f",
6204
- "mate-show-me/SKILL.md": "908f009299ac",
6205
- "mate-simplify-code/SKILL.md": "a728118654f8",
6817
+ "mate-propose-change/references/openspec-update-change.md": "098ef729c37f",
6818
+ "mate-publish-artifact/SKILL.md": "4332053cc80d",
6819
+ "mate-publish-artifact/references/openspec.md": "83196c70960c",
6820
+ "mate-show-me/SKILL.md": "4cb867ba9740",
6821
+ "mate-simplify-code/SKILL.md": "740c2b533c6a",
6822
+ "mate-submit-change/SKILL.md": "4595ca11960e",
6206
6823
  },
6207
6824
  }
6208
6825
  `;
@@ -6235,9 +6852,8 @@ exports[`runtime surface golden fixtures setup openspec × opencode 2`] = `
6235
6852
  <linked-repository id="$MATE_REPO_ID" />
6236
6853
  </context>
6237
6854
  <mandatory-rules>
6238
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
6855
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
6239
6856
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
6240
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
6241
6857
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
6242
6858
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
6243
6859
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -6245,7 +6861,7 @@ exports[`runtime surface golden fixtures setup openspec × opencode 2`] = `
6245
6861
  <rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
6246
6862
  <rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
6247
6863
  <rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
6248
- <rule id="openspec-publish" severity="critical">Archiving an OpenSpec change is local and publishes nothing. Publish only through the mate-publish-artifact skill, whose sanctioned command is mate artifact publish "<name>" --json: only after an explicit user selection and confirmation of the commit, tag, and push, and only for an archive whose delivery branch is merged; never hand-commit or hand-tag one. Publish never archives and never applies delta specs itself: archiving is a precondition (mate-archive-change, allowed before the merge), and publishing a still-active change is an error. Publish refuses to run anywhere but the companion's default branch.</rule>
6864
+ <rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
6249
6865
  </mandatory-rules>
6250
6866
  </companion-policy>"
6251
6867
  ,
@@ -6549,6 +7165,10 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
6549
7165
  "Skill(mate-publish-artifact)",
6550
7166
  "Skill(mate-show-me)",
6551
7167
  "Skill(mate-simplify-code)",
7168
+ "Skill(mate-submit-change)",
7169
+ ],
7170
+ "ask": [
7171
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
6552
7172
  ],
6553
7173
  "deny": [
6554
7174
  "EnterPlanMode",
@@ -6590,30 +7210,31 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
6590
7210
  },
6591
7211
  },
6592
7212
  "claudeSkills": {
6593
- "mate-apply-change/SKILL.md": "898e51f592f8",
7213
+ "mate-apply-change/SKILL.md": "6c3f42b0ace2",
6594
7214
  "mate-apply-change/references/mate-compact-apply.md": "3f20c80a4d78",
6595
- "mate-apply-change/references/openspec-apply-change.md": "d11b6fc25bf4",
6596
- "mate-archive-change/SKILL.md": "a231ddabb438",
7215
+ "mate-apply-change/references/openspec-apply-change.md": "fa61cbd0bc83",
7216
+ "mate-archive-change/SKILL.md": "675ef32ae065",
6597
7217
  "mate-backfill-spec/SKILL.md": "d07cd4a60169",
6598
- "mate-clarify-intent/SKILL.md": "a2e38ae50f05",
6599
- "mate-create-report/SKILL.md": "7db1adecbc1a",
6600
- "mate-domain-modeling/SKILL.md": "722d0e5a972d",
7218
+ "mate-clarify-intent/SKILL.md": "7f7d768be634",
7219
+ "mate-create-report/SKILL.md": "b4d92b44719a",
7220
+ "mate-domain-modeling/SKILL.md": "92f3e1f5faa2",
6601
7221
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
6602
7222
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
6603
- "mate-explore-change/SKILL.md": "dcc6ec66b74f",
7223
+ "mate-explore-change/SKILL.md": "66158c617ed4",
6604
7224
  "mate-explore-change/references/openspec-explore.md": "3cf63d55e3d2",
6605
7225
  "mate-grill-me/SKILL.md": "ab55b002ba24",
6606
7226
  "mate-grill-with-docs/SKILL.md": "b542b610c484",
6607
7227
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
6608
7228
  "mate-interview-me/SKILL.md": "b48d9804c423",
6609
- "mate-propose-change/SKILL.md": "b5e1eb6e0b0c",
6610
- "mate-propose-change/references/mate-revise.md": "fab04cde133f",
7229
+ "mate-propose-change/SKILL.md": "371e31803cc5",
7230
+ "mate-propose-change/references/mate-revise.md": "1f90002ee95d",
6611
7231
  "mate-propose-change/references/openspec-propose.md": "dbd00207ffa4",
6612
- "mate-propose-change/references/openspec-update-change.md": "678af6ec1889",
6613
- "mate-publish-artifact/SKILL.md": "532edb58212d",
6614
- "mate-publish-artifact/references/openspec.md": "d004aed5cf3f",
6615
- "mate-show-me/SKILL.md": "908f009299ac",
6616
- "mate-simplify-code/SKILL.md": "a728118654f8",
7232
+ "mate-propose-change/references/openspec-update-change.md": "0b0f6dee9f1e",
7233
+ "mate-publish-artifact/SKILL.md": "4332053cc80d",
7234
+ "mate-publish-artifact/references/openspec.md": "83196c70960c",
7235
+ "mate-show-me/SKILL.md": "4cb867ba9740",
7236
+ "mate-simplify-code/SKILL.md": "740c2b533c6a",
7237
+ "mate-submit-change/SKILL.md": "4595ca11960e",
6617
7238
  },
6618
7239
  "opencodeConfig": {
6619
7240
  "$schema": "https://opencode.ai/config.json",
@@ -6636,30 +7257,31 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
6636
7257
  "opencodeSkills": {},
6637
7258
  "opencodeTui": null,
6638
7259
  "sharedSkills": {
6639
- "mate-apply-change/SKILL.md": "898e51f592f8",
7260
+ "mate-apply-change/SKILL.md": "6c3f42b0ace2",
6640
7261
  "mate-apply-change/references/mate-compact-apply.md": "3f20c80a4d78",
6641
- "mate-apply-change/references/openspec-apply-change.md": "de22021f4daa",
6642
- "mate-archive-change/SKILL.md": "a231ddabb438",
7262
+ "mate-apply-change/references/openspec-apply-change.md": "c132265690b4",
7263
+ "mate-archive-change/SKILL.md": "675ef32ae065",
6643
7264
  "mate-backfill-spec/SKILL.md": "d07cd4a60169",
6644
- "mate-clarify-intent/SKILL.md": "a2e38ae50f05",
6645
- "mate-create-report/SKILL.md": "7db1adecbc1a",
6646
- "mate-domain-modeling/SKILL.md": "722d0e5a972d",
7265
+ "mate-clarify-intent/SKILL.md": "7f7d768be634",
7266
+ "mate-create-report/SKILL.md": "b4d92b44719a",
7267
+ "mate-domain-modeling/SKILL.md": "92f3e1f5faa2",
6647
7268
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
6648
7269
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
6649
- "mate-explore-change/SKILL.md": "dcc6ec66b74f",
7270
+ "mate-explore-change/SKILL.md": "66158c617ed4",
6650
7271
  "mate-explore-change/references/openspec-explore.md": "5bfcc2eefbd8",
6651
7272
  "mate-grill-me/SKILL.md": "ab55b002ba24",
6652
7273
  "mate-grill-with-docs/SKILL.md": "b542b610c484",
6653
7274
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
6654
7275
  "mate-interview-me/SKILL.md": "b48d9804c423",
6655
- "mate-propose-change/SKILL.md": "b5e1eb6e0b0c",
6656
- "mate-propose-change/references/mate-revise.md": "fab04cde133f",
7276
+ "mate-propose-change/SKILL.md": "371e31803cc5",
7277
+ "mate-propose-change/references/mate-revise.md": "1f90002ee95d",
6657
7278
  "mate-propose-change/references/openspec-propose.md": "c1f1d1291283",
6658
- "mate-propose-change/references/openspec-update-change.md": "cdb8d6c17526",
6659
- "mate-publish-artifact/SKILL.md": "532edb58212d",
6660
- "mate-publish-artifact/references/openspec.md": "d004aed5cf3f",
6661
- "mate-show-me/SKILL.md": "908f009299ac",
6662
- "mate-simplify-code/SKILL.md": "a728118654f8",
7279
+ "mate-propose-change/references/openspec-update-change.md": "098ef729c37f",
7280
+ "mate-publish-artifact/SKILL.md": "4332053cc80d",
7281
+ "mate-publish-artifact/references/openspec.md": "83196c70960c",
7282
+ "mate-show-me/SKILL.md": "4cb867ba9740",
7283
+ "mate-simplify-code/SKILL.md": "740c2b533c6a",
7284
+ "mate-submit-change/SKILL.md": "4595ca11960e",
6663
7285
  },
6664
7286
  }
6665
7287
  `;
@@ -6687,9 +7309,8 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
6687
7309
  <linked-repository id="app" />
6688
7310
  </context>
6689
7311
  <mandatory-rules>
6690
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
7312
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
6691
7313
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
6692
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
6693
7314
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
6694
7315
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
6695
7316
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -6697,7 +7318,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
6697
7318
  <rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
6698
7319
  <rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
6699
7320
  <rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
6700
- <rule id="openspec-publish" severity="critical">Archiving an OpenSpec change is local and publishes nothing. Publish only through the mate-publish-artifact skill, whose sanctioned command is mate artifact publish "<name>" --json: only after an explicit user selection and confirmation of the commit, tag, and push, and only for an archive whose delivery branch is merged; never hand-commit or hand-tag one. Publish never archives and never applies delta specs itself: archiving is a precondition (mate-archive-change, allowed before the merge), and publishing a still-active change is an error. Publish refuses to run anywhere but the companion's default branch.</rule>
7321
+ <rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
6701
7322
  </mandatory-rules>
6702
7323
  </companion-policy>"
6703
7324
  ,
@@ -6735,9 +7356,8 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
6735
7356
  <linked-repository id="$MATE_REPO_ID" />
6736
7357
  </context>
6737
7358
  <mandatory-rules>
6738
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
7359
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
6739
7360
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
6740
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
6741
7361
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
6742
7362
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
6743
7363
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -6745,7 +7365,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
6745
7365
  <rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
6746
7366
  <rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
6747
7367
  <rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
6748
- <rule id="openspec-publish" severity="critical">Archiving an OpenSpec change is local and publishes nothing. Publish only through the mate-publish-artifact skill, whose sanctioned command is mate artifact publish "<name>" --json: only after an explicit user selection and confirmation of the commit, tag, and push, and only for an archive whose delivery branch is merged; never hand-commit or hand-tag one. Publish never archives and never applies delta specs itself: archiving is a precondition (mate-archive-change, allowed before the merge), and publishing a still-active change is an error. Publish refuses to run anywhere but the companion's default branch.</rule>
7368
+ <rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
6749
7369
  </mandatory-rules>
6750
7370
  </companion-policy>"
6751
7371
  ,
@@ -6787,6 +7407,15 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
6787
7407
  ],
6788
7408
  "matcher": "mcp__tokensave__.*",
6789
7409
  },
7410
+ {
7411
+ "hooks": [
7412
+ {
7413
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
7414
+ "type": "command",
7415
+ },
7416
+ ],
7417
+ "matcher": "Bash",
7418
+ },
6790
7419
  ],
6791
7420
  },
6792
7421
  {
@@ -6874,6 +7503,58 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
6874
7503
  },
6875
7504
  ],
6876
7505
  },
7506
+ {
7507
+ "at": [
7508
+ "hooks",
7509
+ "UserPromptSubmit",
7510
+ ],
7511
+ "kind": "list",
7512
+ "values": [
7513
+ {
7514
+ "hooks": [
7515
+ {
7516
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
7517
+ "type": "command",
7518
+ },
7519
+ ],
7520
+ },
7521
+ ],
7522
+ },
7523
+ {
7524
+ "at": [
7525
+ "hooks",
7526
+ "PostToolUse",
7527
+ ],
7528
+ "kind": "list",
7529
+ "values": [
7530
+ {
7531
+ "hooks": [
7532
+ {
7533
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
7534
+ "type": "command",
7535
+ },
7536
+ ],
7537
+ "matcher": "Skill|Bash",
7538
+ },
7539
+ ],
7540
+ },
7541
+ {
7542
+ "at": [
7543
+ "hooks",
7544
+ "Stop",
7545
+ ],
7546
+ "kind": "list",
7547
+ "values": [
7548
+ {
7549
+ "hooks": [
7550
+ {
7551
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
7552
+ "type": "command",
7553
+ },
7554
+ ],
7555
+ },
7556
+ ],
7557
+ },
6877
7558
  {
6878
7559
  "at": [
6879
7560
  "env",
@@ -6896,6 +7577,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
6896
7577
  "Skill(mate-explore-change)",
6897
7578
  "Skill(mate-propose-change)",
6898
7579
  "Skill(mate-apply-change)",
7580
+ "Skill(mate-submit-change)",
6899
7581
  "Skill(mate-archive-change)",
6900
7582
  "Skill(mate-publish-artifact)",
6901
7583
  "Skill(mate-backfill-spec)",
@@ -6955,6 +7637,16 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
6955
7637
  "Edit(**/.npmrc)",
6956
7638
  ],
6957
7639
  },
7640
+ {
7641
+ "at": [
7642
+ "permissions",
7643
+ "ask",
7644
+ ],
7645
+ "kind": "list",
7646
+ "values": [
7647
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
7648
+ ],
7649
+ },
6958
7650
  {
6959
7651
  "at": [
6960
7652
  "enableArtifact",
@@ -7340,9 +8032,13 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
7340
8032
  "Skill(mate-react-doctor)",
7341
8033
  "Skill(mate-show-me)",
7342
8034
  "Skill(mate-simplify-code)",
8035
+ "Skill(mate-submit-change)",
7343
8036
  "mcp__plugin_context-mode_context-mode__*",
7344
8037
  "mcp__tokensave__*",
7345
8038
  ],
8039
+ "ask": [
8040
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
8041
+ ],
7346
8042
  "deny": [
7347
8043
  "EnterPlanMode",
7348
8044
  "DesignSync",
@@ -7398,32 +8094,33 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
7398
8094
  "Outputs land in $GRAPHIFY_OUT by default.
7399
8095
  "
7400
8096
  ,
7401
- "mate-apply-change/SKILL.md": "898e51f592f8",
8097
+ "mate-apply-change/SKILL.md": "6c3f42b0ace2",
7402
8098
  "mate-apply-change/references/mate-compact-apply.md": "3f20c80a4d78",
7403
- "mate-apply-change/references/openspec-apply-change.md": "d11b6fc25bf4",
7404
- "mate-archive-change/SKILL.md": "a231ddabb438",
8099
+ "mate-apply-change/references/openspec-apply-change.md": "fa61cbd0bc83",
8100
+ "mate-archive-change/SKILL.md": "675ef32ae065",
7405
8101
  "mate-backfill-spec/SKILL.md": "d07cd4a60169",
7406
- "mate-clarify-intent/SKILL.md": "a2e38ae50f05",
7407
- "mate-create-report/SKILL.md": "7db1adecbc1a",
7408
- "mate-domain-modeling/SKILL.md": "722d0e5a972d",
8102
+ "mate-clarify-intent/SKILL.md": "7f7d768be634",
8103
+ "mate-create-report/SKILL.md": "b4d92b44719a",
8104
+ "mate-domain-modeling/SKILL.md": "92f3e1f5faa2",
7409
8105
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
7410
8106
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
7411
- "mate-explore-change/SKILL.md": "dcc6ec66b74f",
8107
+ "mate-explore-change/SKILL.md": "66158c617ed4",
7412
8108
  "mate-explore-change/references/openspec-explore.md": "3cf63d55e3d2",
7413
8109
  "mate-grill-me/SKILL.md": "ab55b002ba24",
7414
8110
  "mate-grill-with-docs/SKILL.md": "b542b610c484",
7415
8111
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
7416
8112
  "mate-interview-me/SKILL.md": "b48d9804c423",
7417
- "mate-propose-change/SKILL.md": "b5e1eb6e0b0c",
7418
- "mate-propose-change/references/mate-revise.md": "fab04cde133f",
8113
+ "mate-propose-change/SKILL.md": "371e31803cc5",
8114
+ "mate-propose-change/references/mate-revise.md": "1f90002ee95d",
7419
8115
  "mate-propose-change/references/openspec-propose.md": "dbd00207ffa4",
7420
- "mate-propose-change/references/openspec-update-change.md": "678af6ec1889",
7421
- "mate-publish-artifact/SKILL.md": "532edb58212d",
7422
- "mate-publish-artifact/references/openspec.md": "d004aed5cf3f",
8116
+ "mate-propose-change/references/openspec-update-change.md": "0b0f6dee9f1e",
8117
+ "mate-publish-artifact/SKILL.md": "4332053cc80d",
8118
+ "mate-publish-artifact/references/openspec.md": "83196c70960c",
7423
8119
  "mate-react-doctor/SKILL.md": "2ecf137679df",
7424
8120
  "mate-react-doctor/references/explain.md": "86754a7e5436",
7425
- "mate-show-me/SKILL.md": "908f009299ac",
7426
- "mate-simplify-code/SKILL.md": "a728118654f8",
8121
+ "mate-show-me/SKILL.md": "4cb867ba9740",
8122
+ "mate-simplify-code/SKILL.md": "740c2b533c6a",
8123
+ "mate-submit-change/SKILL.md": "4595ca11960e",
7427
8124
  },
7428
8125
  "opencodeConfig": {
7429
8126
  "$schema": "https://opencode.ai/config.json",
@@ -7482,32 +8179,33 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
7482
8179
  },
7483
8180
  "opencodeTui": null,
7484
8181
  "sharedSkills": {
7485
- "mate-apply-change/SKILL.md": "898e51f592f8",
8182
+ "mate-apply-change/SKILL.md": "6c3f42b0ace2",
7486
8183
  "mate-apply-change/references/mate-compact-apply.md": "3f20c80a4d78",
7487
- "mate-apply-change/references/openspec-apply-change.md": "de22021f4daa",
7488
- "mate-archive-change/SKILL.md": "a231ddabb438",
8184
+ "mate-apply-change/references/openspec-apply-change.md": "c132265690b4",
8185
+ "mate-archive-change/SKILL.md": "675ef32ae065",
7489
8186
  "mate-backfill-spec/SKILL.md": "d07cd4a60169",
7490
- "mate-clarify-intent/SKILL.md": "a2e38ae50f05",
7491
- "mate-create-report/SKILL.md": "7db1adecbc1a",
7492
- "mate-domain-modeling/SKILL.md": "722d0e5a972d",
8187
+ "mate-clarify-intent/SKILL.md": "7f7d768be634",
8188
+ "mate-create-report/SKILL.md": "b4d92b44719a",
8189
+ "mate-domain-modeling/SKILL.md": "92f3e1f5faa2",
7493
8190
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
7494
8191
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
7495
- "mate-explore-change/SKILL.md": "dcc6ec66b74f",
8192
+ "mate-explore-change/SKILL.md": "66158c617ed4",
7496
8193
  "mate-explore-change/references/openspec-explore.md": "5bfcc2eefbd8",
7497
8194
  "mate-grill-me/SKILL.md": "ab55b002ba24",
7498
8195
  "mate-grill-with-docs/SKILL.md": "b542b610c484",
7499
8196
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
7500
8197
  "mate-interview-me/SKILL.md": "b48d9804c423",
7501
- "mate-propose-change/SKILL.md": "b5e1eb6e0b0c",
7502
- "mate-propose-change/references/mate-revise.md": "fab04cde133f",
8198
+ "mate-propose-change/SKILL.md": "371e31803cc5",
8199
+ "mate-propose-change/references/mate-revise.md": "1f90002ee95d",
7503
8200
  "mate-propose-change/references/openspec-propose.md": "c1f1d1291283",
7504
- "mate-propose-change/references/openspec-update-change.md": "cdb8d6c17526",
7505
- "mate-publish-artifact/SKILL.md": "532edb58212d",
7506
- "mate-publish-artifact/references/openspec.md": "d004aed5cf3f",
8201
+ "mate-propose-change/references/openspec-update-change.md": "098ef729c37f",
8202
+ "mate-publish-artifact/SKILL.md": "4332053cc80d",
8203
+ "mate-publish-artifact/references/openspec.md": "83196c70960c",
7507
8204
  "mate-react-doctor/SKILL.md": "2ecf137679df",
7508
8205
  "mate-react-doctor/references/explain.md": "86754a7e5436",
7509
- "mate-show-me/SKILL.md": "908f009299ac",
7510
- "mate-simplify-code/SKILL.md": "a728118654f8",
8206
+ "mate-show-me/SKILL.md": "4cb867ba9740",
8207
+ "mate-simplify-code/SKILL.md": "740c2b533c6a",
8208
+ "mate-submit-change/SKILL.md": "4595ca11960e",
7511
8209
  },
7512
8210
  }
7513
8211
  `;
@@ -7535,9 +8233,8 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7535
8233
  <linked-repository id="app" />
7536
8234
  </context>
7537
8235
  <mandatory-rules>
7538
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
8236
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
7539
8237
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
7540
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
7541
8238
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
7542
8239
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against <root>/working and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under <root>/companion.</rule>
7543
8240
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -7545,7 +8242,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7545
8242
  <rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
7546
8243
  <rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
7547
8244
  <rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
7548
- <rule id="openspec-publish" severity="critical">Archiving an OpenSpec change is local and publishes nothing. Publish only through the mate-publish-artifact skill, whose sanctioned command is mate artifact publish "<name>" --json: only after an explicit user selection and confirmation of the commit, tag, and push, and only for an archive whose delivery branch is merged; never hand-commit or hand-tag one. Publish never archives and never applies delta specs itself: archiving is a precondition (mate-archive-change, allowed before the merge), and publishing a still-active change is an error. Publish refuses to run anywhere but the companion's default branch.</rule>
8245
+ <rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
7549
8246
  </mandatory-rules>
7550
8247
  </companion-policy>
7551
8248
 
@@ -7607,9 +8304,8 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7607
8304
  <linked-repository id="$MATE_REPO_ID" />
7608
8305
  </context>
7609
8306
  <mandatory-rules>
7610
- <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
8307
+ <rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH, which holds product code (README, docs, source, tests). Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
7611
8308
  <rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
7612
- <rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in the working-repository path; agent artifacts in the companion-repository path.</rule>
7613
8309
  <rule id="local-artifact-exception" severity="critical">Write an artifact in the working repository only when its exact path is gitignored AND intentionally local-only.</rule>
7614
8310
  <rule id="guardrail" severity="critical">Bad artifact writes to the working repository are rejected. The guardrail resolves relative paths against $MATE_REPO_PATH and does not follow cd, so write artifacts, including shell redirects and tee, with absolute paths under $MATE_ARTIFACT_PATH.</rule>
7615
8311
  <rule id="companion-multi-repository" severity="critical">This Companion Repository may serve multiple Working Repositories; the working-repository path is this session's single primary Working Repository (the product-code plane), not the full set. The Companion Repository is the shared artifact and context plane.</rule>
@@ -7617,7 +8313,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7617
8313
  <rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
7618
8314
  <rule id="secret-handling" severity="critical">Never read, print, copy, or write secret files (.env, .env.*, keys, certificates, credential files such as .npmrc or .netrc) or secret values. To learn which variables exist, read only the example files (.env.example, .env.sample, .env.template, .env.dist). Refer to a secret by its variable name only. Do not print environment variables that may hold secrets. When a secret must be set or rotated, ask the user to do it instead of writing it yourself. Guarded calls are blocked; the companion's framework.yaml secrets block is the user's switch, not yours.</rule>
7619
8315
  <rule id="openspec-scope" severity="critical">In OpenSpec, the frontmatter repository identifies the Working Repository; areas are repository-relative paths within that repository. Canonical specs use repository plus flat areas; change artifacts use paired scopes entries. In a monorepo, an Area normally stops at the package root. A cross-repository change may declare multiple scopes, but each resulting spec remains owned by one repository, and each requirement must bind its Area explicitly.</rule>
7620
- <rule id="openspec-publish" severity="critical">Archiving an OpenSpec change is local and publishes nothing. Publish only through the mate-publish-artifact skill, whose sanctioned command is mate artifact publish "<name>" --json: only after an explicit user selection and confirmation of the commit, tag, and push, and only for an archive whose delivery branch is merged; never hand-commit or hand-tag one. Publish never archives and never applies delta specs itself: archiving is a precondition (mate-archive-change, allowed before the merge), and publishing a still-active change is an error. Publish refuses to run anywhere but the companion's default branch.</rule>
8316
+ <rule id="openspec-publish" severity="critical">Submit publishes nothing: it pushes an OpenSpec change folder (state: submitted) to the inbox mate/inbox to await its merge. A submitted change is not the truth: only publication lands it on the companion's default branch. openspec/specs/ is current; mate artifact project "<name>" shows the unpublished outcome. mate artifact pending --json lists them with author, touched requirements, ref and path; read one (git show <ref>:<path>/<file>) only where it touches your work or the user names it; implement or revise one only when the user names it: mate artifact take "<name>" brings it into the checkout when it is missing there, then resubmit it with mate-submit-change. Publish only through mate-publish-artifact (mate artifact publish "<name>" --json), after the user selects and confirms the commit and push, for a Delivery Group whose delivery branch is merged. It creates no tag. Never hand-commit or hand-tag one. Publish archives submitted changes and never submits: submitting is a precondition (mate-submit-change, before the merge).</rule>
7621
8317
  </mandatory-rules>
7622
8318
  </companion-policy>"
7623
8319
  ,
@@ -7659,6 +8355,15 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7659
8355
  ],
7660
8356
  "matcher": "mcp__tokensave__.*",
7661
8357
  },
8358
+ {
8359
+ "hooks": [
8360
+ {
8361
+ "command": "node "<runtime-claude-plugin>/hooks/rtk-worktree-git.mjs"",
8362
+ "type": "command",
8363
+ },
8364
+ ],
8365
+ "matcher": "Bash",
8366
+ },
7662
8367
  {
7663
8368
  "hooks": [
7664
8369
  {
@@ -7765,6 +8470,14 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7765
8470
  ],
7766
8471
  "kind": "list",
7767
8472
  "values": [
8473
+ {
8474
+ "hooks": [
8475
+ {
8476
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
8477
+ "type": "command",
8478
+ },
8479
+ ],
8480
+ },
7768
8481
  {
7769
8482
  "hooks": [
7770
8483
  {
@@ -7778,6 +8491,24 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7778
8491
  },
7779
8492
  ],
7780
8493
  },
8494
+ {
8495
+ "at": [
8496
+ "hooks",
8497
+ "PostToolUse",
8498
+ ],
8499
+ "kind": "list",
8500
+ "values": [
8501
+ {
8502
+ "hooks": [
8503
+ {
8504
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
8505
+ "type": "command",
8506
+ },
8507
+ ],
8508
+ "matcher": "Skill|Bash",
8509
+ },
8510
+ ],
8511
+ },
7781
8512
  {
7782
8513
  "at": [
7783
8514
  "hooks",
@@ -7785,6 +8516,14 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7785
8516
  ],
7786
8517
  "kind": "list",
7787
8518
  "values": [
8519
+ {
8520
+ "hooks": [
8521
+ {
8522
+ "command": "node "<runtime-claude-plugin>/hooks/workflow-turn.mjs" --projected",
8523
+ "type": "command",
8524
+ },
8525
+ ],
8526
+ },
7788
8527
  {
7789
8528
  "hooks": [
7790
8529
  {
@@ -7820,6 +8559,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7820
8559
  "Skill(mate-explore-change)",
7821
8560
  "Skill(mate-propose-change)",
7822
8561
  "Skill(mate-apply-change)",
8562
+ "Skill(mate-submit-change)",
7823
8563
  "Skill(mate-archive-change)",
7824
8564
  "Skill(mate-publish-artifact)",
7825
8565
  "Skill(mate-backfill-spec)",
@@ -7888,6 +8628,16 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
7888
8628
  "Edit(**/.npmrc)",
7889
8629
  ],
7890
8630
  },
8631
+ {
8632
+ "at": [
8633
+ "permissions",
8634
+ "ask",
8635
+ ],
8636
+ "kind": "list",
8637
+ "values": [
8638
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
8639
+ ],
8640
+ },
7891
8641
  {
7892
8642
  "at": [
7893
8643
  "enableArtifact",
@@ -8223,6 +8973,9 @@ exports[`runtime surface golden fixtures teardown graphify × claude+opencode 1`
8223
8973
  "Edit(<root>/companion/**)",
8224
8974
  "Read(<root>/companion/**)",
8225
8975
  ],
8976
+ "ask": [
8977
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
8978
+ ],
8226
8979
  "deny": [
8227
8980
  "EnterPlanMode",
8228
8981
  "DesignSync",
@@ -8323,6 +9076,9 @@ exports[`runtime surface golden fixtures teardown tokensave × claude+opencode 1
8323
9076
  "Edit(<root>/companion/**)",
8324
9077
  "Read(<root>/companion/**)",
8325
9078
  ],
9079
+ "ask": [
9080
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
9081
+ ],
8326
9082
  "deny": [
8327
9083
  "EnterPlanMode",
8328
9084
  "DesignSync",
@@ -8424,6 +9180,9 @@ exports[`runtime surface golden fixtures teardown context-mode × claude+opencod
8424
9180
  "Edit(<root>/companion/**)",
8425
9181
  "Read(<root>/companion/**)",
8426
9182
  ],
9183
+ "ask": [
9184
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
9185
+ ],
8427
9186
  "deny": [
8428
9187
  "EnterPlanMode",
8429
9188
  "DesignSync",
@@ -8524,6 +9283,9 @@ exports[`runtime surface golden fixtures teardown react-doctor × claude+opencod
8524
9283
  "Edit(<root>/companion/**)",
8525
9284
  "Read(<root>/companion/**)",
8526
9285
  ],
9286
+ "ask": [
9287
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
9288
+ ],
8527
9289
  "deny": [
8528
9290
  "EnterPlanMode",
8529
9291
  "DesignSync",
@@ -8624,6 +9386,9 @@ exports[`runtime surface golden fixtures teardown openspec × claude+opencode 1`
8624
9386
  "Edit(<root>/companion/**)",
8625
9387
  "Read(<root>/companion/**)",
8626
9388
  ],
9389
+ "ask": [
9390
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
9391
+ ],
8627
9392
  "deny": [
8628
9393
  "EnterPlanMode",
8629
9394
  "DesignSync",
@@ -8741,6 +9506,9 @@ exports[`runtime surface golden fixtures deselect opencode runtime with graphify
8741
9506
  "Read(<root>/companion/**)",
8742
9507
  "Skill(graphify)",
8743
9508
  ],
9509
+ "ask": [
9510
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
9511
+ ],
8744
9512
  "deny": [
8745
9513
  "EnterPlanMode",
8746
9514
  "DesignSync",
@@ -8820,6 +9588,7 @@ User notes.
8820
9588
  /.opencode/opencode.json
8821
9589
  /.agents/
8822
9590
  /.mcp.json
9591
+ /.worktreeinclude.local
8823
9592
  # mate managed: end
8824
9593
  .tokensave/
8825
9594
  "
@@ -8866,6 +9635,7 @@ User notes.
8866
9635
  /.opencode/opencode.json
8867
9636
  /.agents/
8868
9637
  /.mcp.json
9638
+ /.worktreeinclude.local
8869
9639
  # mate managed: end
8870
9640
  "
8871
9641
  ,
@@ -8925,6 +9695,9 @@ exports[`working repo golden fixtures hub roots set up providers only without co
8925
9695
  "Edit(<root>/companion/**)",
8926
9696
  "Read(<root>/companion/**)",
8927
9697
  ],
9698
+ "ask": [
9699
+ "Edit(/<root>/companion/.mate/config/framework.yaml)",
9700
+ ],
8928
9701
  "deny": [
8929
9702
  "EnterPlanMode",
8930
9703
  "DesignSync",