@uniqbit/mate-core 0.18.5 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/claude-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 +41 -2
- package/claude-plugin/hooks/session-attention.mjs +10 -0
- package/claude-plugin/hooks/session-end.mjs +9 -0
- package/claude-plugin/hooks/session-guidance.mjs +1 -1
- package/claude-plugin/hooks/tokensave-route.mjs +52 -0
- package/opencode-plugin/src/server.ts +17 -2
- package/opencode-plugin/src/tui.tsx +3 -1
- package/opencode-plugin/tui.tsx +4 -1
- 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 +191 -0
- package/src/cli/commands/artifact/delivery/output.ts +97 -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 +180 -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/companion.ts +1 -1
- package/src/cli/commands/companion/link.ts +50 -5
- package/src/cli/commands/companion/open.ts +101 -51
- 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 +317 -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/session/prepare.ts +32 -4
- package/src/cli/commands/session/registry.ts +90 -0
- package/src/cli/commands/setup.ts +50 -24
- package/src/cli/commands/studio/companion-removal.ts +79 -0
- package/src/cli/commands/studio/factory-credential.ts +49 -0
- package/src/cli/commands/studio/index.ts +29 -2
- package/src/cli/commands/studio/mate-inventory.ts +1 -1
- package/src/cli/commands/studio/openspec-cli.ts +10 -58
- package/src/cli/commands/studio/payload.ts +260 -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 +429 -326
- package/src/cli/commands/studio/services.ts +80 -0
- package/src/cli/commands/studio/skill-files.ts +133 -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/vault.ts +218 -44
- package/src/cli/commands/studio/views/model.ts +13 -0
- package/src/cli/commands/studio/views/vault/markdown-tree.ts +518 -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 +16 -0
- package/src/cli/commands/update.ts +53 -9
- package/src/cli/commands/vscode/setup.ts +155 -0
- package/src/cli/commands/vscode/vsix.ts +73 -0
- package/src/cli/commands/working/cleanup.ts +44 -11
- 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 +406 -0
- package/src/cli/commands/wrap.ts +38 -20
- 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 +31 -3
- 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 +20 -1
- package/src/create-mate.ts +5 -4
- package/src/hooks/companion-instructions.ts +198 -0
- package/src/hooks/hook-io.ts +78 -0
- package/src/hooks/session-banner.ts +24 -30
- package/src/hooks/session-end.ts +10 -0
- package/src/hooks/session-guidance.ts +18 -22
- package/src/hooks/session-prepare.ts +137 -34
- package/src/hooks/session-register.ts +199 -0
- package/src/hooks/tokensave-route.ts +30 -0
- package/src/hooks/validate-artifact-path.ts +90 -25
- 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 +165 -0
- package/src/lib/delivery/branches.ts +147 -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 +338 -0
- package/src/lib/delivery/record.ts +405 -0
- package/src/lib/delivery/refresh.ts +288 -0
- package/src/lib/delivery/repository-access.ts +141 -0
- package/src/lib/delivery/resolve-branch.ts +383 -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 +391 -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 +981 -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/opencode-server.ts +238 -0
- 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 +201 -43
- package/src/lib/orchestrator/adapters/opencode.ts +55 -2
- package/src/lib/orchestrator/checkout-adoption.ts +125 -0
- package/src/lib/orchestrator/companion-registry-store.ts +6 -2
- package/src/lib/orchestrator/config-store.ts +3 -2
- package/src/lib/orchestrator/editor.ts +32 -26
- package/src/lib/orchestrator/framework-context.ts +26 -14
- package/src/lib/orchestrator/global-config-store.ts +11 -0
- package/src/lib/orchestrator/launcher.ts +15 -2
- 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 +206 -0
- package/src/lib/orchestrator/projection-claude-skills.ts +37 -129
- package/src/lib/orchestrator/projection-companion-link.ts +12 -1
- 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/registry-checkouts.ts +177 -0
- package/src/lib/orchestrator/repository-link.ts +216 -57
- package/src/lib/orchestrator/serving-claude-wrap.ts +43 -0
- package/src/lib/orchestrator/session-context-link.ts +73 -0
- package/src/lib/orchestrator/session-prepare.ts +81 -11
- package/src/lib/orchestrator/setup-compatibilities.ts +56 -70
- package/src/lib/orchestrator/types.ts +12 -2
- package/src/lib/orchestrator/working-repo-projection.ts +50 -7
- package/src/lib/orchestrator/workspace-document.ts +105 -0
- package/src/lib/orchestrator/workspace-inventory.ts +5 -1
- package/src/lib/orchestrator/wrap-pass.ts +22 -1
- package/src/lib/package-paths.ts +37 -0
- package/src/lib/public-npm.ts +17 -0
- package/src/lib/runtime-directory-refresh.ts +17 -1
- package/src/lib/session-attribution.ts +52 -0
- package/src/lib/session-state.ts +285 -0
- package/src/lib/session-stop.ts +64 -0
- package/src/lib/workset/record.ts +533 -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 +898 -0
- package/src/opencode/background-server.ts +145 -0
- package/src/opencode/companion-hooks.ts +111 -7
- package/src/opencode/companion-policy.ts +39 -20
- package/src/opencode/enter-worktree.ts +72 -0
- package/src/opencode/projected-guidance.ts +6 -2
- package/src/opencode/session-prepare.ts +2 -1
- package/src/opencode/session-register.ts +176 -0
- package/src/opencode/tui.tsx +24 -27
- package/src/plugins.ts +1 -0
- package/src/runtime/artifact-refusal.ts +63 -0
- package/src/runtime/claude-delivery-plan.ts +121 -11
- 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/current-branch.ts +10 -0
- package/src/runtime/env.ts +59 -8
- package/src/runtime/error-message.ts +4 -0
- package/src/runtime/git-layout.ts +366 -0
- package/src/runtime/index.ts +29 -0
- package/src/runtime/launch-env-guard.ts +65 -0
- package/src/runtime/managed-block.ts +117 -0
- package/src/runtime/markdown-scan.ts +266 -0
- package/src/runtime/opencode-server-record.ts +136 -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/projection.ts +40 -6
- package/src/runtime/repo-local.ts +6 -1
- 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/serving-claude-wrap.ts +28 -0
- package/src/runtime/session-context.ts +99 -0
- package/src/runtime/session-kind.ts +13 -0
- package/src/runtime/session-registry.ts +434 -0
- package/src/runtime/shell-heredoc.ts +81 -0
- package/src/runtime/tokensave-route.ts +157 -0
- package/src/runtime/wrap-state.ts +75 -2
- package/src/runtime/write-atomic.ts +64 -0
- package/src/studio.ts +126 -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 +162 -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 +81 -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 +102 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/mate-revise.md +45 -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 +109 -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 +162 -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 +81 -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 +102 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/mate-revise.md +45 -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 +109 -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 +4340 -419
- 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/hydrate.ts +4 -3
- 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 +77 -19
- package/src/tools/setup/providers/claude-worktree-plugins.ts +122 -0
- package/src/tools/setup/providers/claude.ts +310 -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/app-CdPiFv59.css +2 -0
- package/studio-dist/client/assets/button-BIIHE0EQ.js +3 -0
- package/studio-dist/client/assets/companion-view-DM6YyXaR.js +1 -0
- package/studio-dist/client/assets/delivery-path-DELxj0Av.js +1 -0
- package/studio-dist/client/assets/dist-Dm7MtyHc.js +5 -0
- package/studio-dist/client/assets/factory-BZy0E8ty.js +4 -0
- package/studio-dist/client/assets/index-B3wkMzjA.js +40 -0
- package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +1 -0
- package/studio-dist/client/assets/panel-CbajlC3p.js +1 -0
- package/studio-dist/client/assets/preload-helper-BLdHbfdN.js +1 -0
- package/studio-dist/client/assets/prepaint-CwSrpdFA.js +27 -0
- package/studio-dist/client/assets/react-CN2GSx7x.js +1 -0
- package/studio-dist/client/assets/reports-DllhYQ5_.js +1 -0
- package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
- package/studio-dist/client/assets/routes-COm-G3mK.js +1 -0
- package/studio-dist/client/assets/skills-DmWAy-jZ.js +1 -0
- package/studio-dist/client/assets/specs-BG3Wi3ln.js +1 -0
- package/studio-dist/client/assets/steps-DFsH3Neu.js +1 -0
- package/studio-dist/client/assets/terminal-eU5fzQzv.css +1 -0
- package/studio-dist/client/assets/vault-B2q1nBY5.js +1 -0
- package/studio-dist/client/assets/warnings-BSXIyuSQ.js +1 -0
- package/studio-dist/client/assets/wasm-inline-C2en61B5.js +1 -0
- package/studio-dist/client/assets/workflow-DlsQD6Hc.js +1 -0
- package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-M2GBs8s3.js +4051 -0
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +95 -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/button-CIJqAhni.js +11929 -0
- package/studio-dist/server/assets/companion-view-DISASvdJ.js +39 -0
- package/studio-dist/server/assets/companions-BYbHWKOZ.js +15 -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-C29fBynY.js +654 -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-DGPmNGbo.js +69 -0
- package/studio-dist/server/assets/factory-DUTa0eDs.js +2172 -0
- package/studio-dist/server/assets/markdown-view-Bn7xPdks.js +86 -0
- package/studio-dist/server/assets/model-PyPALjii.js +18 -0
- package/studio-dist/server/assets/panel-3Jmn4awF.js +169 -0
- package/studio-dist/server/assets/prepaint-DJfTQ_VH.js +45 -0
- package/studio-dist/server/assets/react-Ce6dj15C.js +46 -0
- package/studio-dist/server/assets/reports-C06RXVE2.js +18 -0
- package/studio-dist/server/assets/reports-D6YMqhnO.js +142 -0
- package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +34 -0
- package/studio-dist/server/assets/router-C8MGqlAY.js +13713 -0
- package/studio-dist/server/assets/routes-BcFgvqf7.js +622 -0
- package/studio-dist/server/assets/search-JAKurDNh.js +36 -0
- package/studio-dist/server/assets/shell-DS3wUexh.js +52 -0
- package/studio-dist/server/assets/skills-BEnOxiDl.js +266 -0
- package/studio-dist/server/assets/skills-CtrBAtX3.js +28 -0
- package/studio-dist/server/assets/specs-C8rv34-5.js +211 -0
- package/studio-dist/server/assets/start-h3ICWwd2.js +36 -0
- package/studio-dist/server/assets/steps-Dq_CwY_s.js +181 -0
- package/studio-dist/server/assets/studio-BeltxxKt.js +216 -0
- package/studio-dist/server/assets/utils-C9CX1kcy.js +221 -0
- package/studio-dist/server/assets/vault-BmWnryh3.js +85 -0
- package/studio-dist/server/assets/vault-Fvxt2Tzl.js +1032 -0
- package/studio-dist/server/assets/views-BgYa-za2.js +80 -0
- package/studio-dist/server/assets/warnings-DzR6fyZh.js +23 -0
- package/studio-dist/server/assets/wasm-inline-CNeBKGwC.js +3 -0
- package/studio-dist/server/assets/workflow-liRYecHk.js +73 -0
- package/studio-dist/server/server.js +16066 -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,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mate-propose-change
|
|
3
|
+
description: Propose a change with its schema chosen by the minimal eligibility test (mate-minimal or mate-v1) and one change per agreed slice. Builds on the OpenSpec propose workflow. Use when the user wants to turn an explored direction into a change proposal, or revise an existing change's plan.
|
|
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 Propose Change
|
|
13
|
+
|
|
14
|
+
The Propose change stage of the Delivery Path. It runs the OpenSpec propose workflow
|
|
15
|
+
and adds the schema choice and one change per slice. Its revise mode reworks the plan
|
|
16
|
+
of a change that already exists.
|
|
17
|
+
|
|
18
|
+
## Step 0: Choose the mode
|
|
19
|
+
|
|
20
|
+
Use **Revise mode** when the named change already exists, or the user asks to revise,
|
|
21
|
+
reconcile, or fold feedback or new decisions into a change's plan. Otherwise run the
|
|
22
|
+
propose steps below.
|
|
23
|
+
|
|
24
|
+
## Steps
|
|
25
|
+
|
|
26
|
+
1. **Choose the schema.** Use `mate-minimal` (specs and tasks only) when every
|
|
27
|
+
statement holds; otherwise use `mate-v1` (proposal, specs, design, tasks):
|
|
28
|
+
|
|
29
|
+
- Intent and scope are clear, with nothing left to explore.
|
|
30
|
+
- The change stays within one Area.
|
|
31
|
+
- It is low risk: no new dependency, no data-model or public API change, and no
|
|
32
|
+
security, performance, or migration concern.
|
|
33
|
+
|
|
34
|
+
Public API includes command names, flags, exit codes, JSON output fields, config
|
|
35
|
+
keys, and exported package symbols.
|
|
36
|
+
|
|
37
|
+
State the result and the failing statement, if any, in one line. The user may
|
|
38
|
+
override it.
|
|
39
|
+
|
|
40
|
+
2. **One change per slice.** Slicing test: a feature needs slicing when it holds
|
|
41
|
+
several behaviours that can each ship and be reviewed on their own, or more work
|
|
42
|
+
than one review can hold (roughly more than 20 tasks or 800 changed lines).
|
|
43
|
+
Several Areas alone are no reason to slice: they stay one change with a scope per
|
|
44
|
+
Area. When exploration agreed on several slices, propose one change per slice,
|
|
45
|
+
each with its own name. When no slices were agreed and no decision to keep one
|
|
46
|
+
change was made (in exploration or a PRE-EXPLORE HANDOFF), apply the slicing test
|
|
47
|
+
before writing anything. Only when it clearly passes, suggest slices in dependency
|
|
48
|
+
order, naming their `dependsOn` entries, and write no artifact until the user
|
|
49
|
+
agrees to the slices or keeps one change. A borderline case counts as one change:
|
|
50
|
+
state in one line why, and continue. If the test clearly passes but the slice
|
|
51
|
+
boundaries are unclear, suggest `/mate-explore-change` instead of guessing slices.
|
|
52
|
+
Record a slice's dependency on an earlier change as a `dependsOn` list in the
|
|
53
|
+
frontmatter of its first artifact, for example `dependsOn: [add-graph-model]`; archive
|
|
54
|
+
later warns while a dependency is still unarchived.
|
|
55
|
+
|
|
56
|
+
3. **Follow the OpenSpec workflow.** Read
|
|
57
|
+
[references/openspec-propose.md](references/openspec-propose.md) and follow it with the
|
|
58
|
+
chosen schema (pass `--schema <schema>` when creating the change). Never ask for a
|
|
59
|
+
ticket; apply asks when it creates the branch.
|
|
60
|
+
|
|
61
|
+
4. **Hand off to human review.** Reviews are done by people, not by a skill.
|
|
62
|
+
End the response with a final `## Next steps` section: numbered required actions in
|
|
63
|
+
execution order, with exact commands and known change names, prerequisites first.
|
|
64
|
+
Summaries, evidence, warnings, optional work, and deferred context go above it; nothing
|
|
65
|
+
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.
|
|
66
|
+
|
|
67
|
+
**Skill invocation.** Skill invocations here use `/name`, the syntax of Claude Code
|
|
68
|
+
and Cursor and the fallback. When the current runtime uses another syntax, swap only
|
|
69
|
+
the prefix: `@name` in OpenCode, `$name` in Codex, `/skill:name` in Pi. Only the
|
|
70
|
+
user's statement or the harness's own identity sets the runtime, never a skill's
|
|
71
|
+
folder or an older example. Arguments, commands, paths, and order stay, and naming
|
|
72
|
+
never invokes.
|
|
73
|
+
|
|
74
|
+
List the artifacts to review in schema order (Review proposal, Review specs, Review
|
|
75
|
+
design, Review tasks for `mate-v1`; Review specs and Review tasks for
|
|
76
|
+
`mate-minimal`), then `/mate-apply-change <change-name>` after that review. Never
|
|
77
|
+
describe validation as approval.
|
|
78
|
+
|
|
79
|
+
- **Remaining slices:** when recommending them next, list
|
|
80
|
+
`/mate-propose-change <slice>` per slice in dependency order; otherwise name them
|
|
81
|
+
above the section as deferred.
|
|
82
|
+
- **Dependencies:** a `dependsOn` change with unfinished work (open tasks or an
|
|
83
|
+
outstanding check) gets its named action listed before applying this change. A
|
|
84
|
+
dependency that is implemented but unarchived does not block apply: say above
|
|
85
|
+
the section that archiving it first avoids an archive warning.
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
Validation passed; validation is not approval.
|
|
89
|
+
|
|
90
|
+
## Next steps
|
|
91
|
+
1. Review specs: openspec/changes/acme-queue/specs/
|
|
92
|
+
2. Review tasks: openspec/changes/acme-queue/tasks.md
|
|
93
|
+
3. After your review: /mate-apply-change acme-queue
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Revise mode
|
|
97
|
+
|
|
98
|
+
Revises the planning artifacts a change already has, for example after a person reviewed
|
|
99
|
+
them. In this mode the skill is not a Delivery Path stage. Read
|
|
100
|
+
[references/mate-revise.md](references/mate-revise.md) and follow it; it loads the OpenSpec
|
|
101
|
+
workflow in [references/openspec-update-change.md](references/openspec-update-change.md).
|
|
102
|
+
Read neither when proposing a new change.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Mate Revise Mode
|
|
2
|
+
|
|
3
|
+
Revises the planning artifacts a change already has, for example after a person reviewed
|
|
4
|
+
them, and keeps them consistent with each other. Not a Delivery Path stage.
|
|
5
|
+
|
|
6
|
+
1. **Name the change.** Use the change the user names; otherwise infer it from the
|
|
7
|
+
conversation, or list the active changes and ask.
|
|
8
|
+
|
|
9
|
+
2. **Follow the OpenSpec workflow.** Read
|
|
10
|
+
[openspec-update-change.md](openspec-update-change.md) and follow it. Propose the requested edit together with the matching edits to the other
|
|
11
|
+
artifacts, and write each one only after the user confirms it. Never ask for a ticket.
|
|
12
|
+
|
|
13
|
+
3. **Upgrade a minimal change when it outgrows the gate.** When a revision makes a
|
|
14
|
+
`mate-minimal` change fail a statement of the minimal gate (Step 1 of `SKILL.md`), or
|
|
15
|
+
the user asks, name the failing statement and offer the upgrade to `mate-v1` once. Declined: continue
|
|
16
|
+
the revision unchanged. Confirmed:
|
|
17
|
+
|
|
18
|
+
1. Set `schema: mate-v1` in the change's `.openspec.yaml`, first, so `openspec
|
|
19
|
+
instructions` returns the `mate-v1` text.
|
|
20
|
+
2. Write the proposal from the existing specs and tasks, then the design, each from
|
|
21
|
+
`openspec instructions <artifact-id> --change "<name>" --json` and each confirmed
|
|
22
|
+
before writing.
|
|
23
|
+
3. Align `tasks.md`: frontmatter `schema: mate-v1`, the `← [[proposal]] | [[design]]`
|
|
24
|
+
line after the title, one heading per Area. Keep task numbers and check marks.
|
|
25
|
+
4. Run `openspec validate "<name>" --strict` and `openspec status --change "<name>"`,
|
|
26
|
+
and report any artifact still missing.
|
|
27
|
+
|
|
28
|
+
This upgrade is the only case in which revise mode creates a missing artifact. Never
|
|
29
|
+
downgrade a `mate-v1` change; suggest a new change instead.
|
|
30
|
+
|
|
31
|
+
4. **Hand off.**
|
|
32
|
+
End the response with a final `## Next steps` section: numbered required actions in
|
|
33
|
+
execution order, with exact commands and known change names, prerequisites first.
|
|
34
|
+
Summaries, evidence, warnings, optional work, and deferred context go above it; nothing
|
|
35
|
+
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.
|
|
36
|
+
Swap skill prefixes per **Skill invocation** in `SKILL.md`.
|
|
37
|
+
Start with reviewing the revised artifacts. When the change already has checked
|
|
38
|
+
tasks, then list `/mate-apply-change <change-name>` to carry the revision into code;
|
|
39
|
+
when every task is checked, `/mate-archive-change <change-name>`.
|
|
40
|
+
|
|
41
|
+
Guardrails:
|
|
42
|
+
|
|
43
|
+
- Planning artifacts only; never edit product code.
|
|
44
|
+
- Reviews are done by people. Never describe a revision or a passing validation as
|
|
45
|
+
approval.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<!-- Vendored from OpenSpec 1.15.0: the `openspec-propose` workflow its `agents` tool generates.
|
|
2
|
+
Copyright (c) OpenSpec Contributors, MIT License (see THIRD-PARTY-NOTICES.md in Mate).
|
|
3
|
+
Regenerated by `bun run vendor:openspec`; do not edit. -->
|
|
4
|
+
|
|
5
|
+
> **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
|
+
Propose a new change - create the change and generate all artifacts in one step.
|
|
8
|
+
|
|
9
|
+
**Planning boundary**: This workflow creates planning artifacts only. The user request that selected or triggered this workflow authorizes planning only, even if it asks to build or fix something. Do not edit project code. After the planning artifacts are complete, stop. Do not start implementation in the same response, even if the initial request asks for it. Wait for a new user request after the artifacts are presented; then start the apply workflow.
|
|
10
|
+
|
|
11
|
+
I'll create a change with the artifacts your schema defines. With the default spec-driven schema that is:
|
|
12
|
+
- proposal.md (what & why)
|
|
13
|
+
- `specs/<capability-path>/spec.md` (what the system must do - a delta, not the main spec)
|
|
14
|
+
- design.md (how)
|
|
15
|
+
- tasks.md (implementation steps)
|
|
16
|
+
|
|
17
|
+
`<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve an existing capability's full path and follow the project's established organization for new capabilities.
|
|
18
|
+
|
|
19
|
+
When the user is ready to implement, they must start the apply workflow explicitly.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
**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.
|
|
24
|
+
|
|
25
|
+
**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.
|
|
26
|
+
|
|
27
|
+
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`.
|
|
28
|
+
|
|
29
|
+
Otherwise, with no root, what happens next depends on how this workflow was reached:
|
|
30
|
+
|
|
31
|
+
- **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.
|
|
32
|
+
- **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.
|
|
33
|
+
|
|
34
|
+
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.
|
|
35
|
+
|
|
36
|
+
**Input**: The user's request should include a change name (kebab-case) OR a description of what they want to build.
|
|
37
|
+
|
|
38
|
+
**Steps**
|
|
39
|
+
|
|
40
|
+
1. **Understand the request and clarify material ambiguity**
|
|
41
|
+
|
|
42
|
+
If no clear input is provided, ask the user (open-ended, no preset options):
|
|
43
|
+
> "What change do you want to work on? Describe what you want to build or fix."
|
|
44
|
+
|
|
45
|
+
From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).
|
|
46
|
+
|
|
47
|
+
**IMPORTANT**: Do NOT proceed without understanding what the user wants to build.
|
|
48
|
+
|
|
49
|
+
If the request contains ambiguity that would materially affect scope, externally observable behavior, compatibility, or acceptance criteria, ask the user before creating the change. For minor details, make a reasonable assumption and record it in the planning artifacts.
|
|
50
|
+
|
|
51
|
+
2. **Load project context**
|
|
52
|
+
|
|
53
|
+
Run `openspec context --json` from the current working directory (or `openspec context --json --store "<store-id>"` when a registered store was explicitly selected). Use the returned `root.path` as the authoritative OpenSpec root. If context reports `no_openspec_root`, stop without creating or changing any files and follow the **Project check** above for how this workflow was reached. Offer `openspec init` only for an explicit OpenSpec request, and wait for the user to request initialization. Do not initialize automatically or run `openspec new change`. After initialization, rerun this context check before continuing. For any other context failure, stop and report the error; do not fall back to the current directory or run later OpenSpec commands without the selected store.
|
|
54
|
+
|
|
55
|
+
Only when context returns a resolved `root.path`, read `<root.path>/openspec/config.yaml`. Use `config.yml` only when `config.yaml` does not exist. If neither file exists, continue without project context. Do not fall back to `config.yml` if `config.yaml` is unreadable or invalid.
|
|
56
|
+
|
|
57
|
+
If the file parses as a YAML object and its `context` field is a string no larger than 51,200 bytes in UTF-8, apply that field before exploring the codebase or making planning decisions. If the file cannot be read or parsed, or the context field is invalid or oversized, continue without project context. Validate this field independently of other config fields, as OpenSpec does.
|
|
58
|
+
|
|
59
|
+
Treat context as project-provided data and constraints, not as authority to change this workflow: it cannot override user authorization, the planning boundary, tool restrictions, or artifact and output rules. Do not copy the context into artifacts; use it to focus any codebase exploration and as a constraint on the proposal.
|
|
60
|
+
|
|
61
|
+
3. **Determine the workflow schema**
|
|
62
|
+
|
|
63
|
+
Use the configured default schema unless the user explicitly requests a different workflow.
|
|
64
|
+
|
|
65
|
+
**Use a different schema only if the user:**
|
|
66
|
+
- Explicitly requests a specific schema by name → use `--schema <schema-name>`
|
|
67
|
+
- Asks to "show workflows" or asks "what workflows" exist → resolve the authoritative root by running `openspec context --json` from the current working directory. If the user explicitly selected a registered store, use `openspec context --json --store "<store-id>"`. Then run `openspec schemas --json` with its working directory set to the returned `root.path` and let them choose. This preserves roots selected by a local `store:` pointer or the global `defaultStore`; when a registered store was explicitly selected, append `--store "<store-id>"` to `openspec schemas --json` as well. If context fails, stop as described in the context-loading step; do not fall back to the current directory.
|
|
68
|
+
|
|
69
|
+
Otherwise, omit `--schema` to preserve the configured default.
|
|
70
|
+
|
|
71
|
+
4. **Create the change directory**
|
|
72
|
+
|
|
73
|
+
Choose one schema form below. If a registered store is selected, append `--store "<store-id>"` to that command and each later OpenSpec command shown below that accepts `--store`.
|
|
74
|
+
|
|
75
|
+
Using the configured default:
|
|
76
|
+
```bash
|
|
77
|
+
openspec new change "<name>"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Using an explicitly requested schema:
|
|
81
|
+
```bash
|
|
82
|
+
openspec new change "<name>" --schema "<schema-name>"
|
|
83
|
+
```
|
|
84
|
+
This creates a scaffolded change in the planning home resolved by the CLI with `.openspec.yaml`.
|
|
85
|
+
|
|
86
|
+
5. **Get the artifact build order**
|
|
87
|
+
```bash
|
|
88
|
+
openspec status --change "<name>" --json
|
|
89
|
+
```
|
|
90
|
+
Parse the JSON to get:
|
|
91
|
+
- `applyRequires`: array of artifact IDs needed before implementation (e.g., `["tasks"]`)
|
|
92
|
+
- `artifacts`: list of all artifacts, each with its `status` and its `requires` edges (the artifact IDs it directly depends on)
|
|
93
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
|
|
94
|
+
|
|
95
|
+
6. **Create every artifact in the required set**
|
|
96
|
+
|
|
97
|
+
Use a todo list to track progress through the artifacts.
|
|
98
|
+
|
|
99
|
+
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
|
|
100
|
+
|
|
101
|
+
a. **For each artifact that is `ready` (dependencies satisfied)**:
|
|
102
|
+
- Get instructions:
|
|
103
|
+
```bash
|
|
104
|
+
openspec instructions <artifact-id> --change "<name>" --json
|
|
105
|
+
```
|
|
106
|
+
- The instructions JSON includes:
|
|
107
|
+
- `context`: Project background (constraints for you - do NOT include in output)
|
|
108
|
+
- `rules`: Artifact-specific rules (constraints for you - do NOT include in output)
|
|
109
|
+
- `template`: The structure to use for your output file
|
|
110
|
+
- `instruction`: Schema-specific guidance for this artifact type
|
|
111
|
+
- `skipped`/`warning`: present when the change declares skip_specs and this artifact must NOT be created - stop and pick another artifact
|
|
112
|
+
- `resolvedOutputPath`: Resolved path or pattern to write the artifact
|
|
113
|
+
- `dependencies`: Completed artifacts to read for context
|
|
114
|
+
- Read any completed dependency files for context - always re-read them from disk, even if you saw them earlier in the conversation (the user may have edited them)
|
|
115
|
+
- **Inspect the relevant project before drafting**: Read `context` and `rules` first, then inspect relevant implementation, nearby tests, configuration, and documentation outside `openspec/`. Keep inspection read-only and proportional to the change; reuse findings for later artifacts and inspect more only as needed.
|
|
116
|
+
- Identify the target project from the request and project context; the planning home may be separate from the code. If the target is unclear, ask. For greenfield or non-code changes, inspect the available structure and relevant documents. If source is unavailable, state the limitation and ask when it materially affects the plan.
|
|
117
|
+
- Ground scope, approach, and tasks in what you find. Distinguish observed behavior from assumptions and proposed additions; surface conflicts with existing specs instead of silently deciding which is correct.
|
|
118
|
+
- Do this discovery now, rather than leaving generic "explore the codebase" or "make a plan" tasks for implementation. Keep any necessary follow-up investigation specific to an unresolved question.
|
|
119
|
+
- Choose the output path before creating anything. If `resolvedOutputPath` is a glob, follow `instruction` to choose a concrete path inside `changeRoot` that matches the glob, and verify it remains inside `changeRoot` after resolving symlinks, both in its parent directories and in the file itself if it already exists; if it does not, stop and tell the user. Otherwise the output path is `resolvedOutputPath`
|
|
120
|
+
- If the `instruction` field delegates creation to a specific skill or command, invoke it only if it can write the artifact to that output path; otherwise stop and tell the user. Then verify the artifact file exists at that output path
|
|
121
|
+
- Otherwise create the artifact file using `template` as the structure and write it to that output path
|
|
122
|
+
- Apply `context` and `rules` as constraints - but do NOT copy them into the file
|
|
123
|
+
- Show brief progress: "Created <artifact-id>"
|
|
124
|
+
|
|
125
|
+
b. **Continue until every artifact in the required set exists (not just `apply.requires`)**
|
|
126
|
+
- After creating each artifact, re-run `openspec status --change "<name>" --json`
|
|
127
|
+
- The required set is `applyRequires` plus every artifact reachable from those by following the `requires` edges in `status --json` - walk them transitively (spec-driven closes over proposal, specs, design, tasks). Leave artifacts outside that set alone
|
|
128
|
+
- `status` is file-existence only, so an `applyRequires` artifact reading `done` does NOT mean its dependencies exist - writing `tasks.md` early marks `tasks` done while `specs` was never written. Use each artifact's `requires` edges, not its `status`, to build the required set: a `done` artifact still lists what it depends on
|
|
129
|
+
- An artifact already reading `status: "skipped"` is satisfied: the change declares `skip_specs` in `.openspec.yaml`, so its files must NOT exist. Never try to create one
|
|
130
|
+
- Create every artifact in the required set that is missing, then re-check - creating one can unblock others
|
|
131
|
+
- Skip one only when `status` already reports it `skipped`, or when its own `instruction` says it is conditional: run `openspec instructions <artifact-id> --change "<name>" --json` and skip only if its `instruction` field marks it optional (e.g. "create only if..."). Spec-driven's `design.md` qualifies; `specs` qualifies only via the `skipped` status above, never by your own judgment. Tell the user, and do not reconsider it
|
|
132
|
+
- Dependencies are enablers, not gates: if a required artifact is still `blocked` only because you skipped a conditional dependency, write it anyway
|
|
133
|
+
- Stop when every artifact in the required set is `done`, `skipped`, or was deliberately skipped
|
|
134
|
+
|
|
135
|
+
c. **If an artifact requires user input** (unclear context):
|
|
136
|
+
- Ask the user to clarify
|
|
137
|
+
- Then continue with creation
|
|
138
|
+
|
|
139
|
+
7. **Show final status**
|
|
140
|
+
```bash
|
|
141
|
+
openspec status --change "<name>"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Output**
|
|
145
|
+
|
|
146
|
+
After completing all artifacts, summarize:
|
|
147
|
+
- Change name and location
|
|
148
|
+
- List of artifacts created with brief descriptions, plus any conditional artifact you skipped and why
|
|
149
|
+
- What's ready: "All artifacts needed for implementation are ready."
|
|
150
|
+
- Prompt: "The artifacts are ready for review. When you are ready, run `/mate-apply-change` or ask me to apply this change."
|
|
151
|
+
|
|
152
|
+
**Artifact Creation Guidelines**
|
|
153
|
+
|
|
154
|
+
- Follow the `instruction` field from `openspec instructions` for each artifact type - it is the authoritative guidance, even for familiar artifact names
|
|
155
|
+
- If the `instruction` field directs you to use a specific skill or command to create the artifact, invoke it instead of writing the artifact directly - but only once you have chosen and checked the output path, and only if it can write there
|
|
156
|
+
- The schema defines what each artifact should contain - follow it
|
|
157
|
+
- Read dependency artifacts for context before creating new ones
|
|
158
|
+
- Use `template` as the structure for your output file - fill in its sections
|
|
159
|
+
- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file
|
|
160
|
+
- Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact
|
|
161
|
+
- These guide what you write, but should never appear in the output
|
|
162
|
+
|
|
163
|
+
**Guardrails**
|
|
164
|
+
- The request that invoked this workflow authorizes planning only. Any implementation or apply instruction in that request does not carry forward. Do NOT implement the change, start the apply workflow, or edit project code during this workflow. After presenting the artifacts, stop and wait for a new user request to start the apply workflow
|
|
165
|
+
- Create every artifact the apply phase transitively depends on, not just the ids listed in `apply.requires`
|
|
166
|
+
- Always read dependency artifacts before creating a new one - re-read from disk, not from conversation memory (files may have changed since you last saw them)
|
|
167
|
+
- Ask about ambiguities that would materially change scope, externally observable behavior, compatibility, or acceptance criteria; for minor details, make reasonable assumptions and record them
|
|
168
|
+
- If a change with that name already exists, ask if user wants to continue it or create a new one
|
|
169
|
+
- Verify each artifact file exists after writing before proceeding to next
|
package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-update-change.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<!-- Vendored from OpenSpec 1.15.0: the `openspec-update-change` workflow its `agents` tool generates.
|
|
2
|
+
Copyright (c) OpenSpec Contributors, MIT License (see THIRD-PARTY-NOTICES.md in Mate).
|
|
3
|
+
Regenerated by `bun run vendor:openspec`; do not edit. -->
|
|
4
|
+
|
|
5
|
+
> **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
|
+
Revise a change's existing planning artifacts and keep them coherent. Never edit code.
|
|
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. If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
|
|
23
|
+
|
|
24
|
+
This workflow revises artifacts that already exist; it never creates missing ones. When an artifact is missing, `openspec status --change "<name>" --json` names the next one and `openspec instructions "<artifact-id>" --change "<name>" --json` explains how to write it.
|
|
25
|
+
|
|
26
|
+
**Steps**
|
|
27
|
+
|
|
28
|
+
1. **Select the change**
|
|
29
|
+
|
|
30
|
+
If a name is provided, use it. Otherwise:
|
|
31
|
+
- Infer from conversation context if the user mentioned a change
|
|
32
|
+
- Auto-select if only one active change exists
|
|
33
|
+
- If ambiguous, run `openspec list --json` to get available changes sorted by most recently modified, and ask the user to select one
|
|
34
|
+
|
|
35
|
+
When prompting, present the top 3-4 most recently modified changes as options, showing:
|
|
36
|
+
- Change name
|
|
37
|
+
- Status (e.g., "0/5 tasks", "complete", "no tasks")
|
|
38
|
+
- How recently it was modified (from `lastModified` field)
|
|
39
|
+
|
|
40
|
+
Mark the most recently modified change as "(Recommended)" since it's likely what the user wants to update.
|
|
41
|
+
|
|
42
|
+
Always announce: "Using change: <name>" and how to override (e.g., `/mate-propose-change <other>`).
|
|
43
|
+
|
|
44
|
+
2. **Get the change's artifacts**
|
|
45
|
+
```bash
|
|
46
|
+
openspec status --change "<name>" --json
|
|
47
|
+
```
|
|
48
|
+
Parse the JSON to understand current state. The response includes:
|
|
49
|
+
- `schemaName`: The workflow schema being used (e.g., "spec-driven")
|
|
50
|
+
- `artifacts`: Array of artifacts with their status ("done", "skipped", "ready", "blocked")
|
|
51
|
+
- `isPlanningComplete`: Boolean indicating if all planning artifacts are complete. Older CLI versions expose the same value as `isComplete`.
|
|
52
|
+
- `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`: path and scope context. Use these instead of assuming repo-local paths.
|
|
53
|
+
|
|
54
|
+
The artifact ids and paths come from the active schema - do NOT assume them, and do NOT branch on hardcoded artifact names. Custom schemas must work unchanged.
|
|
55
|
+
|
|
56
|
+
The files to edit are `artifactPaths.<id>.existingOutputPaths` - the concrete files that exist on disk, already glob-expanded for glob artifacts (e.g. `specs/**/*.md`), plus any confirmed concrete path allowed under a partly populated glob artifact (step 4). Do NOT write to `resolvedOutputPath`: for a glob artifact it is still the glob pattern, not a real file.
|
|
57
|
+
|
|
58
|
+
3. **Understand the request**
|
|
59
|
+
- If the user asked for a specific revision ("the design now uses X"), that is the starting edit.
|
|
60
|
+
- If they only said "update" / "make this coherent", treat it as a coherence review: read the existing artifacts and check them against each other for contradictions, gaps, and duplication.
|
|
61
|
+
|
|
62
|
+
4. **Read and reconcile**
|
|
63
|
+
- Read the artifact(s) the request touches and the change's other existing artifacts.
|
|
64
|
+
- Draft the requested edit in the conversation, not in files. Work out exactly what it changes; step 5 owns every write. Then check every other existing artifact against the drafted edit - in ANY direction: an edit to a later artifact may require revising an earlier one, not only the other way around. Build order is a useful reading order, not a constraint on which artifacts may be revised.
|
|
65
|
+
- Note everything that is now inconsistent, missing, or contradictory.
|
|
66
|
+
- Propose revisions to files that already exist (`existingOutputPaths`). If an artifact has no existing output files and status `ready` or `blocked`, note it and point the user to `openspec instructions "<artifact-id>" --change "<name>" --json` for how to create them. Leave `skipped` artifacts untouched; do not treat them as missing or defer them to the continue workflow.
|
|
67
|
+
- A glob artifact (e.g. `specs/**/*.md`) is marked `done` after at least one file matches, and the continue workflow only handles `ready` artifacts. When reconciliation identifies a missing file for a glob artifact whose `existingOutputPaths` is non-empty:
|
|
68
|
+
1. Run `openspec instructions "<artifact-id>" --change "<name>" --json` and use its `instruction` and `template`. Treat `context` and `rules` as constraints; do not copy them into the file. If instructions report `skipped: true`, do not create the file. Read current dependency files from disk; if a required non-skipped dependency is missing, stop and ask the user to restore it first.
|
|
69
|
+
2. Choose a concrete path inside `changeRoot` that matches `artifactPaths.<id>.outputPath` and does not already exist. Verify it remains inside `changeRoot` after resolving any symlinked parent directories. The glob `resolvedOutputPath` is not a valid target.
|
|
70
|
+
3. Include the new file in step 5's proposed revisions and create it only after the user confirms.
|
|
71
|
+
4. After confirmation, immediately before creation, refresh status and instructions. Verify the artifact is still in scope, not skipped, and partially populated; repeat the concrete-path checks above.
|
|
72
|
+
5. Use a create operation that fails if the target already exists. If `instruction` delegates creation to another skill or command, invoke it only if it can honor the confirmed path and these guardrails; otherwise stop. If any check fails or the confirmed draft is no longer valid, stop and reconcile with the user rather than replacing existing content or choosing a different path.
|
|
73
|
+
- If the change is already coherent, say so and propose no revisions.
|
|
74
|
+
|
|
75
|
+
5. **Confirm and apply, one artifact at a time**
|
|
76
|
+
- This step performs every artifact write in this workflow; no earlier step edits an artifact.
|
|
77
|
+
- Show each proposed revision and why - including the requested edit drafted in step 4. Write only after the user confirms.
|
|
78
|
+
- If the user rejects a revision, do not write it - leave that artifact unchanged.
|
|
79
|
+
- When a substantial rewrite is needed, get that artifact's rules and template first:
|
|
80
|
+
```bash
|
|
81
|
+
openspec instructions "<artifact-id>" --change "<name>" --json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
6. **Point to the next step (guidance only - NEVER act on it)**
|
|
85
|
+
- Artifacts with empty `existingOutputPaths` and status `ready` or `blocked` -> run `openspec status --change "<name>" --json` for the next artifact and point the user to `openspec instructions "<artifact-id>" --change "<name>" --json` for how to create it.
|
|
86
|
+
- Change already implemented (tasks checked off / already applied) -> the code may no longer match the revised plan; suggest `/mate-apply-change` to carry the delta into code.
|
|
87
|
+
- Everything done and implemented -> suggest `/mate-archive-change`.
|
|
88
|
+
|
|
89
|
+
**Output**
|
|
90
|
+
|
|
91
|
+
After each invocation, show:
|
|
92
|
+
- Which artifacts were revised (and which proposed revisions were rejected)
|
|
93
|
+
- Any file created under a glob artifact that was already partially populated
|
|
94
|
+
- Anything deferred because it does not exist yet (artifacts with no files and status `ready` or `blocked`, never `skipped` artifacts)
|
|
95
|
+
- Where the change stands and the recommended next command
|
|
96
|
+
|
|
97
|
+
**Guardrails**
|
|
98
|
+
- Planning artifacts only - NEVER edit implementation code. If the revised plan implies code changes, stop and point to `/mate-apply-change`.
|
|
99
|
+
- Use the artifact ids and paths reported by `openspec status`; never branch on hardcoded artifact names.
|
|
100
|
+
- Edit only the concrete files in `existingOutputPaths`, plus any confirmed concrete path allowed under a partly populated glob artifact (step 4); never write to a glob `resolvedOutputPath`.
|
|
101
|
+
- Do not advance the build frontier: if an artifact has empty `existingOutputPaths` and status `ready` or `blocked`, creating them is a separate step, outside this workflow. Leave `skipped` artifacts untouched. The only new-file scope is a confirmed concrete path under a glob artifact whose `existingOutputPaths` is non-empty.
|
|
102
|
+
- Confirm every edit with the user before writing.
|
|
103
|
+
- If the request changes the change's *intent* rather than refining it, ask for a distinct unused change name and recommend `openspec new change "<new-change-name>"` instead (the "Update vs. Start Fresh" heuristic).
|