@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
@@ -0,0 +1,198 @@
1
+ <!-- Vendored from OpenSpec 1.15.0: the `openspec-apply-change` workflow its `claude` 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.
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: mate-clarify-intent
3
+ description: Pick the pre-explore mode a request needs (interview, grilling, or skip) from what it already states, then run that one mode. Use only when the user explicitly starts clarifying an idea before exploring a change.
4
+ disable-model-invocation: true
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 Clarify Intent
13
+
14
+ The optional first stage of the Delivery Path. It runs before `/mate-explore-change`
15
+ and decides how much clarification a request needs: an interview when intent is
16
+ incomplete, grilling when intent is clear but a proposed direction needs testing, or
17
+ nothing at all for a small, fully specified change.
18
+
19
+ Read only the user's request and this conversation. Do not read or investigate the
20
+ repository; questions that need repository evidence go to explore.
21
+
22
+ ## Step 1: Fill the slot table
23
+
24
+ Mark each slot `stated`, `implied`, or `missing` from the request and conversation:
25
+
26
+ | Slot | Question |
27
+ | ---------- | --------------------------------------------- |
28
+ | Who | Who benefits or is affected? |
29
+ | Why | What problem or change makes this needed now? |
30
+ | Success | How will we know it worked? |
31
+ | Constraint | What limit binds the solution? |
32
+
33
+ `implied` Success counts as `missing`: a guessed success measure is the gap this stage
34
+ exists to close. Then note whether the request proposes a direction (an approach,
35
+ design, or solution shape): yes or no.
36
+
37
+ ## Step 2: Route
38
+
39
+ Apply the first rule that matches:
40
+
41
+ 1. Any slot `missing` → **interview**.
42
+ 2. All slots filled and a direction is proposed → **grill**.
43
+ 3. All slots filled, no direction, and the change is minimal-eligible (one Area, low
44
+ risk, no new dependency or data-model change) → **skip**.
45
+ 4. Otherwise → **grill**.
46
+
47
+ ## Step 3: Announce and accept an override
48
+
49
+ Show the slot table with each slot's mark, the direction answer, and the route with
50
+ its rule in one line, for example:
51
+
52
+ ```text
53
+ Route: interview — Success is missing.
54
+ Reply `interview`, `grill`, or `skip` to switch; anything else continues.
55
+ ```
56
+
57
+ A one-word reply `interview`, `grill`, or `skip` replaces the route without further
58
+ questions. Run exactly one mode.
59
+
60
+ ## Step 4: Run the routed mode
61
+
62
+ Run the mode by **reading its instructions and following them**, not by invoking a
63
+ skill. Resolve the file relative to this skill's own directory:
64
+
65
+ - **interview** → read `../mate-interview-me/SKILL.md` and follow it from its first
66
+ step.
67
+ - **grill** → read `../mate-grill-me/SKILL.md` and follow it.
68
+ - **skip** → run nothing.
69
+
70
+ `mate-interview-me` and `mate-grill-me` are manual-only skills: never call them through
71
+ the skill mechanism. Reading the file is the supported way to run them from here. If
72
+ the file is missing, report that the companion's Mate skills need
73
+ `mate companion update` and stop.
74
+
75
+ ## Step 5: Hand off
76
+
77
+ A routed mode ends with its own `PRE-EXPLORE HANDOFF` block naming
78
+ `/mate-explore-change`. For **skip**, emit:
79
+
80
+ ```text
81
+ PRE-EXPLORE HANDOFF (skip)
82
+ Confirmed: <the four slots as stated>
83
+ Unresolved: none
84
+ Assumptions: <points explore should verify, or "none">
85
+ Next: /mate-explore-change
86
+ ```
87
+
88
+ Tell the user the next step is `/mate-explore-change`; do not invoke it.
89
+
90
+ ## Mate Boundary
91
+
92
+ Conversational only. Do not create or modify code, context files, ADRs, OpenSpec
93
+ artifacts, or any other file. This skill runs before `/mate-explore-change`: wide
94
+ repository investigation and option comparison belong there, recorded under
95
+ Unresolved or Assumptions in the handoff.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: mate-explore-change
3
+ description: Explore a change with its Working Repository and Area resolved from the companion context map, and suggest slicing a large feature into several changes. Builds on the OpenSpec explore workflow. Use when the user wants to explore, investigate, or think through a change before proposing it.
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 Explore Change
13
+
14
+ The Explore change stage of the Delivery Path. It runs the OpenSpec explore workflow
15
+ and adds two things: the scope comes from the companion context map, and a feature too
16
+ large for one change is suggested as several.
17
+
18
+ ## Steps
19
+
20
+ 1. **Follow the OpenSpec workflow.** Read
21
+ [references/openspec-explore.md](references/openspec-explore.md) and follow it for the
22
+ exploration itself. When a `PRE-EXPLORE HANDOFF` block is in this conversation, treat
23
+ its Confirmed points as settled and start from its Unresolved questions and
24
+ Assumptions.
25
+
26
+ 2. **Resolve scope from the context map.** Before reading code, identify the canonical
27
+ Working Repository (`org/repository` from its Git remote) and the repository-relative
28
+ Area (the owning package root in a monorepo). Read the Companion Repository's
29
+ `CONTEXT-MAP.md`, then only the repository-scoped map for that Working Repository,
30
+ and load only the contexts it maps to that Area. Use their vocabulary in the
31
+ exploration. When the map has no entry for the Area, say so instead of borrowing
32
+ another Area's context.
33
+
34
+ 3. **Suggest slicing when the feature is large.** Slicing test: a feature needs
35
+ slicing when it spans several Areas, several independent behaviours, or more work
36
+ than one review can hold (roughly more than 10 tasks or 400 changed lines).
37
+ Several Areas that only work together stay one change with a scope per Area. When
38
+ the explored direction passes the test, propose slices: one change per slice,
39
+ each reviewable and archivable on its own, in dependency order. Name the
40
+ dependencies between slices; they become `dependsOn` entries when the changes are
41
+ proposed. Several slices may share one delivery branch. Slicing is a suggestion;
42
+ the user decides.
43
+
44
+ 4. **Hand off.** End by naming `/mate-propose-change` as the next step, once per agreed
45
+ slice. Do not invoke it.
46
+
47
+ ## Boundary
48
+
49
+ Exploration writes no product code. Agent artifacts written while exploring go to the
50
+ Companion Repository, never the Working Repository.