@uniqbit/mate-core 0.18.3-canary.0 → 0.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/claude-plugin/hooks/hooks.json +10 -1
  2. package/claude-plugin/hooks/session-banner.mjs +4 -3
  3. package/claude-plugin/hooks/session-prepare.mjs +9 -0
  4. package/opencode-plugin/src/companion.ts +47 -12
  5. package/opencode-plugin/src/server.ts +39 -4
  6. package/package.json +3 -3
  7. package/src/cli/commands/artifact/finish/openspec.ts +1 -1
  8. package/src/cli/commands/artifact/pending/discovery.ts +60 -21
  9. package/src/cli/commands/companion/link.ts +16 -11
  10. package/src/cli/commands/companion/list.ts +4 -5
  11. package/src/cli/commands/companion/open.ts +4 -5
  12. package/src/cli/commands/companion/tui.ts +1 -1
  13. package/src/cli/commands/doctor.ts +1 -1
  14. package/src/cli/commands/report/renderer.ts +9 -19
  15. package/src/cli/commands/session/prepare.ts +119 -0
  16. package/src/cli/commands/shared/companion-selection.ts +2 -2
  17. package/src/cli/commands/studio/reports.ts +0 -1
  18. package/src/cli/commands/studio/server.ts +6 -2
  19. package/src/cli/commands/unwrap.ts +28 -3
  20. package/src/cli/commands/wrap.ts +53 -59
  21. package/src/cli/companion-selector.tsx +1 -1
  22. package/src/cli/main.ts +17 -0
  23. package/src/cli/usage.ts +3 -1
  24. package/src/hooks/session-banner.ts +19 -10
  25. package/src/hooks/session-prepare.ts +101 -0
  26. package/src/lib/fs-utils.ts +13 -0
  27. package/src/lib/orchestrator/adapters/base.ts +43 -8
  28. package/src/lib/orchestrator/adapters/claude.ts +130 -29
  29. package/src/lib/orchestrator/adapters/opencode.ts +17 -19
  30. package/src/lib/orchestrator/companion-git-sync.ts +28 -1
  31. package/src/lib/orchestrator/companion-hub.ts +2 -1
  32. package/src/lib/orchestrator/config-store.ts +56 -2
  33. package/src/lib/orchestrator/framework-context.ts +5 -29
  34. package/src/lib/orchestrator/launcher.ts +36 -171
  35. package/src/lib/orchestrator/projection-claude-entry.ts +17 -6
  36. package/src/lib/orchestrator/projection-claude-skills.ts +54 -22
  37. package/src/lib/orchestrator/projection-entries.ts +78 -11
  38. package/src/lib/orchestrator/projection-opencode-copies.ts +230 -0
  39. package/src/lib/orchestrator/projection-record.ts +7 -1
  40. package/src/lib/orchestrator/projection-runtime-documents.ts +83 -130
  41. package/src/lib/orchestrator/projection-types.ts +38 -33
  42. package/src/lib/orchestrator/repository-link.ts +473 -0
  43. package/src/lib/orchestrator/root-context.ts +6 -2
  44. package/src/lib/orchestrator/session-prepare.ts +425 -0
  45. package/src/lib/orchestrator/setup-compatibilities.ts +1 -1
  46. package/src/lib/orchestrator/setup-preflight.ts +3 -1
  47. package/src/lib/orchestrator/types.ts +4 -1
  48. package/src/lib/orchestrator/working-repo-projection.ts +71 -159
  49. package/src/lib/orchestrator/workspace-inventory.ts +2 -2
  50. package/src/lib/orchestrator/wrap-pass.ts +131 -0
  51. package/src/lib/runtime-directory-refresh.ts +186 -0
  52. package/src/lib/update-checker.ts +6 -0
  53. package/src/opencode/companion-hooks.ts +24 -132
  54. package/src/opencode/companion-policy.ts +26 -10
  55. package/src/opencode/index.ts +1 -7
  56. package/src/opencode/session-notes.ts +76 -0
  57. package/src/opencode/session-prepare.ts +139 -0
  58. package/src/opencode/tui.tsx +56 -9
  59. package/src/runtime/claude-delivery-plan.ts +73 -0
  60. package/src/runtime/claude-hook-group.ts +21 -0
  61. package/src/runtime/companion-lock.ts +121 -0
  62. package/src/runtime/companion-sync.ts +66 -9
  63. package/src/runtime/runtime-directory.ts +43 -0
  64. package/src/runtime/runtime-document-manifest.ts +335 -0
  65. package/src/runtime/session-prepare-runner.ts +148 -0
  66. package/src/runtime/wrap-state.ts +90 -0
  67. package/src/runtime/write-atomic.ts +27 -0
  68. package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +2 -1
  69. package/src/templates/capabilities/openspec-cap/mate-v1/schema.yaml +2 -1
  70. package/src/templates/capabilities/openspec-cap/openspec-conventions.yaml +5 -0
  71. package/src/templates/capabilities/react-doctor/mate-react-doctor/SKILL.md +84 -0
  72. package/src/templates/capabilities/react-doctor/{skill → mate-react-doctor}/references/explain.md +18 -15
  73. package/src/templates/mate-skills/agents/mate-openspec-backfill/SKILL.md +45 -29
  74. package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +1 -1
  75. package/src/templates/mate-skills/claude/mate-openspec-backfill/SKILL.md +45 -29
  76. package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +1 -1
  77. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +850 -499
  78. package/src/tools/setup/capabilities/react-doctor.ts +34 -50
  79. package/src/tools/setup/dynamic-plugins/hydrate.ts +1 -1
  80. package/src/tools/setup/engine.ts +15 -4
  81. package/src/tools/setup/mate.ts +1 -1
  82. package/src/tools/setup/providers/claude-format.ts +11 -18
  83. package/src/tools/setup/providers/claude-plugin-hooks.ts +61 -24
  84. package/src/tools/setup/providers/claude.ts +23 -6
  85. package/src/tools/setup/runtime-documents.ts +152 -32
  86. package/src/tools/setup/working-repo-local-state.ts +82 -13
  87. package/src/tools/setup.ts +2 -2
  88. package/src/lib/orchestrator/companion-registry-reader.ts +0 -37
  89. package/src/lib/orchestrator/companion-resolver.ts +0 -179
  90. package/src/lib/orchestrator/companion-store.ts +0 -94
  91. package/src/lib/orchestrator/repo-local-registry.ts +0 -143
  92. package/src/templates/capabilities/react-doctor/claude/hooks/react-doctor.sh +0 -144
  93. package/src/templates/capabilities/react-doctor/skill/SKILL.md +0 -51
  94. package/src/templates/report-assets/README.md +0 -32
  95. package/src/templates/report-assets/mermaid.LICENSE +0 -21
  96. package/src/templates/report-assets/mermaid.min.js +0 -4376
@@ -77,8 +77,6 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
77
77
  exports[`runtime surface golden fixtures setup graphify × claude 2`] = `
78
78
  {
79
79
  "claudeArgs": [
80
- "--add-dir",
81
- "<root>/companion",
82
80
  "--append-system-prompt",
83
81
 
84
82
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -124,9 +122,7 @@ exports[`runtime surface golden fixtures setup graphify × claude 2`] = `
124
122
  "--setting-sources",
125
123
  "user,project,local",
126
124
  "--settings",
127
- "<root>/companion/.claude/settings.local.json",
128
- "--mcp-config",
129
- "<root>/companion/.mcp.json",
125
+ "<root>/companion/.claude/state/launch-settings.app.json",
130
126
  "--plugin-dir",
131
127
  "<claude-plugin>",
132
128
  ],
@@ -151,7 +147,7 @@ exports[`runtime surface golden fixtures setup graphify × claude 3`] = `
151
147
  {
152
148
  "hooks": [
153
149
  {
154
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
150
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
155
151
  "type": "command",
156
152
  },
157
153
  ],
@@ -169,7 +165,7 @@ exports[`runtime surface golden fixtures setup graphify × claude 3`] = `
169
165
  {
170
166
  "hooks": [
171
167
  {
172
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
168
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
173
169
  "type": "command",
174
170
  },
175
171
  ],
@@ -177,7 +173,16 @@ exports[`runtime surface golden fixtures setup graphify × claude 3`] = `
177
173
  {
178
174
  "hooks": [
179
175
  {
180
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
176
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
177
+ "type": "command",
178
+ },
179
+ ],
180
+ },
181
+ {
182
+ "hooks": [
183
+ {
184
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
185
+ "timeout": 45,
181
186
  "type": "command",
182
187
  },
183
188
  ],
@@ -332,30 +337,7 @@ exports[`runtime surface golden fixtures setup graphify × opencode 2`] = `
332
337
  "errors": [],
333
338
  "version": 1,
334
339
  },
335
- "OPENCODE_CONFIG_CONTENT": {
336
- "permissions": [
337
- {
338
- "action": "external_directory",
339
- "effect": "allow",
340
- "resource": "<root>/companion",
341
- },
342
- {
343
- "action": "external_directory",
344
- "effect": "allow",
345
- "resource": "<root>/companion/**",
346
- },
347
- ],
348
- "plugins": [
349
- "<opencode-plugin>",
350
- ],
351
- "references": {
352
- "mate": "<root>/companion",
353
- },
354
- "skills": [
355
- "<root>/companion/.agents/skills",
356
- ],
357
- },
358
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
340
+ "OPENCODE_CONFIG_CONTENT": {},
359
341
  },
360
342
  }
361
343
  `;
@@ -371,7 +353,7 @@ exports[`runtime surface golden fixtures setup graphify × opencode 3`] = `
371
353
  ],
372
354
  "kind": "list",
373
355
  "values": [
374
- "<opencode-plugin>",
356
+ "<runtime-opencode-plugin>",
375
357
  ],
376
358
  },
