@uniqbit/mate-core 0.15.4-canary.8 → 0.15.4
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/artifact-finish-nudge.mjs +5 -3
- package/claude-plugin/hooks/session-banner.mjs +5 -3
- package/claude-plugin/hooks/ts-loader.mjs +28 -0
- package/claude-plugin/hooks/validate-artifact-path.mjs +5 -3
- package/package.json +1 -1
- package/src/cli/commands/cap/openspec.ts +20 -1
- package/src/cli/commands/companion/hub.ts +1 -0
- package/src/cli/commands/plugin/install.ts +15 -3
- package/src/hooks/artifact-finish-nudge.ts +35 -3
- package/src/lib/context-mode-package.ts +5 -3
- package/src/lib/orchestrator/adapters/opencode.ts +10 -60
- package/src/lib/orchestrator/companion-git-sync.ts +67 -8
- package/src/lib/orchestrator/companion-hub.ts +28 -6
- package/src/lib/orchestrator/types.ts +2 -2
- package/src/lib/package-paths.ts +1 -0
- package/src/opencode/companion-hooks.ts +33 -12
- package/src/playbooks/companion-guidance.ts +1 -1
- package/src/templates/capabilities/openspec-cap/mate-skills/agents/mate-openspec-backfill/SKILL.md +65 -0
- package/src/templates/capabilities/openspec-cap/mate-v1/schema.yaml +1 -0
- package/src/templates/root/TEMPLATE_AGENTS.md +2 -0
- package/src/templates/root/TEMPLATE_CLAUDE.md +2 -0
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +3612 -0
- package/src/tools/setup/capabilities/context-mode.ts +57 -83
- package/src/tools/setup/capabilities/graphify-shared.ts +27 -0
- package/src/tools/setup/capabilities/graphify.ts +86 -295
- package/src/tools/setup/capabilities/openspec.ts +34 -1
- package/src/tools/setup/capabilities/react-doctor.ts +37 -37
- package/src/tools/setup/capabilities/rtk.ts +4 -1
- package/src/tools/setup/capabilities/tokensave-shared.ts +6 -0
- package/src/tools/setup/capabilities/tokensave.ts +51 -72
- package/src/tools/setup/context-services.ts +29 -0
- package/src/tools/setup/dynamic-plugins/hydrate.ts +15 -1
- package/src/tools/setup/engine.ts +68 -1
- package/src/tools/setup/mate.ts +10 -2
- package/src/tools/setup/plugin.ts +105 -0
- package/src/tools/setup/plugins/gitignore.ts +7 -4
- package/src/tools/setup/plugins/guidance.ts +1 -1
- package/src/tools/setup/providers/agent-file-sections.ts +78 -0
- package/src/tools/setup/providers/claude-format.ts +159 -0
- package/src/tools/setup/providers/claude.ts +281 -227
- package/src/tools/setup/providers/opencode-format.ts +146 -0
- package/src/tools/setup/providers/opencode.ts +209 -60
- package/src/tools/setup/providers/skill-tree.ts +38 -0
- package/src/tools/setup.ts +7 -56
|
@@ -0,0 +1,3612 @@
|
|
|
1
|
+
// Bun Snapshot v1, https://bun.sh/docs/test/snapshots
|
|
2
|
+
|
|
3
|
+
exports[`runtime surface golden fixtures setup graphify × claude 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"agentsMd":
|
|
6
|
+
"<!-- MATE:COMPANION:START -->
|
|
7
|
+
|
|
8
|
+
You are operating in a Mate-managed session.
|
|
9
|
+
|
|
10
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
11
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
12
|
+
|
|
13
|
+
## Agent Notes
|
|
14
|
+
|
|
15
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
16
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
17
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
18
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
19
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
20
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
21
|
+
|
|
22
|
+
<!-- MATE:COMPANION:END -->
|
|
23
|
+
"
|
|
24
|
+
,
|
|
25
|
+
"claudeHooks": {},
|
|
26
|
+
"claudeMcpConfig": {
|
|
27
|
+
"mcpServers": {},
|
|
28
|
+
},
|
|
29
|
+
"claudeMd":
|
|
30
|
+
"<!-- MATE:COMPANION:START -->
|
|
31
|
+
|
|
32
|
+
You are operating in a Mate-managed session.
|
|
33
|
+
|
|
34
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
35
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
36
|
+
|
|
37
|
+
## Claude Notes
|
|
38
|
+
|
|
39
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
40
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
41
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
42
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
43
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
44
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
45
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
46
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
47
|
+
|
|
48
|
+
<!-- MATE:COMPANION:END -->
|
|
49
|
+
"
|
|
50
|
+
,
|
|
51
|
+
"claudeSettingsLocal": {
|
|
52
|
+
"autoMemoryEnabled": false,
|
|
53
|
+
"hooks": {
|
|
54
|
+
"PreToolUse": [
|
|
55
|
+
{
|
|
56
|
+
"hooks": [
|
|
57
|
+
{
|
|
58
|
+
"command": "<root>/companion/.claude/hooks/graphify-guard.sh",
|
|
59
|
+
"type": "command",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
"matcher": "Bash",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
"permissions": {
|
|
67
|
+
"allow": [
|
|
68
|
+
"Bash(<wrapper-bin>/graphify:*)",
|
|
69
|
+
"Bash(graphify:*)",
|
|
70
|
+
"Bash(mate cap graphify:*)",
|
|
71
|
+
"Bash(mate:*)",
|
|
72
|
+
"Edit(<root>/companion/**)",
|
|
73
|
+
"Read(<root>/companion/**)",
|
|
74
|
+
"Skill(graphify)",
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
"claudeSkills": {
|
|
79
|
+
"graphify/SKILL.md":
|
|
80
|
+
"---
|
|
81
|
+
description: builds graphify-out artifacts
|
|
82
|
+
---
|
|
83
|
+
Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
84
|
+
"
|
|
85
|
+
,
|
|
86
|
+
"graphify/references/github-and-merge.md":
|
|
87
|
+
"Merge graphs into graphify-out of each clone.
|
|
88
|
+
"
|
|
89
|
+
,
|
|
90
|
+
"graphify/references/usage.md":
|
|
91
|
+
"Outputs land in $GRAPHIFY_OUT by default.
|
|
92
|
+
"
|
|
93
|
+
,
|
|
94
|
+
},
|
|
95
|
+
"opencodeConfig": null,
|
|
96
|
+
"opencodePlugins": {},
|
|
97
|
+
"opencodeSkills": {},
|
|
98
|
+
"opencodeTui": null,
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
101
|
+
|
|
102
|
+
exports[`runtime surface golden fixtures setup graphify × claude 2`] = `
|
|
103
|
+
{
|
|
104
|
+
"claudeArgs": [
|
|
105
|
+
"--add-dir",
|
|
106
|
+
"<root>/companion",
|
|
107
|
+
"--append-system-prompt",
|
|
108
|
+
|
|
109
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
110
|
+
|
|
111
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
112
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
113
|
+
<context>
|
|
114
|
+
<paths>
|
|
115
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
116
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
117
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
118
|
+
</paths>
|
|
119
|
+
<cli-tools>
|
|
120
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
121
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
122
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
123
|
+
</cli-tools>
|
|
124
|
+
<linked-repository id="app" />
|
|
125
|
+
</context>
|
|
126
|
+
<mandatory-rules>
|
|
127
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
128
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
129
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
130
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
131
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
132
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
133
|
+
</mandatory-rules>
|
|
134
|
+
</companion-policy>
|
|
135
|
+
|
|
136
|
+
<codebase-exploration-rules priority="mandatory">
|
|
137
|
+
<path role="graphify-out">$MATE_ARTIFACT_PATH/.graphify/$MATE_REPO_ID/graphify-out/</path>
|
|
138
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
139
|
+
<order>graphify -> grep/glob/read. MUST try graphify before raw source.
|
|
140
|
+
1. graphify query "<question>" first.
|
|
141
|
+
2. Use graphify path "<A>" "<B>" or graphify explain "<concept>" to deepen.
|
|
142
|
+
3. Use grep/glob/read only after graphify was tried.</order>
|
|
143
|
+
<notes>Dirty graph files are expected. Use wiki/index.md for broad navigation; GRAPH_REPORT.md only if query/path/explain fall short.</notes>
|
|
144
|
+
<post-edit>After code changes, run mate cap index --graphify.</post-edit>
|
|
145
|
+
</codebase-exploration-rules>"
|
|
146
|
+
,
|
|
147
|
+
"--setting-sources",
|
|
148
|
+
"user,project,local",
|
|
149
|
+
"--settings",
|
|
150
|
+
"<root>/companion/.claude/settings.local.json",
|
|
151
|
+
"--mcp-config",
|
|
152
|
+
"<root>/companion/.mcp.json",
|
|
153
|
+
"--plugin-dir",
|
|
154
|
+
"<claude-plugin>",
|
|
155
|
+
],
|
|
156
|
+
"claudeEnv": {
|
|
157
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
158
|
+
},
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
|
|
162
|
+
exports[`runtime surface golden fixtures setup graphify × opencode 1`] = `
|
|
163
|
+
{
|
|
164
|
+
"agentsMd":
|
|
165
|
+
"<!-- MATE:COMPANION:START -->
|
|
166
|
+
|
|
167
|
+
You are operating in a Mate-managed session.
|
|
168
|
+
|
|
169
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
170
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
171
|
+
|
|
172
|
+
## Agent Notes
|
|
173
|
+
|
|
174
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
175
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
176
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
177
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
178
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
179
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
180
|
+
|
|
181
|
+
<!-- MATE:COMPANION:END -->
|
|
182
|
+
"
|
|
183
|
+
,
|
|
184
|
+
"claudeHooks": {},
|
|
185
|
+
"claudeMcpConfig": null,
|
|
186
|
+
"claudeMd": null,
|
|
187
|
+
"claudeSettingsLocal": null,
|
|
188
|
+
"claudeSkills": {},
|
|
189
|
+
"opencodeConfig": {
|
|
190
|
+
"$schema": "https://opencode.ai/config.json",
|
|
191
|
+
"compaction": {
|
|
192
|
+
"auto": true,
|
|
193
|
+
"prune": true,
|
|
194
|
+
"reserved": 15000,
|
|
195
|
+
},
|
|
196
|
+
"plugin": [
|
|
197
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
198
|
+
],
|
|
199
|
+
"references": {
|
|
200
|
+
"mate": "..",
|
|
201
|
+
},
|
|
202
|
+
"tool_output": {
|
|
203
|
+
"max_bytes": 20000,
|
|
204
|
+
"max_lines": 500,
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
"opencodePlugins": {
|
|
208
|
+
"graphify.js":
|
|
209
|
+
"export default {}
|
|
210
|
+
"
|
|
211
|
+
,
|
|
212
|
+
},
|
|
213
|
+
"opencodeSkills": {
|
|
214
|
+
"graphify/SKILL.md":
|
|
215
|
+
"---
|
|
216
|
+
description: builds graphify-out artifacts
|
|
217
|
+
---
|
|
218
|
+
Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
219
|
+
"
|
|
220
|
+
,
|
|
221
|
+
"graphify/references/github-and-merge.md":
|
|
222
|
+
"Merge graphs into graphify-out of each clone.
|
|
223
|
+
"
|
|
224
|
+
,
|
|
225
|
+
"graphify/references/usage.md":
|
|
226
|
+
"Outputs land in $GRAPHIFY_OUT by default.
|
|
227
|
+
"
|
|
228
|
+
,
|
|
229
|
+
},
|
|
230
|
+
"opencodeTui": {
|
|
231
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
232
|
+
"plugin": [
|
|
233
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
}
|
|
237
|
+
`;
|
|
238
|
+
|
|
239
|
+
exports[`runtime surface golden fixtures setup graphify × opencode 2`] = `
|
|
240
|
+
{
|
|
241
|
+
"opencodeArgs": [
|
|
242
|
+
"<root>/working",
|
|
243
|
+
],
|
|
244
|
+
"opencodeEnv": {
|
|
245
|
+
"MATE_GUIDANCE_JSON": {
|
|
246
|
+
"codebaseExplorationGuidance":
|
|
247
|
+
"<codebase-exploration-rules priority="mandatory">
|
|
248
|
+
<path role="graphify-out">$MATE_ARTIFACT_PATH/.graphify/$MATE_REPO_ID/graphify-out/</path>
|
|
249
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
250
|
+
<order>graphify -> grep/glob/read. MUST try graphify before raw source.
|
|
251
|
+
1. graphify query "<question>" first.
|
|
252
|
+
2. Use graphify path "<A>" "<B>" or graphify explain "<concept>" to deepen.
|
|
253
|
+
3. Use grep/glob/read only after graphify was tried.</order>
|
|
254
|
+
<notes>Dirty graph files are expected. Use wiki/index.md for broad navigation; GRAPH_REPORT.md only if query/path/explain fall short.</notes>
|
|
255
|
+
<post-edit>After code changes, run mate cap index --graphify.</post-edit>
|
|
256
|
+
</codebase-exploration-rules>"
|
|
257
|
+
,
|
|
258
|
+
"companionGuidance":
|
|
259
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
260
|
+
|
|
261
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
262
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
263
|
+
<context>
|
|
264
|
+
<paths>
|
|
265
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
266
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
267
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
268
|
+
</paths>
|
|
269
|
+
<cli-tools>
|
|
270
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
271
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
272
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
273
|
+
</cli-tools>
|
|
274
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
275
|
+
</context>
|
|
276
|
+
<mandatory-rules>
|
|
277
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
278
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
279
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
280
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
281
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
282
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
283
|
+
</mandatory-rules>
|
|
284
|
+
</companion-policy>"
|
|
285
|
+
,
|
|
286
|
+
"errors": [],
|
|
287
|
+
"version": 1,
|
|
288
|
+
},
|
|
289
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
290
|
+
"permission": {
|
|
291
|
+
"external_directory": {
|
|
292
|
+
"<root>/companion": "allow",
|
|
293
|
+
"<root>/companion/**": "allow",
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
"references": {
|
|
297
|
+
"mate": "<root>/companion",
|
|
298
|
+
},
|
|
299
|
+
"skills": {
|
|
300
|
+
"paths": [
|
|
301
|
+
"<root>/companion/.agents/skills",
|
|
302
|
+
],
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
306
|
+
},
|
|
307
|
+
}
|
|
308
|
+
`;
|
|
309
|
+
|
|
310
|
+
exports[`runtime surface golden fixtures setup graphify × claude+opencode 1`] = `
|
|
311
|
+
{
|
|
312
|
+
"agentsMd":
|
|
313
|
+
"<!-- MATE:COMPANION:START -->
|
|
314
|
+
|
|
315
|
+
You are operating in a Mate-managed session.
|
|
316
|
+
|
|
317
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
318
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
319
|
+
|
|
320
|
+
## Agent Notes
|
|
321
|
+
|
|
322
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
323
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
324
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
325
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
326
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
327
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
328
|
+
|
|
329
|
+
<!-- MATE:COMPANION:END -->
|
|
330
|
+
"
|
|
331
|
+
,
|
|
332
|
+
"claudeHooks": {},
|
|
333
|
+
"claudeMcpConfig": {
|
|
334
|
+
"mcpServers": {},
|
|
335
|
+
},
|
|
336
|
+
"claudeMd":
|
|
337
|
+
"<!-- MATE:COMPANION:START -->
|
|
338
|
+
|
|
339
|
+
You are operating in a Mate-managed session.
|
|
340
|
+
|
|
341
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
342
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
343
|
+
|
|
344
|
+
## Claude Notes
|
|
345
|
+
|
|
346
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
347
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
348
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
349
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
350
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
351
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
352
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
353
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
354
|
+
|
|
355
|
+
<!-- MATE:COMPANION:END -->
|
|
356
|
+
"
|
|
357
|
+
,
|
|
358
|
+
"claudeSettingsLocal": {
|
|
359
|
+
"autoMemoryEnabled": false,
|
|
360
|
+
"hooks": {
|
|
361
|
+
"PreToolUse": [
|
|
362
|
+
{
|
|
363
|
+
"hooks": [
|
|
364
|
+
{
|
|
365
|
+
"command": "<root>/companion/.claude/hooks/graphify-guard.sh",
|
|
366
|
+
"type": "command",
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
"matcher": "Bash",
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
},
|
|
373
|
+
"permissions": {
|
|
374
|
+
"allow": [
|
|
375
|
+
"Bash(<wrapper-bin>/graphify:*)",
|
|
376
|
+
"Bash(graphify:*)",
|
|
377
|
+
"Bash(mate cap graphify:*)",
|
|
378
|
+
"Bash(mate:*)",
|
|
379
|
+
"Edit(<root>/companion/**)",
|
|
380
|
+
"Read(<root>/companion/**)",
|
|
381
|
+
"Skill(graphify)",
|
|
382
|
+
],
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
"claudeSkills": {
|
|
386
|
+
"graphify/SKILL.md":
|
|
387
|
+
"---
|
|
388
|
+
description: builds graphify-out artifacts
|
|
389
|
+
---
|
|
390
|
+
Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
391
|
+
"
|
|
392
|
+
,
|
|
393
|
+
"graphify/references/github-and-merge.md":
|
|
394
|
+
"Merge graphs into graphify-out of each clone.
|
|
395
|
+
"
|
|
396
|
+
,
|
|
397
|
+
"graphify/references/usage.md":
|
|
398
|
+
"Outputs land in $GRAPHIFY_OUT by default.
|
|
399
|
+
"
|
|
400
|
+
,
|
|
401
|
+
},
|
|
402
|
+
"opencodeConfig": {
|
|
403
|
+
"$schema": "https://opencode.ai/config.json",
|
|
404
|
+
"compaction": {
|
|
405
|
+
"auto": true,
|
|
406
|
+
"prune": true,
|
|
407
|
+
"reserved": 15000,
|
|
408
|
+
},
|
|
409
|
+
"plugin": [
|
|
410
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
411
|
+
],
|
|
412
|
+
"references": {
|
|
413
|
+
"mate": "..",
|
|
414
|
+
},
|
|
415
|
+
"tool_output": {
|
|
416
|
+
"max_bytes": 20000,
|
|
417
|
+
"max_lines": 500,
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
"opencodePlugins": {
|
|
421
|
+
"graphify.js":
|
|
422
|
+
"export default {}
|
|
423
|
+
"
|
|
424
|
+
,
|
|
425
|
+
},
|
|
426
|
+
"opencodeSkills": {
|
|
427
|
+
"graphify/SKILL.md":
|
|
428
|
+
"---
|
|
429
|
+
description: builds graphify-out artifacts
|
|
430
|
+
---
|
|
431
|
+
Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
432
|
+
"
|
|
433
|
+
,
|
|
434
|
+
"graphify/references/github-and-merge.md":
|
|
435
|
+
"Merge graphs into graphify-out of each clone.
|
|
436
|
+
"
|
|
437
|
+
,
|
|
438
|
+
"graphify/references/usage.md":
|
|
439
|
+
"Outputs land in $GRAPHIFY_OUT by default.
|
|
440
|
+
"
|
|
441
|
+
,
|
|
442
|
+
},
|
|
443
|
+
"opencodeTui": {
|
|
444
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
445
|
+
"plugin": [
|
|
446
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
447
|
+
],
|
|
448
|
+
},
|
|
449
|
+
}
|
|
450
|
+
`;
|
|
451
|
+
|
|
452
|
+
exports[`runtime surface golden fixtures setup graphify × claude+opencode 2`] = `
|
|
453
|
+
{
|
|
454
|
+
"claudeArgs": [
|
|
455
|
+
"--add-dir",
|
|
456
|
+
"<root>/companion",
|
|
457
|
+
"--append-system-prompt",
|
|
458
|
+
|
|
459
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
460
|
+
|
|
461
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
462
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
463
|
+
<context>
|
|
464
|
+
<paths>
|
|
465
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
466
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
467
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
468
|
+
</paths>
|
|
469
|
+
<cli-tools>
|
|
470
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
471
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
472
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
473
|
+
</cli-tools>
|
|
474
|
+
<linked-repository id="app" />
|
|
475
|
+
</context>
|
|
476
|
+
<mandatory-rules>
|
|
477
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
478
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
479
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
480
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
481
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
482
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
483
|
+
</mandatory-rules>
|
|
484
|
+
</companion-policy>
|
|
485
|
+
|
|
486
|
+
<codebase-exploration-rules priority="mandatory">
|
|
487
|
+
<path role="graphify-out">$MATE_ARTIFACT_PATH/.graphify/$MATE_REPO_ID/graphify-out/</path>
|
|
488
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
489
|
+
<order>graphify -> grep/glob/read. MUST try graphify before raw source.
|
|
490
|
+
1. graphify query "<question>" first.
|
|
491
|
+
2. Use graphify path "<A>" "<B>" or graphify explain "<concept>" to deepen.
|
|
492
|
+
3. Use grep/glob/read only after graphify was tried.</order>
|
|
493
|
+
<notes>Dirty graph files are expected. Use wiki/index.md for broad navigation; GRAPH_REPORT.md only if query/path/explain fall short.</notes>
|
|
494
|
+
<post-edit>After code changes, run mate cap index --graphify.</post-edit>
|
|
495
|
+
</codebase-exploration-rules>"
|
|
496
|
+
,
|
|
497
|
+
"--setting-sources",
|
|
498
|
+
"user,project,local",
|
|
499
|
+
"--settings",
|
|
500
|
+
"<root>/companion/.claude/settings.local.json",
|
|
501
|
+
"--mcp-config",
|
|
502
|
+
"<root>/companion/.mcp.json",
|
|
503
|
+
"--plugin-dir",
|
|
504
|
+
"<claude-plugin>",
|
|
505
|
+
],
|
|
506
|
+
"claudeEnv": {
|
|
507
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
508
|
+
},
|
|
509
|
+
"opencodeArgs": [
|
|
510
|
+
"<root>/working",
|
|
511
|
+
],
|
|
512
|
+
"opencodeEnv": {
|
|
513
|
+
"MATE_GUIDANCE_JSON": {
|
|
514
|
+
"codebaseExplorationGuidance":
|
|
515
|
+
"<codebase-exploration-rules priority="mandatory">
|
|
516
|
+
<path role="graphify-out">$MATE_ARTIFACT_PATH/.graphify/$MATE_REPO_ID/graphify-out/</path>
|
|
517
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
518
|
+
<order>graphify -> grep/glob/read. MUST try graphify before raw source.
|
|
519
|
+
1. graphify query "<question>" first.
|
|
520
|
+
2. Use graphify path "<A>" "<B>" or graphify explain "<concept>" to deepen.
|
|
521
|
+
3. Use grep/glob/read only after graphify was tried.</order>
|
|
522
|
+
<notes>Dirty graph files are expected. Use wiki/index.md for broad navigation; GRAPH_REPORT.md only if query/path/explain fall short.</notes>
|
|
523
|
+
<post-edit>After code changes, run mate cap index --graphify.</post-edit>
|
|
524
|
+
</codebase-exploration-rules>"
|
|
525
|
+
,
|
|
526
|
+
"companionGuidance":
|
|
527
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
528
|
+
|
|
529
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
530
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
531
|
+
<context>
|
|
532
|
+
<paths>
|
|
533
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
534
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
535
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
536
|
+
</paths>
|
|
537
|
+
<cli-tools>
|
|
538
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
539
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
540
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
541
|
+
</cli-tools>
|
|
542
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
543
|
+
</context>
|
|
544
|
+
<mandatory-rules>
|
|
545
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
546
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
547
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
548
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
549
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
550
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
551
|
+
</mandatory-rules>
|
|
552
|
+
</companion-policy>"
|
|
553
|
+
,
|
|
554
|
+
"errors": [],
|
|
555
|
+
"version": 1,
|
|
556
|
+
},
|
|
557
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
558
|
+
"permission": {
|
|
559
|
+
"external_directory": {
|
|
560
|
+
"<root>/companion": "allow",
|
|
561
|
+
"<root>/companion/**": "allow",
|
|
562
|
+
},
|
|
563
|
+
},
|
|
564
|
+
"references": {
|
|
565
|
+
"mate": "<root>/companion",
|
|
566
|
+
},
|
|
567
|
+
"skills": {
|
|
568
|
+
"paths": [
|
|
569
|
+
"<root>/companion/.agents/skills",
|
|
570
|
+
],
|
|
571
|
+
},
|
|
572
|
+
},
|
|
573
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
574
|
+
},
|
|
575
|
+
}
|
|
576
|
+
`;
|
|
577
|
+
|
|
578
|
+
exports[`runtime surface golden fixtures setup tokensave × claude 1`] = `
|
|
579
|
+
{
|
|
580
|
+
"agentsMd":
|
|
581
|
+
"<!-- MATE:COMPANION:START -->
|
|
582
|
+
|
|
583
|
+
You are operating in a Mate-managed session.
|
|
584
|
+
|
|
585
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
586
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
587
|
+
|
|
588
|
+
## Agent Notes
|
|
589
|
+
|
|
590
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
591
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
592
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
593
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
594
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
595
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
596
|
+
|
|
597
|
+
<!-- MATE:COMPANION:END -->
|
|
598
|
+
"
|
|
599
|
+
,
|
|
600
|
+
"claudeHooks": {},
|
|
601
|
+
"claudeMcpConfig": {
|
|
602
|
+
"mcpServers": {
|
|
603
|
+
"tokensave": {
|
|
604
|
+
"args": [
|
|
605
|
+
"serve",
|
|
606
|
+
],
|
|
607
|
+
"command": "tokensave",
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
"claudeMd":
|
|
612
|
+
"<!-- MATE:COMPANION:START -->
|
|
613
|
+
|
|
614
|
+
You are operating in a Mate-managed session.
|
|
615
|
+
|
|
616
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
617
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
618
|
+
|
|
619
|
+
## Claude Notes
|
|
620
|
+
|
|
621
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
622
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
623
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
624
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
625
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
626
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
627
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
628
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
629
|
+
|
|
630
|
+
<!-- MATE:COMPANION:END -->
|
|
631
|
+
"
|
|
632
|
+
,
|
|
633
|
+
"claudeSettingsLocal": {
|
|
634
|
+
"autoMemoryEnabled": false,
|
|
635
|
+
"hooks": {
|
|
636
|
+
"PreToolUse": [
|
|
637
|
+
{
|
|
638
|
+
"hooks": [
|
|
639
|
+
{
|
|
640
|
+
"args": [
|
|
641
|
+
"hook-pre-tool-use",
|
|
642
|
+
],
|
|
643
|
+
"command": "<root>/bin/tokensave",
|
|
644
|
+
"type": "command",
|
|
645
|
+
},
|
|
646
|
+
],
|
|
647
|
+
"matcher": "Agent|Grep|Bash",
|
|
648
|
+
},
|
|
649
|
+
],
|
|
650
|
+
"Stop": [
|
|
651
|
+
{
|
|
652
|
+
"hooks": [
|
|
653
|
+
{
|
|
654
|
+
"args": [
|
|
655
|
+
"hook-stop",
|
|
656
|
+
],
|
|
657
|
+
"command": "<root>/bin/tokensave",
|
|
658
|
+
"type": "command",
|
|
659
|
+
},
|
|
660
|
+
],
|
|
661
|
+
},
|
|
662
|
+
],
|
|
663
|
+
"UserPromptSubmit": [
|
|
664
|
+
{
|
|
665
|
+
"hooks": [
|
|
666
|
+
{
|
|
667
|
+
"args": [
|
|
668
|
+
"hook-prompt-submit",
|
|
669
|
+
],
|
|
670
|
+
"command": "<root>/bin/tokensave",
|
|
671
|
+
"type": "command",
|
|
672
|
+
},
|
|
673
|
+
],
|
|
674
|
+
},
|
|
675
|
+
],
|
|
676
|
+
},
|
|
677
|
+
"permissions": {
|
|
678
|
+
"allow": [
|
|
679
|
+
"Bash(mate:*)",
|
|
680
|
+
"Edit(<root>/companion/**)",
|
|
681
|
+
"Read(<root>/companion/**)",
|
|
682
|
+
"mcp__tokensave__*",
|
|
683
|
+
],
|
|
684
|
+
},
|
|
685
|
+
},
|
|
686
|
+
"claudeSkills": {},
|
|
687
|
+
"opencodeConfig": null,
|
|
688
|
+
"opencodePlugins": {},
|
|
689
|
+
"opencodeSkills": {},
|
|
690
|
+
"opencodeTui": null,
|
|
691
|
+
}
|
|
692
|
+
`;
|
|
693
|
+
|
|
694
|
+
exports[`runtime surface golden fixtures setup tokensave × claude 2`] = `
|
|
695
|
+
{
|
|
696
|
+
"claudeArgs": [
|
|
697
|
+
"--add-dir",
|
|
698
|
+
"<root>/companion",
|
|
699
|
+
"--append-system-prompt",
|
|
700
|
+
|
|
701
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
702
|
+
|
|
703
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
704
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
705
|
+
<context>
|
|
706
|
+
<paths>
|
|
707
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
708
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
709
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
710
|
+
</paths>
|
|
711
|
+
<cli-tools>
|
|
712
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
713
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
714
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
715
|
+
</cli-tools>
|
|
716
|
+
<linked-repository id="app" />
|
|
717
|
+
</context>
|
|
718
|
+
<mandatory-rules>
|
|
719
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
720
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
721
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
722
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
723
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
724
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
725
|
+
</mandatory-rules>
|
|
726
|
+
</companion-policy>
|
|
727
|
+
|
|
728
|
+
<codebase-exploration-rules priority="mandatory">
|
|
729
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
730
|
+
<order>tokensave -> grep/glob/read. MUST try tokensave before raw source.
|
|
731
|
+
1. tokensave_context first.
|
|
732
|
+
2. Use grep/glob/read only after tokensave is empty or irrelevant.</order>
|
|
733
|
+
<post-edit>After code changes, run mate cap index --tokensave.</post-edit>
|
|
734
|
+
</codebase-exploration-rules>"
|
|
735
|
+
,
|
|
736
|
+
"--setting-sources",
|
|
737
|
+
"user,project,local",
|
|
738
|
+
"--settings",
|
|
739
|
+
"<root>/companion/.claude/settings.local.json",
|
|
740
|
+
"--mcp-config",
|
|
741
|
+
"<root>/companion/.mcp.json",
|
|
742
|
+
"--plugin-dir",
|
|
743
|
+
"<claude-plugin>",
|
|
744
|
+
],
|
|
745
|
+
"claudeEnv": {
|
|
746
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
747
|
+
},
|
|
748
|
+
}
|
|
749
|
+
`;
|
|
750
|
+
|
|
751
|
+
exports[`runtime surface golden fixtures setup tokensave × opencode 1`] = `
|
|
752
|
+
{
|
|
753
|
+
"agentsMd":
|
|
754
|
+
"<!-- MATE:COMPANION:START -->
|
|
755
|
+
|
|
756
|
+
You are operating in a Mate-managed session.
|
|
757
|
+
|
|
758
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
759
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
760
|
+
|
|
761
|
+
## Agent Notes
|
|
762
|
+
|
|
763
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
764
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
765
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
766
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
767
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
768
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
769
|
+
|
|
770
|
+
<!-- MATE:COMPANION:END -->
|
|
771
|
+
"
|
|
772
|
+
,
|
|
773
|
+
"claudeHooks": {},
|
|
774
|
+
"claudeMcpConfig": null,
|
|
775
|
+
"claudeMd": null,
|
|
776
|
+
"claudeSettingsLocal": null,
|
|
777
|
+
"claudeSkills": {},
|
|
778
|
+
"opencodeConfig": {
|
|
779
|
+
"$schema": "https://opencode.ai/config.json",
|
|
780
|
+
"compaction": {
|
|
781
|
+
"auto": true,
|
|
782
|
+
"prune": true,
|
|
783
|
+
"reserved": 15000,
|
|
784
|
+
},
|
|
785
|
+
"mcp": {
|
|
786
|
+
"tokensave": {
|
|
787
|
+
"command": [
|
|
788
|
+
"tokensave",
|
|
789
|
+
"serve",
|
|
790
|
+
],
|
|
791
|
+
"enabled": true,
|
|
792
|
+
"type": "local",
|
|
793
|
+
},
|
|
794
|
+
},
|
|
795
|
+
"plugin": [
|
|
796
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
797
|
+
],
|
|
798
|
+
"references": {
|
|
799
|
+
"mate": "..",
|
|
800
|
+
},
|
|
801
|
+
"tool_output": {
|
|
802
|
+
"max_bytes": 20000,
|
|
803
|
+
"max_lines": 500,
|
|
804
|
+
},
|
|
805
|
+
},
|
|
806
|
+
"opencodePlugins": {},
|
|
807
|
+
"opencodeSkills": {},
|
|
808
|
+
"opencodeTui": {
|
|
809
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
810
|
+
"plugin": [
|
|
811
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
812
|
+
],
|
|
813
|
+
},
|
|
814
|
+
}
|
|
815
|
+
`;
|
|
816
|
+
|
|
817
|
+
exports[`runtime surface golden fixtures setup tokensave × opencode 2`] = `
|
|
818
|
+
{
|
|
819
|
+
"opencodeArgs": [
|
|
820
|
+
"<root>/working",
|
|
821
|
+
],
|
|
822
|
+
"opencodeEnv": {
|
|
823
|
+
"MATE_GUIDANCE_JSON": {
|
|
824
|
+
"codebaseExplorationGuidance":
|
|
825
|
+
"<codebase-exploration-rules priority="mandatory">
|
|
826
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
827
|
+
<order>tokensave -> grep/glob/read. MUST try tokensave before raw source.
|
|
828
|
+
1. tokensave_context first.
|
|
829
|
+
2. Use grep/glob/read only after tokensave is empty or irrelevant.</order>
|
|
830
|
+
<post-edit>After code changes, run mate cap index --tokensave.</post-edit>
|
|
831
|
+
</codebase-exploration-rules>"
|
|
832
|
+
,
|
|
833
|
+
"companionGuidance":
|
|
834
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
835
|
+
|
|
836
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
837
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
838
|
+
<context>
|
|
839
|
+
<paths>
|
|
840
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
841
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
842
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
843
|
+
</paths>
|
|
844
|
+
<cli-tools>
|
|
845
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
846
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
847
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
848
|
+
</cli-tools>
|
|
849
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
850
|
+
</context>
|
|
851
|
+
<mandatory-rules>
|
|
852
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
853
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
854
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
855
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
856
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
857
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
858
|
+
</mandatory-rules>
|
|
859
|
+
</companion-policy>"
|
|
860
|
+
,
|
|
861
|
+
"errors": [],
|
|
862
|
+
"version": 1,
|
|
863
|
+
},
|
|
864
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
865
|
+
"permission": {
|
|
866
|
+
"external_directory": {
|
|
867
|
+
"<root>/companion": "allow",
|
|
868
|
+
"<root>/companion/**": "allow",
|
|
869
|
+
},
|
|
870
|
+
},
|
|
871
|
+
"references": {
|
|
872
|
+
"mate": "<root>/companion",
|
|
873
|
+
},
|
|
874
|
+
"skills": {
|
|
875
|
+
"paths": [
|
|
876
|
+
"<root>/companion/.agents/skills",
|
|
877
|
+
],
|
|
878
|
+
},
|
|
879
|
+
},
|
|
880
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
881
|
+
},
|
|
882
|
+
}
|
|
883
|
+
`;
|
|
884
|
+
|
|
885
|
+
exports[`runtime surface golden fixtures setup tokensave × claude+opencode 1`] = `
|
|
886
|
+
{
|
|
887
|
+
"agentsMd":
|
|
888
|
+
"<!-- MATE:COMPANION:START -->
|
|
889
|
+
|
|
890
|
+
You are operating in a Mate-managed session.
|
|
891
|
+
|
|
892
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
893
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
894
|
+
|
|
895
|
+
## Agent Notes
|
|
896
|
+
|
|
897
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
898
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
899
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
900
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
901
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
902
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
903
|
+
|
|
904
|
+
<!-- MATE:COMPANION:END -->
|
|
905
|
+
"
|
|
906
|
+
,
|
|
907
|
+
"claudeHooks": {},
|
|
908
|
+
"claudeMcpConfig": {
|
|
909
|
+
"mcpServers": {
|
|
910
|
+
"tokensave": {
|
|
911
|
+
"args": [
|
|
912
|
+
"serve",
|
|
913
|
+
],
|
|
914
|
+
"command": "tokensave",
|
|
915
|
+
},
|
|
916
|
+
},
|
|
917
|
+
},
|
|
918
|
+
"claudeMd":
|
|
919
|
+
"<!-- MATE:COMPANION:START -->
|
|
920
|
+
|
|
921
|
+
You are operating in a Mate-managed session.
|
|
922
|
+
|
|
923
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
924
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
925
|
+
|
|
926
|
+
## Claude Notes
|
|
927
|
+
|
|
928
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
929
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
930
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
931
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
932
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
933
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
934
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
935
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
936
|
+
|
|
937
|
+
<!-- MATE:COMPANION:END -->
|
|
938
|
+
"
|
|
939
|
+
,
|
|
940
|
+
"claudeSettingsLocal": {
|
|
941
|
+
"autoMemoryEnabled": false,
|
|
942
|
+
"hooks": {
|
|
943
|
+
"PreToolUse": [
|
|
944
|
+
{
|
|
945
|
+
"hooks": [
|
|
946
|
+
{
|
|
947
|
+
"args": [
|
|
948
|
+
"hook-pre-tool-use",
|
|
949
|
+
],
|
|
950
|
+
"command": "<root>/bin/tokensave",
|
|
951
|
+
"type": "command",
|
|
952
|
+
},
|
|
953
|
+
],
|
|
954
|
+
"matcher": "Agent|Grep|Bash",
|
|
955
|
+
},
|
|
956
|
+
],
|
|
957
|
+
"Stop": [
|
|
958
|
+
{
|
|
959
|
+
"hooks": [
|
|
960
|
+
{
|
|
961
|
+
"args": [
|
|
962
|
+
"hook-stop",
|
|
963
|
+
],
|
|
964
|
+
"command": "<root>/bin/tokensave",
|
|
965
|
+
"type": "command",
|
|
966
|
+
},
|
|
967
|
+
],
|
|
968
|
+
},
|
|
969
|
+
],
|
|
970
|
+
"UserPromptSubmit": [
|
|
971
|
+
{
|
|
972
|
+
"hooks": [
|
|
973
|
+
{
|
|
974
|
+
"args": [
|
|
975
|
+
"hook-prompt-submit",
|
|
976
|
+
],
|
|
977
|
+
"command": "<root>/bin/tokensave",
|
|
978
|
+
"type": "command",
|
|
979
|
+
},
|
|
980
|
+
],
|
|
981
|
+
},
|
|
982
|
+
],
|
|
983
|
+
},
|
|
984
|
+
"permissions": {
|
|
985
|
+
"allow": [
|
|
986
|
+
"Bash(mate:*)",
|
|
987
|
+
"Edit(<root>/companion/**)",
|
|
988
|
+
"Read(<root>/companion/**)",
|
|
989
|
+
"mcp__tokensave__*",
|
|
990
|
+
],
|
|
991
|
+
},
|
|
992
|
+
},
|
|
993
|
+
"claudeSkills": {},
|
|
994
|
+
"opencodeConfig": {
|
|
995
|
+
"$schema": "https://opencode.ai/config.json",
|
|
996
|
+
"compaction": {
|
|
997
|
+
"auto": true,
|
|
998
|
+
"prune": true,
|
|
999
|
+
"reserved": 15000,
|
|
1000
|
+
},
|
|
1001
|
+
"mcp": {
|
|
1002
|
+
"tokensave": {
|
|
1003
|
+
"command": [
|
|
1004
|
+
"tokensave",
|
|
1005
|
+
"serve",
|
|
1006
|
+
],
|
|
1007
|
+
"enabled": true,
|
|
1008
|
+
"type": "local",
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
1011
|
+
"plugin": [
|
|
1012
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1013
|
+
],
|
|
1014
|
+
"references": {
|
|
1015
|
+
"mate": "..",
|
|
1016
|
+
},
|
|
1017
|
+
"tool_output": {
|
|
1018
|
+
"max_bytes": 20000,
|
|
1019
|
+
"max_lines": 500,
|
|
1020
|
+
},
|
|
1021
|
+
},
|
|
1022
|
+
"opencodePlugins": {},
|
|
1023
|
+
"opencodeSkills": {},
|
|
1024
|
+
"opencodeTui": {
|
|
1025
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
1026
|
+
"plugin": [
|
|
1027
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1028
|
+
],
|
|
1029
|
+
},
|
|
1030
|
+
}
|
|
1031
|
+
`;
|
|
1032
|
+
|
|
1033
|
+
exports[`runtime surface golden fixtures setup tokensave × claude+opencode 2`] = `
|
|
1034
|
+
{
|
|
1035
|
+
"claudeArgs": [
|
|
1036
|
+
"--add-dir",
|
|
1037
|
+
"<root>/companion",
|
|
1038
|
+
"--append-system-prompt",
|
|
1039
|
+
|
|
1040
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
1041
|
+
|
|
1042
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
1043
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
1044
|
+
<context>
|
|
1045
|
+
<paths>
|
|
1046
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
1047
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
1048
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
1049
|
+
</paths>
|
|
1050
|
+
<cli-tools>
|
|
1051
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
1052
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
1053
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
1054
|
+
</cli-tools>
|
|
1055
|
+
<linked-repository id="app" />
|
|
1056
|
+
</context>
|
|
1057
|
+
<mandatory-rules>
|
|
1058
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
1059
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
1060
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
1061
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
1062
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
1063
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
1064
|
+
</mandatory-rules>
|
|
1065
|
+
</companion-policy>
|
|
1066
|
+
|
|
1067
|
+
<codebase-exploration-rules priority="mandatory">
|
|
1068
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
1069
|
+
<order>tokensave -> grep/glob/read. MUST try tokensave before raw source.
|
|
1070
|
+
1. tokensave_context first.
|
|
1071
|
+
2. Use grep/glob/read only after tokensave is empty or irrelevant.</order>
|
|
1072
|
+
<post-edit>After code changes, run mate cap index --tokensave.</post-edit>
|
|
1073
|
+
</codebase-exploration-rules>"
|
|
1074
|
+
,
|
|
1075
|
+
"--setting-sources",
|
|
1076
|
+
"user,project,local",
|
|
1077
|
+
"--settings",
|
|
1078
|
+
"<root>/companion/.claude/settings.local.json",
|
|
1079
|
+
"--mcp-config",
|
|
1080
|
+
"<root>/companion/.mcp.json",
|
|
1081
|
+
"--plugin-dir",
|
|
1082
|
+
"<claude-plugin>",
|
|
1083
|
+
],
|
|
1084
|
+
"claudeEnv": {
|
|
1085
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
1086
|
+
},
|
|
1087
|
+
"opencodeArgs": [
|
|
1088
|
+
"<root>/working",
|
|
1089
|
+
],
|
|
1090
|
+
"opencodeEnv": {
|
|
1091
|
+
"MATE_GUIDANCE_JSON": {
|
|
1092
|
+
"codebaseExplorationGuidance":
|
|
1093
|
+
"<codebase-exploration-rules priority="mandatory">
|
|
1094
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
1095
|
+
<order>tokensave -> grep/glob/read. MUST try tokensave before raw source.
|
|
1096
|
+
1. tokensave_context first.
|
|
1097
|
+
2. Use grep/glob/read only after tokensave is empty or irrelevant.</order>
|
|
1098
|
+
<post-edit>After code changes, run mate cap index --tokensave.</post-edit>
|
|
1099
|
+
</codebase-exploration-rules>"
|
|
1100
|
+
,
|
|
1101
|
+
"companionGuidance":
|
|
1102
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
1103
|
+
|
|
1104
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
1105
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
1106
|
+
<context>
|
|
1107
|
+
<paths>
|
|
1108
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
1109
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
1110
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
1111
|
+
</paths>
|
|
1112
|
+
<cli-tools>
|
|
1113
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
1114
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
1115
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
1116
|
+
</cli-tools>
|
|
1117
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
1118
|
+
</context>
|
|
1119
|
+
<mandatory-rules>
|
|
1120
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
1121
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
1122
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
1123
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
1124
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
1125
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
1126
|
+
</mandatory-rules>
|
|
1127
|
+
</companion-policy>"
|
|
1128
|
+
,
|
|
1129
|
+
"errors": [],
|
|
1130
|
+
"version": 1,
|
|
1131
|
+
},
|
|
1132
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
1133
|
+
"permission": {
|
|
1134
|
+
"external_directory": {
|
|
1135
|
+
"<root>/companion": "allow",
|
|
1136
|
+
"<root>/companion/**": "allow",
|
|
1137
|
+
},
|
|
1138
|
+
},
|
|
1139
|
+
"references": {
|
|
1140
|
+
"mate": "<root>/companion",
|
|
1141
|
+
},
|
|
1142
|
+
"skills": {
|
|
1143
|
+
"paths": [
|
|
1144
|
+
"<root>/companion/.agents/skills",
|
|
1145
|
+
],
|
|
1146
|
+
},
|
|
1147
|
+
},
|
|
1148
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
1149
|
+
},
|
|
1150
|
+
}
|
|
1151
|
+
`;
|
|
1152
|
+
|
|
1153
|
+
exports[`runtime surface golden fixtures setup context-mode × claude 1`] = `
|
|
1154
|
+
{
|
|
1155
|
+
"agentsMd":
|
|
1156
|
+
"<!-- MATE:COMPANION:START -->
|
|
1157
|
+
|
|
1158
|
+
You are operating in a Mate-managed session.
|
|
1159
|
+
|
|
1160
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1161
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
1162
|
+
|
|
1163
|
+
## Agent Notes
|
|
1164
|
+
|
|
1165
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1166
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1167
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1168
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1169
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1170
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1171
|
+
|
|
1172
|
+
<!-- MATE:COMPANION:END -->
|
|
1173
|
+
"
|
|
1174
|
+
,
|
|
1175
|
+
"claudeHooks": {},
|
|
1176
|
+
"claudeMcpConfig": {
|
|
1177
|
+
"mcpServers": {},
|
|
1178
|
+
},
|
|
1179
|
+
"claudeMd":
|
|
1180
|
+
"<!-- MATE:COMPANION:START -->
|
|
1181
|
+
|
|
1182
|
+
You are operating in a Mate-managed session.
|
|
1183
|
+
|
|
1184
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1185
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
1186
|
+
|
|
1187
|
+
## Claude Notes
|
|
1188
|
+
|
|
1189
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1190
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1191
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1192
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
1193
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
1194
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1195
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1196
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1197
|
+
|
|
1198
|
+
<!-- MATE:COMPANION:END -->
|
|
1199
|
+
"
|
|
1200
|
+
,
|
|
1201
|
+
"claudeSettingsLocal": {
|
|
1202
|
+
"autoMemoryEnabled": false,
|
|
1203
|
+
"permissions": {
|
|
1204
|
+
"allow": [
|
|
1205
|
+
"Bash(mate:*)",
|
|
1206
|
+
"Edit(<root>/companion/**)",
|
|
1207
|
+
"Read(<root>/companion/**)",
|
|
1208
|
+
"Skill(context-mode:context-mode)",
|
|
1209
|
+
"mcp__plugin_context-mode_context-mode__*",
|
|
1210
|
+
],
|
|
1211
|
+
},
|
|
1212
|
+
},
|
|
1213
|
+
"claudeSkills": {},
|
|
1214
|
+
"opencodeConfig": null,
|
|
1215
|
+
"opencodePlugins": {},
|
|
1216
|
+
"opencodeSkills": {},
|
|
1217
|
+
"opencodeTui": null,
|
|
1218
|
+
}
|
|
1219
|
+
`;
|
|
1220
|
+
|
|
1221
|
+
exports[`runtime surface golden fixtures setup context-mode × claude 2`] = `
|
|
1222
|
+
{
|
|
1223
|
+
"claudeArgs": [
|
|
1224
|
+
"--add-dir",
|
|
1225
|
+
"<root>/companion",
|
|
1226
|
+
"--append-system-prompt",
|
|
1227
|
+
|
|
1228
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
1229
|
+
|
|
1230
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
1231
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
1232
|
+
<context>
|
|
1233
|
+
<paths>
|
|
1234
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
1235
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
1236
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
1237
|
+
</paths>
|
|
1238
|
+
<cli-tools>
|
|
1239
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
1240
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
1241
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
1242
|
+
</cli-tools>
|
|
1243
|
+
<linked-repository id="app" />
|
|
1244
|
+
</context>
|
|
1245
|
+
<mandatory-rules>
|
|
1246
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
1247
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
1248
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
1249
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
1250
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
1251
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
1252
|
+
</mandatory-rules>
|
|
1253
|
+
</companion-policy>"
|
|
1254
|
+
,
|
|
1255
|
+
"--setting-sources",
|
|
1256
|
+
"user,project,local",
|
|
1257
|
+
"--settings",
|
|
1258
|
+
"<root>/companion/.claude/settings.local.json",
|
|
1259
|
+
"--mcp-config",
|
|
1260
|
+
"<root>/companion/.mcp.json",
|
|
1261
|
+
"--plugin-dir",
|
|
1262
|
+
"<claude-plugin>",
|
|
1263
|
+
"--plugin-dir",
|
|
1264
|
+
"<root>/companion/.mate/plugins/.local/node_modules/context-mode",
|
|
1265
|
+
],
|
|
1266
|
+
"claudeEnv": {
|
|
1267
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
1268
|
+
},
|
|
1269
|
+
}
|
|
1270
|
+
`;
|
|
1271
|
+
|
|
1272
|
+
exports[`runtime surface golden fixtures setup context-mode × opencode 1`] = `
|
|
1273
|
+
{
|
|
1274
|
+
"agentsMd":
|
|
1275
|
+
"<!-- MATE:COMPANION:START -->
|
|
1276
|
+
|
|
1277
|
+
You are operating in a Mate-managed session.
|
|
1278
|
+
|
|
1279
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1280
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
1281
|
+
|
|
1282
|
+
## Agent Notes
|
|
1283
|
+
|
|
1284
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1285
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1286
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1287
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1288
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1289
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1290
|
+
|
|
1291
|
+
<!-- MATE:COMPANION:END -->
|
|
1292
|
+
|
|
1293
|
+
<!-- mate:managed:context-mode:9561e6cf6059 start -->
|
|
1294
|
+
## Context Mode
|
|
1295
|
+
|
|
1296
|
+
Use Context Mode tools for commands or tool calls whose output may be large, for sandboxed analysis of large files or structured data, and when indexing large fetched content.
|
|
1297
|
+
|
|
1298
|
+
Canonical Mate policy and any more specific tool-routing instructions remain authoritative. In particular, follow explicit requirements to use TokenSave for codebase exploration, Context7 for library documentation, and specialized tools for their assigned operations; Context Mode complements rather than replaces them.
|
|
1299
|
+
<!-- mate:managed:context-mode:9561e6cf6059 end -->
|
|
1300
|
+
"
|
|
1301
|
+
,
|
|
1302
|
+
"claudeHooks": {},
|
|
1303
|
+
"claudeMcpConfig": null,
|
|
1304
|
+
"claudeMd": null,
|
|
1305
|
+
"claudeSettingsLocal": null,
|
|
1306
|
+
"claudeSkills": {},
|
|
1307
|
+
"opencodeConfig": {
|
|
1308
|
+
"$schema": "https://opencode.ai/config.json",
|
|
1309
|
+
"compaction": {
|
|
1310
|
+
"auto": true,
|
|
1311
|
+
"prune": true,
|
|
1312
|
+
"reserved": 15000,
|
|
1313
|
+
},
|
|
1314
|
+
"plugin": [
|
|
1315
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1316
|
+
"context-mode@1.0.169",
|
|
1317
|
+
],
|
|
1318
|
+
"references": {
|
|
1319
|
+
"mate": "..",
|
|
1320
|
+
},
|
|
1321
|
+
"tool_output": {
|
|
1322
|
+
"max_bytes": 20000,
|
|
1323
|
+
"max_lines": 500,
|
|
1324
|
+
},
|
|
1325
|
+
},
|
|
1326
|
+
"opencodePlugins": {},
|
|
1327
|
+
"opencodeSkills": {},
|
|
1328
|
+
"opencodeTui": {
|
|
1329
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
1330
|
+
"plugin": [
|
|
1331
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1332
|
+
"context-mode@1.0.169",
|
|
1333
|
+
],
|
|
1334
|
+
},
|
|
1335
|
+
}
|
|
1336
|
+
`;
|
|
1337
|
+
|
|
1338
|
+
exports[`runtime surface golden fixtures setup context-mode × opencode 2`] = `
|
|
1339
|
+
{
|
|
1340
|
+
"opencodeArgs": [
|
|
1341
|
+
"<root>/working",
|
|
1342
|
+
],
|
|
1343
|
+
"opencodeEnv": {
|
|
1344
|
+
"MATE_GUIDANCE_JSON": {
|
|
1345
|
+
"codebaseExplorationGuidance": "",
|
|
1346
|
+
"companionGuidance":
|
|
1347
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
1348
|
+
|
|
1349
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
1350
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
1351
|
+
<context>
|
|
1352
|
+
<paths>
|
|
1353
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
1354
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
1355
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
1356
|
+
</paths>
|
|
1357
|
+
<cli-tools>
|
|
1358
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
1359
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
1360
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
1361
|
+
</cli-tools>
|
|
1362
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
1363
|
+
</context>
|
|
1364
|
+
<mandatory-rules>
|
|
1365
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
1366
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
1367
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
1368
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
1369
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
1370
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
1371
|
+
</mandatory-rules>
|
|
1372
|
+
</companion-policy>"
|
|
1373
|
+
,
|
|
1374
|
+
"errors": [],
|
|
1375
|
+
"version": 1,
|
|
1376
|
+
},
|
|
1377
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
1378
|
+
"permission": {
|
|
1379
|
+
"external_directory": {
|
|
1380
|
+
"<root>/companion": "allow",
|
|
1381
|
+
"<root>/companion/**": "allow",
|
|
1382
|
+
},
|
|
1383
|
+
},
|
|
1384
|
+
"references": {
|
|
1385
|
+
"mate": "<root>/companion",
|
|
1386
|
+
},
|
|
1387
|
+
"skills": {
|
|
1388
|
+
"paths": [
|
|
1389
|
+
"<root>/companion/.agents/skills",
|
|
1390
|
+
],
|
|
1391
|
+
},
|
|
1392
|
+
},
|
|
1393
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
1394
|
+
},
|
|
1395
|
+
}
|
|
1396
|
+
`;
|
|
1397
|
+
|
|
1398
|
+
exports[`runtime surface golden fixtures setup context-mode × claude+opencode 1`] = `
|
|
1399
|
+
{
|
|
1400
|
+
"agentsMd":
|
|
1401
|
+
"<!-- MATE:COMPANION:START -->
|
|
1402
|
+
|
|
1403
|
+
You are operating in a Mate-managed session.
|
|
1404
|
+
|
|
1405
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1406
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
1407
|
+
|
|
1408
|
+
## Agent Notes
|
|
1409
|
+
|
|
1410
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1411
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1412
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1413
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1414
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1415
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1416
|
+
|
|
1417
|
+
<!-- MATE:COMPANION:END -->
|
|
1418
|
+
|
|
1419
|
+
<!-- mate:managed:context-mode:9561e6cf6059 start -->
|
|
1420
|
+
## Context Mode
|
|
1421
|
+
|
|
1422
|
+
Use Context Mode tools for commands or tool calls whose output may be large, for sandboxed analysis of large files or structured data, and when indexing large fetched content.
|
|
1423
|
+
|
|
1424
|
+
Canonical Mate policy and any more specific tool-routing instructions remain authoritative. In particular, follow explicit requirements to use TokenSave for codebase exploration, Context7 for library documentation, and specialized tools for their assigned operations; Context Mode complements rather than replaces them.
|
|
1425
|
+
<!-- mate:managed:context-mode:9561e6cf6059 end -->
|
|
1426
|
+
"
|
|
1427
|
+
,
|
|
1428
|
+
"claudeHooks": {},
|
|
1429
|
+
"claudeMcpConfig": {
|
|
1430
|
+
"mcpServers": {},
|
|
1431
|
+
},
|
|
1432
|
+
"claudeMd":
|
|
1433
|
+
"<!-- MATE:COMPANION:START -->
|
|
1434
|
+
|
|
1435
|
+
You are operating in a Mate-managed session.
|
|
1436
|
+
|
|
1437
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1438
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
1439
|
+
|
|
1440
|
+
## Claude Notes
|
|
1441
|
+
|
|
1442
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1443
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1444
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1445
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
1446
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
1447
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1448
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1449
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1450
|
+
|
|
1451
|
+
<!-- MATE:COMPANION:END -->
|
|
1452
|
+
"
|
|
1453
|
+
,
|
|
1454
|
+
"claudeSettingsLocal": {
|
|
1455
|
+
"autoMemoryEnabled": false,
|
|
1456
|
+
"permissions": {
|
|
1457
|
+
"allow": [
|
|
1458
|
+
"Bash(mate:*)",
|
|
1459
|
+
"Edit(<root>/companion/**)",
|
|
1460
|
+
"Read(<root>/companion/**)",
|
|
1461
|
+
"Skill(context-mode:context-mode)",
|
|
1462
|
+
"mcp__plugin_context-mode_context-mode__*",
|
|
1463
|
+
],
|
|
1464
|
+
},
|
|
1465
|
+
},
|
|
1466
|
+
"claudeSkills": {},
|
|
1467
|
+
"opencodeConfig": {
|
|
1468
|
+
"$schema": "https://opencode.ai/config.json",
|
|
1469
|
+
"compaction": {
|
|
1470
|
+
"auto": true,
|
|
1471
|
+
"prune": true,
|
|
1472
|
+
"reserved": 15000,
|
|
1473
|
+
},
|
|
1474
|
+
"plugin": [
|
|
1475
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1476
|
+
"context-mode@1.0.169",
|
|
1477
|
+
],
|
|
1478
|
+
"references": {
|
|
1479
|
+
"mate": "..",
|
|
1480
|
+
},
|
|
1481
|
+
"tool_output": {
|
|
1482
|
+
"max_bytes": 20000,
|
|
1483
|
+
"max_lines": 500,
|
|
1484
|
+
},
|
|
1485
|
+
},
|
|
1486
|
+
"opencodePlugins": {},
|
|
1487
|
+
"opencodeSkills": {},
|
|
1488
|
+
"opencodeTui": {
|
|
1489
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
1490
|
+
"plugin": [
|
|
1491
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1492
|
+
"context-mode@1.0.169",
|
|
1493
|
+
],
|
|
1494
|
+
},
|
|
1495
|
+
}
|
|
1496
|
+
`;
|
|
1497
|
+
|
|
1498
|
+
exports[`runtime surface golden fixtures setup context-mode × claude+opencode 2`] = `
|
|
1499
|
+
{
|
|
1500
|
+
"claudeArgs": [
|
|
1501
|
+
"--add-dir",
|
|
1502
|
+
"<root>/companion",
|
|
1503
|
+
"--append-system-prompt",
|
|
1504
|
+
|
|
1505
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
1506
|
+
|
|
1507
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
1508
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
1509
|
+
<context>
|
|
1510
|
+
<paths>
|
|
1511
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
1512
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
1513
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
1514
|
+
</paths>
|
|
1515
|
+
<cli-tools>
|
|
1516
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
1517
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
1518
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
1519
|
+
</cli-tools>
|
|
1520
|
+
<linked-repository id="app" />
|
|
1521
|
+
</context>
|
|
1522
|
+
<mandatory-rules>
|
|
1523
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
1524
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
1525
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
1526
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
1527
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
1528
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
1529
|
+
</mandatory-rules>
|
|
1530
|
+
</companion-policy>"
|
|
1531
|
+
,
|
|
1532
|
+
"--setting-sources",
|
|
1533
|
+
"user,project,local",
|
|
1534
|
+
"--settings",
|
|
1535
|
+
"<root>/companion/.claude/settings.local.json",
|
|
1536
|
+
"--mcp-config",
|
|
1537
|
+
"<root>/companion/.mcp.json",
|
|
1538
|
+
"--plugin-dir",
|
|
1539
|
+
"<claude-plugin>",
|
|
1540
|
+
"--plugin-dir",
|
|
1541
|
+
"<root>/companion/.mate/plugins/.local/node_modules/context-mode",
|
|
1542
|
+
],
|
|
1543
|
+
"claudeEnv": {
|
|
1544
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
1545
|
+
},
|
|
1546
|
+
"opencodeArgs": [
|
|
1547
|
+
"<root>/working",
|
|
1548
|
+
],
|
|
1549
|
+
"opencodeEnv": {
|
|
1550
|
+
"MATE_GUIDANCE_JSON": {
|
|
1551
|
+
"codebaseExplorationGuidance": "",
|
|
1552
|
+
"companionGuidance":
|
|
1553
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
1554
|
+
|
|
1555
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
1556
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
1557
|
+
<context>
|
|
1558
|
+
<paths>
|
|
1559
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
1560
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
1561
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
1562
|
+
</paths>
|
|
1563
|
+
<cli-tools>
|
|
1564
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
1565
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
1566
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
1567
|
+
</cli-tools>
|
|
1568
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
1569
|
+
</context>
|
|
1570
|
+
<mandatory-rules>
|
|
1571
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
1572
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
1573
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
1574
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
1575
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
1576
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
1577
|
+
</mandatory-rules>
|
|
1578
|
+
</companion-policy>"
|
|
1579
|
+
,
|
|
1580
|
+
"errors": [],
|
|
1581
|
+
"version": 1,
|
|
1582
|
+
},
|
|
1583
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
1584
|
+
"permission": {
|
|
1585
|
+
"external_directory": {
|
|
1586
|
+
"<root>/companion": "allow",
|
|
1587
|
+
"<root>/companion/**": "allow",
|
|
1588
|
+
},
|
|
1589
|
+
},
|
|
1590
|
+
"references": {
|
|
1591
|
+
"mate": "<root>/companion",
|
|
1592
|
+
},
|
|
1593
|
+
"skills": {
|
|
1594
|
+
"paths": [
|
|
1595
|
+
"<root>/companion/.agents/skills",
|
|
1596
|
+
],
|
|
1597
|
+
},
|
|
1598
|
+
},
|
|
1599
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
1600
|
+
},
|
|
1601
|
+
}
|
|
1602
|
+
`;
|
|
1603
|
+
|
|
1604
|
+
exports[`runtime surface golden fixtures setup react-doctor × claude 1`] = `
|
|
1605
|
+
{
|
|
1606
|
+
"agentsMd":
|
|
1607
|
+
"<!-- MATE:COMPANION:START -->
|
|
1608
|
+
|
|
1609
|
+
You are operating in a Mate-managed session.
|
|
1610
|
+
|
|
1611
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1612
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
1613
|
+
|
|
1614
|
+
## Agent Notes
|
|
1615
|
+
|
|
1616
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1617
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1618
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1619
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1620
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1621
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1622
|
+
|
|
1623
|
+
<!-- MATE:COMPANION:END -->
|
|
1624
|
+
"
|
|
1625
|
+
,
|
|
1626
|
+
"claudeHooks": {
|
|
1627
|
+
"react-doctor.sh": "e25569935b64",
|
|
1628
|
+
},
|
|
1629
|
+
"claudeMcpConfig": {
|
|
1630
|
+
"mcpServers": {},
|
|
1631
|
+
},
|
|
1632
|
+
"claudeMd":
|
|
1633
|
+
"<!-- MATE:COMPANION:START -->
|
|
1634
|
+
|
|
1635
|
+
You are operating in a Mate-managed session.
|
|
1636
|
+
|
|
1637
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1638
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
1639
|
+
|
|
1640
|
+
## Claude Notes
|
|
1641
|
+
|
|
1642
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1643
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1644
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1645
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
1646
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
1647
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1648
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1649
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1650
|
+
|
|
1651
|
+
<!-- MATE:COMPANION:END -->
|
|
1652
|
+
"
|
|
1653
|
+
,
|
|
1654
|
+
"claudeSettingsLocal": {
|
|
1655
|
+
"autoMemoryEnabled": false,
|
|
1656
|
+
"hooks": {
|
|
1657
|
+
"PostToolUse": [
|
|
1658
|
+
{
|
|
1659
|
+
"hooks": [
|
|
1660
|
+
{
|
|
1661
|
+
"command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
|
|
1662
|
+
"timeout": 5,
|
|
1663
|
+
"type": "command",
|
|
1664
|
+
},
|
|
1665
|
+
],
|
|
1666
|
+
"matcher": "Write|Edit|MultiEdit|NotebookEdit|ApplyPatch",
|
|
1667
|
+
},
|
|
1668
|
+
],
|
|
1669
|
+
"Stop": [
|
|
1670
|
+
{
|
|
1671
|
+
"hooks": [
|
|
1672
|
+
{
|
|
1673
|
+
"command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
|
|
1674
|
+
"timeout": 45,
|
|
1675
|
+
"type": "command",
|
|
1676
|
+
},
|
|
1677
|
+
],
|
|
1678
|
+
},
|
|
1679
|
+
],
|
|
1680
|
+
},
|
|
1681
|
+
"permissions": {
|
|
1682
|
+
"allow": [
|
|
1683
|
+
"Bash(mate:*)",
|
|
1684
|
+
"Bash(npx react-doctor:*)",
|
|
1685
|
+
"Bash(npx react-doctor@latest *)",
|
|
1686
|
+
"Edit(<root>/companion/**)",
|
|
1687
|
+
"Read(<root>/companion/**)",
|
|
1688
|
+
"Skill(react-doctor)",
|
|
1689
|
+
],
|
|
1690
|
+
},
|
|
1691
|
+
},
|
|
1692
|
+
"claudeSkills": {
|
|
1693
|
+
"react-doctor/SKILL.md": "df58b3490543",
|
|
1694
|
+
"react-doctor/references/explain.md": "2382ea820f20",
|
|
1695
|
+
},
|
|
1696
|
+
"opencodeConfig": null,
|
|
1697
|
+
"opencodePlugins": {},
|
|
1698
|
+
"opencodeSkills": {},
|
|
1699
|
+
"opencodeTui": null,
|
|
1700
|
+
}
|
|
1701
|
+
`;
|
|
1702
|
+
|
|
1703
|
+
exports[`runtime surface golden fixtures setup react-doctor × claude 2`] = `
|
|
1704
|
+
{
|
|
1705
|
+
"claudeArgs": [
|
|
1706
|
+
"--add-dir",
|
|
1707
|
+
"<root>/companion",
|
|
1708
|
+
"--append-system-prompt",
|
|
1709
|
+
|
|
1710
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
1711
|
+
|
|
1712
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
1713
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
1714
|
+
<context>
|
|
1715
|
+
<paths>
|
|
1716
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
1717
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
1718
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
1719
|
+
</paths>
|
|
1720
|
+
<cli-tools>
|
|
1721
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
1722
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
1723
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
1724
|
+
</cli-tools>
|
|
1725
|
+
<linked-repository id="app" />
|
|
1726
|
+
</context>
|
|
1727
|
+
<mandatory-rules>
|
|
1728
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
1729
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
1730
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
1731
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
1732
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
1733
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
1734
|
+
</mandatory-rules>
|
|
1735
|
+
</companion-policy>"
|
|
1736
|
+
,
|
|
1737
|
+
"--setting-sources",
|
|
1738
|
+
"user,project,local",
|
|
1739
|
+
"--settings",
|
|
1740
|
+
"<root>/companion/.claude/settings.local.json",
|
|
1741
|
+
"--mcp-config",
|
|
1742
|
+
"<root>/companion/.mcp.json",
|
|
1743
|
+
"--plugin-dir",
|
|
1744
|
+
"<claude-plugin>",
|
|
1745
|
+
],
|
|
1746
|
+
"claudeEnv": {
|
|
1747
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
1748
|
+
},
|
|
1749
|
+
}
|
|
1750
|
+
`;
|
|
1751
|
+
|
|
1752
|
+
exports[`runtime surface golden fixtures setup react-doctor × opencode 1`] = `
|
|
1753
|
+
{
|
|
1754
|
+
"agentsMd":
|
|
1755
|
+
"<!-- MATE:COMPANION:START -->
|
|
1756
|
+
|
|
1757
|
+
You are operating in a Mate-managed session.
|
|
1758
|
+
|
|
1759
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1760
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
1761
|
+
|
|
1762
|
+
## Agent Notes
|
|
1763
|
+
|
|
1764
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1765
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1766
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1767
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1768
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1769
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1770
|
+
|
|
1771
|
+
<!-- MATE:COMPANION:END -->
|
|
1772
|
+
"
|
|
1773
|
+
,
|
|
1774
|
+
"claudeHooks": {},
|
|
1775
|
+
"claudeMcpConfig": null,
|
|
1776
|
+
"claudeMd": null,
|
|
1777
|
+
"claudeSettingsLocal": null,
|
|
1778
|
+
"claudeSkills": {},
|
|
1779
|
+
"opencodeConfig": {
|
|
1780
|
+
"$schema": "https://opencode.ai/config.json",
|
|
1781
|
+
"compaction": {
|
|
1782
|
+
"auto": true,
|
|
1783
|
+
"prune": true,
|
|
1784
|
+
"reserved": 15000,
|
|
1785
|
+
},
|
|
1786
|
+
"plugin": [
|
|
1787
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1788
|
+
],
|
|
1789
|
+
"references": {
|
|
1790
|
+
"mate": "..",
|
|
1791
|
+
},
|
|
1792
|
+
"tool_output": {
|
|
1793
|
+
"max_bytes": 20000,
|
|
1794
|
+
"max_lines": 500,
|
|
1795
|
+
},
|
|
1796
|
+
},
|
|
1797
|
+
"opencodePlugins": {},
|
|
1798
|
+
"opencodeSkills": {
|
|
1799
|
+
"react-doctor/SKILL.md": "df58b3490543",
|
|
1800
|
+
"react-doctor/references/explain.md": "2382ea820f20",
|
|
1801
|
+
},
|
|
1802
|
+
"opencodeTui": {
|
|
1803
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
1804
|
+
"plugin": [
|
|
1805
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1806
|
+
],
|
|
1807
|
+
},
|
|
1808
|
+
}
|
|
1809
|
+
`;
|
|
1810
|
+
|
|
1811
|
+
exports[`runtime surface golden fixtures setup react-doctor × opencode 2`] = `
|
|
1812
|
+
{
|
|
1813
|
+
"opencodeArgs": [
|
|
1814
|
+
"<root>/working",
|
|
1815
|
+
],
|
|
1816
|
+
"opencodeEnv": {
|
|
1817
|
+
"MATE_GUIDANCE_JSON": {
|
|
1818
|
+
"codebaseExplorationGuidance": "",
|
|
1819
|
+
"companionGuidance":
|
|
1820
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
1821
|
+
|
|
1822
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
1823
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
1824
|
+
<context>
|
|
1825
|
+
<paths>
|
|
1826
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
1827
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
1828
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
1829
|
+
</paths>
|
|
1830
|
+
<cli-tools>
|
|
1831
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
1832
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
1833
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
1834
|
+
</cli-tools>
|
|
1835
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
1836
|
+
</context>
|
|
1837
|
+
<mandatory-rules>
|
|
1838
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
1839
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
1840
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
1841
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
1842
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
1843
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
1844
|
+
</mandatory-rules>
|
|
1845
|
+
</companion-policy>"
|
|
1846
|
+
,
|
|
1847
|
+
"errors": [],
|
|
1848
|
+
"version": 1,
|
|
1849
|
+
},
|
|
1850
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
1851
|
+
"permission": {
|
|
1852
|
+
"external_directory": {
|
|
1853
|
+
"<root>/companion": "allow",
|
|
1854
|
+
"<root>/companion/**": "allow",
|
|
1855
|
+
},
|
|
1856
|
+
},
|
|
1857
|
+
"references": {
|
|
1858
|
+
"mate": "<root>/companion",
|
|
1859
|
+
},
|
|
1860
|
+
"skills": {
|
|
1861
|
+
"paths": [
|
|
1862
|
+
"<root>/companion/.agents/skills",
|
|
1863
|
+
],
|
|
1864
|
+
},
|
|
1865
|
+
},
|
|
1866
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
1867
|
+
},
|
|
1868
|
+
}
|
|
1869
|
+
`;
|
|
1870
|
+
|
|
1871
|
+
exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1`] = `
|
|
1872
|
+
{
|
|
1873
|
+
"agentsMd":
|
|
1874
|
+
"<!-- MATE:COMPANION:START -->
|
|
1875
|
+
|
|
1876
|
+
You are operating in a Mate-managed session.
|
|
1877
|
+
|
|
1878
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1879
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
1880
|
+
|
|
1881
|
+
## Agent Notes
|
|
1882
|
+
|
|
1883
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1884
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1885
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1886
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1887
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1888
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1889
|
+
|
|
1890
|
+
<!-- MATE:COMPANION:END -->
|
|
1891
|
+
"
|
|
1892
|
+
,
|
|
1893
|
+
"claudeHooks": {
|
|
1894
|
+
"react-doctor.sh": "e25569935b64",
|
|
1895
|
+
},
|
|
1896
|
+
"claudeMcpConfig": {
|
|
1897
|
+
"mcpServers": {},
|
|
1898
|
+
},
|
|
1899
|
+
"claudeMd":
|
|
1900
|
+
"<!-- MATE:COMPANION:START -->
|
|
1901
|
+
|
|
1902
|
+
You are operating in a Mate-managed session.
|
|
1903
|
+
|
|
1904
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
1905
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
1906
|
+
|
|
1907
|
+
## Claude Notes
|
|
1908
|
+
|
|
1909
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
1910
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
1911
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
1912
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
1913
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
1914
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
1915
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
1916
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
1917
|
+
|
|
1918
|
+
<!-- MATE:COMPANION:END -->
|
|
1919
|
+
"
|
|
1920
|
+
,
|
|
1921
|
+
"claudeSettingsLocal": {
|
|
1922
|
+
"autoMemoryEnabled": false,
|
|
1923
|
+
"hooks": {
|
|
1924
|
+
"PostToolUse": [
|
|
1925
|
+
{
|
|
1926
|
+
"hooks": [
|
|
1927
|
+
{
|
|
1928
|
+
"command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
|
|
1929
|
+
"timeout": 5,
|
|
1930
|
+
"type": "command",
|
|
1931
|
+
},
|
|
1932
|
+
],
|
|
1933
|
+
"matcher": "Write|Edit|MultiEdit|NotebookEdit|ApplyPatch",
|
|
1934
|
+
},
|
|
1935
|
+
],
|
|
1936
|
+
"Stop": [
|
|
1937
|
+
{
|
|
1938
|
+
"hooks": [
|
|
1939
|
+
{
|
|
1940
|
+
"command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
|
|
1941
|
+
"timeout": 45,
|
|
1942
|
+
"type": "command",
|
|
1943
|
+
},
|
|
1944
|
+
],
|
|
1945
|
+
},
|
|
1946
|
+
],
|
|
1947
|
+
},
|
|
1948
|
+
"permissions": {
|
|
1949
|
+
"allow": [
|
|
1950
|
+
"Bash(mate:*)",
|
|
1951
|
+
"Bash(npx react-doctor:*)",
|
|
1952
|
+
"Bash(npx react-doctor@latest *)",
|
|
1953
|
+
"Edit(<root>/companion/**)",
|
|
1954
|
+
"Read(<root>/companion/**)",
|
|
1955
|
+
"Skill(react-doctor)",
|
|
1956
|
+
],
|
|
1957
|
+
},
|
|
1958
|
+
},
|
|
1959
|
+
"claudeSkills": {
|
|
1960
|
+
"react-doctor/SKILL.md": "df58b3490543",
|
|
1961
|
+
"react-doctor/references/explain.md": "2382ea820f20",
|
|
1962
|
+
},
|
|
1963
|
+
"opencodeConfig": {
|
|
1964
|
+
"$schema": "https://opencode.ai/config.json",
|
|
1965
|
+
"compaction": {
|
|
1966
|
+
"auto": true,
|
|
1967
|
+
"prune": true,
|
|
1968
|
+
"reserved": 15000,
|
|
1969
|
+
},
|
|
1970
|
+
"plugin": [
|
|
1971
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1972
|
+
],
|
|
1973
|
+
"references": {
|
|
1974
|
+
"mate": "..",
|
|
1975
|
+
},
|
|
1976
|
+
"tool_output": {
|
|
1977
|
+
"max_bytes": 20000,
|
|
1978
|
+
"max_lines": 500,
|
|
1979
|
+
},
|
|
1980
|
+
},
|
|
1981
|
+
"opencodePlugins": {},
|
|
1982
|
+
"opencodeSkills": {
|
|
1983
|
+
"react-doctor/SKILL.md": "df58b3490543",
|
|
1984
|
+
"react-doctor/references/explain.md": "2382ea820f20",
|
|
1985
|
+
},
|
|
1986
|
+
"opencodeTui": {
|
|
1987
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
1988
|
+
"plugin": [
|
|
1989
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
1990
|
+
],
|
|
1991
|
+
},
|
|
1992
|
+
}
|
|
1993
|
+
`;
|
|
1994
|
+
|
|
1995
|
+
exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 2`] = `
|
|
1996
|
+
{
|
|
1997
|
+
"claudeArgs": [
|
|
1998
|
+
"--add-dir",
|
|
1999
|
+
"<root>/companion",
|
|
2000
|
+
"--append-system-prompt",
|
|
2001
|
+
|
|
2002
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
2003
|
+
|
|
2004
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
2005
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
2006
|
+
<context>
|
|
2007
|
+
<paths>
|
|
2008
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
2009
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
2010
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
2011
|
+
</paths>
|
|
2012
|
+
<cli-tools>
|
|
2013
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
2014
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
2015
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
2016
|
+
</cli-tools>
|
|
2017
|
+
<linked-repository id="app" />
|
|
2018
|
+
</context>
|
|
2019
|
+
<mandatory-rules>
|
|
2020
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
2021
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
2022
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
2023
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
2024
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
2025
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
2026
|
+
</mandatory-rules>
|
|
2027
|
+
</companion-policy>"
|
|
2028
|
+
,
|
|
2029
|
+
"--setting-sources",
|
|
2030
|
+
"user,project,local",
|
|
2031
|
+
"--settings",
|
|
2032
|
+
"<root>/companion/.claude/settings.local.json",
|
|
2033
|
+
"--mcp-config",
|
|
2034
|
+
"<root>/companion/.mcp.json",
|
|
2035
|
+
"--plugin-dir",
|
|
2036
|
+
"<claude-plugin>",
|
|
2037
|
+
],
|
|
2038
|
+
"claudeEnv": {
|
|
2039
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
2040
|
+
},
|
|
2041
|
+
"opencodeArgs": [
|
|
2042
|
+
"<root>/working",
|
|
2043
|
+
],
|
|
2044
|
+
"opencodeEnv": {
|
|
2045
|
+
"MATE_GUIDANCE_JSON": {
|
|
2046
|
+
"codebaseExplorationGuidance": "",
|
|
2047
|
+
"companionGuidance":
|
|
2048
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
2049
|
+
|
|
2050
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
2051
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
2052
|
+
<context>
|
|
2053
|
+
<paths>
|
|
2054
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
2055
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
2056
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
2057
|
+
</paths>
|
|
2058
|
+
<cli-tools>
|
|
2059
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
2060
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
2061
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
2062
|
+
</cli-tools>
|
|
2063
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
2064
|
+
</context>
|
|
2065
|
+
<mandatory-rules>
|
|
2066
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
2067
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
2068
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
2069
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
2070
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
2071
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
2072
|
+
</mandatory-rules>
|
|
2073
|
+
</companion-policy>"
|
|
2074
|
+
,
|
|
2075
|
+
"errors": [],
|
|
2076
|
+
"version": 1,
|
|
2077
|
+
},
|
|
2078
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
2079
|
+
"permission": {
|
|
2080
|
+
"external_directory": {
|
|
2081
|
+
"<root>/companion": "allow",
|
|
2082
|
+
"<root>/companion/**": "allow",
|
|
2083
|
+
},
|
|
2084
|
+
},
|
|
2085
|
+
"references": {
|
|
2086
|
+
"mate": "<root>/companion",
|
|
2087
|
+
},
|
|
2088
|
+
"skills": {
|
|
2089
|
+
"paths": [
|
|
2090
|
+
"<root>/companion/.agents/skills",
|
|
2091
|
+
],
|
|
2092
|
+
},
|
|
2093
|
+
},
|
|
2094
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
2095
|
+
},
|
|
2096
|
+
}
|
|
2097
|
+
`;
|
|
2098
|
+
|
|
2099
|
+
exports[`runtime surface golden fixtures setup openspec × claude 1`] = `
|
|
2100
|
+
{
|
|
2101
|
+
"agentsMd":
|
|
2102
|
+
"<!-- MATE:COMPANION:START -->
|
|
2103
|
+
|
|
2104
|
+
You are operating in a Mate-managed session.
|
|
2105
|
+
|
|
2106
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2107
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
2108
|
+
|
|
2109
|
+
## Agent Notes
|
|
2110
|
+
|
|
2111
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2112
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2113
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2114
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2115
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2116
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2117
|
+
|
|
2118
|
+
<!-- MATE:COMPANION:END -->
|
|
2119
|
+
"
|
|
2120
|
+
,
|
|
2121
|
+
"claudeHooks": {},
|
|
2122
|
+
"claudeMcpConfig": {
|
|
2123
|
+
"mcpServers": {},
|
|
2124
|
+
},
|
|
2125
|
+
"claudeMd":
|
|
2126
|
+
"<!-- MATE:COMPANION:START -->
|
|
2127
|
+
|
|
2128
|
+
You are operating in a Mate-managed session.
|
|
2129
|
+
|
|
2130
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2131
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
2132
|
+
|
|
2133
|
+
## Claude Notes
|
|
2134
|
+
|
|
2135
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2136
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2137
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2138
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
2139
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
2140
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2141
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2142
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2143
|
+
|
|
2144
|
+
<!-- MATE:COMPANION:END -->
|
|
2145
|
+
"
|
|
2146
|
+
,
|
|
2147
|
+
"claudeSettingsLocal": {
|
|
2148
|
+
"autoMemoryEnabled": false,
|
|
2149
|
+
"permissions": {
|
|
2150
|
+
"allow": [
|
|
2151
|
+
"Bash(<wrapper-bin>/openspec:*)",
|
|
2152
|
+
"Bash(mate cap graphify:*)",
|
|
2153
|
+
"Bash(mate:*)",
|
|
2154
|
+
"Bash(openspec:*)",
|
|
2155
|
+
"Edit(<root>/companion/**)",
|
|
2156
|
+
"Read(<root>/companion/**)",
|
|
2157
|
+
"Skill(mate-artifact-finish)",
|
|
2158
|
+
"Skill(mate-openspec-backfill)",
|
|
2159
|
+
"Skill(openspec-apply-change)",
|
|
2160
|
+
"Skill(openspec-archive-change)",
|
|
2161
|
+
"Skill(openspec-explore)",
|
|
2162
|
+
"Skill(openspec-propose)",
|
|
2163
|
+
],
|
|
2164
|
+
},
|
|
2165
|
+
},
|
|
2166
|
+
"claudeSkills": {
|
|
2167
|
+
"openspec-apply-change/SKILL.md": "b023edd228ab",
|
|
2168
|
+
"openspec-archive-change/SKILL.md": "890bada99035",
|
|
2169
|
+
"openspec-explore/SKILL.md": "477fdec2cdb0",
|
|
2170
|
+
"openspec-propose/SKILL.md": "13e8a2d0d873",
|
|
2171
|
+
},
|
|
2172
|
+
"opencodeConfig": null,
|
|
2173
|
+
"opencodePlugins": {},
|
|
2174
|
+
"opencodeSkills": {},
|
|
2175
|
+
"opencodeTui": null,
|
|
2176
|
+
}
|
|
2177
|
+
`;
|
|
2178
|
+
|
|
2179
|
+
exports[`runtime surface golden fixtures setup openspec × claude 2`] = `
|
|
2180
|
+
{
|
|
2181
|
+
"claudeArgs": [
|
|
2182
|
+
"--add-dir",
|
|
2183
|
+
"<root>/companion",
|
|
2184
|
+
"--append-system-prompt",
|
|
2185
|
+
|
|
2186
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
2187
|
+
|
|
2188
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
2189
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
2190
|
+
<context>
|
|
2191
|
+
<paths>
|
|
2192
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
2193
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
2194
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
2195
|
+
</paths>
|
|
2196
|
+
<cli-tools>
|
|
2197
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
2198
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
2199
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
2200
|
+
</cli-tools>
|
|
2201
|
+
<linked-repository id="app" />
|
|
2202
|
+
</context>
|
|
2203
|
+
<mandatory-rules>
|
|
2204
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
2205
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
2206
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
2207
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
2208
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
2209
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
2210
|
+
<rule id="openspec-finish" severity="critical">Finish OpenSpec changes by archiving them: the archive triggers a nudge directing you to run mate artifact finish "<name>" --json — if no nudge arrives, invoke that command yourself. It is the only sanctioned completion; never hand-commit or hand-tag a finish. Finishing a still-active change archives it and applies its delta specs itself, so do not pre-apply them to openspec/specs right before finishing. Finishing an already-archived change resumes without re-applying delta specs, so an archive flow that already synced specs (e.g. openspec-sync-specs) composes fine with a finish afterwards.</rule>
|
|
2211
|
+
</mandatory-rules>
|
|
2212
|
+
</companion-policy>"
|
|
2213
|
+
,
|
|
2214
|
+
"--setting-sources",
|
|
2215
|
+
"user,project,local",
|
|
2216
|
+
"--settings",
|
|
2217
|
+
"<root>/companion/.claude/settings.local.json",
|
|
2218
|
+
"--mcp-config",
|
|
2219
|
+
"<root>/companion/.mcp.json",
|
|
2220
|
+
"--plugin-dir",
|
|
2221
|
+
"<claude-plugin>",
|
|
2222
|
+
],
|
|
2223
|
+
"claudeEnv": {
|
|
2224
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
2225
|
+
},
|
|
2226
|
+
}
|
|
2227
|
+
`;
|
|
2228
|
+
|
|
2229
|
+
exports[`runtime surface golden fixtures setup openspec × opencode 1`] = `
|
|
2230
|
+
{
|
|
2231
|
+
"agentsMd":
|
|
2232
|
+
"<!-- MATE:COMPANION:START -->
|
|
2233
|
+
|
|
2234
|
+
You are operating in a Mate-managed session.
|
|
2235
|
+
|
|
2236
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2237
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
2238
|
+
|
|
2239
|
+
## Agent Notes
|
|
2240
|
+
|
|
2241
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2242
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2243
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2244
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2245
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2246
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2247
|
+
|
|
2248
|
+
<!-- MATE:COMPANION:END -->
|
|
2249
|
+
"
|
|
2250
|
+
,
|
|
2251
|
+
"claudeHooks": {},
|
|
2252
|
+
"claudeMcpConfig": null,
|
|
2253
|
+
"claudeMd": null,
|
|
2254
|
+
"claudeSettingsLocal": null,
|
|
2255
|
+
"claudeSkills": {},
|
|
2256
|
+
"opencodeConfig": {
|
|
2257
|
+
"$schema": "https://opencode.ai/config.json",
|
|
2258
|
+
"compaction": {
|
|
2259
|
+
"auto": true,
|
|
2260
|
+
"prune": true,
|
|
2261
|
+
"reserved": 15000,
|
|
2262
|
+
},
|
|
2263
|
+
"plugin": [
|
|
2264
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
2265
|
+
],
|
|
2266
|
+
"references": {
|
|
2267
|
+
"mate": "..",
|
|
2268
|
+
},
|
|
2269
|
+
"tool_output": {
|
|
2270
|
+
"max_bytes": 20000,
|
|
2271
|
+
"max_lines": 500,
|
|
2272
|
+
},
|
|
2273
|
+
},
|
|
2274
|
+
"opencodePlugins": {},
|
|
2275
|
+
"opencodeSkills": {
|
|
2276
|
+
"openspec-apply-change/SKILL.md": "cb6e43b175c8",
|
|
2277
|
+
"openspec-archive-change/SKILL.md": "920c4cc68edf",
|
|
2278
|
+
"openspec-explore/SKILL.md": "87d1237e5ffa",
|
|
2279
|
+
"openspec-propose/SKILL.md": "3618b84ce74c",
|
|
2280
|
+
},
|
|
2281
|
+
"opencodeTui": {
|
|
2282
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
2283
|
+
"plugin": [
|
|
2284
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
2285
|
+
],
|
|
2286
|
+
},
|
|
2287
|
+
}
|
|
2288
|
+
`;
|
|
2289
|
+
|
|
2290
|
+
exports[`runtime surface golden fixtures setup openspec × opencode 2`] = `
|
|
2291
|
+
{
|
|
2292
|
+
"opencodeArgs": [
|
|
2293
|
+
"<root>/working",
|
|
2294
|
+
],
|
|
2295
|
+
"opencodeEnv": {
|
|
2296
|
+
"MATE_GUIDANCE_JSON": {
|
|
2297
|
+
"codebaseExplorationGuidance": "",
|
|
2298
|
+
"companionGuidance":
|
|
2299
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
2300
|
+
|
|
2301
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
2302
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
2303
|
+
<context>
|
|
2304
|
+
<paths>
|
|
2305
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
2306
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
2307
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
2308
|
+
</paths>
|
|
2309
|
+
<cli-tools>
|
|
2310
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
2311
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
2312
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
2313
|
+
</cli-tools>
|
|
2314
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
2315
|
+
</context>
|
|
2316
|
+
<mandatory-rules>
|
|
2317
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
2318
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
2319
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
2320
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
2321
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
2322
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
2323
|
+
<rule id="openspec-finish" severity="critical">Finish OpenSpec changes by archiving them: the archive triggers a nudge directing you to run mate artifact finish "<name>" --json — if no nudge arrives, invoke that command yourself. It is the only sanctioned completion; never hand-commit or hand-tag a finish. Finishing a still-active change archives it and applies its delta specs itself, so do not pre-apply them to openspec/specs right before finishing. Finishing an already-archived change resumes without re-applying delta specs, so an archive flow that already synced specs (e.g. openspec-sync-specs) composes fine with a finish afterwards.</rule>
|
|
2324
|
+
</mandatory-rules>
|
|
2325
|
+
</companion-policy>"
|
|
2326
|
+
,
|
|
2327
|
+
"errors": [],
|
|
2328
|
+
"version": 1,
|
|
2329
|
+
},
|
|
2330
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
2331
|
+
"permission": {
|
|
2332
|
+
"external_directory": {
|
|
2333
|
+
"<root>/companion": "allow",
|
|
2334
|
+
"<root>/companion/**": "allow",
|
|
2335
|
+
},
|
|
2336
|
+
},
|
|
2337
|
+
"references": {
|
|
2338
|
+
"mate": "<root>/companion",
|
|
2339
|
+
},
|
|
2340
|
+
"skills": {
|
|
2341
|
+
"paths": [
|
|
2342
|
+
"<root>/companion/.agents/skills",
|
|
2343
|
+
],
|
|
2344
|
+
},
|
|
2345
|
+
},
|
|
2346
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
2347
|
+
},
|
|
2348
|
+
}
|
|
2349
|
+
`;
|
|
2350
|
+
|
|
2351
|
+
exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] = `
|
|
2352
|
+
{
|
|
2353
|
+
"agentsMd":
|
|
2354
|
+
"<!-- MATE:COMPANION:START -->
|
|
2355
|
+
|
|
2356
|
+
You are operating in a Mate-managed session.
|
|
2357
|
+
|
|
2358
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2359
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
2360
|
+
|
|
2361
|
+
## Agent Notes
|
|
2362
|
+
|
|
2363
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2364
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2365
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2366
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2367
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2368
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2369
|
+
|
|
2370
|
+
<!-- MATE:COMPANION:END -->
|
|
2371
|
+
"
|
|
2372
|
+
,
|
|
2373
|
+
"claudeHooks": {},
|
|
2374
|
+
"claudeMcpConfig": {
|
|
2375
|
+
"mcpServers": {},
|
|
2376
|
+
},
|
|
2377
|
+
"claudeMd":
|
|
2378
|
+
"<!-- MATE:COMPANION:START -->
|
|
2379
|
+
|
|
2380
|
+
You are operating in a Mate-managed session.
|
|
2381
|
+
|
|
2382
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2383
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
2384
|
+
|
|
2385
|
+
## Claude Notes
|
|
2386
|
+
|
|
2387
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2388
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2389
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2390
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
2391
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
2392
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2393
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2394
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2395
|
+
|
|
2396
|
+
<!-- MATE:COMPANION:END -->
|
|
2397
|
+
"
|
|
2398
|
+
,
|
|
2399
|
+
"claudeSettingsLocal": {
|
|
2400
|
+
"autoMemoryEnabled": false,
|
|
2401
|
+
"permissions": {
|
|
2402
|
+
"allow": [
|
|
2403
|
+
"Bash(<wrapper-bin>/openspec:*)",
|
|
2404
|
+
"Bash(mate cap graphify:*)",
|
|
2405
|
+
"Bash(mate:*)",
|
|
2406
|
+
"Bash(openspec:*)",
|
|
2407
|
+
"Edit(<root>/companion/**)",
|
|
2408
|
+
"Read(<root>/companion/**)",
|
|
2409
|
+
"Skill(mate-artifact-finish)",
|
|
2410
|
+
"Skill(mate-openspec-backfill)",
|
|
2411
|
+
"Skill(openspec-apply-change)",
|
|
2412
|
+
"Skill(openspec-archive-change)",
|
|
2413
|
+
"Skill(openspec-explore)",
|
|
2414
|
+
"Skill(openspec-propose)",
|
|
2415
|
+
],
|
|
2416
|
+
},
|
|
2417
|
+
},
|
|
2418
|
+
"claudeSkills": {
|
|
2419
|
+
"openspec-apply-change/SKILL.md": "b023edd228ab",
|
|
2420
|
+
"openspec-archive-change/SKILL.md": "890bada99035",
|
|
2421
|
+
"openspec-explore/SKILL.md": "477fdec2cdb0",
|
|
2422
|
+
"openspec-propose/SKILL.md": "13e8a2d0d873",
|
|
2423
|
+
},
|
|
2424
|
+
"opencodeConfig": {
|
|
2425
|
+
"$schema": "https://opencode.ai/config.json",
|
|
2426
|
+
"compaction": {
|
|
2427
|
+
"auto": true,
|
|
2428
|
+
"prune": true,
|
|
2429
|
+
"reserved": 15000,
|
|
2430
|
+
},
|
|
2431
|
+
"plugin": [
|
|
2432
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
2433
|
+
],
|
|
2434
|
+
"references": {
|
|
2435
|
+
"mate": "..",
|
|
2436
|
+
},
|
|
2437
|
+
"tool_output": {
|
|
2438
|
+
"max_bytes": 20000,
|
|
2439
|
+
"max_lines": 500,
|
|
2440
|
+
},
|
|
2441
|
+
},
|
|
2442
|
+
"opencodePlugins": {},
|
|
2443
|
+
"opencodeSkills": {
|
|
2444
|
+
"openspec-apply-change/SKILL.md": "cb6e43b175c8",
|
|
2445
|
+
"openspec-archive-change/SKILL.md": "920c4cc68edf",
|
|
2446
|
+
"openspec-explore/SKILL.md": "87d1237e5ffa",
|
|
2447
|
+
"openspec-propose/SKILL.md": "3618b84ce74c",
|
|
2448
|
+
},
|
|
2449
|
+
"opencodeTui": {
|
|
2450
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
2451
|
+
"plugin": [
|
|
2452
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
2453
|
+
],
|
|
2454
|
+
},
|
|
2455
|
+
}
|
|
2456
|
+
`;
|
|
2457
|
+
|
|
2458
|
+
exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] = `
|
|
2459
|
+
{
|
|
2460
|
+
"claudeArgs": [
|
|
2461
|
+
"--add-dir",
|
|
2462
|
+
"<root>/companion",
|
|
2463
|
+
"--append-system-prompt",
|
|
2464
|
+
|
|
2465
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
2466
|
+
|
|
2467
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
2468
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
2469
|
+
<context>
|
|
2470
|
+
<paths>
|
|
2471
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
2472
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
2473
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
2474
|
+
</paths>
|
|
2475
|
+
<cli-tools>
|
|
2476
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
2477
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
2478
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
2479
|
+
</cli-tools>
|
|
2480
|
+
<linked-repository id="app" />
|
|
2481
|
+
</context>
|
|
2482
|
+
<mandatory-rules>
|
|
2483
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
2484
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
2485
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
2486
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
2487
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
2488
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
2489
|
+
<rule id="openspec-finish" severity="critical">Finish OpenSpec changes by archiving them: the archive triggers a nudge directing you to run mate artifact finish "<name>" --json — if no nudge arrives, invoke that command yourself. It is the only sanctioned completion; never hand-commit or hand-tag a finish. Finishing a still-active change archives it and applies its delta specs itself, so do not pre-apply them to openspec/specs right before finishing. Finishing an already-archived change resumes without re-applying delta specs, so an archive flow that already synced specs (e.g. openspec-sync-specs) composes fine with a finish afterwards.</rule>
|
|
2490
|
+
</mandatory-rules>
|
|
2491
|
+
</companion-policy>"
|
|
2492
|
+
,
|
|
2493
|
+
"--setting-sources",
|
|
2494
|
+
"user,project,local",
|
|
2495
|
+
"--settings",
|
|
2496
|
+
"<root>/companion/.claude/settings.local.json",
|
|
2497
|
+
"--mcp-config",
|
|
2498
|
+
"<root>/companion/.mcp.json",
|
|
2499
|
+
"--plugin-dir",
|
|
2500
|
+
"<claude-plugin>",
|
|
2501
|
+
],
|
|
2502
|
+
"claudeEnv": {
|
|
2503
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
2504
|
+
},
|
|
2505
|
+
"opencodeArgs": [
|
|
2506
|
+
"<root>/working",
|
|
2507
|
+
],
|
|
2508
|
+
"opencodeEnv": {
|
|
2509
|
+
"MATE_GUIDANCE_JSON": {
|
|
2510
|
+
"codebaseExplorationGuidance": "",
|
|
2511
|
+
"companionGuidance":
|
|
2512
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
2513
|
+
|
|
2514
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
2515
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
2516
|
+
<context>
|
|
2517
|
+
<paths>
|
|
2518
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
2519
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
2520
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
2521
|
+
</paths>
|
|
2522
|
+
<cli-tools>
|
|
2523
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
2524
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
2525
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
2526
|
+
</cli-tools>
|
|
2527
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
2528
|
+
</context>
|
|
2529
|
+
<mandatory-rules>
|
|
2530
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
2531
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
2532
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
2533
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
2534
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
2535
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
2536
|
+
<rule id="openspec-finish" severity="critical">Finish OpenSpec changes by archiving them: the archive triggers a nudge directing you to run mate artifact finish "<name>" --json — if no nudge arrives, invoke that command yourself. It is the only sanctioned completion; never hand-commit or hand-tag a finish. Finishing a still-active change archives it and applies its delta specs itself, so do not pre-apply them to openspec/specs right before finishing. Finishing an already-archived change resumes without re-applying delta specs, so an archive flow that already synced specs (e.g. openspec-sync-specs) composes fine with a finish afterwards.</rule>
|
|
2537
|
+
</mandatory-rules>
|
|
2538
|
+
</companion-policy>"
|
|
2539
|
+
,
|
|
2540
|
+
"errors": [],
|
|
2541
|
+
"version": 1,
|
|
2542
|
+
},
|
|
2543
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
2544
|
+
"permission": {
|
|
2545
|
+
"external_directory": {
|
|
2546
|
+
"<root>/companion": "allow",
|
|
2547
|
+
"<root>/companion/**": "allow",
|
|
2548
|
+
},
|
|
2549
|
+
},
|
|
2550
|
+
"references": {
|
|
2551
|
+
"mate": "<root>/companion",
|
|
2552
|
+
},
|
|
2553
|
+
"skills": {
|
|
2554
|
+
"paths": [
|
|
2555
|
+
"<root>/companion/.agents/skills",
|
|
2556
|
+
],
|
|
2557
|
+
},
|
|
2558
|
+
},
|
|
2559
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
2560
|
+
},
|
|
2561
|
+
}
|
|
2562
|
+
`;
|
|
2563
|
+
|
|
2564
|
+
exports[`runtime surface golden fixtures setup all capabilities × claude+opencode 1`] = `
|
|
2565
|
+
{
|
|
2566
|
+
"agentsMd":
|
|
2567
|
+
"<!-- MATE:COMPANION:START -->
|
|
2568
|
+
|
|
2569
|
+
You are operating in a Mate-managed session.
|
|
2570
|
+
|
|
2571
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2572
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
2573
|
+
|
|
2574
|
+
## Agent Notes
|
|
2575
|
+
|
|
2576
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2577
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2578
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2579
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2580
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2581
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2582
|
+
|
|
2583
|
+
<!-- MATE:COMPANION:END -->
|
|
2584
|
+
|
|
2585
|
+
<!-- mate:managed:context-mode:9561e6cf6059 start -->
|
|
2586
|
+
## Context Mode
|
|
2587
|
+
|
|
2588
|
+
Use Context Mode tools for commands or tool calls whose output may be large, for sandboxed analysis of large files or structured data, and when indexing large fetched content.
|
|
2589
|
+
|
|
2590
|
+
Canonical Mate policy and any more specific tool-routing instructions remain authoritative. In particular, follow explicit requirements to use TokenSave for codebase exploration, Context7 for library documentation, and specialized tools for their assigned operations; Context Mode complements rather than replaces them.
|
|
2591
|
+
<!-- mate:managed:context-mode:9561e6cf6059 end -->
|
|
2592
|
+
"
|
|
2593
|
+
,
|
|
2594
|
+
"claudeHooks": {
|
|
2595
|
+
"react-doctor.sh": "e25569935b64",
|
|
2596
|
+
},
|
|
2597
|
+
"claudeMcpConfig": {
|
|
2598
|
+
"mcpServers": {
|
|
2599
|
+
"tokensave": {
|
|
2600
|
+
"args": [
|
|
2601
|
+
"serve",
|
|
2602
|
+
],
|
|
2603
|
+
"command": "tokensave",
|
|
2604
|
+
},
|
|
2605
|
+
},
|
|
2606
|
+
},
|
|
2607
|
+
"claudeMd":
|
|
2608
|
+
"<!-- MATE:COMPANION:START -->
|
|
2609
|
+
|
|
2610
|
+
You are operating in a Mate-managed session.
|
|
2611
|
+
|
|
2612
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2613
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
2614
|
+
|
|
2615
|
+
## Claude Notes
|
|
2616
|
+
|
|
2617
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2618
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2619
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2620
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
2621
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
2622
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2623
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2624
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2625
|
+
|
|
2626
|
+
<!-- MATE:COMPANION:END -->
|
|
2627
|
+
"
|
|
2628
|
+
,
|
|
2629
|
+
"claudeSettingsLocal": {
|
|
2630
|
+
"autoMemoryEnabled": false,
|
|
2631
|
+
"hooks": {
|
|
2632
|
+
"PostToolUse": [
|
|
2633
|
+
{
|
|
2634
|
+
"hooks": [
|
|
2635
|
+
{
|
|
2636
|
+
"command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
|
|
2637
|
+
"timeout": 5,
|
|
2638
|
+
"type": "command",
|
|
2639
|
+
},
|
|
2640
|
+
],
|
|
2641
|
+
"matcher": "Write|Edit|MultiEdit|NotebookEdit|ApplyPatch",
|
|
2642
|
+
},
|
|
2643
|
+
],
|
|
2644
|
+
"PreToolUse": [
|
|
2645
|
+
{
|
|
2646
|
+
"hooks": [
|
|
2647
|
+
{
|
|
2648
|
+
"args": [
|
|
2649
|
+
"hook-pre-tool-use",
|
|
2650
|
+
],
|
|
2651
|
+
"command": "<root>/bin/tokensave",
|
|
2652
|
+
"type": "command",
|
|
2653
|
+
},
|
|
2654
|
+
],
|
|
2655
|
+
"matcher": "Agent|Grep|Bash",
|
|
2656
|
+
},
|
|
2657
|
+
{
|
|
2658
|
+
"hooks": [
|
|
2659
|
+
{
|
|
2660
|
+
"command": "<root>/companion/.claude/hooks/graphify-guard.sh",
|
|
2661
|
+
"type": "command",
|
|
2662
|
+
},
|
|
2663
|
+
],
|
|
2664
|
+
"matcher": "Bash",
|
|
2665
|
+
},
|
|
2666
|
+
],
|
|
2667
|
+
"Stop": [
|
|
2668
|
+
{
|
|
2669
|
+
"hooks": [
|
|
2670
|
+
{
|
|
2671
|
+
"args": [
|
|
2672
|
+
"hook-stop",
|
|
2673
|
+
],
|
|
2674
|
+
"command": "<root>/bin/tokensave",
|
|
2675
|
+
"type": "command",
|
|
2676
|
+
},
|
|
2677
|
+
],
|
|
2678
|
+
},
|
|
2679
|
+
{
|
|
2680
|
+
"hooks": [
|
|
2681
|
+
{
|
|
2682
|
+
"command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
|
|
2683
|
+
"timeout": 45,
|
|
2684
|
+
"type": "command",
|
|
2685
|
+
},
|
|
2686
|
+
],
|
|
2687
|
+
},
|
|
2688
|
+
],
|
|
2689
|
+
"UserPromptSubmit": [
|
|
2690
|
+
{
|
|
2691
|
+
"hooks": [
|
|
2692
|
+
{
|
|
2693
|
+
"args": [
|
|
2694
|
+
"hook-prompt-submit",
|
|
2695
|
+
],
|
|
2696
|
+
"command": "<root>/bin/tokensave",
|
|
2697
|
+
"type": "command",
|
|
2698
|
+
},
|
|
2699
|
+
],
|
|
2700
|
+
},
|
|
2701
|
+
],
|
|
2702
|
+
},
|
|
2703
|
+
"permissions": {
|
|
2704
|
+
"allow": [
|
|
2705
|
+
"Bash(<wrapper-bin>/graphify:*)",
|
|
2706
|
+
"Bash(<wrapper-bin>/openspec:*)",
|
|
2707
|
+
"Bash(graphify:*)",
|
|
2708
|
+
"Bash(mate cap graphify:*)",
|
|
2709
|
+
"Bash(mate cap graphify:*)",
|
|
2710
|
+
"Bash(mate:*)",
|
|
2711
|
+
"Bash(npx react-doctor:*)",
|
|
2712
|
+
"Bash(npx react-doctor@latest *)",
|
|
2713
|
+
"Bash(openspec:*)",
|
|
2714
|
+
"Edit(<root>/companion/**)",
|
|
2715
|
+
"Read(<root>/companion/**)",
|
|
2716
|
+
"Skill(context-mode:context-mode)",
|
|
2717
|
+
"Skill(graphify)",
|
|
2718
|
+
"Skill(mate-artifact-finish)",
|
|
2719
|
+
"Skill(mate-openspec-backfill)",
|
|
2720
|
+
"Skill(openspec-apply-change)",
|
|
2721
|
+
"Skill(openspec-archive-change)",
|
|
2722
|
+
"Skill(openspec-explore)",
|
|
2723
|
+
"Skill(openspec-propose)",
|
|
2724
|
+
"Skill(react-doctor)",
|
|
2725
|
+
"mcp__plugin_context-mode_context-mode__*",
|
|
2726
|
+
"mcp__tokensave__*",
|
|
2727
|
+
],
|
|
2728
|
+
},
|
|
2729
|
+
},
|
|
2730
|
+
"claudeSkills": {
|
|
2731
|
+
"graphify/SKILL.md":
|
|
2732
|
+
"---
|
|
2733
|
+
description: builds graphify-out artifacts
|
|
2734
|
+
---
|
|
2735
|
+
Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
2736
|
+
"
|
|
2737
|
+
,
|
|
2738
|
+
"graphify/references/github-and-merge.md":
|
|
2739
|
+
"Merge graphs into graphify-out of each clone.
|
|
2740
|
+
"
|
|
2741
|
+
,
|
|
2742
|
+
"graphify/references/usage.md":
|
|
2743
|
+
"Outputs land in $GRAPHIFY_OUT by default.
|
|
2744
|
+
"
|
|
2745
|
+
,
|
|
2746
|
+
"openspec-apply-change/SKILL.md": "b023edd228ab",
|
|
2747
|
+
"openspec-archive-change/SKILL.md": "890bada99035",
|
|
2748
|
+
"openspec-explore/SKILL.md": "477fdec2cdb0",
|
|
2749
|
+
"openspec-propose/SKILL.md": "13e8a2d0d873",
|
|
2750
|
+
"react-doctor/SKILL.md": "df58b3490543",
|
|
2751
|
+
"react-doctor/references/explain.md": "2382ea820f20",
|
|
2752
|
+
},
|
|
2753
|
+
"opencodeConfig": {
|
|
2754
|
+
"$schema": "https://opencode.ai/config.json",
|
|
2755
|
+
"compaction": {
|
|
2756
|
+
"auto": true,
|
|
2757
|
+
"prune": true,
|
|
2758
|
+
"reserved": 15000,
|
|
2759
|
+
},
|
|
2760
|
+
"mcp": {
|
|
2761
|
+
"tokensave": {
|
|
2762
|
+
"command": [
|
|
2763
|
+
"tokensave",
|
|
2764
|
+
"serve",
|
|
2765
|
+
],
|
|
2766
|
+
"enabled": true,
|
|
2767
|
+
"type": "local",
|
|
2768
|
+
},
|
|
2769
|
+
},
|
|
2770
|
+
"plugin": [
|
|
2771
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
2772
|
+
"context-mode@1.0.169",
|
|
2773
|
+
],
|
|
2774
|
+
"references": {
|
|
2775
|
+
"mate": "..",
|
|
2776
|
+
},
|
|
2777
|
+
"tool_output": {
|
|
2778
|
+
"max_bytes": 20000,
|
|
2779
|
+
"max_lines": 500,
|
|
2780
|
+
},
|
|
2781
|
+
},
|
|
2782
|
+
"opencodePlugins": {
|
|
2783
|
+
"graphify.js":
|
|
2784
|
+
"export default {}
|
|
2785
|
+
"
|
|
2786
|
+
,
|
|
2787
|
+
},
|
|
2788
|
+
"opencodeSkills": {
|
|
2789
|
+
"graphify/SKILL.md":
|
|
2790
|
+
"---
|
|
2791
|
+
description: builds graphify-out artifacts
|
|
2792
|
+
---
|
|
2793
|
+
Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
2794
|
+
"
|
|
2795
|
+
,
|
|
2796
|
+
"graphify/references/github-and-merge.md":
|
|
2797
|
+
"Merge graphs into graphify-out of each clone.
|
|
2798
|
+
"
|
|
2799
|
+
,
|
|
2800
|
+
"graphify/references/usage.md":
|
|
2801
|
+
"Outputs land in $GRAPHIFY_OUT by default.
|
|
2802
|
+
"
|
|
2803
|
+
,
|
|
2804
|
+
"openspec-apply-change/SKILL.md": "cb6e43b175c8",
|
|
2805
|
+
"openspec-archive-change/SKILL.md": "920c4cc68edf",
|
|
2806
|
+
"openspec-explore/SKILL.md": "87d1237e5ffa",
|
|
2807
|
+
"openspec-propose/SKILL.md": "3618b84ce74c",
|
|
2808
|
+
"react-doctor/SKILL.md": "df58b3490543",
|
|
2809
|
+
"react-doctor/references/explain.md": "2382ea820f20",
|
|
2810
|
+
},
|
|
2811
|
+
"opencodeTui": {
|
|
2812
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
2813
|
+
"plugin": [
|
|
2814
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
2815
|
+
"context-mode@1.0.169",
|
|
2816
|
+
],
|
|
2817
|
+
},
|
|
2818
|
+
}
|
|
2819
|
+
`;
|
|
2820
|
+
|
|
2821
|
+
exports[`runtime surface golden fixtures setup all capabilities × claude+opencode 2`] = `
|
|
2822
|
+
{
|
|
2823
|
+
"claudeArgs": [
|
|
2824
|
+
"--add-dir",
|
|
2825
|
+
"<root>/companion",
|
|
2826
|
+
"--append-system-prompt",
|
|
2827
|
+
|
|
2828
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
2829
|
+
|
|
2830
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
2831
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
2832
|
+
<context>
|
|
2833
|
+
<paths>
|
|
2834
|
+
<path role="working-repository" env="MATE_REPO_PATH"><root>/working</path>
|
|
2835
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH"><root>/companion</path>
|
|
2836
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH"><wrapper-bin></path>
|
|
2837
|
+
</paths>
|
|
2838
|
+
<cli-tools>
|
|
2839
|
+
<cli name="openspec" type="wrapper" invokeAs="<wrapper-bin>/openspec" />
|
|
2840
|
+
<cli name="graphify" type="wrapper" invokeAs="<wrapper-bin>/graphify" />
|
|
2841
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
2842
|
+
</cli-tools>
|
|
2843
|
+
<linked-repository id="app" />
|
|
2844
|
+
</context>
|
|
2845
|
+
<mandatory-rules>
|
|
2846
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to <root>/companion, NEVER <root>/working. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
2847
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
2848
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in <root>/working. Agent-artifacts belong in <root>/companion.</rule>
|
|
2849
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in <root>/working when the exact path is gitignored AND intentionally local-only; otherwise use <root>/companion.</rule>
|
|
2850
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to <root>/working are rejected. Classify correctly first.</rule>
|
|
2851
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: <wrapper-bin>/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
2852
|
+
<rule id="openspec-finish" severity="critical">Finish OpenSpec changes by archiving them: the archive triggers a nudge directing you to run mate artifact finish "<name>" --json — if no nudge arrives, invoke that command yourself. It is the only sanctioned completion; never hand-commit or hand-tag a finish. Finishing a still-active change archives it and applies its delta specs itself, so do not pre-apply them to openspec/specs right before finishing. Finishing an already-archived change resumes without re-applying delta specs, so an archive flow that already synced specs (e.g. openspec-sync-specs) composes fine with a finish afterwards.</rule>
|
|
2853
|
+
</mandatory-rules>
|
|
2854
|
+
</companion-policy>
|
|
2855
|
+
|
|
2856
|
+
<codebase-exploration-rules priority="mandatory">
|
|
2857
|
+
<path role="graphify-out">$MATE_ARTIFACT_PATH/.graphify/$MATE_REPO_ID/graphify-out/</path>
|
|
2858
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
2859
|
+
<order>tokensave -> graphify -> grep/glob/read. MUST NOT skip steps.
|
|
2860
|
+
1. tokensave_context first.
|
|
2861
|
+
2. If tokensave is empty/file-only/irrelevant, run graphify query "<question>"; use graphify path/explain to deepen.
|
|
2862
|
+
3. Use grep/glob/read only after tokensave and graphify were tried.</order>
|
|
2863
|
+
<notes>Dirty graph files are expected. Use wiki/index.md for broad navigation; GRAPH_REPORT.md only if query/path/explain fall short.</notes>
|
|
2864
|
+
<post-edit>After code changes, run mate cap index.</post-edit>
|
|
2865
|
+
</codebase-exploration-rules>"
|
|
2866
|
+
,
|
|
2867
|
+
"--setting-sources",
|
|
2868
|
+
"user,project,local",
|
|
2869
|
+
"--settings",
|
|
2870
|
+
"<root>/companion/.claude/settings.local.json",
|
|
2871
|
+
"--mcp-config",
|
|
2872
|
+
"<root>/companion/.mcp.json",
|
|
2873
|
+
"--plugin-dir",
|
|
2874
|
+
"<claude-plugin>",
|
|
2875
|
+
"--plugin-dir",
|
|
2876
|
+
"<root>/companion/.mate/plugins/.local/node_modules/context-mode",
|
|
2877
|
+
],
|
|
2878
|
+
"claudeEnv": {
|
|
2879
|
+
"CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD": "1",
|
|
2880
|
+
},
|
|
2881
|
+
"opencodeArgs": [
|
|
2882
|
+
"<root>/working",
|
|
2883
|
+
],
|
|
2884
|
+
"opencodeEnv": {
|
|
2885
|
+
"MATE_GUIDANCE_JSON": {
|
|
2886
|
+
"codebaseExplorationGuidance":
|
|
2887
|
+
"<codebase-exploration-rules priority="mandatory">
|
|
2888
|
+
<path role="graphify-out">$MATE_ARTIFACT_PATH/.graphify/$MATE_REPO_ID/graphify-out/</path>
|
|
2889
|
+
<trigger>Codebase-understanding: architecture, tracing, integrations, impact, "how does X work?"</trigger>
|
|
2890
|
+
<order>tokensave -> graphify -> grep/glob/read. MUST NOT skip steps.
|
|
2891
|
+
1. tokensave_context first.
|
|
2892
|
+
2. If tokensave is empty/file-only/irrelevant, run graphify query "<question>"; use graphify path/explain to deepen.
|
|
2893
|
+
3. Use grep/glob/read only after tokensave and graphify were tried.</order>
|
|
2894
|
+
<notes>Dirty graph files are expected. Use wiki/index.md for broad navigation; GRAPH_REPORT.md only if query/path/explain fall short.</notes>
|
|
2895
|
+
<post-edit>After code changes, run mate cap index.</post-edit>
|
|
2896
|
+
</codebase-exploration-rules>"
|
|
2897
|
+
,
|
|
2898
|
+
"companionGuidance":
|
|
2899
|
+
"## MANDATORY RULES - NON-NEGOTIABLE
|
|
2900
|
+
|
|
2901
|
+
<companion-policy framework="mate" priority="mandatory">
|
|
2902
|
+
<overview>You are operating inside the mate companion repository.</overview>
|
|
2903
|
+
<context>
|
|
2904
|
+
<paths>
|
|
2905
|
+
<path role="working-repository" env="MATE_REPO_PATH">$MATE_REPO_PATH</path>
|
|
2906
|
+
<path role="companion-repository" env="MATE_ARTIFACT_PATH">$MATE_ARTIFACT_PATH</path>
|
|
2907
|
+
<path role="package-wrapper-bin" env="MATE_WRAPPER_BIN_PATH">$MATE_WRAPPER_BIN_PATH</path>
|
|
2908
|
+
</paths>
|
|
2909
|
+
<cli-tools>
|
|
2910
|
+
<cli name="openspec" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/openspec" />
|
|
2911
|
+
<cli name="graphify" type="wrapper" invokeAs="$MATE_WRAPPER_BIN_PATH/graphify" />
|
|
2912
|
+
<cli name="mate" type="global" invokeAs="mate" />
|
|
2913
|
+
</cli-tools>
|
|
2914
|
+
<linked-repository id="$MATE_REPO_ID" />
|
|
2915
|
+
</context>
|
|
2916
|
+
<mandatory-rules>
|
|
2917
|
+
<rule id="artifact-location" severity="critical">Agent artifacts MUST go to $MATE_ARTIFACT_PATH, NEVER $MATE_REPO_PATH. Artifacts include plans, specs, ADRs, todos, notes, handoffs, reasoning docs, and scratch files.</rule>
|
|
2918
|
+
<rule id="pre-write-classification" severity="critical">Before ANY write, classify the target as product-code or agent-artifact. If unsure, treat it as agent-artifact.</rule>
|
|
2919
|
+
<rule id="product-code-location" severity="critical">Product code (README, docs, source, tests) belongs in $MATE_REPO_PATH. Agent-artifacts belong in $MATE_ARTIFACT_PATH.</rule>
|
|
2920
|
+
<rule id="local-artifact-exception" severity="critical">Only write artifacts in $MATE_REPO_PATH when the exact path is gitignored AND intentionally local-only; otherwise use $MATE_ARTIFACT_PATH.</rule>
|
|
2921
|
+
<rule id="guardrail" severity="critical">Bad artifact writes to $MATE_REPO_PATH are rejected. Classify correctly first.</rule>
|
|
2922
|
+
<rule id="wrapper-only-cli-execution" severity="critical">For every CLI declared in cli-tools, invoke the exact path in its invokeAs attribute. Correct: $MATE_WRAPPER_BIN_PATH/openspec status ... . Incorrect: openspec status ... . Do not run bare openspec or graphify commands and do not rely on PATH, aliases, or shell functions. If the exact wrapper path is unavailable, stop and report it.</rule>
|
|
2923
|
+
<rule id="openspec-finish" severity="critical">Finish OpenSpec changes by archiving them: the archive triggers a nudge directing you to run mate artifact finish "<name>" --json — if no nudge arrives, invoke that command yourself. It is the only sanctioned completion; never hand-commit or hand-tag a finish. Finishing a still-active change archives it and applies its delta specs itself, so do not pre-apply them to openspec/specs right before finishing. Finishing an already-archived change resumes without re-applying delta specs, so an archive flow that already synced specs (e.g. openspec-sync-specs) composes fine with a finish afterwards.</rule>
|
|
2924
|
+
</mandatory-rules>
|
|
2925
|
+
</companion-policy>"
|
|
2926
|
+
,
|
|
2927
|
+
"errors": [],
|
|
2928
|
+
"version": 1,
|
|
2929
|
+
},
|
|
2930
|
+
"OPENCODE_CONFIG_CONTENT": {
|
|
2931
|
+
"permission": {
|
|
2932
|
+
"external_directory": {
|
|
2933
|
+
"<root>/companion": "allow",
|
|
2934
|
+
"<root>/companion/**": "allow",
|
|
2935
|
+
},
|
|
2936
|
+
},
|
|
2937
|
+
"references": {
|
|
2938
|
+
"mate": "<root>/companion",
|
|
2939
|
+
},
|
|
2940
|
+
"skills": {
|
|
2941
|
+
"paths": [
|
|
2942
|
+
"<root>/companion/.agents/skills",
|
|
2943
|
+
],
|
|
2944
|
+
},
|
|
2945
|
+
},
|
|
2946
|
+
"OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
|
|
2947
|
+
},
|
|
2948
|
+
}
|
|
2949
|
+
`;
|
|
2950
|
+
|
|
2951
|
+
exports[`runtime surface golden fixtures teardown graphify × claude+opencode 1`] = `
|
|
2952
|
+
{
|
|
2953
|
+
"agentsMd":
|
|
2954
|
+
"<!-- MATE:COMPANION:START -->
|
|
2955
|
+
|
|
2956
|
+
You are operating in a Mate-managed session.
|
|
2957
|
+
|
|
2958
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2959
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
2960
|
+
|
|
2961
|
+
## Agent Notes
|
|
2962
|
+
|
|
2963
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2964
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2965
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2966
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2967
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2968
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2969
|
+
|
|
2970
|
+
<!-- MATE:COMPANION:END -->
|
|
2971
|
+
"
|
|
2972
|
+
,
|
|
2973
|
+
"claudeHooks": {},
|
|
2974
|
+
"claudeMcpConfig": {
|
|
2975
|
+
"mcpServers": {},
|
|
2976
|
+
},
|
|
2977
|
+
"claudeMd":
|
|
2978
|
+
"<!-- MATE:COMPANION:START -->
|
|
2979
|
+
|
|
2980
|
+
You are operating in a Mate-managed session.
|
|
2981
|
+
|
|
2982
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
2983
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
2984
|
+
|
|
2985
|
+
## Claude Notes
|
|
2986
|
+
|
|
2987
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
2988
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
2989
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
2990
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
2991
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
2992
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
2993
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
2994
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
2995
|
+
|
|
2996
|
+
<!-- MATE:COMPANION:END -->
|
|
2997
|
+
"
|
|
2998
|
+
,
|
|
2999
|
+
"claudeSettingsLocal": {
|
|
3000
|
+
"autoMemoryEnabled": false,
|
|
3001
|
+
"permissions": {
|
|
3002
|
+
"allow": [
|
|
3003
|
+
"Bash(mate:*)",
|
|
3004
|
+
"Edit(<root>/companion/**)",
|
|
3005
|
+
"Read(<root>/companion/**)",
|
|
3006
|
+
],
|
|
3007
|
+
},
|
|
3008
|
+
},
|
|
3009
|
+
"claudeSkills": {},
|
|
3010
|
+
"opencodeConfig": {
|
|
3011
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3012
|
+
"compaction": {
|
|
3013
|
+
"auto": true,
|
|
3014
|
+
"prune": true,
|
|
3015
|
+
"reserved": 15000,
|
|
3016
|
+
},
|
|
3017
|
+
"plugin": [
|
|
3018
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3019
|
+
],
|
|
3020
|
+
"references": {
|
|
3021
|
+
"mate": "..",
|
|
3022
|
+
},
|
|
3023
|
+
"tool_output": {
|
|
3024
|
+
"max_bytes": 20000,
|
|
3025
|
+
"max_lines": 500,
|
|
3026
|
+
},
|
|
3027
|
+
},
|
|
3028
|
+
"opencodePlugins": {},
|
|
3029
|
+
"opencodeSkills": {},
|
|
3030
|
+
"opencodeTui": {
|
|
3031
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
3032
|
+
"plugin": [
|
|
3033
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3034
|
+
],
|
|
3035
|
+
},
|
|
3036
|
+
}
|
|
3037
|
+
`;
|
|
3038
|
+
|
|
3039
|
+
exports[`runtime surface golden fixtures teardown tokensave × claude+opencode 1`] = `
|
|
3040
|
+
{
|
|
3041
|
+
"agentsMd":
|
|
3042
|
+
"<!-- MATE:COMPANION:START -->
|
|
3043
|
+
|
|
3044
|
+
You are operating in a Mate-managed session.
|
|
3045
|
+
|
|
3046
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3047
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
3048
|
+
|
|
3049
|
+
## Agent Notes
|
|
3050
|
+
|
|
3051
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3052
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3053
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3054
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3055
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3056
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3057
|
+
|
|
3058
|
+
<!-- MATE:COMPANION:END -->
|
|
3059
|
+
"
|
|
3060
|
+
,
|
|
3061
|
+
"claudeHooks": {},
|
|
3062
|
+
"claudeMcpConfig": {
|
|
3063
|
+
"mcpServers": {},
|
|
3064
|
+
},
|
|
3065
|
+
"claudeMd":
|
|
3066
|
+
"<!-- MATE:COMPANION:START -->
|
|
3067
|
+
|
|
3068
|
+
You are operating in a Mate-managed session.
|
|
3069
|
+
|
|
3070
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3071
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
3072
|
+
|
|
3073
|
+
## Claude Notes
|
|
3074
|
+
|
|
3075
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3076
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3077
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3078
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
3079
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
3080
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3081
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3082
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3083
|
+
|
|
3084
|
+
<!-- MATE:COMPANION:END -->
|
|
3085
|
+
"
|
|
3086
|
+
,
|
|
3087
|
+
"claudeSettingsLocal": {
|
|
3088
|
+
"autoMemoryEnabled": false,
|
|
3089
|
+
"permissions": {
|
|
3090
|
+
"allow": [
|
|
3091
|
+
"Bash(mate:*)",
|
|
3092
|
+
"Edit(<root>/companion/**)",
|
|
3093
|
+
"Read(<root>/companion/**)",
|
|
3094
|
+
],
|
|
3095
|
+
},
|
|
3096
|
+
},
|
|
3097
|
+
"claudeSkills": {},
|
|
3098
|
+
"opencodeConfig": {
|
|
3099
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3100
|
+
"compaction": {
|
|
3101
|
+
"auto": true,
|
|
3102
|
+
"prune": true,
|
|
3103
|
+
"reserved": 15000,
|
|
3104
|
+
},
|
|
3105
|
+
"plugin": [
|
|
3106
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3107
|
+
],
|
|
3108
|
+
"references": {
|
|
3109
|
+
"mate": "..",
|
|
3110
|
+
},
|
|
3111
|
+
"tool_output": {
|
|
3112
|
+
"max_bytes": 20000,
|
|
3113
|
+
"max_lines": 500,
|
|
3114
|
+
},
|
|
3115
|
+
},
|
|
3116
|
+
"opencodePlugins": {},
|
|
3117
|
+
"opencodeSkills": {},
|
|
3118
|
+
"opencodeTui": {
|
|
3119
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
3120
|
+
"plugin": [
|
|
3121
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3122
|
+
],
|
|
3123
|
+
},
|
|
3124
|
+
}
|
|
3125
|
+
`;
|
|
3126
|
+
|
|
3127
|
+
exports[`runtime surface golden fixtures teardown context-mode × claude+opencode 1`] = `
|
|
3128
|
+
{
|
|
3129
|
+
"agentsMd":
|
|
3130
|
+
"<!-- MATE:COMPANION:START -->
|
|
3131
|
+
|
|
3132
|
+
You are operating in a Mate-managed session.
|
|
3133
|
+
|
|
3134
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3135
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
3136
|
+
|
|
3137
|
+
## Agent Notes
|
|
3138
|
+
|
|
3139
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3140
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3141
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3142
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3143
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3144
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3145
|
+
|
|
3146
|
+
<!-- MATE:COMPANION:END -->
|
|
3147
|
+
|
|
3148
|
+
"
|
|
3149
|
+
,
|
|
3150
|
+
"claudeHooks": {},
|
|
3151
|
+
"claudeMcpConfig": {
|
|
3152
|
+
"mcpServers": {},
|
|
3153
|
+
},
|
|
3154
|
+
"claudeMd":
|
|
3155
|
+
"<!-- MATE:COMPANION:START -->
|
|
3156
|
+
|
|
3157
|
+
You are operating in a Mate-managed session.
|
|
3158
|
+
|
|
3159
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3160
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
3161
|
+
|
|
3162
|
+
## Claude Notes
|
|
3163
|
+
|
|
3164
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3165
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3166
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3167
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
3168
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
3169
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3170
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3171
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3172
|
+
|
|
3173
|
+
<!-- MATE:COMPANION:END -->
|
|
3174
|
+
"
|
|
3175
|
+
,
|
|
3176
|
+
"claudeSettingsLocal": {
|
|
3177
|
+
"autoMemoryEnabled": false,
|
|
3178
|
+
"permissions": {
|
|
3179
|
+
"allow": [
|
|
3180
|
+
"Bash(mate:*)",
|
|
3181
|
+
"Edit(<root>/companion/**)",
|
|
3182
|
+
"Read(<root>/companion/**)",
|
|
3183
|
+
],
|
|
3184
|
+
},
|
|
3185
|
+
},
|
|
3186
|
+
"claudeSkills": {},
|
|
3187
|
+
"opencodeConfig": {
|
|
3188
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3189
|
+
"compaction": {
|
|
3190
|
+
"auto": true,
|
|
3191
|
+
"prune": true,
|
|
3192
|
+
"reserved": 15000,
|
|
3193
|
+
},
|
|
3194
|
+
"plugin": [
|
|
3195
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3196
|
+
],
|
|
3197
|
+
"references": {
|
|
3198
|
+
"mate": "..",
|
|
3199
|
+
},
|
|
3200
|
+
"tool_output": {
|
|
3201
|
+
"max_bytes": 20000,
|
|
3202
|
+
"max_lines": 500,
|
|
3203
|
+
},
|
|
3204
|
+
},
|
|
3205
|
+
"opencodePlugins": {},
|
|
3206
|
+
"opencodeSkills": {},
|
|
3207
|
+
"opencodeTui": {
|
|
3208
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
3209
|
+
"plugin": [
|
|
3210
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3211
|
+
],
|
|
3212
|
+
},
|
|
3213
|
+
}
|
|
3214
|
+
`;
|
|
3215
|
+
|
|
3216
|
+
exports[`runtime surface golden fixtures teardown react-doctor × claude+opencode 1`] = `
|
|
3217
|
+
{
|
|
3218
|
+
"agentsMd":
|
|
3219
|
+
"<!-- MATE:COMPANION:START -->
|
|
3220
|
+
|
|
3221
|
+
You are operating in a Mate-managed session.
|
|
3222
|
+
|
|
3223
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3224
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
3225
|
+
|
|
3226
|
+
## Agent Notes
|
|
3227
|
+
|
|
3228
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3229
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3230
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3231
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3232
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3233
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3234
|
+
|
|
3235
|
+
<!-- MATE:COMPANION:END -->
|
|
3236
|
+
"
|
|
3237
|
+
,
|
|
3238
|
+
"claudeHooks": {},
|
|
3239
|
+
"claudeMcpConfig": {
|
|
3240
|
+
"mcpServers": {},
|
|
3241
|
+
},
|
|
3242
|
+
"claudeMd":
|
|
3243
|
+
"<!-- MATE:COMPANION:START -->
|
|
3244
|
+
|
|
3245
|
+
You are operating in a Mate-managed session.
|
|
3246
|
+
|
|
3247
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3248
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
3249
|
+
|
|
3250
|
+
## Claude Notes
|
|
3251
|
+
|
|
3252
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3253
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3254
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3255
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
3256
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
3257
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3258
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3259
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3260
|
+
|
|
3261
|
+
<!-- MATE:COMPANION:END -->
|
|
3262
|
+
"
|
|
3263
|
+
,
|
|
3264
|
+
"claudeSettingsLocal": {
|
|
3265
|
+
"autoMemoryEnabled": false,
|
|
3266
|
+
"permissions": {
|
|
3267
|
+
"allow": [
|
|
3268
|
+
"Bash(mate:*)",
|
|
3269
|
+
"Edit(<root>/companion/**)",
|
|
3270
|
+
"Read(<root>/companion/**)",
|
|
3271
|
+
],
|
|
3272
|
+
},
|
|
3273
|
+
},
|
|
3274
|
+
"claudeSkills": {},
|
|
3275
|
+
"opencodeConfig": {
|
|
3276
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3277
|
+
"compaction": {
|
|
3278
|
+
"auto": true,
|
|
3279
|
+
"prune": true,
|
|
3280
|
+
"reserved": 15000,
|
|
3281
|
+
},
|
|
3282
|
+
"plugin": [
|
|
3283
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3284
|
+
],
|
|
3285
|
+
"references": {
|
|
3286
|
+
"mate": "..",
|
|
3287
|
+
},
|
|
3288
|
+
"tool_output": {
|
|
3289
|
+
"max_bytes": 20000,
|
|
3290
|
+
"max_lines": 500,
|
|
3291
|
+
},
|
|
3292
|
+
},
|
|
3293
|
+
"opencodePlugins": {},
|
|
3294
|
+
"opencodeSkills": {},
|
|
3295
|
+
"opencodeTui": {
|
|
3296
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
3297
|
+
"plugin": [
|
|
3298
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3299
|
+
],
|
|
3300
|
+
},
|
|
3301
|
+
}
|
|
3302
|
+
`;
|
|
3303
|
+
|
|
3304
|
+
exports[`runtime surface golden fixtures teardown openspec × claude+opencode 1`] = `
|
|
3305
|
+
{
|
|
3306
|
+
"agentsMd":
|
|
3307
|
+
"<!-- MATE:COMPANION:START -->
|
|
3308
|
+
|
|
3309
|
+
You are operating in a Mate-managed session.
|
|
3310
|
+
|
|
3311
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3312
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
3313
|
+
|
|
3314
|
+
## Agent Notes
|
|
3315
|
+
|
|
3316
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3317
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3318
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3319
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3320
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3321
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3322
|
+
|
|
3323
|
+
<!-- MATE:COMPANION:END -->
|
|
3324
|
+
"
|
|
3325
|
+
,
|
|
3326
|
+
"claudeHooks": {},
|
|
3327
|
+
"claudeMcpConfig": {
|
|
3328
|
+
"mcpServers": {},
|
|
3329
|
+
},
|
|
3330
|
+
"claudeMd":
|
|
3331
|
+
"<!-- MATE:COMPANION:START -->
|
|
3332
|
+
|
|
3333
|
+
You are operating in a Mate-managed session.
|
|
3334
|
+
|
|
3335
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3336
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
3337
|
+
|
|
3338
|
+
## Claude Notes
|
|
3339
|
+
|
|
3340
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3341
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3342
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3343
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
3344
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
3345
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3346
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3347
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3348
|
+
|
|
3349
|
+
<!-- MATE:COMPANION:END -->
|
|
3350
|
+
"
|
|
3351
|
+
,
|
|
3352
|
+
"claudeSettingsLocal": {
|
|
3353
|
+
"autoMemoryEnabled": false,
|
|
3354
|
+
"permissions": {
|
|
3355
|
+
"allow": [
|
|
3356
|
+
"Bash(mate:*)",
|
|
3357
|
+
"Edit(<root>/companion/**)",
|
|
3358
|
+
"Read(<root>/companion/**)",
|
|
3359
|
+
],
|
|
3360
|
+
},
|
|
3361
|
+
},
|
|
3362
|
+
"claudeSkills": {},
|
|
3363
|
+
"opencodeConfig": {
|
|
3364
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3365
|
+
"compaction": {
|
|
3366
|
+
"auto": true,
|
|
3367
|
+
"prune": true,
|
|
3368
|
+
"reserved": 15000,
|
|
3369
|
+
},
|
|
3370
|
+
"plugin": [
|
|
3371
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3372
|
+
],
|
|
3373
|
+
"references": {
|
|
3374
|
+
"mate": "..",
|
|
3375
|
+
},
|
|
3376
|
+
"tool_output": {
|
|
3377
|
+
"max_bytes": 20000,
|
|
3378
|
+
"max_lines": 500,
|
|
3379
|
+
},
|
|
3380
|
+
},
|
|
3381
|
+
"opencodePlugins": {},
|
|
3382
|
+
"opencodeSkills": {},
|
|
3383
|
+
"opencodeTui": {
|
|
3384
|
+
"$schema": "https://opencode.ai/tui.json",
|
|
3385
|
+
"plugin": [
|
|
3386
|
+
"@uniqbit/mate-opencode-plugin@0.15.4-canary.11",
|
|
3387
|
+
],
|
|
3388
|
+
},
|
|
3389
|
+
}
|
|
3390
|
+
`;
|
|
3391
|
+
|
|
3392
|
+
exports[`runtime surface golden fixtures deselect opencode runtime with graphify enabled 1`] = `
|
|
3393
|
+
{
|
|
3394
|
+
"agentsMd":
|
|
3395
|
+
"<!-- MATE:COMPANION:START -->
|
|
3396
|
+
|
|
3397
|
+
You are operating in a Mate-managed session.
|
|
3398
|
+
|
|
3399
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3400
|
+
This block is kept for AGENTS.md compatibility and must not restate that policy.
|
|
3401
|
+
|
|
3402
|
+
## Agent Notes
|
|
3403
|
+
|
|
3404
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3405
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3406
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3407
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3408
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3409
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3410
|
+
|
|
3411
|
+
<!-- MATE:COMPANION:END -->
|
|
3412
|
+
"
|
|
3413
|
+
,
|
|
3414
|
+
"claudeHooks": {},
|
|
3415
|
+
"claudeMcpConfig": {
|
|
3416
|
+
"mcpServers": {},
|
|
3417
|
+
},
|
|
3418
|
+
"claudeMd":
|
|
3419
|
+
"<!-- MATE:COMPANION:START -->
|
|
3420
|
+
|
|
3421
|
+
You are operating in a Mate-managed session.
|
|
3422
|
+
|
|
3423
|
+
Canonical companion policy is injected through \`<companion-policy framework="mate" priority="mandatory">\`.
|
|
3424
|
+
This block is kept for Claude/AGENTS.md compatibility and must not restate that policy.
|
|
3425
|
+
|
|
3426
|
+
## Claude Notes
|
|
3427
|
+
|
|
3428
|
+
- Use absolute paths when a tool needs a file path. Do not create literal \`$MATE_REPO_PATH\` or \`$MATE_ARTIFACT_PATH\` directories.
|
|
3429
|
+
- When reporting information to me, be extremely concise and sacrifice grammar for the sake of concision. Apply this same preference to JSDoc.
|
|
3430
|
+
- Code comments: JSDoc format only (\`/** ... */\`), never \`//\`. Sparse — only non-obvious invariants or constraints, never restated artifact rationale.
|
|
3431
|
+
- Claude Code receives \`$MATE_ARTIFACT_PATH\` via \`--add-dir\`; if \`@\` autocomplete does not show companion artifacts, reference them by absolute path.
|
|
3432
|
+
- The root \`CLAUDE.md\` in the companion repo is intentional and loaded by Mate. Do not create another project-level \`CLAUDE.md\` in the working repo unless the user explicitly asks for one.
|
|
3433
|
+
- Never add a \`Co-Authored-By: <model>\` trailer or model-attribution footer to commit messages.
|
|
3434
|
+
- Never commit, push, or open a pull request in the working repo (\`$MATE_REPO_PATH\`) unless the user explicitly asks for it.
|
|
3435
|
+
- Never connect to a database (local or remote), touch live/external systems (deploys, infra), or take destructive/irreversible actions without asking the user first.
|
|
3436
|
+
|
|
3437
|
+
<!-- MATE:COMPANION:END -->
|
|
3438
|
+
"
|
|
3439
|
+
,
|
|
3440
|
+
"claudeSettingsLocal": {
|
|
3441
|
+
"autoMemoryEnabled": false,
|
|
3442
|
+
"hooks": {
|
|
3443
|
+
"PreToolUse": [
|
|
3444
|
+
{
|
|
3445
|
+
"hooks": [
|
|
3446
|
+
{
|
|
3447
|
+
"command": "<root>/companion/.claude/hooks/graphify-guard.sh",
|
|
3448
|
+
"type": "command",
|
|
3449
|
+
},
|
|
3450
|
+
],
|
|
3451
|
+
"matcher": "Bash",
|
|
3452
|
+
},
|
|
3453
|
+
],
|
|
3454
|
+
},
|
|
3455
|
+
"permissions": {
|
|
3456
|
+
"allow": [
|
|
3457
|
+
"Bash(<wrapper-bin>/graphify:*)",
|
|
3458
|
+
"Bash(graphify:*)",
|
|
3459
|
+
"Bash(mate cap graphify:*)",
|
|
3460
|
+
"Bash(mate:*)",
|
|
3461
|
+
"Edit(<root>/companion/**)",
|
|
3462
|
+
"Read(<root>/companion/**)",
|
|
3463
|
+
"Skill(graphify)",
|
|
3464
|
+
],
|
|
3465
|
+
},
|
|
3466
|
+
},
|
|
3467
|
+
"claudeSkills": {
|
|
3468
|
+
"graphify/SKILL.md":
|
|
3469
|
+
"---
|
|
3470
|
+
description: builds graphify-out artifacts
|
|
3471
|
+
---
|
|
3472
|
+
Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
|
|
3473
|
+
"
|
|
3474
|
+
,
|
|
3475
|
+
"graphify/references/github-and-merge.md":
|
|
3476
|
+
"Merge graphs into graphify-out of each clone.
|
|
3477
|
+
"
|
|
3478
|
+
,
|
|
3479
|
+
"graphify/references/usage.md":
|
|
3480
|
+
"Outputs land in $GRAPHIFY_OUT by default.
|
|
3481
|
+
"
|
|
3482
|
+
,
|
|
3483
|
+
},
|
|
3484
|
+
"opencodeConfig": null,
|
|
3485
|
+
"opencodePlugins": {},
|
|
3486
|
+
"opencodeSkills": {},
|
|
3487
|
+
"opencodeTui": null,
|
|
3488
|
+
}
|
|
3489
|
+
`;
|
|
3490
|
+
|
|
3491
|
+
exports[`working repo golden fixtures sync working repo with capabilities [tokensave, react-doctor] 1`] = `
|
|
3492
|
+
{
|
|
3493
|
+
"claudeMd":
|
|
3494
|
+
"# Project
|
|
3495
|
+
|
|
3496
|
+
User notes.
|
|
3497
|
+
"
|
|
3498
|
+
,
|
|
3499
|
+
"gitExclude":
|
|
3500
|
+
".claude/settings.local.json
|
|
3501
|
+
.tokensave/
|
|
3502
|
+
"
|
|
3503
|
+
,
|
|
3504
|
+
"settingsLocal": {
|
|
3505
|
+
"hooks": {
|
|
3506
|
+
"PreToolUse": [
|
|
3507
|
+
{
|
|
3508
|
+
"hooks": [
|
|
3509
|
+
{
|
|
3510
|
+
"command": "user-hook.sh",
|
|
3511
|
+
"type": "command",
|
|
3512
|
+
},
|
|
3513
|
+
],
|
|
3514
|
+
"matcher": "Bash",
|
|
3515
|
+
},
|
|
3516
|
+
],
|
|
3517
|
+
},
|
|
3518
|
+
"permissions": {
|
|
3519
|
+
"additionalDirectories": [
|
|
3520
|
+
"<root>/working/keep",
|
|
3521
|
+
"<root>/companion",
|
|
3522
|
+
],
|
|
3523
|
+
"allow": [
|
|
3524
|
+
"User(entry)",
|
|
3525
|
+
],
|
|
3526
|
+
},
|
|
3527
|
+
},
|
|
3528
|
+
}
|
|
3529
|
+
`;
|
|
3530
|
+
|
|
3531
|
+
exports[`working repo golden fixtures sync working repo with capabilities [] 1`] = `
|
|
3532
|
+
{
|
|
3533
|
+
"claudeMd":
|
|
3534
|
+
"# Project
|
|
3535
|
+
|
|
3536
|
+
User notes.
|
|
3537
|
+
"
|
|
3538
|
+
,
|
|
3539
|
+
"gitExclude":
|
|
3540
|
+
".claude/settings.local.json
|
|
3541
|
+
"
|
|
3542
|
+
,
|
|
3543
|
+
"settingsLocal": {
|
|
3544
|
+
"hooks": {
|
|
3545
|
+
"PreToolUse": [
|
|
3546
|
+
{
|
|
3547
|
+
"hooks": [
|
|
3548
|
+
{
|
|
3549
|
+
"command": "user-hook.sh",
|
|
3550
|
+
"type": "command",
|
|
3551
|
+
},
|
|
3552
|
+
],
|
|
3553
|
+
"matcher": "Bash",
|
|
3554
|
+
},
|
|
3555
|
+
],
|
|
3556
|
+
},
|
|
3557
|
+
"permissions": {
|
|
3558
|
+
"additionalDirectories": [
|
|
3559
|
+
"<root>/working/keep",
|
|
3560
|
+
"<root>/companion",
|
|
3561
|
+
],
|
|
3562
|
+
"allow": [
|
|
3563
|
+
"User(entry)",
|
|
3564
|
+
],
|
|
3565
|
+
},
|
|
3566
|
+
},
|
|
3567
|
+
}
|
|
3568
|
+
`;
|
|
3569
|
+
|
|
3570
|
+
exports[`working repo golden fixtures hub roots set up providers only without companion surfaces 1`] = `
|
|
3571
|
+
{
|
|
3572
|
+
"agentsMd": null,
|
|
3573
|
+
"claudeHooks": {},
|
|
3574
|
+
"claudeMcpConfig": {
|
|
3575
|
+
"mcpServers": {
|
|
3576
|
+
"tokensave": {
|
|
3577
|
+
"args": [
|
|
3578
|
+
"serve",
|
|
3579
|
+
],
|
|
3580
|
+
"command": "tokensave",
|
|
3581
|
+
},
|
|
3582
|
+
},
|
|
3583
|
+
},
|
|
3584
|
+
"claudeMd": null,
|
|
3585
|
+
"claudeSettingsLocal": {
|
|
3586
|
+
"autoMemoryEnabled": false,
|
|
3587
|
+
"permissions": {
|
|
3588
|
+
"allow": [
|
|
3589
|
+
"Bash(mate:*)",
|
|
3590
|
+
"Edit(<root>/companion/**)",
|
|
3591
|
+
"Read(<root>/companion/**)",
|
|
3592
|
+
],
|
|
3593
|
+
},
|
|
3594
|
+
},
|
|
3595
|
+
"claudeSkills": {},
|
|
3596
|
+
"opencodeConfig": {
|
|
3597
|
+
"mcp": {
|
|
3598
|
+
"tokensave": {
|
|
3599
|
+
"command": [
|
|
3600
|
+
"tokensave",
|
|
3601
|
+
"serve",
|
|
3602
|
+
],
|
|
3603
|
+
"enabled": true,
|
|
3604
|
+
"type": "local",
|
|
3605
|
+
},
|
|
3606
|
+
},
|
|
3607
|
+
},
|
|
3608
|
+
"opencodePlugins": {},
|
|
3609
|
+
"opencodeSkills": {},
|
|
3610
|
+
"opencodeTui": null,
|
|
3611
|
+
}
|
|
3612
|
+
`;
|