@uniqbit/mate-core 0.18.4 → 1.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/claude-plugin/hooks/companion-instructions.mjs +9 -0
  2. package/claude-plugin/hooks/hooks.json +12 -2
  3. package/opencode-plugin/src/add-dir.ts +76 -10
  4. package/opencode-plugin/src/companion.ts +1 -8
  5. package/opencode-plugin/src/server.ts +2 -15
  6. package/package.json +10 -2
  7. package/src/brand/art.generated.ts +69 -0
  8. package/src/brand/index.ts +12 -0
  9. package/src/brand/palette.ts +19 -0
  10. package/src/brand/svg.generated.ts +8 -0
  11. package/src/brand/terminal.ts +83 -0
  12. package/src/brand/types.ts +33 -0
  13. package/src/cli/commands/artifact/artifact.ts +8 -0
  14. package/src/cli/commands/artifact/delivery/archive.ts +117 -0
  15. package/src/cli/commands/artifact/delivery/branch-flags.ts +55 -0
  16. package/src/cli/commands/artifact/delivery/environment.ts +104 -0
  17. package/src/cli/commands/artifact/delivery/link.ts +154 -0
  18. package/src/cli/commands/artifact/delivery/output.ts +58 -0
  19. package/src/cli/commands/artifact/finish/command.ts +33 -3
  20. package/src/cli/commands/artifact/finish/engine.ts +47 -3
  21. package/src/cli/commands/artifact/finish/finisher.ts +10 -0
  22. package/src/cli/commands/artifact/finish/openspec.ts +200 -129
  23. package/src/cli/commands/artifact/finish/secret-scan.ts +43 -0
  24. package/src/cli/commands/artifact/pending/command.ts +31 -3
  25. package/src/cli/commands/artifact/pending/discovery.ts +21 -57
  26. package/src/cli/commands/cap/graphify.ts +52 -3
  27. package/src/cli/commands/cap/index-cmd.ts +8 -1
  28. package/src/cli/commands/cap/openspec.ts +13 -25
  29. package/src/cli/commands/companion/open.ts +56 -39
  30. package/src/cli/commands/companion/update.ts +75 -42
  31. package/src/cli/commands/doctor.ts +257 -78
  32. package/src/cli/commands/install.ts +0 -8
  33. package/src/cli/commands/plugin/install.ts +9 -4
  34. package/src/cli/commands/plugin/plugin.ts +3 -2
  35. package/src/cli/commands/report/adapter.ts +11 -2
  36. package/src/cli/commands/report/contract.ts +21 -0
  37. package/src/cli/commands/report/highlight.ts +34 -4
  38. package/src/cli/commands/report/markdown.ts +110 -0
  39. package/src/cli/commands/report/palette.ts +118 -0
  40. package/src/cli/commands/report/renderer.ts +456 -153
  41. package/src/cli/commands/report/types.ts +16 -0
  42. package/src/cli/commands/setup.ts +7 -15
  43. package/src/cli/commands/studio/client-asset.ts +16 -0
  44. package/src/cli/commands/studio/openspec-cli.ts +10 -58
  45. package/src/cli/commands/studio/routes.ts +2 -0
  46. package/src/cli/commands/studio/selection.ts +19 -1
  47. package/src/cli/commands/studio/server.ts +42 -1
  48. package/src/cli/commands/studio/terminal-launch.ts +7 -16
  49. package/src/cli/commands/studio/views/client.ts +6 -616
  50. package/src/cli/commands/studio/views/dashboard/changes.tsx +5 -10
  51. package/src/cli/commands/studio/views/document.tsx +137 -69
  52. package/src/cli/commands/studio/views/markdown.tsx +250 -0
  53. package/src/cli/commands/studio/views/palette.ts +134 -0
  54. package/src/cli/commands/studio/views/reports/index.tsx +2 -7
  55. package/src/cli/commands/studio/views/skills/index.tsx +43 -62
  56. package/src/cli/commands/studio/views/specs/index.tsx +7 -15
  57. package/src/cli/commands/studio/views/studio-client/actions.ts +51 -0
  58. package/src/cli/commands/studio/views/studio-client/companion.ts +13 -0
  59. package/src/cli/commands/studio/views/studio-client/index.ts +32 -0
  60. package/src/cli/commands/studio/views/studio-client/keys.ts +3 -0
  61. package/src/cli/commands/studio/views/studio-client/main.ts +3 -0
  62. package/src/cli/commands/studio/views/studio-client/page.ts +146 -0
  63. package/src/cli/commands/studio/views/studio-client/panels.ts +57 -0
  64. package/src/cli/commands/studio/views/studio-client/reports.ts +122 -0
  65. package/src/cli/commands/studio/views/studio-client/theme.ts +63 -0
  66. package/src/cli/commands/studio/views/studio-client/vault-editor.ts +166 -0
  67. package/src/cli/commands/studio/views/studio-client/vault-pane.ts +202 -0
  68. package/src/cli/commands/studio/views/studio-client/vault-tree.ts +258 -0
  69. package/src/cli/commands/studio/views/studio-client.generated.ts +2 -0
  70. package/src/cli/commands/studio/views/styles.ts +217 -206
  71. package/src/cli/commands/studio/views/vault/state.ts +3 -5
  72. package/src/cli/commands/studio/views/workflow/delivery-path.tsx +370 -0
  73. package/src/cli/commands/studio/views/workflow/graph.ts +220 -0
  74. package/src/cli/commands/studio/views/workflow/index.tsx +2 -3
  75. package/src/cli/commands/studio/views/workflow/steps.ts +228 -287
  76. package/src/cli/commands/wrap.ts +9 -42
  77. package/src/cli/main.ts +4 -1
  78. package/src/cli/parse-flags.ts +25 -7
  79. package/src/cli/setup-selector.tsx +38 -162
  80. package/src/cli/usage.ts +5 -2
  81. package/src/hooks/companion-instructions.ts +190 -0
  82. package/src/hooks/hook-io.ts +63 -0
  83. package/src/hooks/session-banner.ts +21 -29
  84. package/src/hooks/session-guidance.ts +10 -36
  85. package/src/hooks/session-prepare.ts +115 -28
  86. package/src/hooks/validate-artifact-path.ts +82 -24
  87. package/src/index.ts +4 -0
  88. package/src/lib/change-layout.ts +154 -0
  89. package/src/lib/components/wizard-header.tsx +3 -1
  90. package/src/lib/context-mode-package.ts +24 -11
  91. package/src/lib/delivery/archive-change.ts +154 -0
  92. package/src/lib/delivery/branches.ts +108 -0
  93. package/src/lib/delivery/environment.ts +29 -0
  94. package/src/lib/delivery/forge.ts +279 -0
  95. package/src/lib/delivery/overlap.ts +202 -0
  96. package/src/lib/delivery/record-delivery.ts +196 -0
  97. package/src/lib/delivery/record.ts +343 -0
  98. package/src/lib/delivery/refresh.ts +174 -0
  99. package/src/lib/delivery/repository-access.ts +97 -0
  100. package/src/lib/delivery/stages.ts +111 -0
  101. package/src/lib/delivery/token.ts +58 -0
  102. package/src/lib/frontmatter.ts +18 -0
  103. package/src/lib/opencode-plugin-package.ts +5 -5
  104. package/src/lib/openspec-cli.ts +116 -0
  105. package/src/lib/openspec-scopes.ts +86 -0
  106. package/src/lib/orchestrator/adapters/claude-args.ts +50 -0
  107. package/src/lib/orchestrator/adapters/claude.ts +60 -162
  108. package/src/lib/orchestrator/adapters/opencode.ts +9 -24
  109. package/src/lib/orchestrator/config-store.ts +2 -70
  110. package/src/lib/orchestrator/editor.ts +9 -9
  111. package/src/lib/orchestrator/openspec-store.ts +14 -54
  112. package/src/lib/orchestrator/projection-claude-commands.ts +36 -0
  113. package/src/lib/orchestrator/projection-claude-links.ts +159 -0
  114. package/src/lib/orchestrator/projection-claude-skills.ts +19 -190
  115. package/src/lib/orchestrator/projection-entries.ts +45 -15
  116. package/src/lib/orchestrator/projection-runtime-documents.ts +15 -6
  117. package/src/lib/orchestrator/projection-types.ts +3 -2
  118. package/src/lib/orchestrator/refresh-working-claude-links.ts +87 -0
  119. package/src/lib/orchestrator/session-prepare.ts +49 -87
  120. package/src/lib/orchestrator/setup-compatibilities.ts +18 -75
  121. package/src/lib/orchestrator/types.ts +2 -2
  122. package/src/lib/orchestrator/wrap-pass.ts +22 -88
  123. package/src/lib/package-paths.ts +8 -0
  124. package/src/opencode/companion-hooks.ts +64 -5
  125. package/src/opencode/companion-policy.ts +37 -18
  126. package/src/opencode/projected-guidance.ts +4 -1
  127. package/src/opencode/session-prepare.ts +2 -1
  128. package/src/opencode/tui.tsx +4 -2
  129. package/src/runtime/artifact-refusal.ts +63 -0
  130. package/src/runtime/claude-delivery-plan.ts +89 -7
  131. package/src/runtime/commit-attribution-guard.ts +181 -0
  132. package/src/runtime/companion-guidance.ts +15 -3
  133. package/src/runtime/companion-instructions.ts +340 -0
  134. package/src/runtime/error-message.ts +4 -0
  135. package/src/runtime/guidance.ts +0 -17
  136. package/src/runtime/index.ts +5 -0
  137. package/src/runtime/managed-block.ts +117 -0
  138. package/src/runtime/markdown-scan.ts +266 -0
  139. package/src/runtime/policy.ts +16 -15
  140. package/src/runtime/projected-flag.ts +7 -0
  141. package/src/runtime/projected-guidance.ts +1 -0
  142. package/src/runtime/runtime-document-manifest.ts +62 -28
  143. package/src/runtime/secret-guard.ts +148 -0
  144. package/src/runtime/secret-patterns.ts +164 -0
  145. package/src/runtime/secret-scan.ts +90 -0
  146. package/src/runtime/session-kind.ts +13 -0
  147. package/src/runtime/shell-heredoc.ts +81 -0
  148. package/src/runtime/wrap-state.ts +36 -6
  149. package/src/runtime/write-atomic.ts +64 -0
  150. package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +8 -6
  151. package/src/templates/capabilities/openspec-cap/mate-minimal/templates/spec.md +3 -5
  152. package/src/templates/capabilities/openspec-cap/mate-v1/schema.yaml +7 -9
  153. package/src/templates/capabilities/openspec-cap/mate-v1/templates/spec.md +3 -5
  154. package/src/templates/capabilities/openspec-cap/openspec-conventions.yaml +10 -12
  155. package/src/templates/mate-skills/THIRD-PARTY-NOTICES.md +40 -0
  156. package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +76 -0
  157. package/src/templates/mate-skills/agents/mate-apply-change/references/openspec-apply-change.md +198 -0
  158. package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +59 -0
  159. package/src/templates/mate-skills/{claude/mate-openspec-backfill → agents/mate-backfill-spec}/SKILL.md +4 -4
  160. package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +95 -0
  161. package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +50 -0
  162. package/src/templates/mate-skills/agents/mate-explore-change/references/openspec-explore.md +348 -0
  163. package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +3 -3
  164. package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +5 -5
  165. package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +103 -0
  166. package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-propose.md +167 -0
  167. package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-update-change.md +101 -0
  168. package/src/templates/mate-skills/agents/{mate-artifact-publish → mate-publish-artifact}/SKILL.md +91 -23
  169. package/src/templates/mate-skills/agents/{mate-artifact-publish → mate-publish-artifact}/references/openspec.md +4 -3
  170. package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +74 -16
  171. package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +74 -68
  172. package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +76 -0
  173. package/src/templates/mate-skills/claude/mate-apply-change/references/openspec-apply-change.md +198 -0
  174. package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +59 -0
  175. package/src/templates/mate-skills/{agents/mate-openspec-backfill → claude/mate-backfill-spec}/SKILL.md +4 -4
  176. package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +95 -0
  177. package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +50 -0
  178. package/src/templates/mate-skills/claude/mate-explore-change/references/openspec-explore.md +348 -0
  179. package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +3 -3
  180. package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +5 -5
  181. package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +103 -0
  182. package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-propose.md +167 -0
  183. package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-update-change.md +101 -0
  184. package/src/templates/mate-skills/claude/{mate-artifact-publish → mate-publish-artifact}/SKILL.md +91 -23
  185. package/src/templates/mate-skills/claude/{mate-artifact-publish → mate-publish-artifact}/references/openspec.md +4 -3
  186. package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +74 -16
  187. package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +74 -68
  188. package/src/templates/mate-skills/openspec-references.ts +140 -0
  189. package/src/templates/root/TEMPLATE_AGENTS.md +2 -2
  190. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +3727 -320
  191. package/src/tools/setup/capabilities/context-mode.ts +25 -5
  192. package/src/tools/setup/capabilities/graphify-gate.ts +31 -0
  193. package/src/tools/setup/capabilities/graphify-secrets.ts +255 -0
  194. package/src/tools/setup/capabilities/graphify.ts +12 -0
  195. package/src/tools/setup/capabilities/openspec.ts +273 -270
  196. package/src/tools/setup/capabilities/tokensave.ts +36 -3
  197. package/src/tools/setup/context-services.ts +9 -17
  198. package/src/tools/setup/dynamic-plugins/audiences.ts +7 -39
  199. package/src/tools/setup/dynamic-plugins/declarations.ts +1 -1
  200. package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -7
  201. package/src/tools/setup/dynamic-plugins/install.ts +24 -28
  202. package/src/tools/setup/engine.ts +93 -148
  203. package/src/tools/setup/managed-output.ts +51 -0
  204. package/src/tools/setup/mate.ts +86 -11
  205. package/src/tools/setup/plugin.ts +37 -17
  206. package/src/tools/setup/plugins/gitignore.ts +1 -7
  207. package/src/tools/setup/plugins/guidance.ts +7 -4
  208. package/src/tools/setup/providers/agent-file-sections.ts +4 -2
  209. package/src/tools/setup/providers/claude-attribution.ts +65 -0
  210. package/src/tools/setup/providers/claude-plugin-folders.ts +625 -0
  211. package/src/tools/setup/providers/claude-plugin-hooks.ts +39 -19
  212. package/src/tools/setup/providers/claude.ts +285 -34
  213. package/src/tools/setup/providers/opencode.ts +180 -11
  214. package/src/tools/setup/registry.ts +2 -24
  215. package/src/tools/setup/surface-target.ts +4 -13
  216. package/src/tools/setup/utils.ts +14 -4
  217. package/src/tools/setup.ts +131 -18
  218. package/wrappers/bin/graphify +52 -4
  219. package/wrappers/bin/openspec +33 -9
  220. package/wrappers/lib/graphify-gate.mjs +8 -0
  221. package/opencode-plugin/src/audience-layer.ts +0 -91
  222. package/src/cli/commands/studio/views/workflow/transcript.tsx +0 -190
  223. package/src/runtime/audience-layer.ts +0 -84
  224. package/src/runtime/opencode-audience-layer.ts +0 -176
  225. package/src/tools/setup/audience-isolation.fixture.ts +0 -325
  226. package/src/tools/setup/audience-layer.ts +0 -207
  227. package/src/tools/setup/audience-registrations.ts +0 -52
  228. package/src/tools/setup/contribution-ledger.ts +0 -207
  229. package/src/tools/setup/isolation-diagnostics.ts +0 -139
  230. package/src/tools/setup/runtime-documents.ts +0 -291
  231. package/src/tools/setup/upgrade-sweep.ts +0 -153