377
359
  {
@@ -392,6 +374,49 @@ exports[`runtime surface golden fixtures setup graphify × opencode 3`] = `
392
374
  },
393
375
  ],
394
376
  },
377
+ {
378
+ "at": [
379
+ "skills",
380
+ ],
381
+ "kind": "list",
382
+ "values": [
383
+ "<root>/companion/.agents/skills",
384
+ ],
385
+ },
386
+ {
387
+ "at": [
388
+ "references",
389
+ ],
390
+ "entries": {
391
+ "mate": "<root>/companion",
392
+ },
393
+ "kind": "map",
394
+ },
395
+ {
396
+ "at": [
397
+ "compaction",
398
+ ],
399
+ "kind": "value",
400
+ "value": {
401
+ "auto": true,
402
+ "buffer": 20000,
403
+ "keep": {
404
+ "tokens": 15000,
405
+ },
406
+ },
407
+ "yields": true,
408
+ },
409
+ {
410
+ "at": [
411
+ "tool_output",
412
+ ],
413
+ "kind": "value",
414
+ "value": {
415
+ "max_bytes": 40000,
416
+ "max_lines": 1000,
417
+ },
418
+ "yields": true,
419
+ },
395
420
  ],
396
421
  },
397
422
  ]
@@ -511,8 +536,6 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
511
536
  exports[`runtime surface golden fixtures setup graphify × claude+opencode 2`] = `
512
537
  {
513
538
  "claudeArgs": [
514
- "--add-dir",
515
- "<root>/companion",
516
539
  "--append-system-prompt",
517
540
 
518
541
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -558,9 +581,7 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 2`] =
558
581
  "--setting-sources",
559
582
  "user,project,local",
560
583
  "--settings",
561
- "<root>/companion/.claude/settings.local.json",
562
- "--mcp-config",
563
- "<root>/companion/.mcp.json",
584
+ "<root>/companion/.claude/state/launch-settings.app.json",
564
585
  "--plugin-dir",
565
586
  "<claude-plugin>",
566
587
  ],
@@ -618,30 +639,7 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 2`] =
618
639
  "errors": [],
619
640
  "version": 1,
620
641
  },
621
- "OPENCODE_CONFIG_CONTENT": {
622
- "permissions": [
623
- {
624
- "action": "external_directory",
625
- "effect": "allow",
626
- "resource": "<root>/companion",
627
- },
628
- {
629
- "action": "external_directory",
630
- "effect": "allow",
631
- "resource": "<root>/companion/**",
632
- },
633
- ],
634
- "plugins": [
635
- "<opencode-plugin>",
636
- ],
637
- "references": {
638
- "mate": "<root>/companion",
639
- },
640
- "skills": [
641
- "<root>/companion/.agents/skills",
642
- ],
643
- },
644
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
642
+ "OPENCODE_CONFIG_CONTENT": {},
645
643
  },
646
644
  }
647
645
  `;
@@ -661,7 +659,7 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
661
659
  {
662
660
  "hooks": [
663
661
  {
664
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
662
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
665
663
  "type": "command",
666
664
  },
667
665
  ],
@@ -679,7 +677,15 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
679
677
  {
680
678
  "hooks": [
681
679
  {
682
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
680
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
681
+ "type": "command",
682
+ },
683
+ ],
684
+ },
685
+ {
686
+ "hooks": [
687
+ {
688
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
683
689
  "type": "command",
684
690
  },
685
691
  ],
@@ -687,7 +693,8 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
687
693
  {
688
694
  "hooks": [
689
695
  {
690
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
696
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
697
+ "timeout": 45,
691
698
  "type": "command",
692
699
  },
693
700
  ],
@@ -731,7 +738,7 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
731
738
  ],
732
739
  "kind": "list",
733
740
  "values": [
734
- "<opencode-plugin>",
741
+ "<runtime-opencode-plugin>",
735
742
  ],
736
743
  },
737
744
  {
@@ -752,6 +759,49 @@ exports[`runtime surface golden fixtures setup graphify × claude+opencode 3`] =
752
759
  },
753
760
  ],
754
761
  },
762
+ {
763
+ "at": [
764
+ "skills",
765
+ ],
766
+ "kind": "list",
767
+ "values": [
768
+ "<root>/companion/.agents/skills",
769
+ ],
770
+ },
771
+ {
772
+ "at": [
773
+ "references",
774
+ ],
775
+ "entries": {
776
+ "mate": "<root>/companion",
777
+ },
778
+ "kind": "map",
779
+ },
780
+ {
781
+ "at": [
782
+ "compaction",
783
+ ],
784
+ "kind": "value",
785
+ "value": {
786
+ "auto": true,
787
+ "buffer": 20000,
788
+ "keep": {
789
+ "tokens": 15000,
790
+ },
791
+ },
792
+ "yields": true,
793
+ },
794
+ {
795
+ "at": [
796
+ "tool_output",
797
+ ],
798
+ "kind": "value",
799
+ "value": {
800
+ "max_bytes": 40000,
801
+ "max_lines": 1000,
802
+ },
803
+ "yields": true,
804
+ },
755
805
  ],
756
806
  },
757
807
  ]
@@ -851,8 +901,6 @@ exports[`runtime surface golden fixtures setup tokensave × claude 1`] = `
851
901
  exports[`runtime surface golden fixtures setup tokensave × claude 2`] = `
852
902
  {
853
903
  "claudeArgs": [
854
- "--add-dir",
855
- "<root>/companion",
856
904
  "--append-system-prompt",
857
905
 
858
906
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -895,9 +943,7 @@ exports[`runtime surface golden fixtures setup tokensave × claude 2`] = `
895
943
  "--setting-sources",
896
944
  "user,project,local",
897
945
  "--settings",
898
- "<root>/companion/.claude/settings.local.json",
899
- "--mcp-config",
900
- "<root>/companion/.mcp.json",
946
+ "<root>/companion/.claude/state/launch-settings.app.json",
901
947
  "--plugin-dir",
902
948
  "<claude-plugin>",
903
949
  ],
@@ -922,12 +968,24 @@ exports[`runtime surface golden fixtures setup tokensave × claude 3`] = `
922
968
  {
923
969
  "hooks": [
924
970
  {
925
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
971
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
926
972
  "type": "command",
927
973
  },
928
974
  ],
929
975
  "matcher": "Write|Edit|MultiEdit|Bash",
930
976
  },
977
+ {
978
+ "hooks": [
979
+ {
980
+ "args": [
981
+ "hook-pre-tool-use",
982
+ ],
983
+ "command": "<root>/bin/tokensave",
984
+ "type": "command",
985
+ },
986
+ ],
987
+ "matcher": "Agent|Grep|Bash",
988
+ },
931
989
  ],
932
990
  },
933
991
  {
@@ -940,15 +998,64 @@ exports[`runtime surface golden fixtures setup tokensave × claude 3`] = `
940
998
  {
941
999
  "hooks": [
942
1000
  {
943
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
1001
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
1002
+ "type": "command",
1003
+ },
1004
+ ],
1005
+ },
1006
+ {
1007
+ "hooks": [
1008
+ {
1009
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
1010
+ "type": "command",
1011
+ },
1012
+ ],
1013
+ },
1014
+ {
1015
+ "hooks": [
1016
+ {
1017
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
1018
+ "timeout": 45,
1019
+ "type": "command",
1020
+ },
1021
+ ],
1022
+ },
1023
+ ],
1024
+ },
1025
+ {
1026
+ "at": [
1027
+ "hooks",
1028
+ "UserPromptSubmit",
1029
+ ],
1030
+ "kind": "list",
1031
+ "values": [
1032
+ {
1033
+ "hooks": [
1034
+ {
1035
+ "args": [
1036
+ "hook-prompt-submit",
1037
+ ],
1038
+ "command": "<root>/bin/tokensave",
944
1039
  "type": "command",
945
1040
  },
946
1041
  ],
947
1042
  },
1043
+ ],
1044
+ },
1045
+ {
1046
+ "at": [
1047
+ "hooks",
1048
+ "Stop",
1049
+ ],
1050
+ "kind": "list",
1051
+ "values": [
948
1052
  {
949
1053
  "hooks": [
950
1054
  {
951
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
1055
+ "args": [
1056
+ "hook-stop",
1057
+ ],
1058
+ "command": "<root>/bin/tokensave",
952
1059
  "type": "command",
953
1060
  },
954
1061
  ],
@@ -1109,30 +1216,7 @@ exports[`runtime surface golden fixtures setup tokensave × opencode 2`] = `
1109
1216
  "errors": [],
1110
1217
  "version": 1,
1111
1218
  },
1112
- "OPENCODE_CONFIG_CONTENT": {
1113
- "permissions": [
1114
- {
1115
- "action": "external_directory",
1116
- "effect": "allow",
1117
- "resource": "<root>/companion",
1118
- },
1119
- {
1120
- "action": "external_directory",
1121
- "effect": "allow",
1122
- "resource": "<root>/companion/**",
1123
- },
1124
- ],
1125
- "plugins": [
1126
- "<opencode-plugin>",
1127
- ],
1128
- "references": {
1129
- "mate": "<root>/companion",
1130
- },
1131
- "skills": [
1132
- "<root>/companion/.agents/skills",
1133
- ],
1134
- },
1135
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
1219
+ "OPENCODE_CONFIG_CONTENT": {},
1136
1220
  },
1137
1221
  }
1138
1222
  `;
@@ -1148,7 +1232,7 @@ exports[`runtime surface golden fixtures setup tokensave × opencode 3`] = `
1148
1232
  ],
1149
1233
  "kind": "list",
1150
1234
  "values": [
1151
- "<opencode-plugin>",
1235
+ "<runtime-opencode-plugin>",
1152
1236
  ],
1153
1237
  },
1154
1238
  {
@@ -1186,6 +1270,49 @@ exports[`runtime surface golden fixtures setup tokensave × opencode 3`] = `
1186
1270
  },
1187
1271
  ],
1188
1272
  },
