@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,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.
@@ -0,0 +1,348 @@
1
+ <!-- Vendored from OpenSpec 1.15.0: the `openspec-explore` 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
+ Enter explore mode. Think deeply. Visualize freely. Follow the conversation wherever it goes.
6
+
7
+ **IMPORTANT: Explore mode is for thinking, not implementing.** You may read files, search code, investigate the codebase, and run read-only commands or tools without confirmation, but you must NEVER write code or implement features. If the user asks you to implement something, do not start it here: say that explore mode does not implement, and point them at `/mate-propose-change`, which turns the discussion into a change. The work happens from that change, never from explore mode. You MAY create or update OpenSpec change artifacts (proposals, designs, specs) within a confirmed scope—that's capturing thinking, not implementing. Answering design or clarifying questions is never consent to write. Before the first write-capable action, name the artifacts or files you would change and what you would do, ask a direct yes/no question, and wait for the user's confirmation in a separate message. Confirmation covers only the scope you described; ask again before expanding it. An explicit request from the user to capture the exploration as a new change is itself that confirmation, covering the change and the change artifacts the request names; scaffold it first as described below.
8
+
9
+ **This is a stance, not a workflow.** There are no fixed steps, no required sequence, no mandatory outputs. You're a thinking partner helping the user explore.
10
+
11
+ **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.
12
+
13
+ **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.
14
+
15
+ 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`.
16
+
17
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
18
+
19
+ - **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.
20
+ - **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.
21
+
22
+ 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.
23
+
24
+ ---
25
+
26
+ ## The Stance
27
+
28
+ - **Curious, not prescriptive** - Ask questions that emerge naturally, don't follow a script
29
+ - **Open threads, not interrogations** - Surface multiple interesting directions and let the user follow what resonates. Don't funnel them through a single path of questions.
30
+ - **Visual** - Use ASCII diagrams liberally when they'd help clarify thinking
31
+ - **Adaptive** - Follow interesting threads, pivot when new information emerges
32
+ - **Patient** - Don't rush to conclusions, let the shape of the problem emerge
33
+ - **Grounded** - Explore the actual codebase when relevant, don't just theorize
34
+
35
+ ---
36
+
37
+ ## Planning a Change
38
+
39
+ When the user is planning a change, guide them toward shared understanding with focused discovery questions. For open-ended discussion, follow the conversation without imposing an interview or a required output.
40
+
41
+ Before asking a factual question, follow the context discovery below and inspect relevant OpenSpec artifacts, source, tests, docs, and configuration. Do not ask the user to repeat facts you can verify. Summarize relevant findings without reproducing private context or rules. If evidence is missing, conflicting, or inaccessible, state that limitation and ask only for the clarification needed to proceed.
42
+
43
+ - **Follow dependencies** - Resolve the next blocking decision before its dependent details. For example, clarify the user's outcome and scope before choosing an API or data model. Revisit downstream assumptions when an earlier answer changes. Skip branches that do not matter to this goal.
44
+ - **Keep questions focused** - Ask one focused question at a time, and briefly explain why it matters and which decision it unlocks. Batch questions only if the user asks for a batch; keep them small and group related decisions.
45
+ - **Offer grounded recommendations** - When evidence supports a recommendation, state your preferred option and why it fits the user's goals, with alternatives and their tradeoffs when useful. Do not invent intent, priorities, or external constraints: ask the user when only they can answer. Avoid a fixed question format.
46
+ - **Keep a conversational record** - Track decisions in the conversation, not in files. Separate confirmed decisions from proposed defaults and unresolved questions. Silence is not acceptance. Accepting an answer or a batch of recommendations is not permission to write. Keep file-write confirmation separate from discovery questions and follow the guardrails below.
47
+
48
+ Stop asking when the user has enough clarity. Let them pause, pivot, or defer a decision; do not exhaust every branch or force a proposal.
49
+
50
+ For example, after inspecting the relevant code:
51
+
52
+ ```text
53
+ The CLI already uses SQLite and has no remote service. Is sharing state
54
+ across devices in scope? That determines whether local storage is enough.
55
+ If this stays a single-device tool, I recommend keeping SQLite to avoid
56
+ adding a service to operate; shared state would need a separate sync design.
57
+ ```
58
+
59
+ ---
60
+
61
+ ## What You Might Do
62
+
63
+ Depending on what the user brings, you might:
64
+
65
+ **Explore the problem space**
66
+ - Ask clarifying questions that emerge from what they said
67
+ - Challenge assumptions
68
+ - Reframe the problem
69
+ - Find analogies
70
+
71
+ **Investigate the codebase**
72
+ - Map existing architecture relevant to the discussion
73
+ - Find integration points
74
+ - Identify patterns already in use
75
+ - Surface hidden complexity
76
+
77
+ **Compare options**
78
+ - Brainstorm multiple approaches
79
+ - Build comparison tables
80
+ - Sketch tradeoffs
81
+ - Recommend a path (if asked)
82
+
83
+ **Visualize**
84
+ ```
85
+ +------------------------------------------+
86
+ | Use ASCII diagrams liberally |
87
+ +------------------------------------------+
88
+ | |
89
+ | [State A] -------> [State B] |
90
+ | | |
91
+ | v |
92
+ | [State C] |
93
+ | |
94
+ | System diagrams, state machines, |
95
+ | data flows, architecture sketches, |
96
+ | dependency graphs, comparison tables |
97
+ | |
98
+ +------------------------------------------+
99
+ ```
100
+
101
+ **Draw with plain ASCII only** — borders `+` `-` `|`, arrows `-->` `<--` `^` `v`, markers `*` `x`.
102
+ Unicode diagram glyphs can render at different widths across terminals, fonts, and locales, so padded boxes and aligned tables can drift. Keep every diagram character ASCII.
103
+
104
+ **Surface risks and unknowns**
105
+ - Identify what could go wrong
106
+ - Find gaps in understanding
107
+ - Suggest spikes or investigations
108
+
109
+ ---
110
+
111
+ ## OpenSpec Awareness
112
+
113
+ You have full context of the OpenSpec system. Use it naturally, don't force it.
114
+
115
+ ### Check for context
116
+
117
+ At the start, quickly check what exists:
118
+ ```bash
119
+ openspec list --json
120
+ ```
121
+
122
+ This tells you:
123
+ - If there are active changes
124
+ - Their names and task status
125
+ - What the user might be working on
126
+
127
+ That is the *change* list - work in flight. It does not include the project's durable capabilities, so list those too:
128
+ ```bash
129
+ openspec list --specs
130
+ ```
131
+ Add `--json` for ids and requirement counts, and append `--store "<id>"` only for a registered standalone store. This is the inventory of what the project already claims to do, and `openspec list` on its own never shows it. To look at one, run `openspec show "<spec-id>" --type spec --json --no-scenarios` (same `--store` rule) - it returns that capability's purpose and requirement texts without pulling the whole spec file into context, and `--type spec` stops a change of the same name from making it ambiguous.
132
+
133
+ The filtered read is only an overview. Before deciding what is already covered or what should change, read each relevant spec in full, including scenarios, with `openspec show "<spec-id>" --type spec` (same `--store` rule).
134
+
135
+ Then read the project's own context from the resolved root - `<root.path>/openspec/config.yaml` (or `config.yml`). Use the `root.path` returned above, and skip this if neither file exists:
136
+ - `context`: project background - tech stack, conventions, constraints
137
+ - `rules`: keyed by artifact id - the entries for an artifact apply only when you write that artifact
138
+
139
+ Ground your thinking in these. They are constraints for you to follow, not content to reproduce: do NOT copy them into the conversation or into any artifact you create.
140
+
141
+ ### When no change exists
142
+
143
+ Think freely. When insights crystallize, you might offer:
144
+
145
+ - "This feels solid enough to start a change. Want me to create a proposal?"
146
+ - Or keep exploring - no pressure to formalize
147
+
148
+ If the user asks you to capture the exploration as a new change, that request is the confirmation required above. It covers scaffolding that change and creating the change artifacts the request names, and nothing else. This holds only when the request is theirs: a yes to an offer you made confirms only the scope your offer itself named, so name the change and the artifacts in the offer. Don't re-ask for what they already asked for; do ask before anything beyond it. Transition seamlessly into the requested capture:
149
+
150
+ 1. Run `openspec new change "<name>"` (with `--store <id>` when applicable) before creating any artifacts. Never create a new change directory under `openspec/changes/` by hand; the CLI scaffold creates required metadata such as `.openspec.yaml`. Keep the selected `--store <id>` on every applicable follow-up `status` and `instructions` command.
151
+ 2. Run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store), then process the requested artifacts in dependency order. For each requested artifact that is `ready`, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store). Before creating a requested artifact, evaluate any condition in its own `instruction` against the explored change; record a deliberate skip instead when the condition does not apply. If a requested artifact is blocked by a direct prerequisite the user did not request, run `openspec instructions "<prerequisite-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) for that prerequisite whether it is `ready` or `blocked`. If its own `instruction` states a condition, evaluate that condition against the explored change and record a deliberate skip only when the condition does not apply. If the condition applies, or the prerequisite is not conditional, treat it as a normal prerequisite and ask before expanding the capture. Do not create an unrequested prerequisite unless the user approves.
152
+ 3. Follow the returned `template` and `instruction` fields. Read completed dependency files listed in `dependencies`, and apply `context` and `rules` as constraints without copying them into the artifact. Choose the output path before creating anything: when `resolvedOutputPath` is a glob, use the instruction to choose a concrete path inside `changeRoot` and verify it remains inside `changeRoot` after resolving symlinks, both in its parent directories and in the file itself if it already exists; if it does not, stop and tell the user. Otherwise the output path is `resolvedOutputPath`. If the instruction delegates creation to a specific skill or command, invoke it only if it can write the artifact to that output path; otherwise stop and tell the user. Otherwise write the artifact to that output path. Verify that the selected concrete output exists at that output path.
153
+ 4. After creating each artifact, re-run `openspec status --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) and continue until every requested artifact is `done`, `skipped`, or was deliberately skipped because its own `instruction` stated a condition that did not apply. Tell the user about a deliberate conditional skip, remember it, and do not reconsider it. Dependencies are enablers, not gates: if a requested artifact is still `blocked` only because you deliberately skipped a conditional prerequisite, run `openspec instructions "<artifact-id>" --change "<name>" --json` (append the confirmed `--store "<id>"` only for a registered standalone store) despite the blocked status, then create it using step 3 only when those recorded conditional skips are its sole missing dependencies. If a requested artifact is blocked by a prerequisite the user did not ask to capture and cannot be conditionally skipped, explain that dependency and ask before expanding the capture.
154
+
155
+ Capture the artifact(s) the user requested without asking them to invoke another workflow command. If they asked only to start a change, stop after scaffolding and show its status. When the requested capture is done, stop there and name where the work continues: `/mate-propose-change` writes the remaining planning artifacts, and `/mate-apply-change` implements the change once tasks exist. Capturing artifacts never starts implementing them.
156
+
157
+ ### When a change exists
158
+
159
+ If the user mentions a change or you detect one is relevant:
160
+
161
+ 1. **Resolve and read existing artifacts for context**
162
+ - Run `openspec status --change "<name>" --json`.
163
+ - Use `changeRoot`, `artifactPaths`, and `actionContext` from the status JSON.
164
+ - Read existing files from `artifactPaths.<artifact>.existingOutputPaths`.
165
+
166
+ 2. **Reference them naturally in conversation**
167
+ - "Your design mentions using Redis, but we just realized SQLite fits better..."
168
+ - "The proposal scopes this to premium users, but we're now thinking everyone..."
169
+
170
+ 3. **Offer to capture when decisions are made**
171
+
172
+ `<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
173
+
174
+ The files below are the default spec-driven schema's. With another schema, capture each insight in whichever artifact from `artifactPaths` fits it, and name that artifact in your offer; never create an artifact the schema does not define.
175
+
176
+ | Insight Type | Where to Capture |
177
+ |----------------------------|-------------------------------------|
178
+ | New requirement discovered | `specs/<capability-path>/spec.md` |
179
+ | Requirement changed | `specs/<capability-path>/spec.md` |
180
+ | Design decision made | `design.md` |
181
+ | Scope changed | `proposal.md` |
182
+ | New work identified | `tasks.md` |
183
+ | Assumption invalidated | Relevant artifact |
184
+
185
+ Example offers (default schema):
186
+ - "That's a design decision. Capture it in design.md?"
187
+ - "This is a new requirement. Add it to specs?"
188
+ - "This changes scope. Update the proposal?"
189
+
190
+ 4. **The user decides** - Offer and move on. Don't pressure. Don't auto-capture.
191
+
192
+ ---
193
+
194
+ ## What You Don't Have To Do
195
+
196
+ - Follow a script
197
+ - Ask the same questions every time
198
+ - Produce a specific artifact
199
+ - Reach a conclusion
200
+ - Stay on topic if a tangent is valuable
201
+ - Be brief (this is thinking time)
202
+
203
+ ---
204
+
205
+ ## Handling Different Entry Points
206
+
207
+ **User brings a vague idea:**
208
+ ```
209
+ User: I'm thinking about adding real-time collaboration
210
+
211
+ You: Real-time collab is a big space. Let me think about this...
212
+
213
+ COLLABORATION SPECTRUM
214
+ ============================================
215
+
216
+ Awareness Coordination Sync
217
+ | | |
218
+ v v v
219
+ +--------+ +--------+ +--------+
220
+ |Presence| |Cursors | | CRDT |
221
+ | "3 | | Multi | |Conflict|
222
+ |online" | | select | | free |
223
+ +--------+ +--------+ +--------+
224
+ | | |
225
+ trivial moderate complex
226
+
227
+ Where's your head at?
228
+ ```
229
+
230
+ **User brings a specific problem:**
231
+ ```
232
+ User: The auth system is a mess
233
+
234
+ You: [reads codebase]
235
+
236
+ +---------------------------------------------+
237
+ | CURRENT AUTH FLOW |
238
+ +---------------------------------------------+
239
+ |
240
+ +-------------+-------------+
241
+ v v v
242
+ +---------+ +---------+ +---------+
243
+ | Google | | GitHub | | Email |
244
+ | OAuth | | OAuth | | Magic |
245
+ +----+----+ +----+----+ +----+----+
246
+ | | |
247
+ +-------------+-------------+
248
+ v
249
+ +-----------+
250
+ | Session |
251
+ +-----+-----+
252
+ |
253
+ v
254
+ +-----------+
255
+ | Perms |
256
+ +-----------+
257
+
258
+ I see three tangles. Which one's burning?
259
+ ```
260
+
261
+ **User is stuck mid-implementation:**
262
+ ```
263
+ User: /mate-explore-change add-auth-system
264
+ The OAuth integration is more complex than expected
265
+
266
+ You: [reads change artifacts]
267
+
268
+ You're on task 4: "Implement OAuth flow"
269
+
270
+ Let me trace what's involved...
271
+
272
+ [draws diagram, explores options, suggests paths]
273
+
274
+ Want to update the design to reflect this?
275
+ Or add a spike task to investigate?
276
+ ```
277
+
278
+ **User wants to compare options:**
279
+ ```
280
+ User: Should we use Postgres or SQLite?
281
+
282
+ You: Generic answer is boring. What's the context?
283
+
284
+ User: A CLI tool that tracks local dev environments
285
+
286
+ You: That changes everything.
287
+
288
+ +-------------------------------------------------+
289
+ | CLI TOOL DATA STORAGE |
290
+ +-------------------------------------------------+
291
+
292
+ Key constraints:
293
+ - No daemon running
294
+ - Must work offline
295
+ - Single user
296
+
297
+ SQLite Postgres
298
+ Deployment embedded needs server
299
+ Offline yes no
300
+ Single file yes no
301
+
302
+ SQLite. Not even close.
303
+
304
+ Unless... is there a sync component?
305
+ ```
306
+
307
+ ---
308
+
309
+ ## Ending Discovery
310
+
311
+ There's no required ending. Discovery might:
312
+
313
+ - **Flow into a proposal**: "Ready to start? Run `/mate-propose-change` and this becomes a change."
314
+ - **Result in artifact updates**: "Updated the design with these decisions"
315
+ - **Just provide clarity**: User has what they need, moves on
316
+ - **Continue later**: "We can pick this up anytime"
317
+
318
+ When it feels like things are crystallizing, you might summarize:
319
+
320
+ ```
321
+ ## What We Figured Out
322
+
323
+ **The problem**: [crystallized understanding]
324
+
325
+ **The approach**: [if one emerged]
326
+
327
+ **Open questions**: [if any remain]
328
+
329
+ **Next steps** (if ready):
330
+ - Turn this into a change: `/mate-propose-change`
331
+ - Keep exploring: just keep talking
332
+ ```
333
+
334
+ But this summary is optional. Sometimes the thinking IS the value.
335
+
336
+ ---
337
+
338
+ ## Guardrails
339
+
340
+ - **Don't implement** - Never write code or implement features. Workflow configuration counts too: creating or editing schemas, templates, or `openspec/config.yaml` is a change, not thinking. Creating or updating OpenSpec change artifacts within the confirmed scope is fine, writing anything else is not. When the user is ready to build, name the handoff rather than starting: `/mate-propose-change` turns the discussion into a change, and the work happens there.
341
+ - **Don't fake understanding** - If something is unclear, dig deeper
342
+ - **Don't rush** - Discovery is thinking time, not task time
343
+ - **Don't force structure** - Let patterns emerge naturally
344
+ - **Don't auto-capture** - Offer to save insights, don't just do it. Read-only commands and tools need no confirmation. Before the first write-capable action—including `openspec new change` or another command that writes files—name the artifacts or files and proposed changes, ask a direct yes/no question, and wait for explicit confirmation in a separate user message. That confirmation covers only the described scope; ask again before expanding it. Answers to design or clarifying questions are never consent to write. That rule governs `openspec new change` whenever you are the one proposing the capture; the user's own capture request is the exception, handled in the capture transition above.
345
+ - **Don't manually scaffold changes** - Never create a new change directory under `openspec/changes/` by hand. Always use `openspec new change "<name>"` (with `--store <id>` when applicable) so required metadata such as `.openspec.yaml` is created before writing artifacts.
346
+ - **Do visualize** - A good diagram is worth many paragraphs
347
+ - **Do explore the codebase** - Ground discussions in reality
348
+ - **Do question assumptions** - Including the user's and your own
@@ -11,7 +11,7 @@ metadata:
11
11
 