@@ -1,5 +1,5 @@
1
1
  name: mate-minimal
2
- version: 3
2
+ version: 4
3
3
  description: Mate's short OpenSpec workflow for one-Area, low-risk changes - specs → tasks
4
4
  artifacts:
5
5
  - id: specs
@@ -27,11 +27,13 @@ artifacts:
27
27
  include **Reason** and **Migration**.
28
28
 
29
29
  Every user story carries an **Area:** marker naming the Areas it binds, using values from
30
- the frontmatter scopes - always, even when there is only one Area.
30
+ the `scopes` in the spec's `mate:delta` comment - always, even when there is only one Area.
31
31
 
32
- **Obsidian**: Emit YAML frontmatter with `type: delta-spec`, the actual change name, the
33
- capability, the `openspec/change`, `openspec/spec`, and `openspec/delta` tags, and paired
34
- `scopes` metadata.
32
+ Start each spec file with a `<!-- mate:delta` comment on its very first line, not YAML
33
+ frontmatter. The comment holds YAML with the actual change name as `change`, the
34
+ `capability`, and paired `scopes` metadata, and closes with `-->` on its own line. Between
35
+ the comment and the first `## ` section, put nothing but blank lines and at most one `# `
36
+ title line, or `openspec validate --strict` reports the text archive would drop.
35
37
  requires: []