1273
+ {
1274
+ "at": [
1275
+ "skills",
1276
+ ],
1277
+ "kind": "list",
1278
+ "values": [
1279
+ "<root>/companion/.agents/skills",
1280
+ ],
1281
+ },
1282
+ {
1283
+ "at": [
1284
+ "references",
1285
+ ],
1286
+ "entries": {
1287
+ "mate": "<root>/companion",
1288
+ },
1289
+ "kind": "map",
1290
+ },
1291
+ {
1292
+ "at": [
1293
+ "compaction",
1294
+ ],
1295
+ "kind": "value",
1296
+ "value": {
1297
+ "auto": true,
1298
+ "buffer": 20000,
1299
+ "keep": {
1300
+ "tokens": 15000,
1301
+ },
1302
+ },
1303
+ "yields": true,
1304
+ },
1305
+ {
1306
+ "at": [
1307
+ "tool_output",
1308
+ ],
1309
+ "kind": "value",
1310
+ "value": {
1311
+ "max_bytes": 40000,
1312
+ "max_lines": 1000,
1313
+ },
1314
+ "yields": true,
1315
+ },
1189
1316
  ],
1190
1317
  },
1191
1318
  ]
@@ -1313,8 +1440,6 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 1`]
1313
1440
  exports[`runtime surface golden fixtures setup tokensave × claude+opencode 2`] = `
1314
1441
  {
1315
1442
  "claudeArgs": [
1316
- "--add-dir",
1317
- "<root>/companion",
1318
1443
  "--append-system-prompt",
1319
1444
 
1320
1445
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -1357,9 +1482,7 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 2`]
1357
1482
  "--setting-sources",
1358
1483
  "user,project,local",
1359
1484
  "--settings",
1360
- "<root>/companion/.claude/settings.local.json",
1361
- "--mcp-config",
1362
- "<root>/companion/.mcp.json",
1485
+ "<root>/companion/.claude/state/launch-settings.app.json",
1363
1486
  "--plugin-dir",
1364
1487
  "<claude-plugin>",
1365
1488
  ],
@@ -1414,30 +1537,7 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 2`]
1414
1537
  "errors": [],
1415
1538
  "version": 1,
1416
1539
  },
1417
- "OPENCODE_CONFIG_CONTENT": {
1418
- "permissions": [
1419
- {
1420
- "action": "external_directory",
1421
- "effect": "allow",
1422
- "resource": "<root>/companion",
1423
- },
1424
- {
1425
- "action": "external_directory",
1426
- "effect": "allow",
1427
- "resource": "<root>/companion/**",
1428
- },
1429
- ],
1430
- "plugins": [
1431
- "<opencode-plugin>",
1432
- ],
1433
- "references": {
1434
- "mate": "<root>/companion",
1435
- },
1436
- "skills": [
1437
- "<root>/companion/.agents/skills",
1438
- ],
1439
- },
1440
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
1540
+ "OPENCODE_CONFIG_CONTENT": {},
1441
1541
  },
1442
1542
  }
1443
1543
  `;
@@ -1457,12 +1557,24 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
1457
1557
  {
1458
1558
  "hooks": [
1459
1559
  {
1460
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
1560
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
1461
1561
  "type": "command",
1462
1562
  },
1463
1563
  ],
1464
1564
  "matcher": "Write|Edit|MultiEdit|Bash",
1465
1565
  },
1566
+ {
1567
+ "hooks": [
1568
+ {
1569
+ "args": [
1570
+ "hook-pre-tool-use",
1571
+ ],
1572
+ "command": "<root>/bin/tokensave",
1573
+ "type": "command",
1574
+ },
1575
+ ],
1576
+ "matcher": "Agent|Grep|Bash",
1577
+ },
1466
1578
  ],
1467
1579
  },
1468
1580
  {
@@ -1475,15 +1587,64 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
1475
1587
  {
1476
1588
  "hooks": [
1477
1589
  {
1478
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
1590
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
1591
+ "type": "command",
1592
+ },
1593
+ ],
1594
+ },
1595
+ {
1596
+ "hooks": [
1597
+ {
1598
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
1599
+ "type": "command",
1600
+ },
1601
+ ],
1602
+ },
1603
+ {
1604
+ "hooks": [
1605
+ {
1606
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
1607
+ "timeout": 45,
1608
+ "type": "command",
1609
+ },
1610
+ ],
1611
+ },
1612
+ ],
1613
+ },
1614
+ {
1615
+ "at": [
1616
+ "hooks",
1617
+ "UserPromptSubmit",
1618
+ ],
1619
+ "kind": "list",
1620
+ "values": [
1621
+ {
1622
+ "hooks": [
1623
+ {
1624
+ "args": [
1625
+ "hook-prompt-submit",
1626
+ ],
1627
+ "command": "<root>/bin/tokensave",
1479
1628
  "type": "command",
1480
1629
  },
1481
1630
  ],
1482
1631
  },
1632
+ ],
1633
+ },
1634
+ {
1635
+ "at": [
1636
+ "hooks",
1637
+ "Stop",
1638
+ ],
1639
+ "kind": "list",
1640
+ "values": [
1483
1641
  {
1484
1642
  "hooks": [
1485
1643
  {
1486
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
1644
+ "args": [
1645
+ "hook-stop",
1646
+ ],
1647
+ "command": "<root>/bin/tokensave",
1487
1648
  "type": "command",
1488
1649
  },
1489
1650
  ],
@@ -1545,7 +1706,7 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
1545
1706
  ],
1546
1707
  "kind": "list",
1547
1708
  "values": [
1548
- "<opencode-plugin>",
1709
+ "<runtime-opencode-plugin>",
1549
1710
  ],
1550
1711
  },
1551
1712
  {
@@ -1583,6 +1744,49 @@ exports[`runtime surface golden fixtures setup tokensave × claude+opencode 3`]
1583
1744
  },
1584
1745
  ],
1585
1746
  },
1747
+ {
1748
+ "at": [
1749
+ "skills",
1750
+ ],
1751
+ "kind": "list",
1752
+ "values": [
1753
+ "<root>/companion/.agents/skills",
1754
+ ],
1755
+ },
1756
+ {
1757
+ "at": [
1758
+ "references",
1759
+ ],
1760
+ "entries": {
1761
+ "mate": "<root>/companion",
1762
+ },
1763
+ "kind": "map",
1764
+ },
1765
+ {
1766
+ "at": [
1767
+ "compaction",
1768
+ ],
1769
+ "kind": "value",
1770
+ "value": {
1771
+ "auto": true,
1772
+ "buffer": 20000,
1773
+ "keep": {
1774
+ "tokens": 15000,
1775
+ },
1776
+ },
1777
+ "yields": true,
1778
+ },
1779
+ {
1780
+ "at": [
1781
+ "tool_output",
1782
+ ],
1783
+ "kind": "value",
1784
+ "value": {
1785
+ "max_bytes": 40000,
1786
+ "max_lines": 1000,
1787
+ },
1788
+ "yields": true,
1789
+ },
1586
1790
  ],
1587
1791
  },
1588
1792
  ]
@@ -1634,8 +1838,6 @@ exports[`runtime surface golden fixtures setup context-mode × claude 1`] = `
1634
1838
  exports[`runtime surface golden fixtures setup context-mode × claude 2`] = `
1635
1839
  {
1636
1840
  "claudeArgs": [
1637
- "--add-dir",
1638
- "<root>/companion",
1639
1841
  "--append-system-prompt",
1640
1842
 
1641
1843
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -1670,9 +1872,7 @@ exports[`runtime surface golden fixtures setup context-mode × claude 2`] = `
1670
1872
  "--setting-sources",
1671
1873
  "user,project,local",
1672
1874
  "--settings",
1673
- "<root>/companion/.claude/settings.local.json",
1674
- "--mcp-config",
1675
- "<root>/companion/.mcp.json",
1875
+ "<root>/companion/.claude/state/launch-settings.app.json",
1676
1876
  "--plugin-dir",
1677
1877
  "<claude-plugin>",
1678
1878
  "--plugin-dir",
@@ -1699,7 +1899,7 @@ exports[`runtime surface golden fixtures setup context-mode × claude 3`] = `
1699
1899
  {
1700
1900
  "hooks": [
1701
1901
  {
1702
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
1902
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
1703
1903
  "type": "command",
1704
1904
  },
1705
1905
  ],
@@ -1717,7 +1917,15 @@ exports[`runtime surface golden fixtures setup context-mode × claude 3`] = `
1717
1917
  {
1718
1918
  "hooks": [
1719
1919
  {
1720
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
1920
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
1921
+ "type": "command",
1922
+ },
1923
+ ],
1924
+ },
1925
+ {
1926
+ "hooks": [
1927
+ {
1928
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
1721
1929
  "type": "command",
1722
1930
  },
1723
1931
  ],
@@ -1725,7 +1933,8 @@ exports[`runtime surface golden fixtures setup context-mode × claude 3`] = `
1725
1933
  {
1726
1934
  "hooks": [
1727
1935
  {
1728
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
1936
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
1937
+ "timeout": 45,
1729
1938
  "type": "command",
1730
1939
  },
1731
1940
  ],
@@ -1857,30 +2066,7 @@ exports[`runtime surface golden fixtures setup context-mode × opencode 2`] = `
1857
2066
  "errors": [],
1858
2067
  "version": 1,
1859
2068
  },
1860
- "OPENCODE_CONFIG_CONTENT": {
1861
- "permissions": [
1862
- {
1863
- "action": "external_directory",
1864
- "effect": "allow",
1865
- "resource": "<root>/companion",
1866
- },
1867
- {
1868
- "action": "external_directory",
1869
- "effect": "allow",
1870
- "resource": "<root>/companion/**",
1871
- },
1872
- ],
1873
- "plugins": [
1874
- "<opencode-plugin>",
1875
- ],
1876
- "references": {
1877
- "mate": "<root>/companion",
1878
- },
1879
- "skills": [
1880
- "<root>/companion/.agents/skills",
1881
- ],
1882
- },
1883
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
2069
+ "OPENCODE_CONFIG_CONTENT": {},
1884
2070
  },
1885
2071
  }
1886
2072
  `;
@@ -1896,7 +2082,8 @@ exports[`runtime surface golden fixtures setup context-mode × opencode 3`] = `
1896
2082
  ],
1897
2083
  "kind": "list",
1898
2084
  "values": [
1899
- "<opencode-plugin>",
2085
+ "context-mode@1.0.169",
2086
+ "<runtime-opencode-plugin>",
1900
2087
  ],
1901
2088
  },
