@uniqbit/mate-core 0.18.5 → 1.0.0-canary.2
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-capability-plugins/companion-mentions/.claude-plugin/marketplace.json +14 -0
- package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +8 -0
- package/claude-capability-plugins/companion-mentions/hooks/companion.ts +457 -0
- package/claude-capability-plugins/companion-mentions/hooks/hooks.json +1 -0
- package/claude-capability-plugins/companion-mentions/hooks/register.ts +403 -0
- package/claude-plugin/hooks/companion-instructions.mjs +9 -0
- package/claude-plugin/hooks/hooks.json +21 -2
- package/claude-plugin/hooks/tokensave-route.mjs +52 -0
- package/opencode-plugin/src/server.ts +4 -0
- package/opencode-plugin/src/tui.tsx +2 -0
- package/opencode-plugin/tui.tsx +2 -0
- package/package.json +52 -15
- package/src/brand/art.generated.ts +69 -0
- package/src/brand/index.ts +12 -0
- package/src/brand/palette.ts +19 -0
- package/src/brand/svg.generated.ts +8 -0
- package/src/brand/terminal.ts +88 -0
- package/src/brand/types.ts +33 -0
- package/src/cli/commands/artifact/apply-context.ts +275 -0
- package/src/cli/commands/artifact/artifact.ts +12 -0
- package/src/cli/commands/artifact/delivery/archive.ts +125 -0
- package/src/cli/commands/artifact/delivery/branch-flags.ts +55 -0
- package/src/cli/commands/artifact/delivery/environment.ts +127 -0
- package/src/cli/commands/artifact/delivery/link.ts +174 -0
- package/src/cli/commands/artifact/delivery/output.ts +89 -0
- package/src/cli/commands/artifact/finish/command.ts +83 -8
- package/src/cli/commands/artifact/finish/engine.ts +91 -14
- package/src/cli/commands/artifact/finish/finisher.ts +10 -0
- package/src/cli/commands/artifact/finish/git.ts +132 -19
- package/src/cli/commands/artifact/finish/openspec.ts +182 -138
- package/src/cli/commands/artifact/finish/secret-scan.ts +43 -0
- package/src/cli/commands/artifact/finish/worktree-cleanup.ts +92 -0
- package/src/cli/commands/artifact/pending/command.ts +31 -3
- package/src/cli/commands/artifact/pending/discovery.ts +21 -57
- package/src/cli/commands/cap/graphify.ts +52 -3
- package/src/cli/commands/cap/index-cmd.ts +71 -15
- package/src/cli/commands/cap/openspec.ts +13 -25
- package/src/cli/commands/cap/tokensave.ts +7 -5
- package/src/cli/commands/companion/link.ts +14 -1
- package/src/cli/commands/companion/open.ts +68 -46
- package/src/cli/commands/companion/sync.ts +10 -0
- package/src/cli/commands/companion/tui.ts +17 -7
- package/src/cli/commands/companion/update.ts +143 -48
- package/src/cli/commands/doctor.ts +195 -7
- package/src/cli/commands/factory/factory.ts +301 -0
- package/src/cli/commands/install.ts +133 -9
- package/src/cli/commands/launch/shared.ts +16 -11
- package/src/cli/commands/plugin/install.ts +9 -4
- package/src/cli/commands/plugin/plugin.ts +3 -2
- package/src/cli/commands/report/adapter.ts +11 -2
- package/src/cli/commands/report/contract.ts +21 -0
- package/src/cli/commands/report/highlight.ts +34 -4
- package/src/cli/commands/report/index.ts +20 -1
- package/src/cli/commands/report/markdown.ts +110 -0
- package/src/cli/commands/report/palette.ts +118 -0
- package/src/cli/commands/report/renderer.ts +456 -153
- package/src/cli/commands/report/types.ts +16 -0
- package/src/cli/commands/session/context.ts +102 -0
- package/src/cli/commands/setup.ts +50 -24
- package/src/cli/commands/studio/factory-credential.ts +49 -0
- package/src/cli/commands/studio/index.ts +29 -2
- package/src/cli/commands/studio/openspec-cli.ts +10 -58
- package/src/cli/commands/studio/payload.ts +249 -15
- package/src/cli/commands/studio/routes.ts +41 -6
- package/src/cli/commands/studio/selection.ts +161 -17
- package/src/cli/commands/studio/server.ts +404 -324
- package/src/cli/commands/studio/services.ts +60 -0
- package/src/cli/commands/studio/studio-app.ts +67 -0
- package/src/cli/commands/studio/terminal-assets.ts +21 -33
- package/src/cli/commands/studio/terminal.ts +85 -15
- package/src/cli/commands/studio/views/model.ts +18 -0
- package/src/cli/commands/studio/views/vault/markdown-tree.ts +267 -0
- package/src/cli/commands/studio/views/vault/view.ts +185 -0
- package/src/cli/commands/studio/workset-session.ts +131 -0
- package/src/cli/commands/unwrap.ts +8 -0
- package/src/cli/commands/update.ts +27 -1
- package/src/cli/commands/working/cleanup.ts +10 -1
- package/src/cli/commands/working/link.ts +76 -0
- package/src/cli/commands/working/working.ts +10 -0
- package/src/cli/commands/working/worktree.ts +356 -0
- package/src/cli/commands/wrap.ts +5 -13
- package/src/cli/companion-link-wizard.tsx +2 -0
- package/src/cli/companion-selector.tsx +2 -0
- package/src/cli/confirm.ts +2 -0
- package/src/cli/install-plan.tsx +127 -160
- package/src/cli/launch-selector.tsx +2 -0
- package/src/cli/main.ts +22 -1
- package/src/cli/parse-flags.ts +32 -6
- package/src/cli/repo-list-table.tsx +2 -0
- package/src/cli/setup-selector.tsx +86 -151
- package/src/cli/usage.ts +14 -0
- package/src/create-mate.ts +5 -4
- package/src/hooks/companion-instructions.ts +190 -0
- package/src/hooks/hook-io.ts +63 -0
- package/src/hooks/session-banner.ts +21 -29
- package/src/hooks/session-guidance.ts +9 -17
- package/src/hooks/session-prepare.ts +115 -28
- package/src/hooks/tokensave-route.ts +26 -0
- package/src/hooks/validate-artifact-path.ts +82 -24
- package/src/index.ts +4 -0
- package/src/lib/apply-context/fingerprint.ts +174 -0
- package/src/lib/apply-context/protocol.ts +193 -0
- package/src/lib/change-layout.ts +154 -0
- package/src/lib/components/confirm-prompt.tsx +21 -9
- package/src/lib/components/select-menu.tsx +10 -3
- package/src/lib/components/spinner.tsx +4 -2
- package/src/lib/components/startup-progress.tsx +227 -41
- package/src/lib/components/text-input-display.tsx +2 -0
- package/src/lib/components/wizard-footer.tsx +2 -0
- package/src/lib/components/wizard-header.tsx +16 -12
- package/src/lib/context-mode-package.ts +24 -11
- package/src/lib/delivery/archive-change.ts +166 -0
- package/src/lib/delivery/branches.ts +132 -0
- package/src/lib/delivery/environment.ts +35 -0
- package/src/lib/delivery/forge.ts +279 -0
- package/src/lib/delivery/merge-git.ts +261 -0
- package/src/lib/delivery/overlap.ts +209 -0
- package/src/lib/delivery/record-delivery.ts +283 -0
- package/src/lib/delivery/record.ts +403 -0
- package/src/lib/delivery/refresh.ts +268 -0
- package/src/lib/delivery/repository-access.ts +141 -0
- package/src/lib/delivery/resolve-branch.ts +162 -0
- package/src/lib/delivery/stages.ts +111 -0
- package/src/lib/delivery/token.ts +24 -0
- package/src/lib/factory/attach-client.ts +113 -0
- package/src/lib/factory/attach.ts +178 -0
- package/src/lib/factory/broker.ts +190 -0
- package/src/lib/factory/bun-commands.ts +39 -0
- package/src/lib/factory/client.ts +92 -0
- package/src/lib/factory/command.ts +61 -0
- package/src/lib/factory/credential-store.ts +153 -0
- package/src/lib/factory/frames.ts +77 -0
- package/src/lib/factory/ids.ts +58 -0
- package/src/lib/factory/keyed-serial.ts +27 -0
- package/src/lib/factory/outcomes/actions.ts +114 -0
- package/src/lib/factory/outcomes/index.ts +381 -0
- package/src/lib/factory/outcomes/lifecycle.ts +205 -0
- package/src/lib/factory/outcomes/runs.ts +81 -0
- package/src/lib/factory/outcomes/sessions.ts +38 -0
- package/src/lib/factory/prepare.ts +49 -0
- package/src/lib/factory/pty.ts +103 -0
- package/src/lib/factory/runner/companion-context.ts +178 -0
- package/src/lib/factory/runner/control.ts +92 -0
- package/src/lib/factory/runner/harness-agent.ts +250 -0
- package/src/lib/factory/runner/live.ts +159 -0
- package/src/lib/factory/runner/questions.ts +22 -0
- package/src/lib/factory/runner/rank.ts +26 -0
- package/src/lib/factory/runner/run-policy.ts +12 -0
- package/src/lib/factory/runner/run.ts +199 -0
- package/src/lib/factory/runner/scheduler.ts +416 -0
- package/src/lib/factory/runner/state.ts +233 -0
- package/src/lib/factory/runner/workflow.ts +542 -0
- package/src/lib/factory/runtime.ts +972 -0
- package/src/lib/factory/sandbox.ts +292 -0
- package/src/lib/factory/worktree-branch.ts +17 -0
- package/src/lib/frontmatter.ts +18 -0
- package/src/lib/install.ts +66 -14
- package/src/lib/live-progress.ts +36 -0
- package/src/lib/member-choices.ts +67 -0
- package/src/lib/opencode-plugin-package.ts +5 -5
- package/src/lib/openspec-cli.ts +116 -0
- package/src/lib/openspec-scopes.ts +86 -0
- package/src/lib/orchestrator/adapters/base.ts +55 -22
- package/src/lib/orchestrator/adapters/claude-args.ts +50 -0
- package/src/lib/orchestrator/adapters/claude.ts +54 -41
- package/src/lib/orchestrator/adapters/opencode.ts +2 -0
- package/src/lib/orchestrator/config-store.ts +3 -2
- package/src/lib/orchestrator/editor.ts +31 -25
- package/src/lib/orchestrator/openspec-store.ts +14 -54
- package/src/lib/orchestrator/projection-claude-commands.ts +36 -0
- package/src/lib/orchestrator/projection-claude-links.ts +159 -0
- package/src/lib/orchestrator/projection-claude-skills.ts +19 -137
- package/src/lib/orchestrator/projection-entries.ts +100 -34
- package/src/lib/orchestrator/projection-opencode-copies.ts +32 -15
- package/src/lib/orchestrator/projection-openspec-store.ts +54 -9
- package/src/lib/orchestrator/projection-runtime-documents.ts +15 -6
- package/src/lib/orchestrator/projection-types.ts +36 -1
- package/src/lib/orchestrator/refresh-working-claude-links.ts +87 -0
- package/src/lib/orchestrator/session-context-link.ts +67 -0
- package/src/lib/orchestrator/session-prepare.ts +45 -5
- package/src/lib/orchestrator/setup-compatibilities.ts +56 -70
- package/src/lib/orchestrator/types.ts +7 -2
- package/src/lib/orchestrator/working-repo-projection.ts +50 -7
- package/src/lib/orchestrator/workspace-document.ts +105 -0
- package/src/lib/orchestrator/wrap-pass.ts +22 -1
- package/src/lib/package-paths.ts +37 -0
- package/src/lib/runtime-directory-refresh.ts +17 -1
- package/src/lib/workset/record.ts +513 -0
- package/src/lib/workset/repositories.ts +55 -0
- package/src/lib/workset/stage.ts +148 -0
- package/src/lib/workset/stages.ts +113 -0
- package/src/lib/workset/worktree-index.ts +116 -0
- package/src/lib/workset/worktree.ts +830 -0
- package/src/opencode/companion-hooks.ts +109 -7
- package/src/opencode/companion-policy.ts +37 -18
- package/src/opencode/enter-worktree.ts +72 -0
- package/src/opencode/projected-guidance.ts +4 -1
- package/src/opencode/session-prepare.ts +2 -1
- package/src/opencode/tui.tsx +13 -6
- package/src/plugins.ts +1 -0
- package/src/runtime/artifact-refusal.ts +63 -0
- package/src/runtime/claude-delivery-plan.ts +107 -8
- package/src/runtime/commit-attribution-guard.ts +181 -0
- package/src/runtime/companion-git.ts +52 -10
- package/src/runtime/companion-guidance.ts +20 -8
- package/src/runtime/companion-instructions.ts +340 -0
- package/src/runtime/companion-lock.ts +30 -7
- package/src/runtime/env.ts +48 -3
- package/src/runtime/error-message.ts +4 -0
- package/src/runtime/git-layout.ts +219 -0
- package/src/runtime/index.ts +29 -0
- package/src/runtime/managed-block.ts +117 -0
- package/src/runtime/markdown-scan.ts +266 -0
- package/src/runtime/physical-path.ts +111 -0
- package/src/runtime/policy.ts +50 -2
- package/src/runtime/projected-flag.ts +7 -0
- package/src/runtime/projected-guidance.ts +1 -0
- package/src/runtime/runtime-directory.ts +5 -0
- package/src/runtime/runtime-document-manifest.ts +62 -11
- package/src/runtime/secret-guard.ts +162 -0
- package/src/runtime/secret-patterns.ts +397 -0
- package/src/runtime/secret-scan.ts +90 -0
- package/src/runtime/session-context.ts +98 -0
- package/src/runtime/session-kind.ts +13 -0
- package/src/runtime/shell-heredoc.ts +81 -0
- package/src/runtime/tokensave-route.ts +152 -0
- package/src/runtime/wrap-state.ts +44 -2
- package/src/runtime/write-atomic.ts +64 -0
- package/src/studio.ts +124 -0
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +14 -10
- package/src/templates/capabilities/openspec-cap/mate-minimal/templates/spec.md +3 -5
- package/src/templates/capabilities/openspec-cap/mate-v1/schema.yaml +18 -102
- package/src/templates/capabilities/openspec-cap/mate-v1/templates/spec.md +3 -5
- package/src/templates/capabilities/openspec-cap/openspec-conventions.yaml +20 -14
- package/src/templates/mate-skills/THIRD-PARTY-NOTICES.md +40 -0
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +134 -0
- package/src/templates/mate-skills/agents/mate-apply-change/references/mate-compact-apply.md +47 -0
- package/src/templates/mate-skills/agents/mate-apply-change/references/openspec-apply-change.md +200 -0
- package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +86 -0
- package/src/templates/mate-skills/{claude/mate-openspec-backfill → agents/mate-backfill-spec}/SKILL.md +11 -4
- package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +110 -0
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +66 -0
- package/src/templates/mate-skills/agents/mate-explore-change/references/openspec-explore.md +350 -0
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +11 -4
- package/src/templates/mate-skills/agents/mate-grill-with-docs/SKILL.md +2 -2
- package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +12 -5
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +108 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/mate-revise.md +47 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-propose.md +169 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-update-change.md +103 -0
- package/src/templates/mate-skills/agents/{mate-artifact-publish → mate-publish-artifact}/SKILL.md +111 -24
- package/src/templates/mate-skills/{claude/mate-artifact-publish → agents/mate-publish-artifact}/references/openspec.md +8 -5
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +95 -16
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +87 -68
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +134 -0
- package/src/templates/mate-skills/claude/mate-apply-change/references/mate-compact-apply.md +47 -0
- package/src/templates/mate-skills/claude/mate-apply-change/references/openspec-apply-change.md +200 -0
- package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +86 -0
- package/src/templates/mate-skills/{agents/mate-openspec-backfill → claude/mate-backfill-spec}/SKILL.md +11 -4
- package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +110 -0
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +66 -0
- package/src/templates/mate-skills/claude/mate-explore-change/references/openspec-explore.md +350 -0
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +11 -4
- package/src/templates/mate-skills/claude/mate-grill-with-docs/SKILL.md +2 -2
- package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +12 -5
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +108 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/mate-revise.md +47 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-propose.md +169 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-update-change.md +103 -0
- package/src/templates/mate-skills/claude/{mate-artifact-publish → mate-publish-artifact}/SKILL.md +111 -24
- package/src/templates/mate-skills/{agents/mate-artifact-publish → claude/mate-publish-artifact}/references/openspec.md +8 -5
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +95 -16
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +87 -68
- package/src/templates/mate-skills/openspec-references.ts +142 -0
- package/src/templates/root/TEMPLATE_AGENTS.md +2 -2
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +3938 -391
- package/src/tools/setup/capabilities/companion-mentions.ts +27 -0
- package/src/tools/setup/capabilities/context-mode.ts +56 -7
- package/src/tools/setup/capabilities/graphify-gate.ts +31 -0
- package/src/tools/setup/capabilities/graphify-secrets.ts +243 -0
- package/src/tools/setup/capabilities/graphify.ts +46 -7
- package/src/tools/setup/capabilities/openspec.ts +163 -272
- package/src/tools/setup/capabilities/react-doctor.ts +8 -1
- package/src/tools/setup/capabilities/rtk.ts +4 -0
- package/src/tools/setup/capabilities/tokensave.ts +113 -71
- package/src/tools/setup/context-services.ts +9 -17
- package/src/tools/setup/dynamic-plugins/install.ts +24 -28
- package/src/tools/setup/engine.ts +100 -23
- package/src/tools/setup/install-contract.ts +8 -0
- package/src/tools/setup/managed-output.ts +51 -0
- package/src/tools/setup/mate-skill-copies.ts +51 -0
- package/src/tools/setup/mate.ts +86 -11
- package/src/tools/setup/package-managers/uv.ts +73 -11
- package/src/tools/setup/plugin.ts +40 -0
- package/src/tools/setup/plugins/guidance.ts +7 -4
- package/src/tools/setup/providers/agent-file-sections.ts +4 -2
- package/src/tools/setup/providers/claude-attribution.ts +65 -0
- package/src/tools/setup/providers/claude-plugin-folders.ts +625 -0
- package/src/tools/setup/providers/claude-plugin-hooks.ts +51 -19
- package/src/tools/setup/providers/claude-worktree-plugins.ts +122 -0
- package/src/tools/setup/providers/claude.ts +290 -8
- package/src/tools/setup/providers/opencode.ts +180 -1
- package/src/tools/setup/utils.ts +18 -4
- package/src/tools/setup/working-repo-cleanup.ts +29 -1
- package/src/tools/setup/working-repo-local-state.ts +252 -75
- package/src/tools/setup.ts +183 -26
- package/studio-dist/client/assets/companion-view-Csva26Ir.js +1 -0
- package/studio-dist/client/assets/delivery-path-DJMpRmiY.js +1 -0
- package/studio-dist/client/assets/dist-Dm7MtyHc.js +5 -0
- package/studio-dist/client/assets/factory-B7l9ZQyx.js +4 -0
- package/studio-dist/client/assets/index-n6uo_92S.js +40 -0
- package/studio-dist/client/assets/preload-helper-BLdHbfdN.js +1 -0
- package/studio-dist/client/assets/prepaint-CD5OpmTM.js +24 -0
- package/studio-dist/client/assets/queries-CN3JwMBX.js +1 -0
- package/studio-dist/client/assets/react-CabXf2Ds.js +1 -0
- package/studio-dist/client/assets/report-time-Dc-KOqQu.js +1 -0
- package/studio-dist/client/assets/reports-C01RsnMA.js +1 -0
- package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
- package/studio-dist/client/assets/routes-4pbC-2Hj.js +1 -0
- package/studio-dist/client/assets/skills-CihQganl.js +1 -0
- package/studio-dist/client/assets/spec-areas-C2L48N4C.js +1 -0
- package/studio-dist/client/assets/specs-D24_35_K.js +1 -0
- package/studio-dist/client/assets/studio-DKxfi691.css +1 -0
- package/studio-dist/client/assets/studio-queries-rvbJupCy.js +3 -0
- package/studio-dist/client/assets/terminal-eU5fzQzv.css +1 -0
- package/studio-dist/client/assets/vault-Bd4CQiTK.js +1 -0
- package/studio-dist/client/assets/warnings-V_Ys51wJ.js +1 -0
- package/studio-dist/client/assets/wasm-inline-C2en61B5.js +1 -0
- package/studio-dist/client/assets/workflow-BJejeVwQ.js +1 -0
- package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-BQKuMdJW.js +3881 -0
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +85 -0
- package/studio-dist/server/assets/actions-Bvgj9eb8.js +54 -0
- package/studio-dist/server/assets/actions-D8erOphH.js +44 -0
- package/studio-dist/server/assets/companion-view-aBady57v.js +33 -0
- package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +459 -0
- package/studio-dist/server/assets/createServerRpc-tK2lE9R2.js +11 -0
- package/studio-dist/server/assets/delivery-path-BkKNjgkf.js +778 -0
- package/studio-dist/server/assets/dist-DpJWKyCm.js +5582 -0
- package/studio-dist/server/assets/empty-plugin-adapters-Cipd4ZH4.js +4 -0
- package/studio-dist/server/assets/factory-D6xnjedJ.js +2385 -0
- package/studio-dist/server/assets/factory-DT3UzHlh.js +68 -0
- package/studio-dist/server/assets/model-PyPALjii.js +18 -0
- package/studio-dist/server/assets/prepaint-BMke0fo1.js +41 -0
- package/studio-dist/server/assets/queries-Ag2iL8q2.js +107 -0
- package/studio-dist/server/assets/react-COs0LHn-.js +51 -0
- package/studio-dist/server/assets/report-time-DAfzln-N.js +8 -0
- package/studio-dist/server/assets/reports-BnUNJVtx.js +126 -0
- package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +34 -0
- package/studio-dist/server/assets/router-BH--drIx.js +4298 -0
- package/studio-dist/server/assets/routes-khSDK1bV.js +361 -0
- package/studio-dist/server/assets/search-JAKurDNh.js +36 -0
- package/studio-dist/server/assets/shell-CboT2f66.js +51 -0
- package/studio-dist/server/assets/skills-MWYnWoKs.js +106 -0
- package/studio-dist/server/assets/spec-areas-DcnO6vW-.js +16 -0
- package/studio-dist/server/assets/specs-DE3w8hZP.js +155 -0
- package/studio-dist/server/assets/start-BW5ovN0k.js +33 -0
- package/studio-dist/server/assets/studio-BeltxxKt.js +216 -0
- package/studio-dist/server/assets/studio-queries-CLnP9kGu.js +3365 -0
- package/studio-dist/server/assets/utils-C9CX1kcy.js +221 -0
- package/studio-dist/server/assets/vault-BGulVoNh.js +70 -0
- package/studio-dist/server/assets/vault-CuyyhLyB.js +832 -0
- package/studio-dist/server/assets/views-Bd7cRr27.js +82 -0
- package/studio-dist/server/assets/warnings-BH05rOuG.js +15 -0
- package/studio-dist/server/assets/wasm-inline-CNeBKGwC.js +3 -0
- package/studio-dist/server/assets/workflow-BSuIKWqH.js +42 -0
- package/studio-dist/server/server.js +16220 -0
- package/wrappers/bin/graphify +52 -4
- package/wrappers/bin/openspec +33 -9
- package/wrappers/lib/graphify-gate.mjs +8 -0
- package/src/cli/commands/studio/views/client.ts +0 -654
- package/src/cli/commands/studio/views/companion-picker.tsx +0 -95
- package/src/cli/commands/studio/views/companion-selector.tsx +0 -94
- package/src/cli/commands/studio/views/dashboard/changes.tsx +0 -107
- package/src/cli/commands/studio/views/dashboard/index.tsx +0 -19
- package/src/cli/commands/studio/views/document.tsx +0 -842
- package/src/cli/commands/studio/views/error.tsx +0 -20
- package/src/cli/commands/studio/views/reports/index.tsx +0 -49
- package/src/cli/commands/studio/views/selection-fields.tsx +0 -14
- package/src/cli/commands/studio/views/skills/index.tsx +0 -87
- package/src/cli/commands/studio/views/specs/index.tsx +0 -157
- package/src/cli/commands/studio/views/styles.ts +0 -519
- package/src/cli/commands/studio/views/terminal.tsx +0 -484
- package/src/cli/commands/studio/views/vault/state.ts +0 -43
- package/src/cli/commands/studio/views/warnings.tsx +0 -21
- package/src/cli/commands/studio/views/workflow/index.tsx +0 -21
- package/src/cli/commands/studio/views/workflow/steps.ts +0 -337
- package/src/cli/commands/studio/views/workflow/transcript.tsx +0 -190
- package/src/lib/components/theme.ts +0 -2
- package/src/tools/setup/git-utils.ts +0 -30
- package/src/tools/setup/runtime-documents.ts +0 -291
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mate-apply-change
|
|
3
|
+
description: Implement a change on a recorded delivery branch, offering workset/<workset-id> instead of a protected branch. Builds on the OpenSpec apply workflow. Use when the user wants to implement, apply, or continue implementing a reviewed change.
|
|
4
|
+
allowed-tools: Bash(mate:*), Bash(openspec:*), Bash(git:*)
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Requires the mate CLI and the openspec capability enabled.
|
|
7
|
+
metadata:
|
|
8
|
+
author: mate
|
|
9
|
+
version: "1.0"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Mate Apply Change
|
|
13
|
+
|
|
14
|
+
The Apply change stage of the Delivery Path. Before any code changes, it records the
|
|
15
|
+
Working Repository branch the change is delivered through, so archive and publication
|
|
16
|
+
later know which merge to wait for. Then it runs the OpenSpec apply workflow.
|
|
17
|
+
|
|
18
|
+
## Step 1: Read the branch and the record
|
|
19
|
+
|
|
20
|
+
In the Working Repository, read local Git state only:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git symbolic-ref --quiet --short HEAD # current branch; fails when detached
|
|
24
|
+
git symbolic-ref --quiet --short refs/remotes/origin/HEAD # default branch
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Read the change's existing record without changing it:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
mate artifact link "<change-name>" --json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Step 2: Settle the delivery branch
|
|
34
|
+
|
|
35
|
+
Read `defaultBranch`, `diagnostics`, `ticketFormat`, `ticketCandidate`, and
|
|
36
|
+
`record.ticket` from the link result. Report every diagnostic;
|
|
37
|
+
never derive a default from a change or Workset name. `defaultBranch: null` means ask
|
|
38
|
+
for a branch name, not infer one. Preserve recorded branches after membership changes;
|
|
39
|
+
a mismatch is informational, and relinking requires explicit user confirmation.
|
|
40
|
+
|
|
41
|
+
A branch is **protected** when it is the default branch or matches a configured
|
|
42
|
+
protected pattern; `mate artifact link` refuses a
|
|
43
|
+
protected branch unless it is recorded as a direct delivery. Mate never asks the forge,
|
|
44
|
+
so a branch only the forge protects looks unprotected; hence the menu below.
|
|
45
|
+
|
|
46
|
+
- **A branch is already recorded** and it is the current branch → continue. When the
|
|
47
|
+
current branch differs, warn, name both branches, and ask before implementing
|
|
48
|
+
whether to switch to the recorded branch or record the current one.
|
|
49
|
+
- **On `defaultBranch`** → record it without asking:
|
|
50
|
+
`mate artifact link "<change-name>" --branch "<defaultBranch>" --json`.
|
|
51
|
+
- **Detached HEAD** → ask for the branch name, then record it.
|
|
52
|
+
- **On any other branch**, protected or not → do not implement there yet. First name
|
|
53
|
+
every local commit that is not on the remote (`git log --oneline HEAD --not --remotes`)
|
|
54
|
+
and leave them where they are; never move, reset, or rebase them. On another
|
|
55
|
+
Workset's `workset/<id>` branch, name that Workset. Then offer one menu:
|
|
56
|
+
1. **Create or switch to `defaultBranch`** (recommended): check local and `origin`
|
|
57
|
+
refs; `git switch "<defaultBranch>"` when local,
|
|
58
|
+
`git switch --track -c "<defaultBranch>" "origin/<defaultBranch>"` when remote-only,
|
|
59
|
+
otherwise `git switch -c "<defaultBranch>"`. Uncommitted edits carry over. Record it.
|
|
60
|
+
When `defaultBranch` is null, ask for a name instead; do not offer an inferred branch.
|
|
61
|
+
2. **Create a worktree** (only when `defaultBranch` is set): say uncommitted edits stay
|
|
62
|
+
in this checkout, run `mate working worktree --change "<change-name>" --enter --json`;
|
|
63
|
+
it records the branch. When `enter.action` is `tool`, say an approval prompt may
|
|
64
|
+
follow (Claude Code asks), call the tool `enter.tool` with `enter.path`, then say
|
|
65
|
+
`enter.path` is now the Working Repository and continue at Step 3 there. On `handoff`
|
|
66
|
+
or a declined move, report `enter.reason` and any warnings, write no code, and
|
|
67
|
+
stop. `## Next steps`: name each `repositories[].path`, open a new session in this
|
|
68
|
+
repository's worktree, run `/mate-apply-change <change-name>` there. On failure,
|
|
69
|
+
report its diagnostics and offer the other options again.
|
|
70
|
+
3. **Use the current branch** (only when it is not protected): record it. When
|
|
71
|
+
`ticketCandidate` is set, offer it with and without recording that ticket
|
|
72
|
+
(`--ticket "<ticketCandidate>"` on the same link call).
|
|
73
|
+
4. **Use another existing branch**: switch to the branch the user names and record it.
|
|
74
|
+
5. **Work directly here** (protected branch only) — only when the user explicitly chooses it.
|
|
75
|
+
Record it as a direct delivery:
|
|
76
|
+
`mate artifact link "<change-name>" --branch "<branch>" --direct --json`.
|
|
77
|
+
|
|
78
|
+
**Tickets** exist only when `ticketFormat` is `jira`; otherwise never ask for, offer, or
|
|
79
|
+
mention one. With `jira` and no `record.ticket`, options 1 and 2 accept an optional Jira
|
|
80
|
+
key in the answer (`1 ABC-123`). Record it first with
|
|
81
|
+
`mate artifact link "<change-name>" --ticket "<KEY>" --json`, then read `defaultBranch`
|
|
82
|
+
again with `mate artifact link "<change-name>" --json` before creating the branch or
|
|
83
|
+
running the worktree command. On a refused key, name the expected format and ask once more.
|
|
84
|
+
|
|
85
|
+
Record the branch before writing any code. When `mate artifact link` refuses, report
|
|
86
|
+
its message and ask; never work around it.
|
|
87
|
+
|
|
88
|
+
When its result lists `warnings`, a `dependsOn` change is not implemented yet, so this
|
|
89
|
+
change would be built without the code it builds on. Report each warning and ask
|
|
90
|
+
whether to apply the dependency first or continue here. A dependency that is
|
|
91
|
+
implemented but unarchived is no such warning; it only affects archive order.
|
|
92
|
+
|
|
93
|
+
## Step 3: Apply
|
|
94
|
+
|
|
95
|
+
Read [references/openspec-apply-change.md](references/openspec-apply-change.md) and
|
|
96
|
+
follow it for the implementation. The PR need not exist yet; the branch is the delivery.
|
|
97
|
+
Retrieve its instructions the ordinary way. Only when the user explicitly asks for compact
|
|
98
|
+
apply, also read [references/mate-compact-apply.md](references/mate-compact-apply.md) and
|
|
99
|
+
use its transport.
|
|
100
|
+
|
|
101
|
+
## Step 4: Hand off
|
|
102
|
+
|
|
103
|
+
End the response with a final `## Next steps` section: numbered required actions in
|
|
104
|
+
execution order, with exact commands and known change names, prerequisites first.
|
|
105
|
+
Summaries, evidence, warnings, optional work, and deferred context go above it; nothing
|
|
106
|
+
follows it. Listing an action never invokes it. Never offer the user an optional command, in or above the section; optional work appears above it only as a skill invocation labelled optional.
|
|
107
|
+
|
|
108
|
+
**Skill invocation.** Skill invocations here use `/name`, the syntax of Claude Code
|
|
109
|
+
and Cursor and the fallback. When the current runtime uses another syntax, swap only
|
|
110
|
+
the prefix: `@name` in OpenCode, `$name` in Codex, `/skill:name` in Pi. Only the
|
|
111
|
+
user's statement or the harness's own identity sets the runtime, never a skill's
|
|
112
|
+
folder or an older example. Arguments, commands, paths, and order stay, and naming
|
|
113
|
+
never invokes.
|
|
114
|
+
|
|
115
|
+
- Above the section, label `/mate-show-me` and `/mate-simplify-code` as optional, in
|
|
116
|
+
any order; they are not prerequisites for archive.
|
|
117
|
+
- In the section, list `/mate-archive-change <change-name>`, after any required work
|
|
118
|
+
still open (a failing check, an unanswered question).
|
|
119
|
+
- Several changes on one branch: list their archives in dependency order, and say above
|
|
120
|
+
the section that this order avoids an advisory archive warning; it is not a gate.
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
Optional, any order: /mate-show-me acme-queue, /mate-simplify-code.
|
|
124
|
+
|
|
125
|
+
## Next steps
|
|
126
|
+
1. /mate-archive-change acme-queue
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Guardrails
|
|
130
|
+
|
|
131
|
+
- Never push, open a PR, or merge on the user's behalf.
|
|
132
|
+
- Never record a protected branch except as an explicit direct delivery.
|
|
133
|
+
- The forge token, when one is used by `mate artifact link`, is never printed or
|
|
134
|
+
written; do not read or echo `MATE_GIT_TOKEN`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Mate Compact Apply Transport
|
|
2
|
+
|
|
3
|
+
Use this only when the user explicitly asks for compact apply. It replaces one thing in
|
|
4
|
+
the apply workflow: how its instructions are retrieved. Every other step, check, and
|
|
5
|
+
stop of [openspec-apply-change.md](openspec-apply-change.md) still applies. This is a
|
|
6
|
+
Mate transport, not native OpenSpec delta support.
|
|
7
|
+
|
|
8
|
+
## Retrieval
|
|
9
|
+
|
|
10
|
+
Wherever the workflow runs `openspec instructions apply --change "<name>" --json`, run
|
|
11
|
+
instead:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
mate artifact apply-context "<name>" --json [--since <digest>]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Each call fetches fresh upstream instructions. It returns one of two version 1
|
|
18
|
+
envelopes:
|
|
19
|
+
|
|
20
|
+
- `{"version": 1, "mode": "full", "digest", "payload"}`: `payload` is the complete
|
|
21
|
+
upstream apply object. Treat it exactly as the apply instructions output, read every
|
|
22
|
+
`contextFiles` path again, and make it your baseline, replacing any earlier one. A
|
|
23
|
+
`null` digest (with a `limitation`) means compaction is unavailable: keep calling
|
|
24
|
+
without `--since`.
|
|
25
|
+
- `{"version": 1, "mode": "compact", "digest", "state", "progress", "taskStates"}`:
|
|
26
|
+
nothing static changed since the baseline. The current object is the baseline with
|
|
27
|
+
`state` and `progress` replaced and each task's `done` taken from `taskStates`, which
|
|
28
|
+
lists every task in order.
|
|
29
|
+
|
|
30
|
+
A failing command is a failure, never a cached success: report it and stop, or fall back
|
|
31
|
+
to the ordinary command.
|
|
32
|
+
|
|
33
|
+
## When to pass `--since`
|
|
34
|
+
|
|
35
|
+
Pass `--since <digest>` only when the complete full envelope with that digest is in this
|
|
36
|
+
conversation. Omit it, and reread the required context before any edit, on session
|
|
37
|
+
start, after resume or context compaction, or whenever you are unsure the baseline is
|
|
38
|
+
complete. A digest in a summary is not a baseline.
|
|
39
|
+
|
|
40
|
+
## Unchanged obligations
|
|
41
|
+
|
|
42
|
+
- After each task, check its box at its current `sourcePath` and `line`, then fetch
|
|
43
|
+
again and confirm the task is done and progress changed.
|
|
44
|
+
- `state: "blocked"` in either envelope stops implementation; follow the blocked-state
|
|
45
|
+
steps.
|
|
46
|
+
- A full envelope after a compact one means context changed: reread it before continuing.
|
|
47
|
+
- When you cannot meet any of these, switch back to the ordinary command.
|
package/src/templates/mate-skills/claude/mate-apply-change/references/openspec-apply-change.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<!-- Vendored from OpenSpec 1.15.0: the `openspec-apply-change` workflow its `claude` tool generates.
|
|
2
|
+
Copyright (c) OpenSpec Contributors, MIT License (see THIRD-PARTY-NOTICES.md in Mate).
|
|
3
|
+
Regenerated by `bun run vendor:openspec`; do not edit. -->
|
|
4
|
+
|
|
5
|
+
> **Skill invocation:** `/mate-*` invocations below use the fallback `/name` syntax. For another established runtime, swap only the prefix per **Skill invocation** in this skill's `SKILL.md`.
|
|
6
|
+
|
|
7
|
+
Implement tasks from an OpenSpec change.
|
|
8
|
+
|
|
9
|
+
**Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
|
|
10
|
+
|
|
11
|
+
**Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
|
|
12
|
+
|
|
13
|
+
One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
|
|
14
|
+
|
|
15
|
+
Otherwise, with no root, what happens next depends on how this workflow was reached:
|
|
16
|
+
|
|
17
|
+
- **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
|
|
18
|
+
- **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
|
|
19
|
+
|
|
20
|
+
In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
|
|
21
|
+
|
|
22
|
+
**Input**: Optionally specify a change name (e.g., `/mate-apply-change add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
23
|
+
|
|
24
|
+
**Steps**
|
|
25
|
+
|
|
26
|
+
1. **Select the change**
|
|
27
|
+
|
|
28
|
+
If a name is provided, use it. Otherwise:
|
|
29
|
+
- Infer from conversation context if the user mentioned a change
|
|
30
|
+
- Auto-select if only one active change exists
|
|
31
|
+
- If ambiguous, run `openspec list --json` to get available changes and ask the user to select one
|
|
32
|
+
|
|
33
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/mate-apply-change <other>`).
|
|
34
|
+
|
|
35
|
+
2. **Check status to understand the schema**
|
|
36
|
+
```bash
|
|
37
|
+
openspec status --change "<name>" --json
|
|
38
|
+
```
|
|
39
|
+
Parse the JSON to understand:
|
|
40
|
+
- `schemaName`: The workflow being used (e.g., "spec-driven")
|
|
41
|
+
- `planningHome`, `changeRoot`, and `actionContext`: planning scope and edit constraints
|
|
42
|
+
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
|
|
43
|
+
|
|
44
|
+
3. **Get apply instructions**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
openspec instructions apply --change "<name>" --json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This returns:
|
|
51
|
+
- `contextFiles`: artifact ID -> array of concrete file paths (varies by schema - could be proposal/specs/design/tasks or spec/tests/implementation/docs)
|
|
52
|
+
- Progress (total, complete, remaining)
|
|
53
|
+
- Task list with status, source path, and source line
|
|
54
|
+
- Dynamic instruction based on current state
|
|
55
|
+
- Optional `context`: current required project instruction input from the selected root
|
|
56
|
+
- Optional `operationGuidance`: current advisory guidance for apply
|
|
57
|
+
- `missingArtifacts` (when present): required artifact ids with no output
|
|
58
|
+
|
|
59
|
+
**Handle states:**
|
|
60
|
+
- If `state: "blocked"`: show the message and pause implementation.
|
|
61
|
+
- If `missingArtifacts` is non-empty: suggest completing the missing artifacts. Run `openspec status --change "<name>" --json`, select the next `ready` artifact (not `skipped` or `blocked`), and use `openspec instructions "<artifact-id>" --change "<name>" --json` for its rules and template. Keep the selected `--store <id>` on both commands.
|
|
62
|
+
- Otherwise, follow the CLI instruction to create or repair the schema-configured tracking file from existing planning artifacts. Do not assume another artifact is ready or start implementation while blocked.
|
|
63
|
+
- If `state: "all_done"`: report that all tracked tasks are complete and suggest review or verification as appropriate before archiving
|
|
64
|
+
- Otherwise: proceed to implementation
|
|
65
|
+
|
|
66
|
+
Treat `context` as a required prompt-level input. Read and consider it, and
|
|
67
|
+
apply relevant project facts, conventions, and constraints while implementing.
|
|
68
|
+
Treat `operationGuidance` as optional additive advice. Read and consider every
|
|
69
|
+
entry, and follow entries that are applicable and compatible with the built-in
|
|
70
|
+
workflow.
|
|
71
|
+
|
|
72
|
+
Keep both fields separate from CLI-returned state, missing artifacts, tasks,
|
|
73
|
+
progress, `contextFiles`, and the built-in `instruction`. They are not
|
|
74
|
+
evidence of task completion, do not replace the built-in instruction, and do
|
|
75
|
+
not permit bypassing a blocked state. If context conflicts with the built-in
|
|
76
|
+
instruction, an explicit user choice, or a CLI-controlled value, report the
|
|
77
|
+
conflict and preserve the controlling value. If guidance is inapplicable or
|
|
78
|
+
conflicts with those controlling inputs, do not follow it and explain why.
|
|
79
|
+
These are prompt-level behavior contracts, not enforceable checks.
|
|
80
|
+
|
|
81
|
+
4. **Read context files**
|
|
82
|
+
|
|
83
|
+
Read every file path listed under `contextFiles` from the apply instructions output.
|
|
84
|
+
The files depend on the schema being used:
|
|
85
|
+
- **spec-driven**: proposal, specs, design, tasks
|
|
86
|
+
- Other schemas: follow the contextFiles from CLI output
|
|
87
|
+
|
|
88
|
+
Do not copy `context` or `operationGuidance` verbatim into implementation
|
|
89
|
+
files or planning artifacts unless the user separately asks for that content.
|
|
90
|
+
|
|
91
|
+
5. **Show current progress**
|
|
92
|
+
|
|
93
|
+
Display:
|
|
94
|
+
- Schema being used
|
|
95
|
+
- Progress: "N/M tasks complete"
|
|
96
|
+
- Remaining tasks overview
|
|
97
|
+
- Dynamic instruction from CLI
|
|
98
|
+
|
|
99
|
+
6. **Implement tasks (loop until done or blocked)**
|
|
100
|
+
|
|
101
|
+
For each pending task:
|
|
102
|
+
- Show which task is being worked on
|
|
103
|
+
- Make the code changes required
|
|
104
|
+
- Keep changes minimal and focused
|
|
105
|
+
- Before editing, confirm the checkbox at the returned `sourcePath` and `line` still matches the task description; if it does not, rerun the apply instructions and use the refreshed location
|
|
106
|
+
- Mark the task complete at its returned `sourcePath` and `line`: `- [ ]` → `- [x]`
|
|
107
|
+
- Rerun the apply instructions and confirm that task is now done and progress changed
|
|
108
|
+
- Continue to next task
|
|
109
|
+
|
|
110
|
+
**Pause if:**
|
|
111
|
+
- Task is unclear → ask for clarification
|
|
112
|
+
- Implementation reveals a design issue → suggest updating artifacts
|
|
113
|
+
- A task needs work beyond what the spec and tasks describe, or you are tempted to drop, narrow, defer, or accept exceptions to specified behavior to make it fit → surface the added scope and ask; do not absorb it silently
|
|
114
|
+
- Error or blocker encountered → report and wait for guidance
|
|
115
|
+
- User interrupts
|
|
116
|
+
|
|
117
|
+
7. **On completion or pause, show status**
|
|
118
|
+
|
|
119
|
+
Display:
|
|
120
|
+
- Tasks completed this session
|
|
121
|
+
- Overall progress: "N/M tasks complete"
|
|
122
|
+
- If all done: report that tracked tasks are complete and suggest review or verification as appropriate before archiving
|
|
123
|
+
- If paused: explain why and wait for guidance
|
|
124
|
+
|
|
125
|
+
**Output During Implementation**
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
## Implementing: <change-name> (schema: <schema-name>)
|
|
129
|
+
|
|
130
|
+
Working on task 3/7: <task description>
|
|
131
|
+
[...implementation happening...]
|
|
132
|
+
✓ Task complete
|
|
133
|
+
|
|
134
|
+
Working on task 4/7: <task description>
|
|
135
|
+
[...implementation happening...]
|
|
136
|
+
✓ Task complete
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Output On Completion**
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
## Implementation Complete
|
|
143
|
+
|
|
144
|
+
**Change:** <change-name>
|
|
145
|
+
**Schema:** <schema-name>
|
|
146
|
+
**Progress:** 7/7 tasks complete ✓
|
|
147
|
+
|
|
148
|
+
### Completed This Session
|
|
149
|
+
- [x] Task 1
|
|
150
|
+
- [x] Task 2
|
|
151
|
+
...
|
|
152
|
+
|
|
153
|
+
All tracked tasks are complete. Review or verify the change as appropriate
|
|
154
|
+
before archiving. You can archive this change with `/mate-archive-change`.
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Output On Pause (Issue Encountered)**
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
## Implementation Paused
|
|
161
|
+
|
|
162
|
+
**Change:** <change-name>
|
|
163
|
+
**Schema:** <schema-name>
|
|
164
|
+
**Progress:** 4/7 tasks complete
|
|
165
|
+
|
|
166
|
+
### Issue Encountered
|
|
167
|
+
<description of the issue>
|
|
168
|
+
|
|
169
|
+
**Options:**
|
|
170
|
+
1. <option 1>
|
|
171
|
+
2. <option 2>
|
|
172
|
+
3. Other approach
|
|
173
|
+
|
|
174
|
+
What would you like to do?
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Guardrails**
|
|
178
|
+
- Keep going through tasks until done or blocked
|
|
179
|
+
- Always read context files before starting (from the apply instructions output)
|
|
180
|
+
- If task is ambiguous, pause and ask before implementing
|
|
181
|
+
- If implementation reveals issues, pause and suggest artifact updates
|
|
182
|
+
- Keep code changes minimal and scoped to each task
|
|
183
|
+
- Update task checkbox immediately after completing each task
|
|
184
|
+
- Pause on errors, blockers, or unclear requirements - don't guess
|
|
185
|
+
- When a task needs work beyond what the spec describes, surface the added scope and pause - never silently narrow, defer, or simplify away specified behavior
|
|
186
|
+
- Only mark a task `- [x]` when its specified behavior is fully implemented, not when it is partially done or deferred
|
|
187
|
+
- Use contextFiles from CLI output, don't assume specific file names
|
|
188
|
+
- Use each task's sourcePath and line to update its exact checkbox
|
|
189
|
+
- Do not use context or operation guidance as proof that a task is complete
|
|
190
|
+
- Apply relevant project context; report conflicts with controlling workflow inputs
|
|
191
|
+
- Consider every guidance entry; explain any inapplicable or conflicting advice
|
|
192
|
+
- Do not copy runtime context or operation guidance into implementation files or planning artifacts
|
|
193
|
+
- Preserve CLI-controlled blocked/ready/all-done behavior and completion criteria
|
|
194
|
+
|
|
195
|
+
**Fluid Workflow Integration**
|
|
196
|
+
|
|
197
|
+
This skill supports the "actions on a change" model:
|
|
198
|
+
|
|
199
|
+
- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
|
|
200
|
+
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mate-archive-change
|
|
3
|
+
description: Archive a change through mate artifact archive, which records its delivery, reports merge state and its warnings, and runs the OpenSpec archive, also before the merge. Use when the user wants to archive, finalize, or close out an implemented change.
|
|
4
|
+
allowed-tools: Bash(mate:*), Bash(git:*)
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Requires the mate CLI and the openspec capability enabled.
|
|
7
|
+
metadata:
|
|
8
|
+
author: mate
|
|
9
|
+
version: "1.0"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Mate Archive Change
|
|
13
|
+
|
|
14
|
+
The Archive change stage of the Delivery Path. Archiving applies the change's delta
|
|
15
|
+
specs to the local canonical specs, so a feature's later changes build on it. It is
|
|
16
|
+
allowed **before** the delivery branch merges: publication, not archive, waits for the
|
|
17
|
+
merge. Archiving is local and uncommitted; it publishes nothing.
|
|
18
|
+
|
|
19
|
+
## Steps
|
|
20
|
+
|
|
21
|
+
1. **Archive.**
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
mate artifact archive "<change-name>" --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Run it from the companion or the linked Working Repository. It shows warnings,
|
|
28
|
+
refreshes merge state from the forge when a token is available, writes the change's
|
|
29
|
+
`delivery.yaml`, and runs `openspec archive` itself. Do not run `openspec archive`
|
|
30
|
+
separately.
|
|
31
|
+
|
|
32
|
+
2. **Answer a missing branch.** When the result's `status` is `needs-branch`, nothing
|
|
33
|
+
was archived. Ask the user which branch delivers the change, suggesting
|
|
34
|
+
`suggestedBranch` when it is set, and re-run with exactly one of:
|
|
35
|
+
|
|
36
|
+
- `--branch "<branch>"` — a protected branch only with `--direct`, after the user
|
|
37
|
+
explicitly confirms a direct delivery;
|
|
38
|
+
- `--not-applicable "<reason>"` — for a specification-only change;
|
|
39
|
+
- `--skip-branch` — when the user skips the question; publication will ask again.
|
|
40
|
+
|
|
41
|
+
Before re-running with a named branch, read `mate artifact link "<change-name>" --json`.
|
|
42
|
+
Only when it reports `ticketFormat` `jira` and no `record.ticket`, and the branch name
|
|
43
|
+
holds exactly one Jira key (`feature/ABC-123-retry`), offer to record that ticket first:
|
|
44
|
+
`mate artifact link "<change-name>" --ticket "<KEY>" --json`.
|
|
45
|
+
|
|
46
|
+
3. **Report.** Relay every entry of `warnings` first: another active change that
|
|
47
|
+
modifies the same requirement, a declared dependency that is not archived yet, or
|
|
48
|
+
planning artifacts its schema requires that are missing (`incomplete-planning`).
|
|
49
|
+
Warnings never block. Then report the archive `path` and the delivery: each branch
|
|
50
|
+
with its merge result and source (`forge`, `git`, or `user`) and PR link, or the
|
|
51
|
+
not-applicable reason. An open or unknown merge is information, not a failure and not an
|
|
52
|
+
action: never offer to record it (`mate artifact link … --confirm-*`); publication asks
|
|
53
|
+
the merge question; a `likely-merged` outcome is only a suggestion that publication
|
|
54
|
+
confirms with the user.
|
|
55
|
+
|
|
56
|
+
4. **Hand off.**
|
|
57
|
+
End the response with a final `## Next steps` section: numbered required actions in
|
|
58
|
+
execution order, with exact commands and known change names, prerequisites first.
|
|
59
|
+
Summaries, evidence, warnings, optional work, and deferred context go above it; nothing
|
|
60
|
+
follows it. Listing an action never invokes it. Never offer the user an optional command, in or above the section; optional work appears above it only as a skill invocation labelled optional.
|
|
61
|
+
|
|
62
|
+
**Skill invocation.** Skill invocations here use `/name`, the syntax of Claude Code
|
|
63
|
+
and Cursor and the fallback. When the current runtime uses another syntax, swap only
|
|
64
|
+
the prefix: `@name` in OpenCode, `$name` in Codex, `/skill:name` in Pi. Only the
|
|
65
|
+
user's statement or the harness's own identity sets the runtime, never a skill's
|
|
66
|
+
folder or an older example. Arguments, commands, paths, and order stay, and naming
|
|
67
|
+
never invokes.
|
|
68
|
+
|
|
69
|
+
When the delivery branch is not merged yet, list merging it before
|
|
70
|
+
`/mate-publish-artifact`, and say above the section that publication, not archive,
|
|
71
|
+
waits for the merge. Never commit, push, open a PR, or merge for the user.
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
## Next steps
|
|
75
|
+
1. Merge workset/acme-queue
|
|
76
|
+
2. /mate-publish-artifact
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
When `status` is `failed`, report the message (typically incomplete tasks or a
|
|
80
|
+
validation error) and stop.
|
|
81
|
+
|
|
82
|
+
## Guardrails
|
|
83
|
+
|
|
84
|
+
- Never commit, tag, or push; publication is `mate-publish-artifact`.
|
|
85
|
+
- A merger account is provenance, never an artifact review.
|
|
86
|
+
- Do not read or echo `MATE_GIT_TOKEN`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
name: mate-
|
|
2
|
+
name: mate-backfill-spec
|
|
3
3
|
description: Reverse-engineer an OpenSpec spec for one existing feature and write it directly to the canonical spec, ready to publish. Use when the user wants to backfill, document, or spec existing or legacy behavior that has no spec yet.
|
|
4
4
|
allowed-tools: Bash(openspec:*), Bash(mate:*), Bash(git remote:*), Bash(git diff:*)
|
|
5
5
|
license: MIT
|
|
@@ -11,7 +11,7 @@ metadata:
|
|
|
11
11
|
|
|
12
12
|
# Mate OpenSpec Backfill
|
|
13
13
|
|
|
14
|
-
Specify one feature that already exists in the working repository. A backfill records behavior that already shipped, so the run writes the canonical spec `openspec/specs/<capability>/spec.md` directly and leaves it uncommitted. It never creates a change and never publishes; publication happens afterwards through `mate-artifact
|
|
14
|
+
Specify one feature that already exists in the working repository. A backfill records behavior that already shipped, so the run writes the canonical spec `openspec/specs/<capability>/spec.md` directly and leaves it uncommitted. It never creates a change and never publishes; publication happens afterwards through `mate-publish-artifact`.
|
|
15
15
|
|
|
16
16
|
## Scope rules
|
|
17
17
|
|
|
@@ -70,12 +70,19 @@ Specify one feature that already exists in the working repository. A backfill re
|
|
|
70
70
|
|
|
71
71
|
Fix every reported error and re-validate until it passes. Do not hand off a spec that fails validation.
|
|
72
72
|
|
|
73
|
-
8. **Hand off.** Report the written path and show the uncommitted diff (`git diff -- openspec/specs/<capability>/`, or the file itself when it is new). Point the user to
|
|
73
|
+
8. **Hand off.** Report the written path and show the uncommitted diff (`git diff -- openspec/specs/<capability>/`, or the file itself when it is new). Point the user to `/mate-publish-artifact`: the spec appears there under **Drifted specs** and can be published on its own or with the rest.
|
|
74
|
+
|
|
75
|
+
**Skill invocation.** Skill invocations here use `/name`, the syntax of Claude Code
|
|
76
|
+
and Cursor and the fallback. When the current runtime uses another syntax, swap only
|
|
77
|
+
the prefix: `@name` in OpenCode, `$name` in Codex, `/skill:name` in Pi. Only the
|
|
78
|
+
user's statement or the harness's own identity sets the runtime, never a skill's
|
|
79
|
+
folder or an older example. Arguments, commands, paths, and order stay, and naming
|
|
80
|
+
never invokes.
|
|
74
81
|
|
|
75
82
|
## Guardrails
|
|
76
83
|
|
|
77
84
|
- Never create an OpenSpec change, change artifacts, or verification tasks, and never archive.
|
|
78
|
-
- Never commit, tag, push, or publish — never run `mate artifact publish`. Publication belongs to `mate-artifact
|
|
85
|
+
- Never commit, tag, push, or publish — never run `mate artifact publish`. Publication belongs to `mate-publish-artifact`.
|
|
79
86
|
- Never write any file before the user approves the review table.
|
|
80
87
|
- Never write a requirement without a citation in the review table, and never spec a suspected bug without the user's ruling.
|
|
81
88
|
- Never write citations or evidence tags into the canonical spec.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mate-clarify-intent
|
|
3
|
+
description: Pick the pre-explore mode a request needs (interview, grilling, or skip) from what it already states, then run that one mode. Use only when the user explicitly starts clarifying an idea before exploring a change.
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Requires the mate CLI and the openspec capability enabled.
|
|
7
|
+
metadata:
|
|
8
|
+
author: mate
|
|
9
|
+
version: "1.0"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Mate Clarify Intent
|
|
13
|
+
|
|
14
|
+
The optional first stage of the Delivery Path. It runs before `/mate-explore-change`
|
|
15
|
+
and decides how much clarification a request needs: an interview when intent is
|
|
16
|
+
incomplete, grilling when intent is clear but a proposed direction needs testing, or
|
|
17
|
+
nothing at all for a small, fully specified change.
|
|
18
|
+
|
|
19
|
+
Read only the user's request and this conversation. Do not read or investigate the
|
|
20
|
+
repository; questions that need repository evidence go to explore.
|
|
21
|
+
|
|
22
|
+
## Step 1: Fill the slot table
|
|
23
|
+
|
|
24
|
+
Mark each slot `stated`, `implied`, or `missing` from the request and conversation:
|
|
25
|
+
|
|
26
|
+
| Slot | Question |
|
|
27
|
+
| ---------- | --------------------------------------------- |
|
|
28
|
+
| Who | Who benefits or is affected? |
|
|
29
|
+
| Why | What problem or change makes this needed now? |
|
|
30
|
+
| Success | How will we know it worked? |
|
|
31
|
+
| Constraint | What limit binds the solution? |
|
|
32
|
+
|
|
33
|
+
`implied` Success counts as `missing`: a guessed success measure is the gap this stage
|
|
34
|
+
exists to close. Then note whether the request proposes a direction (an approach,
|
|
35
|
+
design, or solution shape): yes or no.
|
|
36
|
+
|
|
37
|
+
## Step 2: Route
|
|
38
|
+
|
|
39
|
+
Apply the first rule that matches:
|
|
40
|
+
|
|
41
|
+
1. Any slot `missing` → **interview**.
|
|
42
|
+
2. All slots filled and a direction is proposed → **grill**.
|
|
43
|
+
3. All slots filled, no direction, and the change is minimal-eligible (one Area, low
|
|
44
|
+
risk, no new dependency or data-model change) → **skip**.
|
|
45
|
+
4. Otherwise → **grill**.
|
|
46
|
+
|
|
47
|
+
## Step 3: Announce and accept an override
|
|
48
|
+
|
|
49
|
+
Show the slot table with each slot's mark, the direction answer, and the route with
|
|
50
|
+
its rule in one line, for example:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
Route: interview — Success is missing.
|
|
54
|
+
Reply `interview`, `grill`, or `skip` to switch; anything else continues.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
A one-word reply `interview`, `grill`, or `skip` replaces the route without further
|
|
58
|
+
questions. Run exactly one mode.
|
|
59
|
+
|
|
60
|
+
## Step 4: Run the routed mode
|
|
61
|
+
|
|
62
|
+
Run the mode by **reading its instructions and following them**, not by invoking a
|
|
63
|
+
skill. Resolve the file relative to this skill's own directory:
|
|
64
|
+
|
|
65
|
+
- **interview** → read `../mate-interview-me/SKILL.md` and follow it from its first
|
|
66
|
+
step.
|
|
67
|
+
- **grill** → read `../mate-grill-me/SKILL.md` and follow it.
|
|
68
|
+
- **skip** → run nothing.
|
|
69
|
+
|
|
70
|
+
`mate-interview-me` and `mate-grill-me` are manual-only skills: never call them through
|
|
71
|
+
the skill mechanism. Reading the file is the supported way to run them from here. If
|
|
72
|
+
the file is missing, report that the companion's Mate skills need
|
|
73
|
+
`mate companion update` and stop.
|
|
74
|
+
|
|
75
|
+
## Step 5: Hand off
|
|
76
|
+
|
|
77
|
+
A routed mode ends with its own `PRE-EXPLORE HANDOFF` block naming
|
|
78
|
+
`/mate-explore-change`. For **skip**, emit:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
PRE-EXPLORE HANDOFF (skip)
|
|
82
|
+
Confirmed: <the four slots as stated>
|
|
83
|
+
Unresolved: none
|
|
84
|
+
Assumptions: <points explore should verify, or "none">
|
|
85
|
+
Next: /mate-explore-change
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
End the response with a final `## Next steps` section: numbered required actions in
|
|
89
|
+
execution order, with exact commands and known change names, prerequisites first.
|
|
90
|
+
Summaries, evidence, warnings, optional work, and deferred context go above it; nothing
|
|
91
|
+
follows it. Listing an action never invokes it. Never offer the user an optional command, in or above the section; optional work appears above it only as a skill invocation labelled optional. For **skip**, the block is followed by:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
## Next steps
|
|
95
|
+
1. /mate-explore-change
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Skill invocation.** Skill invocations here use `/name`, the syntax of Claude Code
|
|
99
|
+
and Cursor and the fallback. When the current runtime uses another syntax, swap only
|
|
100
|
+
the prefix: `@name` in OpenCode, `$name` in Codex, `/skill:name` in Pi. Only the
|
|
101
|
+
user's statement or the harness's own identity sets the runtime, never a skill's
|
|
102
|
+
folder or an older example. Arguments, commands, paths, and order stay, and naming
|
|
103
|
+
never invokes.
|
|
104
|
+
|
|
105
|
+
## Mate Boundary
|
|
106
|
+
|
|
107
|
+
Conversational only. Do not create or modify code, context files, ADRs, OpenSpec
|
|
108
|
+
artifacts, or any other file. This skill runs before `/mate-explore-change`: wide
|
|
109
|
+
repository investigation and option comparison belong there, recorded under
|
|
110
|
+
Unresolved or Assumptions in the handoff.
|