12
12
  # Mate Grill Me
13
13
 
14
- This skill runs before `/openspec-explore`. It stress-tests decisions; wide
14
+ This skill runs before `/mate-explore-change`. It stress-tests decisions; wide
15
15
  repository investigation and option comparison belong to explore. When a
16
16
  question would need mapping large parts of the repository, record it under
17
17
  Unresolved or Assumptions in the handoff instead of investigating it.
@@ -30,11 +30,11 @@ PRE-EXPLORE HANDOFF (grill)
30
30
  Confirmed: <accepted decisions>
31
31
  Unresolved: <open questions, or "none">
32
32
  Assumptions: <untested assumptions explore should verify, or "none">
33
- Next: /openspec-explore
33
+ Next: /mate-explore-change
34
34
  ```
35
35
 
36
36
  Confirmed decisions are settled; explore should not ask them again. Then tell
37
- the user the next step is `/openspec-explore`; do not invoke it. The user starts
37
+ the user the next step is `/mate-explore-change`; do not invoke it. The user starts
38
38
  it in this conversation.
39
39
 
40
40
  If grilling stopped on a blocker, still emit the block. List the blocker first
@@ -22,7 +22,7 @@ Once implementation has started, switching costs are real and the user may
22
22
  rationalize the wrong thing into "good enough." This skill closes the gap before
23
23
  it costs anything.
24
24
 
25
- This skill runs before `/openspec-explore`. It clarifies intent only: do not read
25
+ This skill runs before `/mate-explore-change`. It clarifies intent only: do not read
26
26
  or investigate the repository, and do not compare implementation options. When
27
27
  an answer would need repository evidence, record it in the handoff for explore
28
28
  instead of looking it up.
@@ -143,11 +143,11 @@ PRE-EXPLORE HANDOFF (interview)
143
143
  Confirmed: <Outcome, User, Why now, Success, Constraint, Out of scope>
144
144
  Unresolved: <open questions, or "none">
145
145
  Assumptions: <points explore should verify against the repository, or "none">
146
- Next: /openspec-explore
146
+ Next: /mate-explore-change
147
147
  ```