1902
2089
  {
@@ -1917,12 +2104,55 @@ exports[`runtime surface golden fixtures setup context-mode × opencode 3`] = `
1917
2104
  },
1918
2105
  ],
1919
2106
  },
1920
- ],
1921
- },
1922
- ]
1923
- `;
1924
-
1925
- exports[`runtime surface golden fixtures setup context-mode × claude+opencode 1`] = `
2107
+ {
2108
+ "at": [
2109
+ "skills",
2110
+ ],
2111
+ "kind": "list",
2112
+ "values": [
2113
+ "<root>/companion/.agents/skills",
2114
+ ],
2115
+ },
2116
+ {
2117
+ "at": [
2118
+ "references",
2119
+ ],
2120
+ "entries": {
2121
+ "mate": "<root>/companion",
2122
+ },
2123
+ "kind": "map",
2124
+ },
2125
+ {
2126
+ "at": [
2127
+ "compaction",
2128
+ ],
2129
+ "kind": "value",
2130
+ "value": {
2131
+ "auto": true,
2132
+ "buffer": 20000,
2133
+ "keep": {
2134
+ "tokens": 15000,
2135
+ },
2136
+ },
2137
+ "yields": true,
2138
+ },
2139
+ {
2140
+ "at": [
2141
+ "tool_output",
2142
+ ],
2143
+ "kind": "value",
2144
+ "value": {
2145
+ "max_bytes": 40000,
2146
+ "max_lines": 1000,
2147
+ },
2148
+ "yields": true,
2149
+ },
2150
+ ],
2151
+ },
2152
+ ]
2153
+ `;
2154
+
2155
+ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 1`] = `
1926
2156
  {
1927
2157
  "agentsMd":
1928
2158
  "<!-- MATE:COMPANION:START -->
@@ -1995,8 +2225,6 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
1995
2225
  exports[`runtime surface golden fixtures setup context-mode × claude+opencode 2`] = `
1996
2226
  {
1997
2227
  "claudeArgs": [
1998
- "--add-dir",
1999
- "<root>/companion",
2000
2228
  "--append-system-prompt",
2001
2229
 
2002
2230
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -2031,9 +2259,7 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 2
2031
2259
  "--setting-sources",
2032
2260
  "user,project,local",
2033
2261
  "--settings",
2034
- "<root>/companion/.claude/settings.local.json",
2035
- "--mcp-config",
2036
- "<root>/companion/.mcp.json",
2262
+ "<root>/companion/.claude/state/launch-settings.app.json",
2037
2263
  "--plugin-dir",
2038
2264
  "<claude-plugin>",
2039
2265
  "--plugin-dir",
@@ -2082,30 +2308,7 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 2
2082
2308
  "errors": [],
2083
2309
  "version": 1,
2084
2310
  },
2085
- "OPENCODE_CONFIG_CONTENT": {
2086
- "permissions": [
2087
- {
2088
- "action": "external_directory",
2089
- "effect": "allow",
2090
- "resource": "<root>/companion",
2091
- },
2092
- {
2093
- "action": "external_directory",
2094
- "effect": "allow",
2095
- "resource": "<root>/companion/**",
2096
- },
2097
- ],
2098
- "plugins": [
2099
- "<opencode-plugin>",
2100
- ],
2101
- "references": {
2102
- "mate": "<root>/companion",
2103
- },
2104
- "skills": [
2105
- "<root>/companion/.agents/skills",
2106
- ],
2107
- },
2108
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
2311
+ "OPENCODE_CONFIG_CONTENT": {},
2109
2312
  },
2110
2313
  }
2111
2314
  `;
@@ -2125,7 +2328,7 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
2125
2328
  {
2126
2329
  "hooks": [
2127
2330
  {
2128
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
2331
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
2129
2332
  "type": "command",
2130
2333
  },
2131
2334
  ],
@@ -2143,7 +2346,15 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
2143
2346
  {
2144
2347
  "hooks": [
2145
2348
  {
2146
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
2349
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
2350
+ "type": "command",
2351
+ },
2352
+ ],
2353
+ },
2354
+ {
2355
+ "hooks": [
2356
+ {
2357
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
2147
2358
  "type": "command",
2148
2359
  },
2149
2360
  ],
@@ -2151,7 +2362,8 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
2151
2362
  {
2152
2363
  "hooks": [
2153
2364
  {
2154
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
2365
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
2366
+ "timeout": 45,
2155
2367
  "type": "command",
2156
2368
  },
2157
2369
  ],
@@ -2193,7 +2405,8 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
2193
2405
  ],
2194
2406
  "kind": "list",
2195
2407
  "values": [
2196
- "<opencode-plugin>",
2408
+ "context-mode@1.0.169",
2409
+ "<runtime-opencode-plugin>",
2197
2410
  ],
2198
2411
  },
2199
2412
  {
@@ -2214,6 +2427,49 @@ exports[`runtime surface golden fixtures setup context-mode × claude+opencode 3
2214
2427
  },
2215
2428
  ],
2216
2429
  },
2430
+ {
2431
+ "at": [
2432
+ "skills",
2433
+ ],
2434
+ "kind": "list",
2435
+ "values": [
2436
+ "<root>/companion/.agents/skills",
2437
+ ],
2438
+ },
2439
+ {
2440
+ "at": [
2441
+ "references",
2442
+ ],
2443
+ "entries": {
2444
+ "mate": "<root>/companion",
2445
+ },
2446
+ "kind": "map",
2447
+ },
2448
+ {
2449
+ "at": [
2450
+ "compaction",
2451
+ ],
2452
+ "kind": "value",
2453
+ "value": {
2454
+ "auto": true,
2455
+ "buffer": 20000,
2456
+ "keep": {
2457
+ "tokens": 15000,
2458
+ },
2459
+ },
2460
+ "yields": true,
2461
+ },
2462
+ {
2463
+ "at": [
2464
+ "tool_output",
2465
+ ],
2466
+ "kind": "value",
2467
+ "value": {
2468
+ "max_bytes": 40000,
2469
+ "max_lines": 1000,
2470
+ },
2471
+ "yields": true,
2472
+ },
2217
2473
  ],
2218
2474
  },
2219
2475
  ]
@@ -2233,9 +2489,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 1`] = `
2233
2489
  <!-- MATE:COMPANION:END -->
2234
2490
  "
2235
2491
  ,
2236
- "claudeHooks": {
2237
- "react-doctor.sh": "a33e1b4ac810",
2238
- },
2492
+ "claudeHooks": {},
2239
2493
  "claudeMcpConfig": {
2240
2494
  "mcpServers": {},
2241
2495
  },
@@ -2245,45 +2499,19 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 1`] = `
2245
2499
  ,
2246
2500
  "claudeSettingsLocal": {
2247
2501
  "autoMemoryEnabled": false,
2248
- "hooks": {
2249
- "PostToolUse": [
2250
- {
2251
- "hooks": [
2252
- {
2253
- "command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
2254
- "timeout": 5,
2255
- "type": "command",
2256
- },
2257
- ],
2258
- "matcher": "Write|Edit|MultiEdit|NotebookEdit|ApplyPatch",
2259
- },
2260
- ],
2261
- "Stop": [
2262
- {
2263
- "hooks": [
2264
- {
2265
- "command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
2266
- "timeout": 45,
2267
- "type": "command",
2268
- },
2269
- ],
2270
- },
2271
- ],
2272
- },
2273
2502
  "permissions": {
2274
2503
  "allow": [
2504
+ "Bash(<react-doctor-bin>:*)",
2275
2505
  "Bash(mate:*)",
2276
- "Bash(npx react-doctor:*)",
2277
- "Bash(npx react-doctor@latest *)",
2278
2506
  "Edit(<root>/companion/**)",
2279
2507
  "Read(<root>/companion/**)",
2280
- "Skill(react-doctor)",
2508
+ "Skill(mate-react-doctor)",
2281
2509
  ],
2282
2510
  },
2283
2511
  },
2284
2512
  "claudeSkills": {
2285
- "react-doctor/SKILL.md": "df58b3490543",
2286
- "react-doctor/references/explain.md": "2382ea820f20",
2513
+ "mate-react-doctor/SKILL.md": "2ecf137679df",
2514
+ "mate-react-doctor/references/explain.md": "86754a7e5436",
2287
2515
  },
2288
2516
  "opencodeConfig": null,
2289
2517
  "opencodePlugins": {},
@@ -2296,8 +2524,6 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 1`] = `
2296
2524
  exports[`runtime surface golden fixtures setup react-doctor × claude 2`] = `
2297
2525
  {
2298
2526
  "claudeArgs": [
2299
- "--add-dir",
2300
- "<root>/companion",
2301
2527
  "--append-system-prompt",
2302
2528
 
2303
2529
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -2332,9 +2558,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 2`] = `
2332
2558
  "--setting-sources",
2333
2559
  "user,project,local",
2334
2560
  "--settings",
2335
- "<root>/companion/.claude/settings.local.json",
2336
- "--mcp-config",
2337
- "<root>/companion/.mcp.json",
2561
+ "<root>/companion/.claude/state/launch-settings.app.json",
2338
2562
  "--plugin-dir",
2339
2563
  "<claude-plugin>",
2340
2564
  ],
@@ -2359,7 +2583,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 3`] = `
2359
2583
  {
2360
2584
  "hooks": [
2361
2585
  {
2362
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
2586
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
2363
2587
  "type": "command",
2364
2588
  },
2365
2589
  ],
@@ -2377,7 +2601,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 3`] = `
2377
2601
  {
2378
2602
  "hooks": [
2379
2603
  {
2380
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
2604
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
2381
2605
  "type": "command",
2382
2606
  },
2383
2607
  ],
@@ -2385,7 +2609,16 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 3`] = `
2385
2609
  {
2386
2610
  "hooks": [
2387
2611
  {
2388
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
2612
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
2613
+ "type": "command",
2614
+ },
2615
+ ],
2616
+ },
2617
+ {
2618
+ "hooks": [
2619
+ {
2620
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
2621
+ "timeout": 45,
2389
2622
  "type": "command",
2390
2623
  },
2391
2624
  ],
@@ -2412,9 +2645,8 @@ exports[`runtime surface golden fixtures setup react-doctor × claude 3`] = `
2412
2645
  "Bash(mate:*)",
2413
2646
  "Read(<root>/companion/**)",
2414
2647
  "Edit(<root>/companion/**)",
2415
- "Skill(react-doctor)",
2416
- "Bash(npx react-doctor:*)",
2417
- "Bash(npx react-doctor@latest *)",
2648
+ "Skill(mate-react-doctor)",
2649
+ "Bash(<react-doctor-bin>:*)",
2418
2650
  ],
2419
2651
  },
2420
2652
  ],
@@ -2462,8 +2694,8 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 1`] = `
2462
2694
  "opencodeSkills": {},
2463
2695
  "opencodeTui": null,
2464
2696
  "sharedSkills": {
2465
- "react-doctor/SKILL.md": "df58b3490543",
2466
- "react-doctor/references/explain.md": "2382ea820f20",
2697
+ "mate-react-doctor/SKILL.md": "2ecf137679df",
2698
+ "mate-react-doctor/references/explain.md": "86754a7e5436",
2467
2699
  },
2468
2700
  }
2469
2701
  `;
@@ -2510,30 +2742,7 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 2`] = `
2510
2742
  "errors": [],
2511
2743
  "version": 1,
2512
2744
  },
2513
- "OPENCODE_CONFIG_CONTENT": {
2514
- "permissions": [
2515
- {
2516
- "action": "external_directory",
2517
- "effect": "allow",
2518
- "resource": "<root>/companion",
2519
- },
2520
- {
2521
- "action": "external_directory",
2522
- "effect": "allow",
2523
- "resource": "<root>/companion/**",
2524
- },
2525
- ],
2526
- "plugins": [
2527
- "<opencode-plugin>",
2528
- ],
2529
- "references": {
2530
- "mate": "<root>/companion",
2531
- },
2532
- "skills": [
2533
- "<root>/companion/.agents/skills",
2534
- ],
2535
- },
2536
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
2745
+ "OPENCODE_CONFIG_CONTENT": {},
2537
2746
  },
2538
2747
  }
2539
2748
  `;
@@ -2549,7 +2758,7 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 3`] = `
2549
2758
  ],
2550
2759
  "kind": "list",
2551
2760
  "values": [
2552
- "<opencode-plugin>",
2761
+ "<runtime-opencode-plugin>",
2553
2762
  ],
2554
2763
  },
2555
2764
  {
@@ -2570,6 +2779,49 @@ exports[`runtime surface golden fixtures setup react-doctor × opencode 3`] = `
2570
2779
  },
