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