148
148
 
149
149
  Confirmed points are settled; explore should not ask them again. Then tell the
150
- user the next step is `/openspec-explore`; do not invoke it. The user starts it
150
+ user the next step is `/mate-explore-change`; do not invoke it. The user starts it
151
151
  in this conversation.
152
152
 
153
153
  If the session stopped on a blocker, still emit the block. Put only explicitly
@@ -166,7 +166,7 @@ its partial intent, blocker, and unresolved questions in the handoff instead.
166
166
  This is a conversational-only skill. Do not create or modify code, context files,
167
167
  ADRs, OpenSpec artifacts, intent documents, or any other files. Do not claim that
168
168
  a file was written, and do not invoke another skill. The only skill this skill
169
- names is `/openspec-explore`, as the user's next step.
169
+ names is `/mate-explore-change`, as the user's next step.
170
170
 
171
171
  ## Verification
172
172
 
@@ -184,6 +184,6 @@ Before stopping, check that:
184
184
  - The user explicitly confirmed the restatement, or the result is clearly marked
185
185
  unresolved because of a blocker.
186
186
  - The session ended with the `PRE-EXPLORE HANDOFF` block and named
187
- `/openspec-explore` as the next step without invoking it.
187
+ `/mate-explore-change` as the next step without invoking it.
188
188
  - No repository investigation was done; evidence needs went to Unresolved or