2571
2780
  ],
2572
2781
  },
2782
+ {
2783
+ "at": [
2784
+ "skills",
2785
+ ],
2786
+ "kind": "list",
2787
+ "values": [
2788
+ "<root>/companion/.agents/skills",
2789
+ ],
2790
+ },
2791
+ {
2792
+ "at": [
2793
+ "references",
2794
+ ],
2795
+ "entries": {
2796
+ "mate": "<root>/companion",
2797
+ },
2798
+ "kind": "map",
2799
+ },
2800
+ {
2801
+ "at": [
2802
+ "compaction",
2803
+ ],
2804
+ "kind": "value",
2805
+ "value": {
2806
+ "auto": true,
2807
+ "buffer": 20000,
2808
+ "keep": {
2809
+ "tokens": 15000,
2810
+ },
2811
+ },
2812
+ "yields": true,
2813
+ },
2814
+ {
2815
+ "at": [
2816
+ "tool_output",
2817
+ ],
2818
+ "kind": "value",
2819
+ "value": {
2820
+ "max_bytes": 40000,
2821
+ "max_lines": 1000,
2822
+ },
2823
+ "yields": true,
2824
+ },
2573
2825
  ],
2574
2826
  },
2575
2827
  ]
@@ -2589,9 +2841,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1
2589
2841
  <!-- MATE:COMPANION:END -->
2590
2842
  "
2591
2843
  ,
2592
- "claudeHooks": {
2593
- "react-doctor.sh": "a33e1b4ac810",
2594
- },
2844
+ "claudeHooks": {},
2595
2845
  "claudeMcpConfig": {
2596
2846
  "mcpServers": {},
2597
2847
  },
@@ -2601,45 +2851,19 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1
2601
2851
  ,
2602
2852
  "claudeSettingsLocal": {
2603
2853
  "autoMemoryEnabled": false,
2604
- "hooks": {
2605
- "PostToolUse": [
2606
- {
2607
- "hooks": [
2608
- {
2609
- "command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
2610
- "timeout": 5,
2611
- "type": "command",
2612
- },
2613
- ],
2614
- "matcher": "Write|Edit|MultiEdit|NotebookEdit|ApplyPatch",
2615
- },
2616
- ],
2617
- "Stop": [
2618
- {
2619
- "hooks": [
2620
- {
2621
- "command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
2622
- "timeout": 45,
2623
- "type": "command",
2624
- },
2625
- ],
2626
- },
2627
- ],
2628
- },
2629
2854
  "permissions": {
2630
2855
  "allow": [
2856
+ "Bash(<react-doctor-bin>:*)",
2631
2857
  "Bash(mate:*)",
2632
- "Bash(npx react-doctor:*)",
2633
- "Bash(npx react-doctor@latest *)",
2634
2858
  "Edit(<root>/companion/**)",
2635
2859
  "Read(<root>/companion/**)",
2636
- "Skill(react-doctor)",
2860
+ "Skill(mate-react-doctor)",
2637
2861
  ],
2638
2862
  },
2639
2863
  },
2640
2864
  "claudeSkills": {
2641
- "react-doctor/SKILL.md": "df58b3490543",
2642
- "react-doctor/references/explain.md": "2382ea820f20",
2865
+ "mate-react-doctor/SKILL.md": "2ecf137679df",
2866
+ "mate-react-doctor/references/explain.md": "86754a7e5436",
2643
2867
  },
2644
2868
  "opencodeConfig": {
2645
2869
  "$schema": "https://opencode.ai/config.json",
@@ -2662,8 +2886,8 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1
2662
2886
  "opencodeSkills": {},
2663
2887
  "opencodeTui": null,
2664
2888
  "sharedSkills": {
2665
- "react-doctor/SKILL.md": "df58b3490543",
2666
- "react-doctor/references/explain.md": "2382ea820f20",
2889
+ "mate-react-doctor/SKILL.md": "2ecf137679df",
2890
+ "mate-react-doctor/references/explain.md": "86754a7e5436",
2667
2891
  },
2668
2892
  }
2669
2893
  `;
@@ -2671,8 +2895,6 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 1
2671
2895
  exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 2`] = `
2672
2896
  {
2673
2897
  "claudeArgs": [
2674
- "--add-dir",
2675
- "<root>/companion",
2676
2898
  "--append-system-prompt",
2677
2899
 
2678
2900
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -2707,9 +2929,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 2
2707
2929
  "--setting-sources",
2708
2930
  "user,project,local",
2709
2931
  "--settings",
2710
- "<root>/companion/.claude/settings.local.json",
2711
- "--mcp-config",
2712
- "<root>/companion/.mcp.json",
2932
+ "<root>/companion/.claude/state/launch-settings.app.json",
2713
2933
  "--plugin-dir",
2714
2934
  "<claude-plugin>",
2715
2935
  ],
@@ -2756,30 +2976,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 2
2756
2976
  "errors": [],
2757
2977
  "version": 1,
2758
2978
  },
2759
- "OPENCODE_CONFIG_CONTENT": {
2760
- "permissions": [
2761
- {
2762
- "action": "external_directory",
2763
- "effect": "allow",
2764
- "resource": "<root>/companion",
2765
- },
2766
- {
2767
- "action": "external_directory",
2768
- "effect": "allow",
2769
- "resource": "<root>/companion/**",
2770
- },
2771
- ],
2772
- "plugins": [
2773
- "<opencode-plugin>",
2774
- ],
2775
- "references": {
2776
- "mate": "<root>/companion",
2777
- },
2778
- "skills": [
2779
- "<root>/companion/.agents/skills",
2780
- ],
2781
- },
2782
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
2979
+ "OPENCODE_CONFIG_CONTENT": {},
2783
2980
  },
2784
2981
  }
2785
2982
  `;
@@ -2799,7 +2996,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
2799
2996
  {
2800
2997
  "hooks": [
2801
2998
  {
2802
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
2999
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
2803
3000
  "type": "command",
2804
3001
  },
2805
3002
  ],
@@ -2817,7 +3014,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
2817
3014
  {
2818
3015
  "hooks": [
2819
3016
  {
2820
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
3017
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
2821
3018
  "type": "command",
2822
3019
  },
2823
3020
  ],
@@ -2825,7 +3022,16 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
2825
3022
  {
2826
3023
  "hooks": [
2827
3024
  {
2828
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
3025
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
3026
+ "type": "command",
3027
+ },
3028
+ ],
3029
+ },
3030
+ {
3031
+ "hooks": [
3032
+ {
3033
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
3034
+ "timeout": 45,
2829
3035
  "type": "command",
2830
3036
  },
2831
3037
  ],
@@ -2852,9 +3058,8 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
2852
3058
  "Bash(mate:*)",
2853
3059
  "Read(<root>/companion/**)",
2854
3060
  "Edit(<root>/companion/**)",
2855
- "Skill(react-doctor)",
2856
- "Bash(npx react-doctor:*)",
2857
- "Bash(npx react-doctor@latest *)",
3061
+ "Skill(mate-react-doctor)",
3062
+ "Bash(<react-doctor-bin>:*)",
2858
3063
  ],
2859
3064
  },
2860
3065
  ],
@@ -2868,7 +3073,7 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
2868
3073
  ],
2869
3074
  "kind": "list",
2870
3075
  "values": [
2871
- "<opencode-plugin>",
3076
+ "<runtime-opencode-plugin>",
2872
3077
  ],
2873
3078
  },