36
38
  - id: tasks
37
39
  generates: tasks.md
@@ -39,7 +41,7 @@ artifacts:
39
41
  template: tasks.md
40
42
  instruction: |
41
43
  Create a flat implementation checklist that satisfies the delta specs. Keep it short: this
42
- profile uses the shared `/openspec-explore` and `/openspec-propose` planning steps but
44
+ profile uses the shared `/mate-explore-change` and `/mate-propose-change` planning steps but
43
45
  intentionally writes no explore, proposal, or design artifact.
44
46
 
45
47
  Number tasks `N.M` and group them under `## N. <group>` headers so apply tracking can address them individually.
@@ -1,12 +1,10 @@
1
- ---
2
- type: delta-spec
1
+ <!-- mate:delta
3
2
  change: <change-name>
4
3
  capability: <capability>
5
- tags: [openspec/change, openspec/spec, openspec/delta]
6
4
  scopes:
7
5
  - repository: org/repository
8
6
  area: .
9
- ---
7
+ -->
10
8
 
11
9
  ## ADDED Requirements
12
10
 
@@ -16,7 +14,7 @@ As a <!-- role -->, I want <!-- capability -->, so that <!-- benefit -->.
16
14
  The system MUST support this behavior.
17
15
  **Area:** `.` <!-- replace with the Area from scopes -->