189
189
  Assumptions.
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: mate-propose-change
3
+ description: Propose a change with its schema chosen by the minimal eligibility test (mate-minimal or mate-v1) and one change per agreed slice. Builds on the OpenSpec propose workflow. Use when the user wants to turn an explored direction into a change proposal, or revise an existing change's plan.
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 Propose Change
13
+
14
+ The Propose change stage of the Delivery Path. It runs the OpenSpec propose workflow
15
+ and adds the schema choice and one change per slice. Its revise mode reworks the plan
16
+ of a change that already exists.
17
+
18
+ ## Step 0: Choose the mode
19
+
20
+ Use **Revise mode** when the named change already exists, or the user asks to revise,
21
+ reconcile, or fold feedback or new decisions into a change's plan. Otherwise run the
22
+ propose steps below.
23
+
24
+ ## Steps
25
+
26
+ 1. **Choose the schema.** Use `mate-minimal` (specs and tasks only) when every
27
+ statement holds; otherwise use `mate-v1` (proposal, specs, design, tasks):
28
+
29
+ - Intent and scope are clear, with nothing left to explore.
30
+ - The change stays within one Area.
31
+ - It is low risk: no new dependency, no data-model or public API change, and no
32
+ security, performance, or migration concern.
33
+
34
+ Public API includes command names, flags, exit codes, JSON output fields, config
35
+ keys, and exported package symbols.
36
+
37
+ State the result and the failing statement, if any, in one line. The user may
38
+ override it.
39
+
40
+ 2. **One change per slice.** Slicing test: a feature needs slicing when it spans
41
+ several Areas, several independent behaviours, or more work than one review can
42
+ hold (roughly more than 10 tasks or 400 changed lines). Several Areas that only
43
+ work together stay one change with a scope per Area. When exploration agreed on
44
+ several slices, propose one change per slice, each with its own name. When no
45
+ slices were agreed, apply the slicing test before writing anything. If it passes,
46
+ suggest slices in dependency order, naming their `dependsOn` entries, and write no
47
+ artifact until the user agrees to the slices or keeps one change. If the slice
48
+ boundaries are unclear, suggest `/mate-explore-change` instead of guessing slices.
49
+ Record a slice's dependency on an earlier change as a `dependsOn` list in the
50
+ frontmatter of its first artifact, for example `dependsOn: [add-graph-model]`; archive
51
+ later warns while a dependency is still unarchived.
52
+
53
+ 3. **Follow the OpenSpec workflow.** Read
54
+ [references/openspec-propose.md](references/openspec-propose.md) and follow it with the
55
+ chosen schema (pass `--schema <schema>` when creating the change).
56
+
57
+ 4. **Hand off to human review.** Reviews are done by people, not by a skill. List the
58
+ artifacts to review in schema order (Review proposal, Review specs, Review design,
59
+ Review tasks for `mate-v1`; Review specs and Review tasks for `mate-minimal`), then
60
+ name `/mate-apply-change` as the step after review. Do not invoke it, and never
61
+ describe validation as approval.
62
+
63
+ ## Revise mode
64
+
65
+ Revises the planning artifacts a change already has, for example after a person reviewed
66
+ them, and keeps them consistent with each other. In this mode the skill is
67
+ not a Delivery Path stage.
68
+
69
+ 1. **Name the change.** Use the change the user names; otherwise infer it from the
70
+ conversation, or list the active changes and ask.
71
+
72
+ 2. **Follow the OpenSpec workflow.** Read
73
+ [references/openspec-update-change.md](references/openspec-update-change.md) and follow
74
+ it. Propose the requested edit together with the matching edits to the other
75
+ artifacts, and write each one only after the user confirms it.
76
+
77
+ 3. **Upgrade a minimal change when it outgrows the gate.** When a revision makes a
78
+ `mate-minimal` change fail a statement of the minimal gate (Step 1), or the user asks,
79
+ name the failing statement and offer the upgrade to `mate-v1` once. Declined: continue
80
+ the revision unchanged. Confirmed:
81
+
82
+ 1. Set `schema: mate-v1` in the change's `.openspec.yaml`, first, so `openspec
83
+ instructions` returns the `mate-v1` text.
84
+ 2. Write the proposal from the existing specs and tasks, then the design, each from
85
+ `openspec instructions <artifact-id> --change "<name>" --json` and each confirmed
86
+ before writing.
87
+ 3. Align `tasks.md`: frontmatter `schema: mate-v1`, the `← [[proposal]] | [[design]]`
88
+ line after the title, one heading per Area. Keep task numbers and check marks.
89
+ 4. Run `openspec validate "<name>" --strict` and `openspec status --change "<name>"`,
90
+ and report any artifact still missing.
91
+
92
+ This upgrade is the only case in which revise mode creates a missing artifact. Never
93
+ downgrade a `mate-v1` change; suggest a new change instead.
94
+
95
+ 4. **Hand off.** When the change already has checked tasks, name `/mate-apply-change` to
96
+ carry the revision into code; when every task is checked, name `/mate-archive-change`.
97
+ Do not invoke them.
98
+
99
+ Guardrails:
100
+
101
+ - Planning artifacts only; never edit product code.
102
+ - Reviews are done by people. Never describe a revision or a passing validation as
103
+ approval.