@uniqbit/mate-core 0.15.5 → 0.16.0-canary.1
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/.claude-plugin/plugin.json +2 -2
- package/claude-plugin/hooks/hooks.json +3 -6
- package/claude-plugin/hooks/session-guidance.mjs +8 -0
- package/claude-plugin/hooks/ts-loader.mjs +19 -0
- package/package.json +7 -5
- package/src/cli/commands/artifact/artifact.ts +19 -3
- package/src/cli/commands/artifact/finish/command.ts +183 -57
- package/src/cli/commands/artifact/finish/engine.ts +80 -91
- package/src/cli/commands/artifact/finish/finisher.ts +26 -33
- package/src/cli/commands/artifact/finish/git.ts +34 -23
- package/src/cli/commands/artifact/finish/index.ts +9 -3
- package/src/cli/commands/artifact/finish/openspec.ts +225 -97
- package/src/cli/commands/artifact/pending/command.ts +175 -0
- package/src/cli/commands/artifact/pending/discovery.ts +249 -0
- package/src/cli/commands/artifact/pending/index.ts +17 -0
- package/src/cli/commands/cap/index-cmd.ts +9 -1
- package/src/cli/commands/cap/index.ts +2 -6
- package/src/cli/commands/cap/tokensave.ts +4 -4
- package/src/cli/commands/companion/companion.ts +5 -1
- package/src/cli/commands/companion/link.ts +2 -2
- package/src/cli/commands/companion/sync.ts +92 -0
- package/src/cli/commands/doctor.ts +0 -3
- package/src/cli/commands/launch/shared.ts +23 -5
- package/src/cli/commands/report/collector.ts +72 -78
- package/src/cli/commands/report/contract.ts +40 -1
- package/src/cli/commands/report/highlight.ts +27 -0
- package/src/cli/commands/report/index.ts +11 -18
- package/src/cli/commands/report/renderer.ts +199 -2
- package/src/cli/commands/report/types.ts +26 -1
- package/src/cli/commands/shared/companion-selection.ts +107 -10
- package/src/cli/commands/studio/areas.ts +68 -0
- package/src/cli/commands/studio/index.ts +69 -0
- package/src/cli/commands/studio/inventory.ts +55 -0
- package/src/cli/commands/studio/mate-inventory.ts +43 -0
- package/src/cli/commands/studio/openspec-cli.ts +198 -0
- package/src/cli/commands/studio/payload.ts +184 -0
- package/src/cli/commands/studio/routes.ts +2 -0
- package/src/cli/commands/studio/selection.ts +61 -0
- package/src/cli/commands/studio/server.ts +201 -0
- package/src/cli/commands/studio/snapshot.ts +63 -0
- package/src/cli/commands/studio/topology.ts +199 -0
- package/src/cli/commands/studio/views/client.ts +197 -0
- package/src/cli/commands/studio/views/companion-picker.tsx +91 -0
- package/src/cli/commands/studio/views/companion-selector.tsx +90 -0
- package/src/cli/commands/studio/views/dashboard/changes.tsx +107 -0
- package/src/cli/commands/studio/views/dashboard/index.tsx +19 -0
- package/src/cli/commands/studio/views/document.tsx +256 -0
- package/src/cli/commands/studio/views/error.tsx +20 -0
- package/src/cli/commands/studio/views/model.ts +34 -0
- package/src/cli/commands/studio/views/pairings.tsx +38 -0
- package/src/cli/commands/studio/views/skills/index.tsx +87 -0
- package/src/cli/commands/studio/views/specs/index.tsx +101 -0
- package/src/cli/commands/studio/views/styles.ts +389 -0
- package/src/cli/commands/studio/views/warnings.tsx +21 -0
- package/src/cli/commands/studio/views/workflow/index.tsx +21 -0
- package/src/cli/commands/studio/views/workflow/steps.ts +329 -0
- package/src/cli/commands/studio/views/workflow/transcript.tsx +190 -0
- package/src/cli/commands/unwrap.ts +70 -0
- package/src/cli/commands/wrap.ts +164 -0
- package/src/cli/main.ts +68 -19
- package/src/cli/parse-flags.ts +36 -11
- package/src/cli/usage.ts +12 -3
- package/src/framework.ts +1 -7
- package/src/hooks/session-banner.ts +64 -11
- package/src/hooks/session-guidance.ts +40 -0
- package/src/hooks/validate-artifact-path.ts +108 -35
- package/src/lib/fs-utils.ts +9 -0
- package/src/lib/install.ts +33 -0
- package/src/lib/orchestrator/adapters/base.ts +14 -125
- package/src/lib/orchestrator/adapters/claude.ts +0 -11
- package/src/lib/orchestrator/adapters/opencode.ts +2 -32
- package/src/lib/orchestrator/companion-git-sync.ts +94 -84
- package/src/lib/orchestrator/config-store.ts +2 -21
- package/src/lib/orchestrator/editor.ts +12 -22
- package/src/lib/orchestrator/framework-context.ts +17 -6
- package/src/lib/orchestrator/global-config-store.ts +1 -1
- package/src/lib/orchestrator/launcher.ts +97 -7
- package/src/lib/orchestrator/opencode-guidance.ts +4 -56
- package/src/lib/orchestrator/projection-claude-entry.ts +198 -0
- package/src/lib/orchestrator/projection-claude-skills.ts +120 -0
- package/src/lib/orchestrator/projection-companion-link.ts +62 -0
- package/src/lib/orchestrator/projection-entries.ts +377 -0
- package/src/lib/orchestrator/projection-record.ts +56 -0
- package/src/lib/orchestrator/projection-runtime-documents.ts +424 -0
- package/src/lib/orchestrator/projection-types.ts +169 -0
- package/src/lib/orchestrator/repo-local-registry.ts +37 -133
- package/src/lib/orchestrator/repo-local-store.ts +96 -0
- package/src/lib/orchestrator/setup-compatibilities.ts +1 -9
- package/src/lib/orchestrator/types.ts +1 -0
- package/src/lib/orchestrator/working-repo-projection.ts +366 -0
- package/src/lib/orchestrator/workspace-inventory.ts +1 -1
- package/src/lib/package-paths.ts +11 -1
- package/src/lib/public-npm.ts +2 -1
- package/src/lib/update-checker.ts +15 -9
- package/src/opencode/companion-hooks.ts +89 -245
- package/src/opencode/companion-policy.ts +35 -10
- package/src/opencode/index.ts +1 -0
- package/src/opencode/projected-guidance.ts +56 -0
- package/src/opencode/tui.tsx +13 -4
- package/src/playbooks/companion-guidance.ts +32 -116
- package/src/plugins.ts +0 -1
- package/src/runtime/companion-git-state.ts +156 -0
- package/src/runtime/companion-git.ts +203 -0
- package/src/runtime/companion-guidance.ts +222 -0
- package/src/runtime/companion-sync.ts +298 -0
- package/src/runtime/env-names.ts +30 -0
- package/src/runtime/env.ts +67 -35
- package/src/runtime/framework.ts +10 -0
- package/src/runtime/freshness.ts +58 -0
- package/src/runtime/index.ts +104 -0
- package/src/runtime/install.ts +30 -0
- package/src/runtime/policy.ts +66 -0
- package/src/runtime/projected-guidance.ts +45 -0
- package/src/runtime/projection.ts +224 -0
- package/src/runtime/repo-local.ts +64 -0
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +56 -0
- package/src/templates/capabilities/openspec-cap/mate-minimal/templates/spec.md +48 -0
- package/src/templates/capabilities/openspec-cap/mate-minimal/templates/tasks.md +22 -0
- package/src/templates/capabilities/openspec-cap/mate-v1/schema.yaml +31 -90
- package/src/templates/capabilities/openspec-cap/mate-v1/templates/design.md +3 -0
- package/src/templates/capabilities/openspec-cap/mate-v1/templates/explore-brief.md +6 -6
- package/src/templates/capabilities/openspec-cap/mate-v1/templates/spec.md +3 -5
- package/src/templates/capabilities/openspec-cap/mate-v1/templates/tasks.md +3 -0
- package/src/templates/capabilities/openspec-cap/openspec-conventions.yaml +30 -0
- package/src/templates/capabilities/react-doctor/claude/hooks/react-doctor.sh +2 -2
- package/src/templates/mate-skills/agents/mate-artifact-publish/SKILL.md +185 -0
- package/src/templates/mate-skills/agents/mate-artifact-publish/references/openspec.md +227 -0
- package/src/templates/mate-skills/agents/mate-domain-modeling/SKILL.md +68 -0
- package/src/templates/mate-skills/agents/mate-domain-modeling/references/ADR-FORMAT.md +9 -0
- package/src/templates/mate-skills/agents/mate-domain-modeling/references/CONTEXT-FORMAT.md +18 -0
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +14 -0
- package/src/templates/mate-skills/agents/mate-grill-with-docs/SKILL.md +29 -0
- package/src/templates/mate-skills/agents/mate-grilling/SKILL.md +49 -0
- package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +156 -0
- package/src/templates/{capabilities/openspec-cap/mate-skills → mate-skills}/agents/mate-openspec-backfill/SKILL.md +4 -2
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +139 -0
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +503 -0
- package/src/templates/mate-skills/claude/mate-artifact-publish/SKILL.md +185 -0
- package/src/templates/mate-skills/claude/mate-artifact-publish/references/openspec.md +227 -0
- package/src/templates/mate-skills/claude/mate-domain-modeling/SKILL.md +68 -0
- package/src/templates/mate-skills/claude/mate-domain-modeling/references/ADR-FORMAT.md +9 -0
- package/src/templates/mate-skills/claude/mate-domain-modeling/references/CONTEXT-FORMAT.md +18 -0
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +14 -0
- package/src/templates/mate-skills/claude/mate-grill-with-docs/SKILL.md +29 -0
- package/src/templates/mate-skills/claude/mate-grilling/SKILL.md +49 -0
- package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +156 -0
- package/src/templates/mate-skills/claude/mate-openspec-backfill/SKILL.md +67 -0
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +139 -0
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +503 -0
- package/src/templates/report-assets/README.md +32 -0
- package/src/templates/report-assets/mermaid.LICENSE +21 -0
- package/src/templates/report-assets/mermaid.min.js +4376 -0
- package/src/templates/root/TEMPLATE_CLAUDE.md +1 -9
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +1476 -197
- package/src/tools/setup/capabilities/graphify.ts +16 -7
- package/src/tools/setup/capabilities/openspec.ts +63 -56
- package/src/tools/setup/capabilities/tokensave.ts +116 -2
- package/src/tools/setup/engine.ts +34 -6
- package/src/tools/setup/mate.ts +42 -13
- package/src/tools/setup/plugin.ts +9 -0
- package/src/tools/setup/plugins/guidance.ts +11 -1
- package/src/tools/setup/providers/claude-format.ts +49 -4
- package/src/tools/setup/providers/claude-plugin-hooks.ts +117 -0
- package/src/tools/setup/providers/claude.ts +55 -220
- package/src/tools/setup/providers/opencode.ts +41 -14
- package/src/tools/setup/runtime-documents.ts +174 -0
- package/src/tools/setup/surface-target.ts +50 -0
- package/src/tools/setup/working-repo-cleanup.ts +33 -26
- package/src/tools/setup/working-repo-local-state.ts +21 -1
- package/src/tools/setup.ts +25 -3
- package/wrappers/bin/graphify +57 -8
- package/wrappers/bin/openspec +50 -3
- package/claude-plugin/hooks/artifact-finish-nudge.mjs +0 -8
- package/src/cli/commands/cap/headroom.ts +0 -52
- package/src/cli/commands/workspace/list.ts +0 -25
- package/src/cli/commands/workspace/materialize.ts +0 -46
- package/src/cli/commands/workspace/workspace.ts +0 -22
- package/src/hooks/artifact-finish-nudge.ts +0 -244
- package/src/lib/orchestrator/headroom/proxy.ts +0 -116
- package/src/lib/orchestrator/workspace-materialize.ts +0 -80
- package/src/templates/capabilities/openspec-cap/mate-skills/agents/mate-artifact-finish/SKILL.md +0 -51
- package/src/templates/capabilities/openspec-cap/mate-skills/agents/mate-artifact-finish/references/openspec.md +0 -134
- package/src/templates/capabilities/openspec-cap/mate-skills/claude/mate-artifact-finish/SKILL.md +0 -58
- package/src/templates/capabilities/openspec-cap/mate-skills/claude/mate-artifact-finish/references/openspec.md +0 -139
- package/src/tools/setup/capabilities/headroom.ts +0 -57
- /package/src/cli/commands/{workspace → companion}/open.ts +0 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mate-interview-me
|
|
3
|
+
description: Clarify intent through a focused, one-question-at-a-time conversation before planning.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Mate Interview Me
|
|
8
|
+
|
|
9
|
+
> Inspired by [Addy Osmani's interview-me skill](https://github.com/addyosmani/agent-skills/tree/main/skills/interview-me) and adapted here as a Mate process-driven skill.
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
What people ask for and what they actually want are different things. They ask
|
|
14
|
+
for a "dashboard" because that is what one asks for, not because a dashboard
|
|
15
|
+
solves their problem. They say "make it faster" without a number to hit.
|
|
16
|
+
|
|
17
|
+
The cheapest moment to find this gap is before any plan, spec, or code exists.
|
|
18
|
+
Once implementation has started, switching costs are real and the user may
|
|
19
|
+
rationalize the wrong thing into "good enough." This skill closes the gap before
|
|
20
|
+
it costs anything.
|
|
21
|
+
|
|
22
|
+
## When to Use
|
|
23
|
+
|
|
24
|
+
Apply this skill when:
|
|
25
|
+
|
|
26
|
+
- The ask is missing at least one of: who the user is, why they want it, what
|
|
27
|
+
success looks like, or the binding constraint.
|
|
28
|
+
- The request is conventional rather than specific and cannot be unpacked
|
|
29
|
+
without guessing.
|
|
30
|
+
- You are tempted to start with assumptions that have not been surfaced.
|
|
31
|
+
- The user has not said which value they are optimizing for when reasonable
|
|
32
|
+
values are in tension, such as simplicity versus flexibility.
|
|
33
|
+
- The user explicitly invokes "interview me", "grill me", "are we sure?", or
|
|
34
|
+
"stress-test my thinking".
|
|
35
|
+
|
|
36
|
+
**When NOT to use:**
|
|
37
|
+
|
|
38
|
+
- The ask is unambiguous and self-contained.
|
|
39
|
+
- The user explicitly asked for speed over verification.
|
|
40
|
+
- The request is purely informational.
|
|
41
|
+
- The operation is mechanical, such as a rename, format, or file move.
|
|
42
|
+
- You already have >=95% confidence; reread the stop condition before assuming
|
|
43
|
+
you do not.
|
|
44
|
+
|
|
45
|
+
## Loading Constraints
|
|
46
|
+
|
|
47
|
+
This skill needs a live, responsive user. Do not use it in non-interactive
|
|
48
|
+
contexts such as CI pipelines, scheduled runs, loops, or autonomous runs. If an
|
|
49
|
+
underspecified ask arrives there, report the blocker instead of guessing.
|
|
50
|
+
|
|
51
|
+
## The Process
|
|
52
|
+
|
|
53
|
+
### Step 1: Hypothesize, with a confidence number
|
|
54
|
+
|
|
55
|
+
Before asking anything, write the current best read of what the user wants in one
|
|
56
|
+
sentence, followed by an honest confidence number from 0 to 100 percent. When
|
|
57
|
+
confidence is below 70 percent, state what is missing on the same line.
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
HYPOTHESIS: You want <the underlying outcome>, and <the user's wording> was the convention that came to mind. CONFIDENCE: ~30% - missing: <what is unresolved>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The number forces honesty. If you wrote a high number but cannot predict the
|
|
64
|
+
user's reactions to the next three questions, the number is wrong.
|
|
65
|
+
|
|
66
|
+
### Step 2: Ask one question at a time, each with a guess attached
|
|
67
|
+
|
|
68
|
+
Ask exactly one focused question that would most reduce uncertainty. Attach your
|
|
69
|
+
best guess about the answer and the reasoning behind it:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
CONFIDENCE: <0-100%> (<change since the previous answer>)
|
|
73
|
+
RESOLVED: <what is now clear>
|
|
74
|
+
REMAINING: <what is still uncertain>
|
|
75
|
+
Q: <one focused question> GUESS: <your hypothesis for the answer and why>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Wait for the answer before asking the next question. Never batch questions or
|
|
79
|
+
advance silently. The guess exposes assumptions and lets the user correct them
|
|
80
|
+
quickly.
|
|
81
|
+
|
|
82
|
+
After every answer, update the confidence, resolved points, and remaining
|
|
83
|
+
uncertainty before asking the next question. Keep this progress state visible;
|
|
84
|
+
do not report confidence only at the beginning or end.
|
|
85
|
+
|
|
86
|
+
### Step 3: Listen for "want versus should want"
|
|
87
|
+
|
|
88
|
+
Watch for best-practice talk without specifics, deference to convention, phrases
|
|
89
|
+
such as "I should probably", and buzzwords used as goals instead of outcomes.
|
|
90
|
+
When you hear one, ask:
|
|
91
|
+
|
|
92
|
+
> _"If you did not have to justify this to anyone, what would you actually want?"_
|
|
93
|
+
|
|
94
|
+
### Step 4: Restate intent in the user's own words
|
|
95
|
+
|
|
96
|
+
When confidence is high, write back a concise restatement using the user's
|
|
97
|
+
language and these fields:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
Outcome: <one line>
|
|
101
|
+
User: <one line - who benefits>
|
|
102
|
+
Why now: <one line - what changed>
|
|
103
|
+
Success: <one line - how we know it worked>
|
|
104
|
+
Constraint: <one line - the binding limit>
|
|
105
|
+
Out of scope: <one line - what we are explicitly not doing>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Ask: "Yes, no, or refine?" The out-of-scope line is mandatory; silent disagreement
|
|
109
|
+
about non-goals is a common source of misalignment.
|
|
110
|
+
|
|
111
|
+
### Step 5: Confirm explicitly
|
|
112
|
+
|
|
113
|
+
The gate is an explicit yes. These are not confirmation:
|
|
114
|
+
|
|
115
|
+
- "Whatever you think is best." Ask again with two concrete options.
|
|
116
|
+
- "Sounds good." Ask what the user would refine.
|
|
117
|
+
- "Sure, let us go." Check whether anything was missed.
|
|
118
|
+
- Silence followed by "okay, let us start." Ask whether the user has confirmed
|
|
119
|
+
the restatement.
|
|
120
|
+
|
|
121
|
+
If the user corrects the restatement, fold in the correction and restate it again.
|
|
122
|
+
|
|
123
|
+
### The 95% Confidence Stop
|
|
124
|
+
|
|
125
|
+
Stop only when you can predict the user's reaction to the next three questions.
|
|
126
|
+
This is a checkable condition, not a feeling. If the user names a blocker before
|
|
127
|
+
that point, stop and label the result unresolved rather than calling it confirmed.
|
|
128
|
+
|
|
129
|
+
## Output
|
|
130
|
+
|
|
131
|
+
The deliverable is a confirmed statement of intent: the restatement above plus
|
|
132
|
+
an explicit yes. Specs, plans, and task lists are downstream and do not belong in
|
|
133
|
+
this skill. A blocked session returns its partial intent, blocker, and unresolved
|
|
134
|
+
questions instead.
|
|
135
|
+
|
|
136
|
+
## Mate Boundary
|
|
137
|
+
|
|
138
|
+
This is a conversational-only skill. Do not create or modify code, context files,
|
|
139
|
+
ADRs, OpenSpec artifacts, intent documents, or any other files. Do not claim that
|
|
140
|
+
a file was written, and do not invoke another skill.
|
|
141
|
+
|
|
142
|
+
## Verification
|
|
143
|
+
|
|
144
|
+
Before stopping, check that:
|
|
145
|
+
|
|
146
|
+
- An initial hypothesis and confidence number were stated.
|
|
147
|
+
- Every confidence number below 70 percent included its reason.
|
|
148
|
+
- Confidence, resolved points, and remaining uncertainty were shown before each
|
|
149
|
+
question.
|
|
150
|
+
- Every question was asked one at a time with an attached guess.
|
|
151
|
+
- The want-versus-should-want probe ran when the user gave a convention or
|
|
152
|
+
sophistication-signaling answer.
|
|
153
|
+
- The restatement includes Outcome, User, Why now, Success, Constraint, and Out
|
|
154
|
+
of scope.
|
|
155
|
+
- The user explicitly confirmed the restatement, or the result is clearly marked
|
|
156
|
+
unresolved because of a blocker.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mate-openspec-backfill
|
|
3
|
+
description: Reverse-engineer an OpenSpec spec for one existing feature and emit a ready-to-finish backfill change. Use when the user wants to backfill, document, or spec existing or legacy behavior that has no spec yet.
|
|
4
|
+
allowed-tools: Bash(openspec:*), Bash(mate:*)
|
|
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 OpenSpec Backfill
|
|
13
|
+
|
|
14
|
+
Create a spec for one feature that already exists in the working repository. The run ends with a standard ready-to-finish change — it never edits main specs and never finishes.
|
|
15
|
+
|
|
16
|
+
## Scope rules
|
|
17
|
+
|
|
18
|
+
- **One named feature per run.** Refuse Area-wide or repository-wide sweeps; ask the user to name a single feature and run the skill once per feature.
|
|
19
|
+
- **Interactive by design.** Every ambiguity and every suspected bug becomes a user question. Do not run this skill unattended.
|
|
20
|
+
|
|
21
|
+
## Steps
|
|
22
|
+
|
|
23
|
+
1. **Scope.** Map the named feature to code: entry points, callees, tests. Use whatever exploration tooling this project has enabled (code-graph or index tools when present, otherwise search and targeted reading) — assume no specific capability is installed. Then check `openspec/specs/` for an existing capability covering this domain — prefer extending it (`MODIFIED`/`ADDED` deltas) over minting a new capability id.
|
|
24
|
+
|
|
25
|
+
2. **Sweep.** Extract candidate behaviors and tag each finding:
|
|
26
|
+
- `[test-backed]` — an existing test verifies it (strongest; scenarios translate almost directly from tests)
|
|
27
|
+
- `[code-only]` — observable in code but untested
|
|
28
|
+
- `[inferred]` — assumed intent without direct evidence
|
|
29
|
+
|
|
30
|
+
Every candidate requirement needs at least one citation: a test name or `file:line`. Docs and comments corroborate but never stand alone. `[inferred]` findings are not requirements — they become questions for step 3.
|
|
31
|
+
|
|
32
|
+
3. **Ask.** Batch the open questions to the user:
|
|
33
|
+
- Behavior that looks unintended → the user rules **spec the actual behavior** or **spec the intent** (with a follow-up fix change). Suspected bugs never silently become requirements.
|
|
34
|
+
- `[inferred]` findings → confirm, demote to out-of-scope, or convert to a question the emitted proposal records as open.
|
|
35
|
+
|
|
36
|
+
4. **Emit.** Create the change and build its artifacts in dependency order:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
openspec new change "backfill-spec-<capability>"
|
|
40
|
+
openspec status --change "backfill-spec-<capability>" --json
|
|
41
|
+
openspec instructions <artifact-id> --change "backfill-spec-<capability>" --json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The artifact set comes from the active schema (`schemaName` in the status JSON) — never assume a fixed artifact list. Follow each artifact's returned instructions and template, and state the active schema in the proposal so reviewers know which workflow produced the change. Map the backfill roles onto whatever artifacts the schema defines:
|
|
45
|
+
|
|
46
|
+
| Backfill role | Typical artifact (mate-v1 example) |
|
|
47
|
+
| ---------------------------------------------------------------------------------------------- | ---------------------------------- |
|
|
48
|
+
| Scope decisions and rulings from step 3 | explore-brief.md |
|
|
49
|
+
| "Documents existing behavior, no code changes" + open questions | proposal.md |
|
|
50
|
+
| `ADDED`/`MODIFIED` requirements, behavior only, one citation each | specs/ |
|
|
51
|
+
| As-built evidence dossier: entry points, test inventory, `file:line` citations per requirement | design.md |
|
|
52
|
+
| Verification checklist: one task per requirement, "confirm behavior at <citation>" | tasks.md |
|
|
53
|
+
|
|
54
|
+
The verification task artifact MUST open with this rule, verbatim, so the applying agent sees it without knowing this skill: "These are verification tasks for a docs-only backfill change. If a requirement fails verification, update the delta spec (reword, drop, or re-cite the requirement) — never modify code in this change. A real bug found here becomes a separate fix change."
|
|
55
|
+
|
|
56
|
+
Requirements state observable contracts, never implementation detail ("propagates the child exit code", not "uses spawnSync").
|
|
57
|
+
|
|
58
|
+
5. **Stop.** Report the change as ready-to-finish and hand off:
|
|
59
|
+
- Verify: `openspec-apply-change` works through tasks.md, checking each requirement against the code.
|
|
60
|
+
- Publish: `mate-artifact-publish` applies the deltas to main specs and anchors the change.
|
|
61
|
+
|
|
62
|
+
## Guardrails
|
|
63
|
+
|
|
64
|
+
- Never write files under `openspec/specs/` — main specs change only through finished changes.
|
|
65
|
+
- Never invoke any finish flow (`mate artifact publish`, `openspec archive`); stop at ready-to-finish.
|
|
66
|
+
- Never emit a requirement without a citation, and never spec a suspected bug without the user's ruling.
|
|
67
|
+
- Keep capability ids opaque kebab-case; extend existing capabilities before creating new ones.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mate-show-me
|
|
3
|
+
description: Explain the current topic or the applied change in a browser-rendered Mate report. Use only when the user explicitly invokes the skill to see how something works, what a change did, or wants a diagram, call tree, or rendered diff of the current work.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
allowed-tools: Bash(git:*), Bash(mate:*)
|
|
6
|
+
license: MIT
|
|
7
|
+
compatibility: Requires the mate CLI and the openspec capability enabled.
|
|
8
|
+
metadata:
|
|
9
|
+
author: mate
|
|
10
|
+
version: "1.0"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Mate Show Me
|
|
14
|
+
|
|
15
|
+
> Inspired by [humanlayer's show-me skill](https://github.com/humanlayer/skills/tree/main/plugins/show-me/skills/show-me) and adapted here as a Mate process-driven skill.
|
|
16
|
+
|
|
17
|
+
Explain the current topic visually in a browser-rendered Mate report. Skip the preamble, keep prose brief, and pick the smallest report view that makes the key point clear.
|
|
18
|
+
|
|
19
|
+
## Mate Workflow
|
|
20
|
+
|
|
21
|
+
- Explanation only. Never write or edit source code, tests, documentation, OpenSpec artifacts, context files, or ADRs. The only file this skill produces is the report document handed to `mate report --input`, which the CLI writes into the operating system temporary directory.
|
|
22
|
+
- Draw from the repositories, not from memory. Every diagram and every diff line comes from the inspected repository state, never from recollection of the conversation. Use the available code-graph tools before broad source scans.
|
|
23
|
+
- Code lives in the Working Repository; the Companion Repository holds only artifacts. Run `git diff` in the Working Repository.
|
|
24
|
+
- Never put an absolute local path, home directory, username, machine name, temporary report path, Companion Repository path, or raw path-valued environment variable in the report. Use repository-relative paths or neutral labels such as `Working Repository` and `Companion Repository`.
|
|
25
|
+
- Never commit, push, or create a pull request.
|
|
26
|
+
|
|
27
|
+
## Browser Report Required
|
|
28
|
+
|
|
29
|
+
Always assemble and open a Mate report, even when a small inline sketch would be sufficient. Do not answer with an inline-only visual or paste the complete diagram or diff into the conversation. The final response should briefly state what the browser report shows without repeating its temporary file path.
|
|
30
|
+
|
|
31
|
+
## Report Contents
|
|
32
|
+
|
|
33
|
+
- Show logic or an algorithm as a `diagram` section. Use a `mermaid` payload when branches, stages, or relationships benefit from a rendered visual; reserve `text` for compact pseudocode:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
on(save)
|
|
37
|
+
if content is unchanged
|
|
38
|
+
return cached result
|
|
39
|
+
write new content
|
|
40
|
+
return fresh result
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- Show runtime control flow as a `diagram` section with a `mermaid` payload. Use `flowchart TD` for a call tree or control flow and `sequenceDiagram` when ordering between components matters:
|
|
44
|
+
|
|
45
|
+
```mermaid
|
|
46
|
+
flowchart TD
|
|
47
|
+
renderHTML[renderHTML] --> validate[validateReportDocument]
|
|
48
|
+
renderHTML --> section[renderHTMLSection]
|
|
49
|
+
section --> diagram[renderHTMLDiagram]
|
|
50
|
+
section --> diff[renderHTMLDiff]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
- Show UI structure as a `diagram` section with a `mermaid` payload when showing relationships between components or modules. Use a `text` payload only when exact component syntax is the point, including the state boundaries that matter:
|
|
54
|
+
|
|
55
|
+
```tsx
|
|
56
|
+
<WorkflowView> (studio/views/workflow/index.tsx)
|
|
57
|
+
workflowPlan(availableSkills)
|
|
58
|
+
<StepList>
|
|
59
|
+
<StepRow optional>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- Show file responsibility or a broad refactor as a `diagram` section with a `text` payload containing a shallow file tree:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
src/
|
|
66
|
+
|-- commands/ # parses user actions
|
|
67
|
+
|-- report/ # owns the report contract and renderer
|
|
68
|
+
`-- templates/ # ships assets and skills
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- Show what changes as a `diff` section when the surrounding shape already exists. Match the diff shape to the topic - component tree, file layout, call tree, or control flow:
|
|
72
|
+
|
|
73
|
+
```diff
|
|
74
|
+
on(save)
|
|
75
|
+
- write content
|
|
76
|
+
+ if content is unchanged
|
|
77
|
+
+ return cached result
|
|
78
|
+
+ write new content
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- Show a whole block in the report when most of it is new, when omitted context would hide ownership or order, or when the user needs a copyable target shape.
|
|
82
|
+
|
|
83
|
+
## Browser Delivery
|
|
84
|
+
|
|
85
|
+
The report is mandatory. Prefer `mate report --input <temporary-json-file>` without `--json` so the CLI reads the complete document reliably, writes self-contained HTML, and opens it in the default browser. The CLI also supports `mate report --input -` when JSON is piped to stdin; if stdin delivery reports empty or truncated JSON, switch to a temporary JSON file rather than retrying the same transport. If validation fails, fix the report document and retry; do not fall back to an inline explanation or JSON-only delivery.
|
|
86
|
+
|
|
87
|
+
Never hand-write an HTML file, never start a server, and never open a browser by any other means. `mate report` is the only browser surface.
|
|
88
|
+
|
|
89
|
+
## Assembling The Report
|
|
90
|
+
|
|
91
|
+
Build a JSON document that conforms to the `mate-create-report` contract, then hand it over:
|
|
92
|
+
|
|
93
|
+
1. Serialize the complete document to an OS temporary JSON file outside both repositories. Do not place the report input in the Working Repository or Companion Repository.
|
|
94
|
+
2. Run `mate report --input <temporary-json-file>`.
|
|
95
|
+
|
|
96
|
+
A report assembled by this skill carries:
|
|
97
|
+
|
|
98
|
+
- `metadata` naming the subject and a neutral repository label, never a local path
|
|
99
|
+
- one `diagram` section for the structure or flow at issue, even when the visual is small
|
|
100
|
+
- use a `mermaid` payload for runtime control flow, call trees, data flow, or component relationships; use `text` only when a sketch or pseudocode is clearer
|
|
101
|
+
- one `diff` section carrying the unified diff, when there is something to diff
|
|
102
|
+
- a short `text` section next to each visual, saying what the reader should notice
|
|
103
|
+
|
|
104
|
+
A `diagram` section carries exactly one payload: `mermaid` for diagram source the report draws as a picture, or `text` for a monospace ASCII sketch or pseudocode block. A `diff` section carries a unified `patch` string.
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"id": "structure",
|
|
109
|
+
"title": "Report rendering",
|
|
110
|
+
"type": "diagram",
|
|
111
|
+
"mermaid": "classDiagram\n Renderer --> Highlight : uses"
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"id": "changes",
|
|
118
|
+
"title": "What changed",
|
|
119
|
+
"type": "diff",
|
|
120
|
+
"patch": "diff --git a/src/acme.ts b/src/acme.ts\n..."
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If the document fails contract validation, report the diagnostic and correct the document. Do not fall back to hand-written HTML.
|
|
125
|
+
|
|
126
|
+
## Mermaid Authoring Rules
|
|
127
|
+
|
|
128
|
+
- Use Mermaid whenever the user asks for a diagram or the subject has meaningful control flow, sequencing, lifecycle, or relationships. A `text` payload is a deliberate fallback, not the default for runtime flows.
|
|
129
|
+
- Pick the diagram type that matches the question: `classDiagram` for structure, `sequenceDiagram` for interaction between components, `stateDiagram-v2` for lifecycles, `flowchart TD` for control flow and call trees.
|
|
130
|
+
- Keep labels short enough to read at report width. A label that needs a sentence belongs in the neighbouring `text` section.
|
|
131
|
+
- Do not use ELK-only layouts or math labels. The report inlines the self-contained mermaid bundle, which may not carry those chunks.
|
|
132
|
+
- Pair each Mermaid visual with a short neighbouring `text` section that calls out the ownership boundary or invariant the reader should notice.
|
|
133
|
+
- Prefer the `text` payload for pseudocode, shallow file trees, or cases where a picture would genuinely obscure the point.
|
|
134
|
+
|
|
135
|
+
## Reviewing An Applied Change
|
|
136
|
+
|
|
137
|
+
- Read the change scope before drawing it, then diagram the structure or flow the change establishes - not the structure it replaced.
|
|
138
|
+
- Take the diff from `git diff` in the Working Repository. Keep only repository-relative paths in the patch, default to the working tree, and ask the user when their intent is a committed range instead.
|
|
139
|
+
- When the inspected scope has no changes, say so and omit the `diff` section. Never invent a patch.
|