2874
3079
  {
@@ -2889,6 +3094,49 @@ exports[`runtime surface golden fixtures setup react-doctor × claude+opencode 3
2889
3094
  },
2890
3095
  ],
2891
3096
  },
3097
+ {
3098
+ "at": [
3099
+ "skills",
3100
+ ],
3101
+ "kind": "list",
3102
+ "values": [
3103
+ "<root>/companion/.agents/skills",
3104
+ ],
3105
+ },
3106
+ {
3107
+ "at": [
3108
+ "references",
3109
+ ],
3110
+ "entries": {
3111
+ "mate": "<root>/companion",
3112
+ },
3113
+ "kind": "map",
3114
+ },
3115
+ {
3116
+ "at": [
3117
+ "compaction",
3118
+ ],
3119
+ "kind": "value",
3120
+ "value": {
3121
+ "auto": true,
3122
+ "buffer": 20000,
3123
+ "keep": {
3124
+ "tokens": 15000,
3125
+ },
3126
+ },
3127
+ "yields": true,
3128
+ },
3129
+ {
3130
+ "at": [
3131
+ "tool_output",
3132
+ ],
3133
+ "kind": "value",
3134
+ "value": {
3135
+ "max_bytes": 40000,
3136
+ "max_lines": 1000,
3137
+ },
3138
+ "yields": true,
3139
+ },
2892
3140
  ],
2893
3141
  },
2894
3142
  ]
@@ -2945,7 +3193,7 @@ exports[`runtime surface golden fixtures setup openspec × claude 1`] = `
2945
3193
  "claudeSkills": {
2946
3194
  "mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
2947
3195
  "mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
2948
- "mate-create-report/SKILL.md": "020b5c3a53ce",
3196
+ "mate-create-report/SKILL.md": "04ac157043b8",
2949
3197
  "mate-domain-modeling/SKILL.md": "722d0e5a972d",
2950
3198
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
2951
3199
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
@@ -2953,8 +3201,8 @@ exports[`runtime surface golden fixtures setup openspec × claude 1`] = `
2953
3201
  "mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
2954
3202
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
2955
3203
  "mate-interview-me/SKILL.md": "5ac966ca1e48",
2956
- "mate-openspec-backfill/SKILL.md": "fa73daee9951",
2957
- "mate-show-me/SKILL.md": "42bdac3dd7f2",
3204
+ "mate-openspec-backfill/SKILL.md": "44c4d5e064dc",
3205
+ "mate-show-me/SKILL.md": "7bda10cae936",
2958
3206
  "mate-simplify-code/SKILL.md": "6fff7fff920c",
2959
3207
  "openspec-apply-change/SKILL.md": "b023edd228ab",
2960
3208
  "openspec-archive-change/SKILL.md": "890bada99035",
@@ -2972,8 +3220,6 @@ exports[`runtime surface golden fixtures setup openspec × claude 1`] = `
2972
3220
  exports[`runtime surface golden fixtures setup openspec × claude 2`] = `
2973
3221
  {
2974
3222
  "claudeArgs": [
2975
- "--add-dir",
2976
- "<root>/companion",
2977
3223
  "--append-system-prompt",
2978
3224
 
2979
3225
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -3010,9 +3256,7 @@ exports[`runtime surface golden fixtures setup openspec × claude 2`] = `
3010
3256
  "--setting-sources",
3011
3257
  "user,project,local",
3012
3258
  "--settings",
3013
- "<root>/companion/.claude/settings.local.json",
3014
- "--mcp-config",
3015
- "<root>/companion/.mcp.json",
3259
+ "<root>/companion/.claude/state/launch-settings.app.json",
3016
3260
  "--plugin-dir",
3017
3261
  "<claude-plugin>",
3018
3262
  ],
@@ -3037,7 +3281,7 @@ exports[`runtime surface golden fixtures setup openspec × claude 3`] = `
3037
3281
  {
3038
3282
  "hooks": [
3039
3283
  {
3040
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
3284
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
3041
3285
  "type": "command",
3042
3286
  },
3043
3287
  ],
@@ -3055,7 +3299,7 @@ exports[`runtime surface golden fixtures setup openspec × claude 3`] = `
3055
3299
  {
3056
3300
  "hooks": [
3057
3301
  {
3058
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
3302
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
3059
3303
  "type": "command",
3060
3304
  },
3061
3305
  ],
@@ -3063,7 +3307,16 @@ exports[`runtime surface golden fixtures setup openspec × claude 3`] = `
3063
3307
  {
3064
3308
  "hooks": [
3065
3309
  {
3066
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
3310
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
3311
+ "type": "command",
3312
+ },
3313
+ ],
3314
+ },
3315
+ {
3316
+ "hooks": [
3317
+ {
3318
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
3319
+ "timeout": 45,
3067
3320
  "type": "command",
3068
3321
  },
3069
3322
  ],
@@ -3156,7 +3409,7 @@ exports[`runtime surface golden fixtures setup openspec × opencode 1`] = `
3156
3409
  ".openspec-target": "38700dfad571",
3157
3410
  "mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
3158
3411
  "mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
3159
- "mate-create-report/SKILL.md": "020b5c3a53ce",
3412
+ "mate-create-report/SKILL.md": "04ac157043b8",
3160
3413
  "mate-domain-modeling/SKILL.md": "722d0e5a972d",
3161
3414
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
3162
3415
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
@@ -3164,8 +3417,8 @@ exports[`runtime surface golden fixtures setup openspec × opencode 1`] = `
3164
3417
  "mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
3165
3418
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
3166
3419
  "mate-interview-me/SKILL.md": "5ac966ca1e48",
3167
- "mate-openspec-backfill/SKILL.md": "fa73daee9951",
3168
- "mate-show-me/SKILL.md": "42bdac3dd7f2",
3420
+ "mate-openspec-backfill/SKILL.md": "44c4d5e064dc",
3421
+ "mate-show-me/SKILL.md": "7bda10cae936",
3169
3422
  "mate-simplify-code/SKILL.md": "6fff7fff920c",
3170
3423
  "openspec-apply-change/SKILL.md": "c657f1b4e9eb",
3171
3424
  "openspec-archive-change/SKILL.md": "ad2463670c0f",
@@ -3219,30 +3472,7 @@ exports[`runtime surface golden fixtures setup openspec × opencode 2`] = `
3219
3472
  "errors": [],
3220
3473
  "version": 1,
3221
3474
  },
3222
- "OPENCODE_CONFIG_CONTENT": {
3223
- "permissions": [
3224
- {
3225
- "action": "external_directory",
3226
- "effect": "allow",
3227
- "resource": "<root>/companion",
3228
- },
3229
- {
3230
- "action": "external_directory",
3231
- "effect": "allow",
3232
- "resource": "<root>/companion/**",
3233
- },
3234
- ],
3235
- "plugins": [
3236
- "<opencode-plugin>",
3237
- ],
3238
- "references": {
3239
- "mate": "<root>/companion",
3240
- },
3241
- "skills": [
3242
- "<root>/companion/.agents/skills",
3243
- ],
3244
- },
3245
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
3475
+ "OPENCODE_CONFIG_CONTENT": {},
3246
3476
  },
3247
3477
  }
3248
3478
  `;
@@ -3258,7 +3488,7 @@ exports[`runtime surface golden fixtures setup openspec × opencode 3`] = `
3258
3488
  ],
3259
3489
  "kind": "list",
3260
3490
  "values": [
3261
- "<opencode-plugin>",
3491
+ "<runtime-opencode-plugin>",
3262
3492
  ],
3263
3493
  },
3264
3494
  {
@@ -3279,6 +3509,49 @@ exports[`runtime surface golden fixtures setup openspec × opencode 3`] = `
3279
3509
  },
3280
3510
  ],
3281
3511
  },
3512
+ {
3513
+ "at": [
3514
+ "skills",
3515
+ ],
3516
+ "kind": "list",
3517
+ "values": [
3518
+ "<root>/companion/.agents/skills",
3519
+ ],
3520
+ },
3521
+ {
3522
+ "at": [
3523
+ "references",
3524
+ ],
3525
+ "entries": {
3526
+ "mate": "<root>/companion",
3527
+ },
3528
+ "kind": "map",
3529
+ },
3530
+ {
3531
+ "at": [
3532
+ "compaction",
3533
+ ],
3534
+ "kind": "value",
3535
+ "value": {
3536
+ "auto": true,
3537
+ "buffer": 20000,
3538
+ "keep": {
3539
+ "tokens": 15000,
3540
+ },
3541
+ },
3542
+ "yields": true,
3543
+ },
3544
+ {
3545
+ "at": [
3546
+ "tool_output",
3547
+ ],
3548
+ "kind": "value",
3549
+ "value": {
3550
+ "max_bytes": 40000,
3551
+ "max_lines": 1000,
3552
+ },
3553
+ "yields": true,
3554
+ },
3282
3555
  ],
3283
3556
  },
3284
3557
  ]
@@ -3335,7 +3608,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
3335
3608
  "claudeSkills": {
3336
3609
  "mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
3337
3610
  "mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
3338
- "mate-create-report/SKILL.md": "020b5c3a53ce",
3611
+ "mate-create-report/SKILL.md": "04ac157043b8",
3339
3612
  "mate-domain-modeling/SKILL.md": "722d0e5a972d",
3340
3613
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
3341
3614
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
@@ -3343,8 +3616,8 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
3343
3616
  "mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
3344
3617
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
3345
3618
  "mate-interview-me/SKILL.md": "5ac966ca1e48",
3346
- "mate-openspec-backfill/SKILL.md": "fa73daee9951",
3347
- "mate-show-me/SKILL.md": "42bdac3dd7f2",
3619
+ "mate-openspec-backfill/SKILL.md": "44c4d5e064dc",
3620
+ "mate-show-me/SKILL.md": "7bda10cae936",
3348
3621
  "mate-simplify-code/SKILL.md": "6fff7fff920c",
3349
3622
  "openspec-apply-change/SKILL.md": "b023edd228ab",
3350
3623
  "openspec-archive-change/SKILL.md": "890bada99035",
@@ -3375,7 +3648,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
3375
3648
  ".openspec-target": "38700dfad571",
3376
3649
  "mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
3377
3650
  "mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
3378
- "mate-create-report/SKILL.md": "020b5c3a53ce",
3651
+ "mate-create-report/SKILL.md": "04ac157043b8",
3379
3652
  "mate-domain-modeling/SKILL.md": "722d0e5a972d",
3380
3653
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
3381
3654
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
@@ -3383,8 +3656,8 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
3383
3656
  "mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
3384
3657
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
3385
3658
  "mate-interview-me/SKILL.md": "5ac966ca1e48",
3386
- "mate-openspec-backfill/SKILL.md": "fa73daee9951",
3387
- "mate-show-me/SKILL.md": "42bdac3dd7f2",
3659
+ "mate-openspec-backfill/SKILL.md": "44c4d5e064dc",
3660
+ "mate-show-me/SKILL.md": "7bda10cae936",
3388
3661
  "mate-simplify-code/SKILL.md": "6fff7fff920c",
3389
3662
  "openspec-apply-change/SKILL.md": "c657f1b4e9eb",
3390
3663
  "openspec-archive-change/SKILL.md": "ad2463670c0f",
@@ -3397,8 +3670,6 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 1`] =
3397
3670
  exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] = `
3398
3671
  {
3399
3672
  "claudeArgs": [
3400
- "--add-dir",
3401
- "<root>/companion",
3402
3673
  "--append-system-prompt",
3403
3674
 
3404
3675
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -3435,9 +3706,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
3435
3706
  "--setting-sources",
3436
3707
  "user,project,local",
3437
3708
  "--settings",
3438
- "<root>/companion/.claude/settings.local.json",
3439
- "--mcp-config",
3440
- "<root>/companion/.mcp.json",
3709
+ "<root>/companion/.claude/state/launch-settings.app.json",
3441
3710
  "--plugin-dir",
3442
3711
  "<claude-plugin>",
3443
3712
  ],
@@ -3486,30 +3755,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 2`] =
3486
3755
  "errors": [],