18
16
 
19
- <!-- Every requirement must bind an Area from the frontmatter scopes. -->
17
+ <!-- Every requirement must bind an Area from the `mate:delta` scopes. -->
20
18
 
21
19
  #### Acceptance Criteria
22
20
 
@@ -1,5 +1,5 @@
1
1
  name: mate-v1
2
- version: 9
2
+ version: 10
3
3
  description: Mate's complete OpenSpec workflow - proposal → specs → design → tasks
4
4
  artifacts:
5
5
  - id: proposal
@@ -74,7 +74,7 @@ artifacts:
74
74
  - **CRITICAL**: Scenarios MUST use exactly 4 hashtags (`####`). Using 3 hashtags or bullets will fail silently.
75
75
  - Every requirement MUST have at least one scenario.
76
76
 
77
- New capabilities only: after the frontmatter and backlink lines, start the delta spec body with a `## Purpose` section - one or two sentences (50+ characters, or `openspec validate --strict` reports it as too brief) describing what the capability is for. Archive copies it into the main spec it creates; without it the new main spec is left with a `TBD ... Update Purpose after archive.` placeholder to fill in by hand. Do NOT add `## Purpose` to a delta for an existing capability - that spec already has one and the delta's is ignored. To change an existing capability's Purpose - including a leftover `TBD` placeholder - edit `openspec/specs/<capability>/spec.md` directly.
77
+ New capabilities only: after the `mate:delta` comment and any `#` title, start the delta spec body with a `## Purpose` section - one or two sentences (50+ characters, or `openspec validate --strict` reports it as too brief) describing what the capability is for. Archive copies it into the main spec it creates; without it the new main spec is left with a `TBD ... Update Purpose after archive.` placeholder to fill in by hand. Do NOT add `## Purpose` to a delta for an existing capability - that spec already has one and the delta's is ignored. To change an existing capability's Purpose - including a leftover `TBD` placeholder - edit `openspec/specs/<capability>/spec.md` directly.
78
78
 
79
79
  MODIFIED requirements workflow:
80
80
  1. Locate the existing requirement in `openspec/specs/<capability>/spec.md`.
@@ -84,7 +84,7 @@ artifacts:
84
84
 
85
85
  Common pitfall: Using MODIFIED with partial content loses detail at archive time. If adding new concerns without changing existing behavior, use ADDED instead.
86
86
 
87
- Example (frontmatter scopes cover `acme` and `packages/api`; every requirement carries an `**Area:**` marker, as always — the first binds both, the second one):
87
+ Example (scope metadata covers `acme` and `packages/api`; every requirement carries an `**Area:**` marker, as always — the first binds both, the second one):
88
88
 
89
89
  ```
90
90
  ## ADDED Requirements
@@ -107,21 +107,19 @@ artifacts:
107
107
 
108
108
  Specs should be testable - each scenario is a potential test case.
109
109
 
110
- **Obsidian**: Emit this YAML frontmatter at the very top of each spec file. Replace `<change-name>`, `<repository>`, `<area>`, and `<capability>` with actual values. Each `scopes` entry MUST preserve its repository/Area pairing:
110
+ **Obsidian**: Start each spec file with this `mate:delta` comment as its very first line, not YAML frontmatter. Replace `<change-name>`, `<repository>`, `<area>`, and `<capability>` with actual values. Each `scopes` entry MUST preserve its repository/Area pairing:
111
111
 
112
112
  ```
113
- ---
114
- type: delta-spec
113
+ <!-- mate:delta
115
114
  change: <change-name>
116
115
  capability: <capability>
117
- tags: [openspec/change, openspec/spec, openspec/delta]
118
116
  scopes:
119
117
  - repository: org/repository
120
118
  area: .
121
- ---
119
+ -->
122
120
  ```
123
121
 
124
- After the file's `#` title line, add a backlink on the next line: `← [[proposal]]`. If modifying an existing main spec, add on the line after: `Applies to: [[openspec/specs/<capability>/spec]]`.
122
+ Between the comment and the first `## ` section, put nothing but blank lines and at most one `# ` title line. OpenSpec skips the comment and the title, but `openspec validate --strict` reports any other text there, because archive drops it, so add no backlink or cross-reference lines.
125
123
 
126
124
  Canonical-spec shape, delta-to-canonical projection, and migration rules live in
127
125
  `openspec/mate-conventions.yaml`. Follow that reference when creating or repairing
@@ -1,12 +1,10 @@
1
- ---
2
- type: delta-spec
1
+ <!-- mate:delta
3
2
  change: <change-name>
4
3
  capability: <capability>
5
- tags: [openspec/change, openspec/spec, openspec/delta]
6
4
  scopes:
7
5
  - repository: org/repository
8
6
  area: .
9
- ---
7
+ -->
10
8
 
11
9
  ## Purpose
12
10
 
@@ -17,7 +15,7 @@ scopes:
17
15
  ### Requirement: <!-- requirement name -->
18
16
 
19
17
  <!-- Write the normative requirement. EVERY requirement carries an **Area:** marker from the
20
- frontmatter scopes, for example **Area:** `packages/ui`. No **Repository:** marker is ever used.
18
+ `mate:delta` scopes, for example **Area:** `packages/ui`. No **Repository:** marker is ever used.
21
19
  See openspec/mate-conventions.yaml for shared scope and canonical-spec rules. -->
22
20
 