3487
3756
  "version": 1,
3488
3757
  },
3489
- "OPENCODE_CONFIG_CONTENT": {
3490
- "permissions": [
3491
- {
3492
- "action": "external_directory",
3493
- "effect": "allow",
3494
- "resource": "<root>/companion",
3495
- },
3496
- {
3497
- "action": "external_directory",
3498
- "effect": "allow",
3499
- "resource": "<root>/companion/**",
3500
- },
3501
- ],
3502
- "plugins": [
3503
- "<opencode-plugin>",
3504
- ],
3505
- "references": {
3506
- "mate": "<root>/companion",
3507
- },
3508
- "skills": [
3509
- "<root>/companion/.agents/skills",
3510
- ],
3511
- },
3512
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
3758
+ "OPENCODE_CONFIG_CONTENT": {},
3513
3759
  },
3514
3760
  }
3515
3761
  `;
@@ -3529,7 +3775,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
3529
3775
  {
3530
3776
  "hooks": [
3531
3777
  {
3532
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
3778
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
3533
3779
  "type": "command",
3534
3780
  },
3535
3781
  ],
@@ -3547,7 +3793,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
3547
3793
  {
3548
3794
  "hooks": [
3549
3795
  {
3550
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
3796
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
3551
3797
  "type": "command",
3552
3798
  },
3553
3799
  ],
@@ -3555,7 +3801,16 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
3555
3801
  {
3556
3802
  "hooks": [
3557
3803
  {
3558
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
3804
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
3805
+ "type": "command",
3806
+ },
3807
+ ],
3808
+ },
3809
+ {
3810
+ "hooks": [
3811
+ {
3812
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
3813
+ "timeout": 45,
3559
3814
  "type": "command",
3560
3815
  },
3561
3816
  ],
@@ -3611,7 +3866,7 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
3611
3866
  ],
3612
3867
  "kind": "list",
3613
3868
  "values": [
3614
- "<opencode-plugin>",
3869
+ "<runtime-opencode-plugin>",
3615
3870
  ],
3616
3871
  },
3617
3872
  {
@@ -3632,6 +3887,49 @@ exports[`runtime surface golden fixtures setup openspec × claude+opencode 3`] =
3632
3887
  },
3633
3888
  ],
3634
3889
  },
3890
+ {
3891
+ "at": [
3892
+ "skills",
3893
+ ],
3894
+ "kind": "list",
3895
+ "values": [
3896
+ "<root>/companion/.agents/skills",
3897
+ ],
3898
+ },
3899
+ {
3900
+ "at": [
3901
+ "references",
3902
+ ],
3903
+ "entries": {
3904
+ "mate": "<root>/companion",
3905
+ },
3906
+ "kind": "map",
3907
+ },
3908
+ {
3909
+ "at": [
3910
+ "compaction",
3911
+ ],
3912
+ "kind": "value",
3913
+ "value": {
3914
+ "auto": true,
3915
+ "buffer": 20000,
3916
+ "keep": {
3917
+ "tokens": 15000,
3918
+ },
3919
+ },
3920
+ "yields": true,
3921
+ },
3922
+ {
3923
+ "at": [
3924
+ "tool_output",
3925
+ ],
3926
+ "kind": "value",
3927
+ "value": {
3928
+ "max_bytes": 40000,
3929
+ "max_lines": 1000,
3930
+ },
3931
+ "yields": true,
3932
+ },
3635
3933
  ],
3636
3934
  },
3637
3935
  ]
@@ -3659,9 +3957,7 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
3659
3957
  <!-- mate:managed:context-mode:9561e6cf6059 end -->
3660
3958
  "
3661
3959
  ,
3662
- "claudeHooks": {
3663
- "react-doctor.sh": "a33e1b4ac810",
3664
- },
3960
+ "claudeHooks": {},
3665
3961
  "claudeMcpConfig": {
3666
3962
  "mcpServers": {
3667
3963
  "tokensave": {
@@ -3679,18 +3975,6 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
3679
3975
  "claudeSettingsLocal": {
3680
3976
  "autoMemoryEnabled": false,
3681
3977
  "hooks": {
3682
- "PostToolUse": [
3683
- {
3684
- "hooks": [
3685
- {
3686
- "command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
3687
- "timeout": 5,
3688
- "type": "command",
3689
- },
3690
- ],
3691
- "matcher": "Write|Edit|MultiEdit|NotebookEdit|ApplyPatch",
3692
- },
3693
- ],
3694
3978
  "PreToolUse": [
3695
3979
  {
3696
3980
  "hooks": [
@@ -3726,15 +4010,6 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
3726
4010
  },
3727
4011
  ],
3728
4012
  },
3729
- {
3730
- "hooks": [
3731
- {
3732
- "command": "sh "<root>/companion/.claude/hooks/react-doctor.sh"",
3733
- "timeout": 45,
3734
- "type": "command",
3735
- },
3736
- ],
3737
- },
3738
4013
  ],
3739
4014
  "UserPromptSubmit": [
3740
4015
  {
@@ -3752,14 +4027,13 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
3752
4027
  },
3753
4028
  "permissions": {
3754
4029
  "allow": [
4030
+ "Bash(<react-doctor-bin>:*)",
3755
4031
  "Bash(<wrapper-bin>/graphify:*)",
3756
4032
  "Bash(<wrapper-bin>/openspec:*)",
3757
4033
  "Bash(graphify:*)",
3758
4034
  "Bash(mate cap graphify:*)",
3759
4035
  "Bash(mate cap graphify:*)",
3760
4036
  "Bash(mate:*)",
3761
- "Bash(npx react-doctor:*)",
3762
- "Bash(npx react-doctor@latest *)",
3763
4037
  "Bash(openspec:*)",
3764
4038
  "Edit(<root>/companion/**)",
3765
4039
  "Read(<root>/companion/**)",
@@ -3772,13 +4046,13 @@ Canonical Mate policy and any more specific tool-routing instructions remain aut
3772
4046
  "Skill(mate-grilling)",
3773
4047
  "Skill(mate-interview-me)",
3774
4048
  "Skill(mate-openspec-backfill)",
4049
+ "Skill(mate-react-doctor)",
3775
4050
  "Skill(mate-show-me)",
3776
4051
  "Skill(mate-simplify-code)",
3777
4052
  "Skill(openspec-apply-change)",
3778
4053
  "Skill(openspec-archive-change)",
3779
4054
  "Skill(openspec-explore)",
3780
4055
  "Skill(openspec-propose)",
3781
- "Skill(react-doctor)",
3782
4056
  "mcp__plugin_context-mode_context-mode__*",
3783
4057
  "mcp__tokensave__*",
3784
4058
  ],
@@ -3802,7 +4076,7 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
3802
4076
  ,
3803
4077
  "mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
3804
4078
  "mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
3805
- "mate-create-report/SKILL.md": "020b5c3a53ce",
4079
+ "mate-create-report/SKILL.md": "04ac157043b8",
3806
4080
  "mate-domain-modeling/SKILL.md": "722d0e5a972d",
3807
4081
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
3808
4082
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
@@ -3810,15 +4084,15 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
3810
4084
  "mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
3811
4085
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
3812
4086
  "mate-interview-me/SKILL.md": "5ac966ca1e48",
3813
- "mate-openspec-backfill/SKILL.md": "fa73daee9951",
3814
- "mate-show-me/SKILL.md": "42bdac3dd7f2",
4087
+ "mate-openspec-backfill/SKILL.md": "44c4d5e064dc",
4088
+ "mate-react-doctor/SKILL.md": "2ecf137679df",
4089
+ "mate-react-doctor/references/explain.md": "86754a7e5436",
4090
+ "mate-show-me/SKILL.md": "7bda10cae936",
3815
4091
  "mate-simplify-code/SKILL.md": "6fff7fff920c",
3816
4092
  "openspec-apply-change/SKILL.md": "b023edd228ab",
3817
4093
  "openspec-archive-change/SKILL.md": "890bada99035",
3818
4094
  "openspec-explore/SKILL.md": "477fdec2cdb0",
3819
4095
  "openspec-propose/SKILL.md": "13e8a2d0d873",
3820
- "react-doctor/SKILL.md": "df58b3490543",
3821
- "react-doctor/references/explain.md": "2382ea820f20",
3822
4096
  },
3823
4097
  "opencodeConfig": {
3824
4098
  "$schema": "https://opencode.ai/config.json",
@@ -3880,7 +4154,7 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
3880
4154
  ".openspec-target": "38700dfad571",
3881
4155
  "mate-artifact-publish/SKILL.md": "9ae069fc6d0d",
3882
4156
  "mate-artifact-publish/references/openspec.md": "b5c986ed9bdc",
3883
- "mate-create-report/SKILL.md": "020b5c3a53ce",
4157
+ "mate-create-report/SKILL.md": "04ac157043b8",
3884
4158
  "mate-domain-modeling/SKILL.md": "722d0e5a972d",
3885
4159
  "mate-domain-modeling/references/ADR-FORMAT.md": "824b87e87d9b",
3886
4160
  "mate-domain-modeling/references/CONTEXT-FORMAT.md": "172622594277",
@@ -3888,15 +4162,15 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
3888
4162
  "mate-grill-with-docs/SKILL.md": "2e4dbb346e51",
3889
4163
  "mate-grilling/SKILL.md": "f37ff4dd9b6d",
3890
4164
  "mate-interview-me/SKILL.md": "5ac966ca1e48",
3891
- "mate-openspec-backfill/SKILL.md": "fa73daee9951",
3892
- "mate-show-me/SKILL.md": "42bdac3dd7f2",
4165
+ "mate-openspec-backfill/SKILL.md": "44c4d5e064dc",
4166
+ "mate-react-doctor/SKILL.md": "2ecf137679df",
4167
+ "mate-react-doctor/references/explain.md": "86754a7e5436",
4168
+ "mate-show-me/SKILL.md": "7bda10cae936",
3893
4169
  "mate-simplify-code/SKILL.md": "6fff7fff920c",
3894
4170
  "openspec-apply-change/SKILL.md": "c657f1b4e9eb",
3895
4171
  "openspec-archive-change/SKILL.md": "ad2463670c0f",
3896
4172
  "openspec-explore/SKILL.md": "214bba092ffa",
3897
4173
  "openspec-propose/SKILL.md": "c09159964f8e",
3898
- "react-doctor/SKILL.md": "df58b3490543",
3899
- "react-doctor/references/explain.md": "2382ea820f20",
3900
4174
  },
3901
4175
  }
3902
4176
  `;
@@ -3904,8 +4178,6 @@ Write chunks to $GRAPHIFY_OUT and read $GRAPHIFY_OUT later.
3904
4178
  exports[`runtime surface golden fixtures setup all capabilities × claude+opencode 2`] = `
3905
4179
  {
3906
4180
  "claudeArgs": [
3907
- "--add-dir",
3908
- "<root>/companion",
3909
4181
  "--append-system-prompt",
3910
4182
 
3911
4183
  "## MANDATORY RULES - NON-NEGOTIABLE
@@ -3953,9 +4225,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
3953
4225
  "--setting-sources",
3954
4226
  "user,project,local",
3955
4227
  "--settings",
3956
- "<root>/companion/.claude/settings.local.json",
3957
- "--mcp-config",
3958
- "<root>/companion/.mcp.json",
4228
+ "<root>/companion/.claude/state/launch-settings.app.json",
3959
4229
  "--plugin-dir",
3960
4230
  "<claude-plugin>",
3961
4231
  "--plugin-dir",
@@ -4017,30 +4287,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
4017
4287
  "errors": [],
4018
4288
  "version": 1,
4019
4289
  },
4020
- "OPENCODE_CONFIG_CONTENT": {
4021
- "permissions": [
4022
- {
4023
- "action": "external_directory",
4024
- "effect": "allow",
4025
- "resource": "<root>/companion",
4026
- },
4027
- {
4028
- "action": "external_directory",
4029
- "effect": "allow",
4030
- "resource": "<root>/companion/**",
4031
- },
4032
- ],
4033
- "plugins": [
4034
- "<opencode-plugin>",
4035
- ],
4036
- "references": {
4037
- "mate": "<root>/companion",
4038
- },
4039
- "skills": [
4040
- "<root>/companion/.agents/skills",
4041
- ],
4042
- },
4043
- "OPENCODE_CONFIG_DIR": "<root>/companion/.opencode",
4290
+ "OPENCODE_CONFIG_CONTENT": {},
4044
4291
  },
4045
4292
  }
4046
4293
  `;
@@ -4060,12 +4307,24 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
4060
4307
  {
4061
4308
  "hooks": [
4062
4309
  {
4063
- "command": "node "<claude-plugin>/hooks/validate-artifact-path.mjs"",
4310
+ "command": "node "<runtime-claude-plugin>/hooks/validate-artifact-path.mjs"",
4064
4311
  "type": "command",
4065
4312
  },
4066
4313
  ],
4067
4314
  "matcher": "Write|Edit|MultiEdit|Bash",
4068
4315
  },
4316
+ {
4317
+ "hooks": [
4318
+ {
4319
+ "args": [
4320
+ "hook-pre-tool-use",
4321
+ ],
4322
+ "command": "<root>/bin/tokensave",
4323
+ "type": "command",
4324
+ },
4325
+ ],
4326
+ "matcher": "Agent|Grep|Bash",
4327
+ },
4069
4328
  ],
4070
4329
  },
4071
4330
  {
@@ -4078,7 +4337,7 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
4078
4337
  {
4079
4338
  "hooks": [
4080
4339
  {
4081
- "command": "node "<claude-plugin>/hooks/session-banner.mjs" --projected",
4340
+ "command": "node "<runtime-claude-plugin>/hooks/session-banner.mjs" --projected",
4082
4341
  "type": "command",
4083
4342
  },
4084
4343
  ],
@@ -4086,7 +4345,56 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
4086
4345
  {
4087
4346
  "hooks": [
4088
4347
  {
4089
- "command": "node "<claude-plugin>/hooks/session-guidance.mjs"",
4348
+ "command": "node "<runtime-claude-plugin>/hooks/session-guidance.mjs"",
4349
+ "type": "command",
4350
+ },
4351
+ ],
4352
+ },
4353
+ {
4354
+ "hooks": [
4355
+ {
4356
+ "command": "node "<runtime-claude-plugin>/hooks/session-prepare.mjs"",
4357
+ "timeout": 45,
4358
+ "type": "command",
4359
+ },
4360
+ ],
4361
+ },
4362
+ ],
4363
+ },
4364
+ {
4365
+ "at": [
4366
+ "hooks",
4367
+ "UserPromptSubmit",
4368
+ ],
4369
+ "kind": "list",
4370
+ "values": [
4371
+ {
4372
+ "hooks": [
4373
+ {
4374
+ "args": [
4375
+ "hook-prompt-submit",
4376
+ ],
4377
+ "command": "<root>/bin/tokensave",
4378
+ "type": "command",
4379
+ },
4380
+ ],
4381
+ },
4382
+ ],
4383
+ },
4384
+ {
4385
+ "at": [
4386
+ "hooks",
4387
+ "Stop",
4388
+ ],
4389
+ "kind": "list",
4390
+ "values": [
4391
+ {
4392
+ "hooks": [
4393
+ {
4394
+ "args": [
4395
+ "hook-stop",
4396
+ ],
4397
+ "command": "<root>/bin/tokensave",
4090
4398
  "type": "command",
4091
4399
  },
4092
4400
  ],
@@ -4129,9 +4437,8 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
4129
4437
  "Bash(openspec:*)",
4130
4438
  "Bash(mate cap graphify:*)",
4131
4439
  "Bash(<wrapper-bin>/openspec:*)",
4132
- "Skill(react-doctor)",
4133
- "Bash(npx react-doctor:*)",
4134
- "Bash(npx react-doctor@latest *)",
4440
+ "Skill(mate-react-doctor)",
4441
+ "Bash(<react-doctor-bin>:*)",
4135
4442
  "mcp__tokensave__*",
4136
4443
  "Skill(graphify)",
4137
4444
  "Bash(graphify:*)",
@@ -4173,7 +4480,8 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
4173
4480
  ],
4174
4481
  "kind": "list",
4175
4482
  "values": [
4176
- "<opencode-plugin>",
4483
+ "context-mode@1.0.169",
4484
+ "<runtime-opencode-plugin>",
4177
4485
  ],
4178
4486
  },
4179
4487
  {
@@ -4211,6 +4519,49 @@ exports[`runtime surface golden fixtures setup all capabilities × claude+openco
4211
4519
  },
4212
4520
  ],
4213
4521
  },
4522
+ {
4523
+ "at": [
4524
+ "skills",
4525
+ ],
4526
+ "kind": "list",
4527
+ "values": [
4528
+ "<root>/companion/.agents/skills",
4529
+ ],
4530
+ },
4531
+ {
4532
+ "at": [
4533
+ "references",
4534
+ ],
4535
+ "entries": {
4536
+ "mate": "<root>/companion",
4537
+ },
4538
+ "kind": "map",
4539
+ },
4540
+ {
4541
+ "at": [
4542
+ "compaction",
4543
+ ],
4544
+ "kind": "value",
4545
+ "value": {
4546
+ "auto": true,
4547
+ "buffer": 20000,
4548
+ "keep": {
4549
+ "tokens": 15000,
4550
+ },
4551
+ },
4552
+ "yields": true,
4553
+ },
4554
+ {
4555
+ "at": [
4556
+ "tool_output",
4557
+ ],
4558
+ "kind": "value",
4559
+ "value": {
4560
+ "max_bytes": 40000,
4561
+ "max_lines": 1000,
4562
+ },
4563
+ "yields": true,
4564
+ },
4214
4565
  ],
4215
4566
  },
4216
4567
  ]
@@ -4588,7 +4939,7 @@ User notes.
4588
4939
  "# mate managed: start
4589
4940
  /.mate/
4590
4941
  /.claude/
4591
- /.opencode/
4942
+ /.opencode/opencode.json
4592
4943
  /.agents/
4593
4944
  /.mcp.json
4594
4945
  # mate managed: end
@@ -4634,7 +4985,7 @@ User notes.
4634
4985
  "# mate managed: start
4635
4986
  /.mate/
4636
4987
  /.claude/
4637
- /.opencode/
4988
+ /.opencode/opencode.json
4638
4989
  /.agents/
4639
4990
  /.mcp.json
4640
4991
  # mate managed: end