23
21
  #### Scenario: <!-- scenario name -->
@@ -2,17 +2,17 @@ name: mate-openspec-conventions
2
2
  version: 1
3
3
  description: Shared scope, frontmatter, delta, and canonical-spec rules for Mate schemas.
4
4
  rules: |
5
- - Every change artifact MUST name at least one paired repository and area in its frontmatter scopes list.
6
- - Repository identity comes from the Git remote. Normalize SSH and HTTPS forms such as git@github.com:org/repository.git and https://github.com/org/repository.git to org/repository.
5
+ - Every change artifact MUST name at least one paired repository and area in its scopes list: a delta spec in its mate:delta comment, every other change artifact in its frontmatter.
6
+ - Repository identity comes from the Git remote: its full path on the host, without host, credentials, or .git. Normalize SSH and HTTPS forms such as git@github.com:org/repository.git and https://github.com/org/repository.git to org/repository; keep every nested group, so git@gitlab.example.com:group/subgroup/repository.git becomes group/subgroup/repository.
7
7
  - In a monorepo, an Area is the owning workspace or package root: the directory containing the nearest package manifest (package.json, Cargo.toml, go.mod, and similar). A non-monorepo may use the exact affected path and uses . only when the repository root is affected.
8
8
  - Do not use a local checkout basename, internal repository ID, synthetic Area, or N/A as durable metadata.
9
9
  - Preserve each repository/Area pair. Never use separate repositories and areas arrays.
10
10
  - Default a new capability to one owning package root. Use one capability per repository when a change crosses repositories. A capability spec names exactly one repository, although a change may name several.
11
- - Area identity comes only from frontmatter. Capability and change folder names are descriptive and have no scope authority.
12
- - A delta lives at openspec/changes/<name>/specs/<capability>/spec.md.
11
+ - Area identity comes only from frontmatter or a delta's mate:delta comment. Capability and change folder names are descriptive and have no scope authority.
12
+ - A delta lives at openspec/changes/<name>/specs/<capability>/spec.md. It starts with a mate:delta comment, never YAML frontmatter, and holds nothing but blank lines and at most one # title line between that comment and its first ## section; openspec validate --strict reports any other text there.
13
13
  - A canonical spec lives at openspec/specs/<capability>/spec.md. The archive command merges delta requirement blocks into this durable file.
14
14
  - OpenSpec parses only ## ADDED Requirements, ## MODIFIED Requirements, ## REMOVED Requirements, and ## RENAMED Requirements. Every parsed requirement starts with ### Requirement:. Do not substitute User Stories in these headers.
15
- - Every requirement MUST carry an Area marker whose values appear in the delta frontmatter. This survives archive, which copies requirement blocks but discards delta frontmatter.
15
+ - Every requirement MUST carry an Area marker whose values appear in the delta's mate:delta comment. This survives archive, which copies requirement blocks but discards the mate:delta comment.
16
16
  - A canonical spec uses flat frontmatter: type: spec, capability, scalar repository, areas list, and tags: [openspec/spec]. It MUST NOT retain a nested scopes list or delta-only change and delta tags.
17
17
  - To project a delta, all its scope entries MUST name the same repository. Emit that repository as the canonical scalar and distinct Areas as areas in their original order. If repositories differ, split the capability before archive.
18
18
  verification: |
@@ -20,16 +20,14 @@ verification: |
20
20
  - mate-react-doctor: when writing tasks, end the task list of every Area whose tasks change React code (components, hooks, or other .tsx/.jsx modules) with one verification task, numbered like its neighbours, for example `- [ ] N.M Verify React changes with React Doctor [skill:mate-react-doctor]`. Areas whose tasks do not change React code get no verification task.
21
21
  - During apply, a tagged verification task is worked like any other task by invoking its skill.
22
22
  - Before reporting a change complete, check every Area that changed React code: if its tagged verification task is already checked, do nothing more; otherwise invoke the skill once for that Area.
23
- example_delta_frontmatter: |
24
- ---
25
- type: delta-spec
23
+ example_delta_metadata: |
24
+ <!-- mate:delta
26
25
  change: <change-name>
27
26
  capability: <capability>
28
- tags: [openspec/change, openspec/spec, openspec/delta]
29
27
  scopes:
30
28
  - repository: org/repository
31
29
  area: .
32
- ---
30
+ -->
33
31
  notes:
34
- - "Change frontmatter uses paired scopes. Canonical frontmatter uses flat repository and areas scalars instead."
35
- - "Do not add a ## Scopes body section; frontmatter is the only source of scope identity."
32
+ - "Change frontmatter and the delta mate:delta comment use paired scopes. Canonical frontmatter uses flat repository and areas scalars instead."
33
+ - "Do not add a ## Scopes body section; frontmatter and the mate:delta comment are the only sources of scope identity."
@@ -0,0 +1,40 @@
1
+ # Third-Party Notices
2
+
3
+ The following files contain workflow text from OpenSpec 1.15.0
4
+ (https://github.com/Fission-AI/OpenSpec), with command references rewritten to
5
+ the matching Mate skills:
6
+
7
+ - `claude/mate-explore-change/references/openspec-explore.md`
8
+ - `claude/mate-propose-change/references/openspec-propose.md`
9
+ - `claude/mate-apply-change/references/openspec-apply-change.md`
10
+ - `claude/mate-propose-change/references/openspec-update-change.md`
11
+ - `agents/mate-explore-change/references/openspec-explore.md`
12
+ - `agents/mate-propose-change/references/openspec-propose.md`
13
+ - `agents/mate-apply-change/references/openspec-apply-change.md`
14
+ - `agents/mate-propose-change/references/openspec-update-change.md`
15
+
16
+ OpenSpec is distributed under this license:
17
+
18
+ ```text
19
+ MIT License
20
+
21
+ Copyright (c) 2024 OpenSpec Contributors
22
+
23
+ Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ of this software and associated documentation files (the "Software"), to deal
25
+ in the Software without restriction, including without limitation the rights
26
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ copies of the Software, and to permit persons to whom the Software is
28
+ furnished to do so, subject to the following conditions:
29
+
30
+ The above copyright notice and this permission notice shall be included in all
31
+ copies or substantial portions of the Software.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39
+ SOFTWARE.
40
+ ```
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: mate-apply-change
3
+ description: Implement a change on a recorded delivery branch, offering change/<change-name> instead of a protected branch. Builds on the OpenSpec apply workflow. Use when the user wants to implement, apply, or continue implementing a reviewed change.
4
+ allowed-tools: Bash(mate:*), Bash(openspec:*), Bash(git:*)
5
+ license: MIT
6
+ compatibility: Requires the mate CLI and the openspec capability enabled.
7
+ metadata:
8
+ author: mate
9
+ version: "1.0"
10
+ ---
11
+
12
+ # Mate Apply Change
13
+
14
+ The Apply change stage of the Delivery Path. Before any code changes, it records the
15
+ Working Repository branch the change is delivered through, so archive and publication
16
+ later know which merge to wait for. Then it runs the OpenSpec apply workflow.
17
+
18
+ ## Step 1: Read the branch and the record
19
+
20
+ In the Working Repository, read local Git state only:
21
+
22
+ ```bash
23
+ git symbolic-ref --quiet --short HEAD # current branch; fails when detached
24
+ git symbolic-ref --quiet --short refs/remotes/origin/HEAD # default branch
25
+ ```
26
+
27
+ Read the change's existing record without changing it:
28
+
29
+ ```bash
30
+ mate artifact link "<change-name>" --json
31
+ ```
32
+
33
+ ## Step 2: Settle the delivery branch
34
+
35
+ A branch is **protected** when it is the default branch or matches a configured
36
+ protected pattern; `mate artifact link` refuses a
37
+ protected branch unless it is recorded as a direct delivery.
38
+
39
+ - **A branch is already recorded** and it is the current branch → continue. When the
40
+ current branch differs, warn, name both branches, and ask before implementing
41
+ whether to switch to the recorded branch or record the current one.
42
+ - **On `change/<change-name>`** → record it without asking:
43
+ `mate artifact link "<change-name>" --branch "change/<change-name>" --json`.
44
+ - **On another unprotected branch** (a shared feature branch) → ask once whether this
45
+ change is delivered through it, then record it on confirmation.
46
+ - **Detached HEAD** → ask for the branch name, then record it.
47
+ - **On a protected branch** → do not implement there by default. First name every
48
+ local commit that is not on the remote (`git log --oneline HEAD --not --remotes`) and
49
+ leave them where they are; never move, reset, or rebase them. Then offer:
50
+ 1. **Create `change/<change-name>`** (default): `git switch -c change/<change-name>`;
51
+ uncommitted edits carry over. Record it.
52
+ 2. **Use an existing branch**: switch to the branch the user names and record it.
53
+ 3. **Work directly here** — only when the user explicitly chooses it. Record it as a
54
+ direct delivery: `mate artifact link "<change-name>" --branch "<branch>" --direct --json`.
55
+
56
+ Record the branch before writing any code. When `mate artifact link` refuses, report
57
+ its message and ask; never work around it.
58
+
59
+ When its result lists `warnings`, a `dependsOn` change is not implemented yet, so this
60
+ change would be built without the code it builds on. Report each warning and ask
61
+ whether to apply the dependency first or continue here.
62
+
63
+ ## Step 3: Apply
64
+
65
+ Read [references/openspec-apply-change.md](references/openspec-apply-change.md) and
66
+ follow it for the implementation. The PR need not exist yet; the branch is the delivery.
67
+ After implementation, the optional peers `/mate-show-me` and `/mate-simplify-code` may
68
+ run in any order, then `/mate-archive-change`. Name them as next steps; do not invoke
69
+ them.
70
+
71
+ ## Guardrails
72
+
73
+ - Never push, open a PR, or merge on the user's behalf.
74
+ - Never record a protected branch except as an explicit direct delivery.
75
+ - The forge token, when one is used by `mate artifact link`, is never printed or
76
+ written; do not read or echo `MATE_GIT_TOKEN`.
@@ -0,0 +1,198 @@
1
+ <!-- Vendored from OpenSpec 1.15.0: the `openspec-apply-change` workflow its `agents` tool generates.
2
+ Copyright (c) OpenSpec Contributors, MIT License (see THIRD-PARTY-NOTICES.md in Mate).
3
+ Regenerated by `bun run vendor:openspec`; do not edit. -->
4
+
5
+ Implement tasks from an OpenSpec change.
6
+
7
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
8
+
9
+ **Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
10
+
11
+ One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
12
+
13
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
14
+
15
+ - **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
16
+ - **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
17
+
18
+ In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
19
+
20
+ **Input**: Optionally specify a change name (e.g., `/mate-apply-change add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
21
+
22
+ **Steps**
23
+
24
+ 1. **Select the change**
25
+
26
+ If a name is provided, use it. Otherwise:
27
+ - Infer from conversation context if the user mentioned a change
28
+ - Auto-select if only one active change exists
29
+ - If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
30
+
31
+ Always announce: "Using change: <name>" and how to override (e.g., `/mate-apply-change <other>`).
32
+
33
+ 2. **Check status to understand the schema**
34
+ ```bash
35
+ openspec status --change "<name>" --json
36
+ ```
37
+ Parse the JSON to understand:
38
+ - `schemaName`: The workflow being used (e.g., "spec-driven")
39
+ - `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
40
+ - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
41
+
42
+ 3. **Get apply instructions**
43
+
44
+ ```bash
45
+ openspec instructions apply --change "<name>" --json
46
+ ```
47
+
48
+ This returns:
49
+ - `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
50
+ - Progress (total, complete, remaining)
51
+ - Task list with status, source path, and source line
52
+ - Dynamic instruction based on current state
53
+ - Optional `context`: current required project instruction input from the selected root
54
+ - Optional `operationGuidance`: current advisory guidance for apply
55
+ - `missingArtifacts` (when present): required artifact ids with no output
56
+
57
+ **Handle states:**
58
+ - If `state: "blocked"`: show the message and pause implementation.
59
+ - If `missingArtifacts` is non-empty: suggest completing the missing artifacts. Run `openspec status --change "<name>" --json`, select the next `ready` artifact (not `skipped` or `blocked`), and use `openspec instructions "<artifact-id>" --change "<name>" --json` for its rules and template. Keep the selected `--store <id>` on both commands.
60
+ - Otherwise, follow the CLI instruction to create or repair the schema-configured tracking file from existing planning artifacts. Do not assume another artifact is ready or start implementation while blocked.
61
+ - If `state: "all_done"`: report that all tracked tasks are complete and suggest review or verification as appropriate before archiving
62
+ - Otherwise: proceed to implementation
63
+
64
+ Treat `context` as a required prompt-level input. Read and consider it, and
65
+ apply relevant project facts, conventions, and constraints while implementing.
66
+ Treat `operationGuidance` as optional additive advice. Read and consider every
67
+ entry, and follow entries that are applicable and compatible with the built-in
68
+ workflow.
69
+
70
+ Keep both fields separate from CLI-returned state, missing artifacts, tasks,
71
+ progress, `contextFiles`, and the built-in `instruction`. They are not
72
+ evidence of task completion, do not replace the built-in instruction, and do
73
+ not permit bypassing a blocked state. If context conflicts with the built-in
74
+ instruction, an explicit user choice, or a CLI-controlled value, report the
75
+ conflict and preserve the controlling value. If guidance is inapplicable or
76
+ conflicts with those controlling inputs, do not follow it and explain why.
77
+ These are prompt-level behavior contracts, not enforceable checks.
78
+
79
+ 4. **Read context files**
80
+
81
+ Read every file path listed under `contextFiles` from the apply instructions output.
82
+ The files depend on the schema being used:
83
+ - **spec-driven**: proposal, specs, design, tasks
84
+ - Other schemas: follow the contextFiles from CLI output
85
+
86
+ Do not copy `context` or `operationGuidance` verbatim into implementation
87
+ files or planning artifacts unless the user separately asks for that content.
88
+
89
+ 5. **Show current progress**
90
+
91
+ Display:
92
+ - Schema being used
93
+ - Progress: "N/M tasks complete"
94
+ - Remaining tasks overview
95
+ - Dynamic instruction from CLI
96
+
97
+ 6. **Implement tasks (loop until done or blocked)**
98
+
99
+ For each pending task:
100
+ - Show which task is being worked on
101
+ - Make the code changes required
102
+ - Keep changes minimal and focused
103
+ - Before editing, confirm the checkbox at the returned `sourcePath` and `line` still matches the task description; if it does not, rerun the apply instructions and use the refreshed location
104
+ - Mark the task complete at its returned `sourcePath` and `line`: `- [ ]` → `- [x]`
105
+ - Rerun the apply instructions and confirm that task is now done and progress changed
106
+ - Continue to next task
107
+
108
+ **Pause if:**
109
+ - Task is unclear → ask for clarification
110
+ - Implementation reveals a design issue → suggest updating artifacts
111
+ - A task needs work beyond what the spec and tasks describe, or you are tempted to drop, narrow, defer, or accept exceptions to specified behavior to make it fit → surface the added scope and ask; do not absorb it silently
112
+ - Error or blocker encountered → report and wait for guidance
113
+ - User interrupts
114
+
115
+ 7. **On completion or pause, show status**
116
+
117
+ Display:
118
+ - Tasks completed this session
119
+ - Overall progress: "N/M tasks complete"
120
+ - If all done: report that tracked tasks are complete and suggest review or verification as appropriate before archiving
121
+ - If paused: explain why and wait for guidance
122
+
123
+ **Output During Implementation**
124
+
125
+ ```
126
+ ## Implementing: <change-name> (schema: <schema-name>)
127
+
128
+ Working on task 3/7: <task description>
129
+ [...implementation happening...]
130
+ ✓ Task complete
131
+
132
+ Working on task 4/7: <task description>
133
+ [...implementation happening...]
134
+ ✓ Task complete
135
+ ```
136
+
137
+ **Output On Completion**
138
+
139
+ ```
140
+ ## Implementation Complete
141
+
142
+ **Change:** <change-name>
143
+ **Schema:** <schema-name>
144
+ **Progress:** 7/7 tasks complete ✓
145
+
146
+ ### Completed This Session
147
+ - [x] Task 1
148
+ - [x] Task 2
149
+ ...
150
+
151
+ All tracked tasks are complete. Review or verify the change as appropriate
152
+ before archiving. You can archive this change with `/mate-archive-change`.
153
+ ```
154
+
155
+ **Output On Pause (Issue Encountered)**
156
+
157
+ ```
158
+ ## Implementation Paused
159
+
160
+ **Change:** <change-name>
161
+ **Schema:** <schema-name>
162
+ **Progress:** 4/7 tasks complete
163
+
164
+ ### Issue Encountered
165
+ <description of the issue>
166
+
167
+ **Options:**
168
+ 1. <option 1>
169
+ 2. <option 2>
170
+ 3. Other approach
171
+
172
+ What would you like to do?
173
+ ```
174
+
175
+ **Guardrails**
176
+ - Keep going through tasks until done or blocked
177
+ - Always read context files before starting (from the apply instructions output)
178
+ - If task is ambiguous, pause and ask before implementing
179
+ - If implementation reveals issues, pause and suggest artifact updates
180
+ - Keep code changes minimal and scoped to each task
181
+ - Update task checkbox immediately after completing each task
182
+ - Pause on errors, blockers, or unclear requirements - don't guess
183
+ - When a task needs work beyond what the spec describes, surface the added scope and pause - never silently narrow, defer, or simplify away specified behavior
184
+ - Only mark a task `- [x]` when its specified behavior is fully implemented, not when it is partially done or deferred
185
+ - Use contextFiles from CLI output, don't assume specific file names
186
+ - Use each task's sourcePath and line to update its exact checkbox
187
+ - Do not use context or operation guidance as proof that a task is complete
188
+ - Apply relevant project context; report conflicts with controlling workflow inputs
189
+ - Consider every guidance entry; explain any inapplicable or conflicting advice
190
+ - Do not copy runtime context or operation guidance into implementation files or planning artifacts
191
+ - Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
192
+
193
+ **Fluid Workflow Integration**
194
+
195
+ This skill supports the "actions on a change" model:
196
+
197
+ - **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
198
+ - **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: mate-archive-change
3
+ description: Archive a change through mate artifact archive, which records its delivery, reports merge state and its warnings, and runs the OpenSpec archive, also before the merge. Use when the user wants to archive, finalize, or close out an implemented change.
4
+ allowed-tools: Bash(mate:*), Bash(git:*)
5
+ license: MIT
6
+ compatibility: Requires the mate CLI and the openspec capability enabled.
7
+ metadata:
8
+ author: mate
9
+ version: "1.0"
10
+ ---
11
+
12
+ # Mate Archive Change
13
+
14
+ The Archive change stage of the Delivery Path. Archiving applies the change's delta
15
+ specs to the local canonical specs, so a feature's later changes build on it. It is
16
+ allowed **before** the delivery branch merges: publication, not archive, waits for the
17
+ merge. Archiving is local and uncommitted; it publishes nothing.
18
+
19
+ ## Steps
20
+
21
+ 1. **Archive.**
22
+
23
+ ```bash
24
+ mate artifact archive "<change-name>" --json
25
+ ```
26
+
27
+ Run it from the companion or the linked Working Repository. It shows warnings,
28
+ refreshes merge state from the forge when a token is available, writes the change's
29
+ `delivery.yaml`, and runs `openspec archive` itself. Do not run `openspec archive`
30
+ separately.
31
+
32
+ 2. **Answer a missing branch.** When the result's `status` is `needs-branch`, nothing
33
+ was archived. Ask the user which branch delivers the change, suggesting
34
+ `suggestedBranch` when it is set, and re-run with exactly one of:
35
+
36
+ - `--branch "<branch>"` — a protected branch only with `--direct`, after the user
37
+ explicitly confirms a direct delivery;
38
+ - `--not-applicable "<reason>"` — for a specification-only change;
39
+ - `--skip-branch` — when the user skips the question; publication will ask again.
40
+
41
+ 3. **Report.** Relay every entry of `warnings` first: another active change that
42
+ modifies the same requirement, a declared dependency that is not archived yet, or
43
+ planning artifacts its schema requires that are missing (`incomplete-planning`).
44
+ Warnings never block. Then report the archive `path` and the delivery: each branch
45
+ with its merge result and source (`forge` or `user`) and PR link, or the
46
+ not-applicable reason. An open or unknown merge is information, not a failure.
47
+
48
+ 4. **Hand off.** Name `/mate-publish-artifact` as the next step and say that
49
+ publication holds the archive back until its delivery branch is merged. Do not
50
+ invoke it.
51
+
52
+ When `status` is `failed`, report the message (typically incomplete tasks or a
53
+ validation error) and stop.
54
+
55
+ ## Guardrails
56
+
57
+ - Never commit, tag, or push; publication is `mate-publish-artifact`.
58
+ - A merger account is provenance, never an artifact review.
59
+ - Do not read or echo `MATE_GIT_TOKEN`.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: mate-openspec-backfill
2
+ name: mate-backfill-spec
3
3
  description: Reverse-engineer an OpenSpec spec for one existing feature and write it directly to the canonical spec, ready to publish. Use when the user wants to backfill, document, or spec existing or legacy behavior that has no spec yet.
4
4
  allowed-tools: Bash(openspec:*), Bash(mate:*), Bash(git remote:*), Bash(git diff:*)
5
5
  license: MIT
@@ -11,7 +11,7 @@ metadata:
11
11
 
12
12
  # Mate OpenSpec Backfill
13
13
 
14
- Specify one feature that already exists in the working repository. A backfill records behavior that already shipped, so the run writes the canonical spec `openspec/specs/<capability>/spec.md` directly and leaves it uncommitted. It never creates a change and never publishes; publication happens afterwards through `mate-artifact-publish`.
14
+ Specify one feature that already exists in the working repository. A backfill records behavior that already shipped, so the run writes the canonical spec `openspec/specs/<capability>/spec.md` directly and leaves it uncommitted. It never creates a change and never publishes; publication happens afterwards through `mate-publish-artifact`.
15
15
 
16
16
  ## Scope rules
17
17
 
@@ -70,12 +70,12 @@ Specify one feature that already exists in the working repository. A backfill re
70
70
 
71
71
  Fix every reported error and re-validate until it passes. Do not hand off a spec that fails validation.
72
72
 
73
- 8. **Hand off.** Report the written path and show the uncommitted diff (`git diff -- openspec/specs/<capability>/`, or the file itself when it is new). Point the user to `mate-artifact-publish`: the spec appears there under **Drifted specs** and can be published on its own or with the rest.
73
+ 8. **Hand off.** Report the written path and show the uncommitted diff (`git diff -- openspec/specs/<capability>/`, or the file itself when it is new). Point the user to `mate-publish-artifact`: the spec appears there under **Drifted specs** and can be published on its own or with the rest.
74
74
 
75
75
  ## Guardrails
76
76
 
77
77
  - Never create an OpenSpec change, change artifacts, or verification tasks, and never archive.
78
- - Never commit, tag, push, or publish — never run `mate artifact publish`. Publication belongs to `mate-artifact-publish`.
78
+ - Never commit, tag, push, or publish — never run `mate artifact publish`. Publication belongs to `mate-publish-artifact`.
79
79
  - Never write any file before the user approves the review table.
80
80
  - Never write a requirement without a citation in the review table, and never spec a suspected bug without the user's ruling.
81
81
  - Never write citations or evidence tags into the canonical spec.