heyspex 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +14 -0
- package/README.md +21 -0
- package/bin/hs.mjs +1089 -104
- package/bin/spexcode.mjs +262 -0
- package/dev-factory/engine/worktree.mjs +740 -0
- package/dev-factory/lib/code-repo-root.mjs +67 -0
- package/dev-factory/lib/context-budget.mjs +84 -0
- package/dev-factory/lib/epic-detect.mjs +190 -0
- package/dev-factory/lib/fleet-queue-file.mjs +846 -0
- package/dev-factory/lib/fleet-queue.mjs +426 -0
- package/dev-factory/lib/fleet-state.mjs +14 -18
- package/dev-factory/lib/model-catalog.mjs +338 -0
- package/dev-factory/lib/seat-context.mjs +199 -0
- package/dev-factory/lib/spec-io.mjs +93 -0
- package/dev-factory/lib/sufficiency-score.mjs +8 -2
- package/dev-factory/lib/worktree-allocator.mjs +744 -0
- package/dev-factory/model-catalog.json +222 -0
- package/dist/cli/hs-check.mjs +1127 -103
- package/dist/cli/hs-claim.mjs +981 -63
- package/dist/cli/hs-connect.mjs +10059 -1729
- package/dist/cli/hs-defer.mjs +5507 -3072
- package/dist/cli/hs-dev.mjs +576 -0
- package/dist/cli/hs-env.mjs +416 -302
- package/dist/cli/hs-index-rebuild.mjs +7334 -0
- package/dist/cli/hs-index-reconcile.mjs +8138 -0
- package/dist/cli/hs-init.mjs +2840 -149
- package/dist/cli/hs-install.mjs +7214 -594
- package/dist/cli/hs-join.mjs +10640 -2421
- package/dist/cli/hs-vault-pull.mjs +8157 -6370
- package/dist/cli/hs-vault-push.mjs +6433 -0
- package/dist/cli/hs-vault.mjs +4029 -1555
- package/dist/cli/hs-workspace.mjs +2702 -538
- package/dist/cli-templates/customer-vault/specs/entity-model.md +594 -601
- package/dist/cli-templates/customer-vault/specs/protocols/canonical-frontmatter-templates.md +110 -177
- package/dist/cli-templates/customer-vault/specs/protocols/destructive-action-checklist.md +122 -0
- package/dist/cli-templates/customer-vault/specs/protocols/memory-protocol.md +13 -15
- package/dist/cli-templates/customer-vault/specs/protocols/session-close-protocol.md +91 -0
- package/dist/cli-templates/customer-vault/specs/protocols/spec-hierarchy.md +150 -168
- package/dist/cli-templates/customer-vault/specs/protocols/spec-summary-authoring.md +83 -0
- package/dist/cli-templates/harness-commands/claude/hs-auto.md +36 -0
- package/dist/cli-templates/harness-commands/claude/hs-backfill.md +28 -0
- package/dist/cli-templates/harness-commands/claude/hs-capture.md +62 -0
- package/dist/cli-templates/harness-commands/claude/hs-defer.md +29 -0
- package/dist/cli-templates/harness-commands/claude/hs-dev.md +20 -0
- package/dist/cli-templates/harness-commands/claude/hs-doctor.md +32 -0
- package/dist/cli-templates/harness-commands/claude/hs-ground.md +30 -0
- package/dist/cli-templates/harness-commands/claude/hs-handoff.md +33 -0
- package/dist/cli-templates/harness-commands/claude/hs-log.md +27 -0
- package/dist/cli-templates/harness-commands/claude/hs-next.md +29 -0
- package/dist/cli-templates/harness-commands/claude/hs-promote.md +70 -0
- package/dist/cli-templates/harness-commands/claude/hs-push.md +35 -0
- package/dist/cli-templates/harness-commands/claude/hs-qc.md +27 -0
- package/dist/cli-templates/harness-commands/claude/hs-res.md +63 -0
- package/dist/cli-templates/harness-commands/claude/hs-resolve.md +23 -0
- package/dist/cli-templates/harness-commands/claude/hs-review.md +23 -0
- package/dist/cli-templates/harness-commands/claude/hs-view.md +28 -0
- package/dist/cli-templates/harness-commands/claude/kill-ports.md +32 -0
- package/dist/cli-templates/harness-commands/claude/prototype.md +91 -0
- package/dist/cli-templates/harness-commands/cursor/hs-auto.md +40 -0
- package/dist/cli-templates/harness-commands/cursor/hs-backfill.md +31 -0
- package/dist/cli-templates/harness-commands/cursor/hs-capture.md +65 -0
- package/dist/cli-templates/harness-commands/cursor/hs-defer.md +32 -0
- package/dist/cli-templates/harness-commands/cursor/hs-dev.md +24 -0
- package/dist/cli-templates/harness-commands/cursor/hs-doctor.md +36 -0
- package/dist/cli-templates/harness-commands/cursor/hs-ground.md +33 -0
- package/dist/cli-templates/harness-commands/cursor/hs-handoff.md +37 -0
- package/dist/cli-templates/harness-commands/cursor/hs-log.md +31 -0
- package/dist/cli-templates/harness-commands/cursor/hs-next.md +32 -0
- package/dist/cli-templates/harness-commands/cursor/hs-promote.md +73 -0
- package/dist/cli-templates/harness-commands/cursor/hs-push.md +38 -0
- package/dist/cli-templates/harness-commands/cursor/hs-qc.md +30 -0
- package/dist/cli-templates/harness-commands/cursor/hs-res.md +67 -0
- package/dist/cli-templates/harness-commands/cursor/hs-resolve.md +26 -0
- package/dist/cli-templates/harness-commands/cursor/hs-review.md +26 -0
- package/dist/cli-templates/harness-commands/cursor/hs-view.md +32 -0
- package/dist/cli-templates/harness-commands/cursor/kill-ports.md +35 -0
- package/dist/cli-templates/harness-commands/cursor/prototype.md +95 -0
- package/docs/copilot-plugin-install.md +162 -0
- package/docs/driving-heyspex-from-copilot.md +165 -0
- package/docs/mcp-client-config.md +259 -6
- package/package.json +249 -124
- package/plugins/heyspex/.claude-plugin/plugin.json +12 -0
- package/plugins/heyspex/.cursor-plugin/plugin.json +15 -0
- package/plugins/heyspex/.mcp.json +12 -0
- package/plugins/heyspex/README.md +309 -0
- package/plugins/heyspex/bin/launch-mcp.mjs +95 -0
- package/plugins/heyspex/bin/run-hook.mjs +80 -0
- package/plugins/heyspex/hooks/cursor-hooks.json +308 -0
- package/plugins/heyspex/hooks/hooks.json +418 -0
- package/plugins/heyspex/mcp.json +13 -0
- package/scripts/check-mcp-freshness.mjs +17 -9
- package/scripts/claude-hooks/_env-vault-events.mjs +68 -0
- package/scripts/claude-hooks/_guardrail-events.mjs +96 -0
- package/scripts/claude-hooks/_guardrail-loader.mjs +494 -0
- package/scripts/claude-hooks/_intent-classifier-router.mjs +456 -0
- package/scripts/claude-hooks/_intent-classifier-semantic.mjs +356 -0
- package/scripts/claude-hooks/_run.mjs +413 -0
- package/scripts/claude-hooks/_transcript-text.mjs +60 -0
- package/scripts/claude-hooks/_vault-retrieval.mjs +322 -0
- package/scripts/claude-hooks/agent-spawn-delegation-gate.mjs +133 -0
- package/scripts/claude-hooks/capture-execution-gate.mjs +51 -0
- package/scripts/claude-hooks/capture-workflow-gate.mjs +11 -0
- package/scripts/claude-hooks/check-auto-memory-budget.mjs +396 -0
- package/scripts/claude-hooks/check-claude-md-budget.mjs +327 -0
- package/scripts/claude-hooks/check-mcp-freshness-hook.mjs +14 -0
- package/scripts/claude-hooks/claim-before-code-gate.mjs +11 -0
- package/scripts/claude-hooks/claim-liveness-shared.mjs +577 -0
- package/scripts/claude-hooks/close-terminal-on-ship.mjs +64 -0
- package/scripts/claude-hooks/coo-denylist-gate.mjs +11 -0
- package/scripts/claude-hooks/coo-guard-check.mjs +11 -0
- package/scripts/claude-hooks/deep-research-cost-gate.mjs +11 -0
- package/scripts/claude-hooks/dev-server-task-reminder.mjs +15 -0
- package/scripts/claude-hooks/diagnose-capture-reminder.mjs +11 -0
- package/scripts/claude-hooks/directive-obligation-gate.mjs +11 -0
- package/scripts/claude-hooks/emit-claim-status.mjs +41 -0
- package/scripts/claude-hooks/enforce-session-sequence.mjs +11 -0
- package/scripts/claude-hooks/enforce-vault-naming.mjs +11 -0
- package/scripts/claude-hooks/env-vault-guard.mjs +11 -0
- package/scripts/claude-hooks/epic-milestone-phrasing-gate.mjs +11 -0
- package/scripts/claude-hooks/git-identity-guard.mjs +11 -0
- package/scripts/claude-hooks/git-reflog-audit.mjs +15 -0
- package/scripts/claude-hooks/git-stash-gate.mjs +11 -0
- package/scripts/claude-hooks/guard-auto-memory-writes.mjs +137 -0
- package/scripts/claude-hooks/id-display-format-gate.mjs +11 -0
- package/scripts/claude-hooks/inject-communication-style.mjs +86 -0
- package/scripts/claude-hooks/inject-coo-seat.mjs +78 -0
- package/scripts/claude-hooks/inject-dev-server-awareness.mjs +11 -0
- package/scripts/claude-hooks/inject-doctrine.mjs +13 -0
- package/scripts/claude-hooks/inject-vault-context.mjs +14 -0
- package/scripts/claude-hooks/intent-classifier-trigger.mjs +279 -0
- package/scripts/claude-hooks/log-session-activity.mjs +341 -0
- package/scripts/claude-hooks/naughty-list-gate.mjs +11 -0
- package/scripts/claude-hooks/notify-status-flip.mjs +72 -0
- package/scripts/claude-hooks/plan-exit-ingest-gate.mjs +170 -0
- package/scripts/claude-hooks/plan-ingest-close-reminder.mjs +66 -0
- package/scripts/claude-hooks/plan-review-gate.mjs +11 -0
- package/scripts/claude-hooks/preflight-reminder.mjs +262 -0
- package/scripts/claude-hooks/protected-action-intent.mjs +221 -0
- package/scripts/claude-hooks/research-method-guard.mjs +398 -0
- package/scripts/claude-hooks/research-protocol-gate.mjs +11 -0
- package/scripts/claude-hooks/session-end.mjs +451 -0
- package/scripts/claude-hooks/settings-write-gate.mjs +11 -0
- package/scripts/claude-hooks/settlement-check-gate.mjs +39 -0
- package/scripts/claude-hooks/status-flip-detect.mjs +17 -0
- package/scripts/claude-hooks/terminal-close-shared.mjs +426 -0
- package/scripts/claude-hooks/terminal-close-watcher.mjs +122 -0
- package/scripts/claude-hooks/vault-mirror-catchup.mjs +11 -0
- package/scripts/claude-hooks/vault-write-tier-guard.mjs +11 -0
- package/scripts/claude-hooks/wip-checkpoint.mjs +302 -0
- package/scripts/cursor-hooks/manifest.mjs +281 -0
- package/scripts/dev-server-status.mjs +34 -13
- package/scripts/dev-server-stop.mjs +313 -0
- package/scripts/heyspex-mode.mjs +288 -0
- package/scripts/hs-auto-resolve.mjs +240 -0
- package/scripts/hs-auto-source.mjs +398 -0
- package/scripts/hs-auto.mjs +134 -0
- package/scripts/hs-capture-cli.mjs +326 -0
- package/scripts/hs-classifier.mjs +136 -0
- package/scripts/hs-companion.mjs +88 -0
- package/scripts/hs-gateway.mjs +115 -0
- package/scripts/hs-mode.mjs +125 -0
- package/scripts/hs-next.mjs +441 -0
- package/scripts/hs-settings.mjs +338 -0
- package/scripts/hs-view.mjs +496 -0
- package/scripts/hs-worktree.mjs +201 -0
- package/scripts/install-claude-code-hooks.mjs +272 -0
- package/scripts/install-cursor-hooks.mjs +471 -0
- package/scripts/lib/agent-env-markers.mjs +38 -0
- package/scripts/lib/console-url-resolver.mjs +199 -61
- package/scripts/lib/customer-kit.mjs +1203 -0
- package/scripts/lib/dev-mode.mjs +249 -32
- package/scripts/lib/directive-obligations.mjs +349 -0
- package/scripts/lib/heyspex-home.mjs +72 -0
- package/scripts/lib/hook-dispositions.mjs +210 -0
- package/scripts/lib/hook-vault-header.mjs +30 -0
- package/scripts/lib/hs-command.mjs +277 -0
- package/scripts/lib/hs-companion-settings.mjs +472 -0
- package/scripts/lib/hs-source-branch.mjs +196 -0
- package/scripts/lib/hs-source-commit.mjs +59 -5
- package/scripts/lib/hs-source-identity.mjs +526 -0
- package/scripts/lib/hs-source-log.mjs +13 -22
- package/scripts/lib/hs-source-preflight.mjs +18 -4
- package/scripts/lib/hs-source-push.mjs +386 -307
- package/scripts/lib/hs-worktree-args.mjs +115 -0
- package/scripts/lib/shared-path-helpers.mjs +134 -0
- package/scripts/lib/standalone-doctor.mjs +540 -3
- package/scripts/lib/subagent-git-lock.mjs +109 -0
- package/scripts/lib/template-pin.mjs +34 -0
- package/scripts/lib/window-placement.mjs +109 -0
- package/scripts/provenance-lib.mjs +91 -0
- package/scripts/stamp-provenance-on-edit.mjs +222 -0
- package/scripts/wip-ledger-health.mjs +653 -0
- package/spexharness/doctrine/baseline/SPEXCODE-DOCTRINE.baseline.json +29 -0
- package/spexharness/src/adapters/audit.mjs +197 -0
- package/spexharness/src/adapters/claude-code.mjs +449 -0
- package/spexharness/src/adapters/copilot.mjs +236 -0
- package/spexharness/src/adapters/detect-harness.mjs +34 -0
- package/spexharness/src/chat/tui/ansi.mjs +448 -0
- package/spexharness/src/chat/tui/palette.mjs +22 -0
- package/spexharness/src/chat/tui/select.mjs +208 -0
- package/spexharness/src/config-root.mjs +54 -0
- package/spexharness/src/context-budget.mjs +141 -0
- package/spexharness/src/dev-server-control.mjs +389 -0
- package/spexharness/src/doctrine/behaviour.mjs +371 -0
- package/spexharness/src/doctrine/corpus.mjs +733 -0
- package/spexharness/src/doctrine/inject.mjs +338 -0
- package/spexharness/src/doctrine/merge.mjs +184 -0
- package/spexharness/src/doctrine/sources.mjs +252 -0
- package/spexharness/src/doctrine/synthesize.mjs +401 -0
- package/spexharness/src/doctrine/vault-source.mjs +574 -0
- package/spexharness/src/doctrine/writer.mjs +176 -0
- package/spexharness/src/events.mjs +84 -0
- package/spexharness/src/gates/_shell-write-targets.mjs +77 -0
- package/spexharness/src/gates/capture-workflow-gate.mjs +202 -0
- package/spexharness/src/gates/claim-before-code-gate.decide.mjs +33 -0
- package/spexharness/src/gates/claim-before-code-gate.mjs +129 -0
- package/spexharness/src/gates/deep-research-cost-gate.mjs +275 -0
- package/spexharness/src/gates/diagnose-capture-reminder.mjs +112 -0
- package/spexharness/src/gates/directive-obligation-gate.decide.mjs +132 -0
- package/spexharness/src/gates/directive-obligation-gate.mjs +183 -0
- package/spexharness/src/gates/enforce-session-sequence.mjs +895 -0
- package/spexharness/src/gates/enforce-vault-naming.mjs +215 -0
- package/spexharness/src/gates/epic-milestone-phrasing-gate.mjs +233 -0
- package/spexharness/src/gates/git-identity-guard.decide.mjs +436 -0
- package/spexharness/src/gates/git-identity-guard.mjs +61 -0
- package/spexharness/src/gates/git-reflog-audit.mjs +151 -0
- package/spexharness/src/gates/git-stash-gate.decide.mjs +361 -0
- package/spexharness/src/gates/git-stash-gate.mjs +159 -0
- package/spexharness/src/gates/id-display-format-gate.mjs +190 -0
- package/spexharness/src/gates/inject-doctrine-gate.mjs +89 -0
- package/spexharness/src/gates/inject-vault-context.mjs +239 -0
- package/spexharness/src/gates/naughty-list-gate.mjs +213 -0
- package/spexharness/src/gates/plan-review-gate.mjs +233 -0
- package/spexharness/src/gates/preflight-reminder-gate.mjs +265 -0
- package/spexharness/src/gates/research-protocol-gate.mjs +175 -0
- package/spexharness/src/gates/settings-write-gate.decide.mjs +96 -0
- package/spexharness/src/gates/settings-write-gate.mjs +104 -0
- package/spexharness/src/gates/vault-mirror-catchup.mjs +124 -0
- package/spexharness/src/gates/vault-write-tier-guard.decide.mjs +125 -0
- package/spexharness/src/gates/vault-write-tier-guard.mjs +42 -0
- package/spexharness/src/git-reflog-audit.mjs +294 -0
- package/spexharness/src/intent-classifier.mjs +196 -0
- package/spexharness/src/intent-directive.mjs +626 -0
- package/spexharness/src/profile/learn.mjs +551 -0
- package/spexharness/src/profile/proposals.mjs +357 -0
- package/spexharness/src/profile/vault-inclusion.mjs +386 -0
- package/spexharness/src/redact.mjs +151 -0
- package/spexharness/src/rule-table.mjs +849 -0
- package/spexharness/src/seat-context.mjs +122 -0
- package/spexharness/src/session-bootstrap.mjs +512 -0
- package/spexharness/src/session-record.mjs +815 -0
- package/spexharness/src/token-inventory.mjs +207 -0
- package/vendor/heyspex-mcp/account-switch.mjs +96 -0
- package/vendor/heyspex-mcp/alignment-gate.mjs +315 -1
- package/vendor/heyspex-mcp/blocker-resolver.mjs +37 -2
- package/vendor/heyspex-mcp/breakdown-ladder.mjs +119 -4
- package/vendor/heyspex-mcp/breakdown-source.mjs +271 -0
- package/vendor/heyspex-mcp/breakdown-writer.mjs +23 -3
- package/vendor/heyspex-mcp/capture-buffer-patches.mjs +77 -8
- package/vendor/heyspex-mcp/capture-channel.mjs +55 -5
- package/vendor/heyspex-mcp/capture-console-client.mjs +117 -3
- package/vendor/heyspex-mcp/capture-focus.mjs +1061 -31
- package/vendor/heyspex-mcp/capture-outbox.mjs +15 -5
- package/vendor/heyspex-mcp/capture-sources.mjs +195 -0
- package/vendor/heyspex-mcp/capture-tools.mjs +1264 -0
- package/vendor/heyspex-mcp/claim-tools.mjs +1147 -0
- package/vendor/heyspex-mcp/cli-verbs.mjs +2074 -0
- package/vendor/heyspex-mcp/cli.mjs +207 -15524
- package/vendor/heyspex-mcp/close-branch-report.mjs +102 -0
- package/vendor/heyspex-mcp/cloud-tool-surface.mjs +128 -0
- package/vendor/heyspex-mcp/cloud-vault-writes.mjs +602 -0
- package/vendor/heyspex-mcp/config-seed.yaml +15 -0
- package/vendor/heyspex-mcp/config-settings.mjs +290 -7
- package/vendor/heyspex-mcp/console-fetch.mjs +822 -17
- package/vendor/heyspex-mcp/console-transport.mjs +172 -0
- package/vendor/heyspex-mcp/credentials.mjs +585 -0
- package/vendor/heyspex-mcp/defer-spec.mjs +44 -4
- package/vendor/heyspex-mcp/deferred-reclaim.mjs +29 -3
- package/vendor/heyspex-mcp/design-handlers.mjs +31 -0
- package/vendor/heyspex-mcp/design-tools.mjs +4 -1
- package/vendor/heyspex-mcp/dev-factory-bridge.mjs +4 -4
- package/vendor/heyspex-mcp/dev-mode-core.mjs +45 -0
- package/vendor/heyspex-mcp/dev-tools.mjs +131 -0
- package/vendor/heyspex-mcp/diagnose-handlers.mjs +54 -0
- package/vendor/heyspex-mcp/events-tools.mjs +207 -0
- package/vendor/heyspex-mcp/filing-tools.mjs +723 -0
- package/vendor/heyspex-mcp/fleet-handlers.mjs +37 -0
- package/vendor/heyspex-mcp/fleet-queue-tools.mjs +71 -15
- package/vendor/heyspex-mcp/focus-tools.mjs +190 -0
- package/vendor/heyspex-mcp/folder-trust-store.mjs +60 -0
- package/vendor/heyspex-mcp/http-transport.mjs +302 -0
- package/vendor/heyspex-mcp/list-tools.mjs +257 -0
- package/vendor/heyspex-mcp/login-handoff.mjs +15 -1
- package/vendor/heyspex-mcp/mcp-config.mjs +107 -0
- package/vendor/heyspex-mcp/memory-tools.mjs +523 -0
- package/vendor/heyspex-mcp/mvp-mode.mjs +53 -6
- package/vendor/heyspex-mcp/obligation-backstop.mjs +103 -0
- package/vendor/heyspex-mcp/occupied-keys.mjs +142 -0
- package/vendor/heyspex-mcp/on-deck-brief.mjs +3377 -0
- package/vendor/heyspex-mcp/on-deck-scheduler.mjs +1708 -0
- package/vendor/heyspex-mcp/package-root.mjs +32 -0
- package/vendor/heyspex-mcp/peer-presence.mjs +8 -1
- package/vendor/heyspex-mcp/plan-ground.mjs +621 -652
- package/vendor/heyspex-mcp/plan-push.mjs +908 -22
- package/vendor/heyspex-mcp/plan-review.mjs +124 -30
- package/vendor/heyspex-mcp/preflight-gate.mjs +0 -0
- package/vendor/heyspex-mcp/procedure-handlers.mjs +327 -0
- package/vendor/heyspex-mcp/procedure-tools.mjs +1181 -970
- package/vendor/heyspex-mcp/promote-capture.mjs +388 -69
- package/vendor/heyspex-mcp/promote-diagnose.mjs +74 -0
- package/vendor/heyspex-mcp/promote-research-to-diagnose.mjs +9 -2
- package/vendor/heyspex-mcp/promote-research.mjs +666 -53
- package/vendor/heyspex-mcp/promotion-helpers.mjs +251 -0
- package/vendor/heyspex-mcp/prompts.mjs +1460 -0
- package/vendor/heyspex-mcp/read-path.mjs +191 -15
- package/vendor/heyspex-mcp/receipt-shape.mjs +146 -0
- package/vendor/heyspex-mcp/recipe-handlers.mjs +117 -0
- package/vendor/heyspex-mcp/regen-tasks.mjs +210 -3
- package/vendor/heyspex-mcp/register-spec.mjs +266 -54
- package/vendor/heyspex-mcp/request-context.mjs +83 -0
- package/vendor/heyspex-mcp/research-focus.mjs +207 -4
- package/vendor/heyspex-mcp/research-handlers.mjs +625 -0
- package/vendor/heyspex-mcp/research-tools.mjs +4 -4
- package/vendor/heyspex-mcp/response-budget.mjs +348 -0
- package/vendor/heyspex-mcp/review-focus.mjs +25 -1
- package/vendor/heyspex-mcp/roadmap-default.mjs +70 -0
- package/vendor/heyspex-mcp/search-specs.mjs +280 -0
- package/vendor/heyspex-mcp/seat-block-ledger.mjs +113 -0
- package/vendor/heyspex-mcp/seat-identity.mjs +2 -6
- package/vendor/heyspex-mcp/session-owner.mjs +109 -0
- package/vendor/heyspex-mcp/session-tools.mjs +162 -0
- package/vendor/heyspex-mcp/settings-registry.mjs +232 -0
- package/vendor/heyspex-mcp/settings-tools.mjs +85 -12
- package/vendor/heyspex-mcp/spec-edit-tools.mjs +453 -0
- package/vendor/heyspex-mcp/spec-id-lib.mjs +93 -17
- package/vendor/heyspex-mcp/split-research.mjs +304 -56
- package/vendor/heyspex-mcp/stdio-rpc.mjs +22 -0
- package/vendor/heyspex-mcp/submit-for-review.mjs +150 -7
- package/vendor/heyspex-mcp/summary-contract.mjs +105 -0
- package/vendor/heyspex-mcp/summary-write-tools.mjs +228 -0
- package/vendor/heyspex-mcp/symptom-query.mjs +146 -0
- package/vendor/heyspex-mcp/test-helpers.mjs +123 -1
- package/vendor/heyspex-mcp/tool-catalog.mjs +2819 -0
- package/vendor/heyspex-mcp/tool-dispatch.mjs +657 -0
- package/vendor/heyspex-mcp/tool-helpers.mjs +325 -0
- package/vendor/heyspex-mcp/validate-linkage.mjs +414 -27
- package/vendor/heyspex-mcp/vault-io.mjs +720 -0
- package/vendor/heyspex-mcp/vault-less-endpoints.mjs +52 -0
- package/vendor/heyspex-mcp/vault-resolve.mjs +554 -68
- package/vendor/heyspex-mcp/verify-reproduction.mjs +270 -30
- package/vendor/heyspex-mcp/whoami.mjs +92 -0
- package/vendor/heyspex-mcp/write-outbox.mjs +512 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: HS-PROTO-spec-summary-authoring
|
|
3
|
+
name: Spec summary authoring — the plain-language `summary:` frontmatter contract
|
|
4
|
+
type: protocol
|
|
5
|
+
status: open
|
|
6
|
+
priority: 1
|
|
7
|
+
scope: vault
|
|
8
|
+
owner: TODO — your name/handle
|
|
9
|
+
created: 2026-06-18
|
|
10
|
+
updated: 2026-06-18
|
|
11
|
+
tags:
|
|
12
|
+
- protocol
|
|
13
|
+
- spec-filing
|
|
14
|
+
- frontmatter
|
|
15
|
+
- summary
|
|
16
|
+
- plain-language
|
|
17
|
+
- agent-experience
|
|
18
|
+
triggers:
|
|
19
|
+
- author_summary
|
|
20
|
+
- file_milestone
|
|
21
|
+
- file_epic
|
|
22
|
+
- file_task
|
|
23
|
+
- file_protocol
|
|
24
|
+
related:
|
|
25
|
+
- "[[entity-model]]"
|
|
26
|
+
- "[[spec-hierarchy]]"
|
|
27
|
+
- "[[canonical-frontmatter-templates]]"
|
|
28
|
+
summary: |
|
|
29
|
+
Contract for the summary: frontmatter field: plain language readable by someone unfamiliar with the project, one opening sentence of 160 characters or fewer authored at filing time, with an optional second sentence for nuance.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
# Spec summary authoring — the plain-language `summary:` frontmatter contract
|
|
34
|
+
|
|
35
|
+
This is the single source of truth for how to write a spec's `summary:` frontmatter field. The `summary:` is a short, plain-language description that explains what a spec is about to someone who has never heard of this project. Cards and list rows render only the opening sentence; drawers and search previews render the whole thing. This procedure is what the "fill in missing summary" prompt (in the console detail drawers and the `/hs-next` brief) hands a coding agent, and what a human should follow when authoring one by hand.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## The contract
|
|
39
|
+
|
|
40
|
+
- The **opening sentence** must be ONE complete, standalone sentence (target ≤160 chars) — list rows and cards render only this sentence.
|
|
41
|
+
- **If this spec has a parent** (a task's parent epic, an epic's parent milestone): the opening sentence must convey two things in one plain sentence — what THIS spec delivers (the *what*) AND the parent's goal it serves (the *why*). A reader should grasp both from that one sentence. Put them in whichever order reads naturally when you say it out loud — often the easiest is the plain action first, then the goal it serves. Do NOT use a rigid "So that …, this …" template, and do NOT stack a long purpose clause in front of the subject before the reader knows what the thing is.
|
|
42
|
+
- **If this spec has no parent** (a top-level milestone): the opening sentence is a standalone, plain-language summary of the spec itself.
|
|
43
|
+
- The **full value** may add a sentence or two of nuance/context after the opening (target ≤400 chars total).
|
|
44
|
+
- Write the WHOLE summary in plain, everyday language a twelve-year-old who has never heard of this project could understand — including the parent's goal. No project-invented jargon anywhere; no metaphor-as-terminology — the banned word list is **seam, wedge, moat, fuse, firehose, grain (noun), lane, spine, zombie, knob, plumbing, rollup (noun), ladder** (use plain replacements: "review level," "entry point," "defensibility," "auto-expiry," etc.); no examples, metaphors, or analogies. No non-standard abbreviations either — spell out project-internal shorthand ("acceptance criteria," not "AC"); only industry-standard acronyms a newcomer would recognize (SEO, API, CLI, MVP) are allowed. Only reach for a technical or project term when there is genuinely no plain word for the thing.
|
|
45
|
+
- Write it as a YAML block scalar (`summary: |`) so multi-line prose stays readable.
|
|
46
|
+
- Derive this spec's contribution from its own body and the parent's goal from the parent context provided — do not invent scope that isn't in the files.
|
|
47
|
+
|
|
48
|
+
## Why these rules
|
|
49
|
+
|
|
50
|
+
Every spec is read by people and by coding agents who may know nothing about the rest of the project. The summary is the one place that has to make sense on its own, with no surrounding context. A reader who is about twelve years old and has never heard of the project should still understand what the spec is about. That is why the language stays plain in every sentence, why made-up words are banned, and why the opening sentence has to stand completely on its own — many surfaces show only that one line.
|
|
51
|
+
|
|
52
|
+
## Not the same thing as `## Explain Like I'm 12`
|
|
53
|
+
|
|
54
|
+
Milestones and epics also carry a required `## Explain Like I'm 12` body section ([[spec-hierarchy]] §Explain Like I'm 12). The two share a voice and do **different jobs** — never write one as a paraphrase of the other. If the summary can be pasted into the section, or the section's first paragraph can be trimmed into the summary, one of them is wrong.
|
|
55
|
+
|
|
56
|
+
| | `summary:` (frontmatter) | `## Explain Like I'm 12` (body) |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| **Answers** | What this spec delivers, and the parent goal it serves | What this work is FOR, and what changes when it ships |
|
|
59
|
+
| **Length** | One standalone sentence, ≤400 chars total | Several short paragraphs |
|
|
60
|
+
| **Kinds** | Milestone, epic, task, protocol | Milestone and epic only |
|
|
61
|
+
| **Rendered** | Cards, list rows, drawers, search, the `/hs-next` brief | The spec body, read first |
|
|
62
|
+
| **Assumes** | Nothing about the project, but compresses the WORK | Nothing about the project, and explains the PURPOSE before the work |
|
|
63
|
+
|
|
64
|
+
The plain-language rules here (no invented jargon, no metaphor-as-terminology, no non-standard abbreviations) are the shared floor. The section adds six more properties on top — purpose before mechanism, name what it replaces, comparisons to real named products only, one idea per paragraph, no ids or file paths, end on the consequence. Those live in [[spec-hierarchy]].
|
|
65
|
+
|
|
66
|
+
## Where it shows up
|
|
67
|
+
|
|
68
|
+
- **List rows and cards** render the opening sentence alone (≤160 chars target).
|
|
69
|
+
- **Detail drawers and search previews** render the full value (≤400 chars target).
|
|
70
|
+
- The **`/hs-next` brief** prefers an authored `summary:` over a body-derived fallback when handing an agent its on-deck work.
|
|
71
|
+
|
|
72
|
+
## When to author it
|
|
73
|
+
|
|
74
|
+
`summary:` is always written **at the same time** as the rest of the spec is authored — a normal step of filing, like giving the spec a name. **Milestones and epics are never authored together with tasks** — they belong to different phases:
|
|
75
|
+
|
|
76
|
+
| Phase | Kinds | Normal authoring moment |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| **Planning** | Milestone + Epic | Plan ingest, research promotion, milestone→epic breakdown — milestones and epics are filed in this wave only |
|
|
79
|
+
| **Execution** | Task | What's Next → **Launch** → `/hs-next` breakdown only — tasks are never filed during plan ingest or alongside epics |
|
|
80
|
+
|
|
81
|
+
`heyspex_push_plan` files epics only (`children: []`). Tasks come from the on-deck `/hs-next` breakdown via `heyspex_file_spec`. `heyspex_file_spec` **refuses** to create a milestone, epic, or task without a `summary` (returns `summary_required`). POST `/api/specs` still accepts the write but returns a soft `summary_missing` warning — prefer the MCP tool for agent filing. The `/hs-next` **author-then-claim** path remains a recovery surface for legacy specs filed before this enforcement, not the primary authoring path.
|
|
82
|
+
|
|
83
|
+
It is optional on captures, research, memory, and ADRs. **Protocols require it** — `summary:` is the field the procedure catalog and `heyspex_get_procedure` surface to agents before they fetch the full body; a protocol without one forces body-text extraction, which is noisier and less precise. See [[entity-model]] §Universal fields and [[spec-hierarchy]] §Frontmatter requirements → "Author `summary:` at file time".
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Autonomous COO — route a filename or spec into dev-factory (pre-flight + dispatch).
|
|
3
|
+
argument-hint: "[filename]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Autonomous COO mode (`/hs-auto`)
|
|
7
|
+
|
|
8
|
+
> Parity: `.commandcode/skills/hs-auto/SKILL.md` · `.cursor/skills/hs-auto/SKILL.md` · `.agents/skills/hs-auto/SKILL.md`
|
|
9
|
+
|
|
10
|
+
## What to do
|
|
11
|
+
|
|
12
|
+
1. **Parse `$ARGUMENTS`** — optional `filename` (spec id, spec `.md` path, or source file path). Bare token only; no flags required. **All prose before/after the command is the COO brief** (scope, slice, constraints) — not permission to implement in this session.
|
|
13
|
+
|
|
14
|
+
2. **Resolve** — one shell call:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
node bin/hs.mjs auto [FILENAME] --json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. On `error`, report and **stop**. (`source_plan` is **not** an error — proceed to step 5.)
|
|
21
|
+
|
|
22
|
+
4. Run **pre-flight** commands from the `preflight` array in the JSON.
|
|
23
|
+
|
|
24
|
+
5. Branch on `mode` (follow `coo_contract` in JSON when present):
|
|
25
|
+
- `source_plan` → diagnose/research with no dispatchable work yet: file remediation epic (no milestone required) → fleet decompose → file tasks with `target:` → re-resolve same source id → `dispatch`
|
|
26
|
+
- `discover` → `discover_command`
|
|
27
|
+
- `breakdown` → `breakdown_command` (review before filing)
|
|
28
|
+
- `dispatch` → `dispatch_command`
|
|
29
|
+
|
|
30
|
+
6. Summarize results for the user (spec, target, gate, checkpoint).
|
|
31
|
+
|
|
32
|
+
## COO contract
|
|
33
|
+
|
|
34
|
+
**Do not write product code in this session** when `/hs-auto` was invoked. Delegate to the local fleet first. Follow fleet rules in `.commandcode/skills/hs-auto/SKILL.md` (Night Action builder ban, budget caps, bias constraint). Implement yourself only if the fleet gate fails after retries.
|
|
35
|
+
|
|
36
|
+
Diagnose (`HS-…-DIAG-…`) and research (`HS-…-RES-…`) specs use the same source pipeline as capture/research in Phase 1 — they are planning inputs until a remediation epic + tasks with `target:` exist.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Retroactively backfill completed work into the vault (creates epic + child tasks at status:in_review, with an auto-generated review doc). Native command (carries full $ARGUMENTS; the MCP prompt only gets the first token).
|
|
3
|
+
argument-hint: "<epic name> [<one-line summary>]"
|
|
4
|
+
allowed-tools: mcp__heyspex__heyspex_backfill_epic
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **Platform asymmetry — read this, it is load-bearing.** Claude Code delivers only the **first whitespace token** of an MCP prompt's argument (GitHub [#14210](https://github.com/anthropics/claude-code/issues/14210), closed *not planned*), so the namespaced MCP prompt `/mcp__heyspex__hs-backfill` can carry at most a single token — never a title plus a summary. This **native project command** is the only IDE surface that receives full `$ARGUMENTS`.
|
|
8
|
+
|
|
9
|
+
## What to do
|
|
10
|
+
|
|
11
|
+
**1. Parse `$ARGUMENTS`:** leading text up to the first sentence break / newline → `epic_name` (required — ask if missing). Remainder of the string → a `summary` hint; the tool still requires a full plain-language `summary` per spec-summary-authoring, so expand/refine a terse arg using the conversation.
|
|
12
|
+
|
|
13
|
+
**2. Gather from the conversation and/or `git log`/`git diff`:**
|
|
14
|
+
- `plan_markdown` — what was actually done + which acceptance criteria were met.
|
|
15
|
+
- `children` — each completed task as `{ name, summary }` (summary required per child).
|
|
16
|
+
- `files_changed` — paths touched.
|
|
17
|
+
- `kind` / `effort` / `tags` / `related` — optional classification.
|
|
18
|
+
|
|
19
|
+
**3. Call** `heyspex_backfill_epic({ epic_name, summary, plan_markdown, children, files_changed, kind?, effort?, tags?, related? })`. All resulting specs land at `status: in_review` with an auto-generated review doc. This is for work done **outside** the normal `/hs-next` flow — never a substitute for it going forward.
|
|
20
|
+
|
|
21
|
+
**4. Roadmap registration** defaults to `HS-ROADMAP-PRODUCT` phase `P0` (Review column) unless the call passes `skip_roadmap_registration: true`.
|
|
22
|
+
|
|
23
|
+
**5. Report** the created epic id + task ids, and remind the user this does not commit or push — they still need to do that themselves.
|
|
24
|
+
|
|
25
|
+
## Hard prohibitions
|
|
26
|
+
|
|
27
|
+
- **Never** use this for work that hasn't actually happened — it documents DONE work retroactively; `/hs-push` is for planning work not yet started.
|
|
28
|
+
- **Never** commit or push git.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Fast brain-offload capture — open/resume a capture, or route a named capture straight to promote. Native command (carries full $ARGUMENTS; the MCP prompt only gets the first token).
|
|
3
|
+
argument-hint: "[HS-CAP-XXXX | HS-IDEA-XXXX] [promote]"
|
|
4
|
+
allowed-tools: mcp__heyspex__heyspex_active_capture, mcp__heyspex__heyspex_update_capture, mcp__heyspex__heyspex_promote_capture, mcp__heyspex__heyspex_promote_capture_to_diagnose, mcp__heyspex__heyspex_load_tools
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **Platform asymmetry — read this, it is load-bearing.** Claude Code delivers only the **first whitespace token** of an MCP prompt's argument (GitHub [#14210](https://github.com/anthropics/claude-code/issues/14210), closed *not planned*), so the namespaced MCP prompt `/mcp__heyspex__hs-capture` can carry **at most a single capture id** — never an intent word. This **native project command** is the only IDE surface that receives full `$ARGUMENTS`/`$1 $2`, so it is the only place `HS-CAP-1234 promote to research` can be parsed. The two surfaces are intentionally **not** identical; do not try to "make them match" — they cannot. Diagnosis + code anchors: [[HS-UIYC-34KP-RES-hs-capture-arg-routing-capture-id-and-pr]]. Owning epic: [[HS-7IOM-QKEF-EPIC-hs-capture-command-parity-resume-aware-s]].
|
|
8
|
+
|
|
9
|
+
## What to do
|
|
10
|
+
|
|
11
|
+
**1. Parse `$ARGUMENTS`** (both optional, order within the string is: id first, then intent words):
|
|
12
|
+
- Leading token matching `HS-(CAP|IDEA|DRAFT)-[A-Z0-9-]{3,}` (case-insensitive) → `capture_id`. `DRAFT` is tolerated here for a stray/manual `HS-DRAFT-*` id (e.g. pasted by hand) — the auto-launch bridge ([[HS-I6NU]]) resolves every companion draft to a real `HS-CAP-*` id before ever invoking this command, so a `DRAFT` id should not normally reach here.
|
|
13
|
+
- Remaining words containing `promote` (case-insensitive) → **promote intent**.
|
|
14
|
+
- Neither → the no-arg path.
|
|
15
|
+
|
|
16
|
+
If the capture tools are not already available in this session, call `heyspex_load_tools` first so `heyspex_active_capture` / `heyspex_promote_capture` / `heyspex_promote_capture_to_diagnose` are callable.
|
|
17
|
+
|
|
18
|
+
**2. Route on what you parsed:**
|
|
19
|
+
|
|
20
|
+
- **`capture_id` + promote intent** → route **straight to the promote exit**, bypassing the capture loop (do not run capture or ground=expand). Follow `/hs-promote`'s **§A. Capture → research** section verbatim (same tools, same two-phase confirm rule, same bug-fix→diagnose branch) — do **not** re-derive or fork that logic here; this command and `/hs-promote` share one promote implementation, this is just a second entrypoint into it.
|
|
21
|
+
|
|
22
|
+
- **`capture_id`, no promote** → **attach/resume that exact capture**: call `heyspex_active_capture({ spec_id: capture_id })`. The server honors the explicit id (resolves that capture DB-first, disk fallback) and, when it already has a Core Idea + Summary, returns it as a **resume**. Then follow the beats below. A non-existent id returns a clear "no such capture" error — surface it; **never** silently start a fresh capture under a near-miss id.
|
|
23
|
+
|
|
24
|
+
- **No arguments** → call `heyspex_active_capture({})`. It attaches to the capture on deck, or auto-creates a fresh `HS-CAP-*` when none is pinned. Then follow the beats below.
|
|
25
|
+
|
|
26
|
+
**3. Run the beats** (the capture protocol — source of truth is `.cursor/skills/hs-capture/SKILL.md` and the MCP prompt markdown; do not re-derive them). Grounding and expanding are the **same act** — three beats, not four:
|
|
27
|
+
|
|
28
|
+
| # | Action | Confirm? |
|
|
29
|
+
|---|--------|----------|
|
|
30
|
+
| 1 | **Capture** — every turn (including the user's answers to your questions), call `heyspex_update_capture` with `user_quote` = verbatim text. If Core Idea is empty, also pass `core_idea` + `summary` in the same call. | No |
|
|
31
|
+
| 2 | **Ground = Expand + sufficiency check** — chat-only, peer-level grounding (technical co-founder). The grounding output IS the Expanded Concept: write it to `agent_expansion` via `heyspex_update_capture` in the same pass, automatically. No offer, no user confirmation. Every `heyspex_update_capture` response carries a `sufficiency` verdict (the same scorer `heyspex_promote_capture` runs) — while it fails, elicit the listed missing elements (`example` / `done_when` / a considered `kind`) from the user and write them in this same pass. | No |
|
|
32
|
+
| 3 | **Promote** — the only exit, **gated**: only offered once the sufficiency verdict passes AND the owner has confirmed satisfaction with the enhanced capture. `heyspex_promote_capture` (research), or `heyspex_promote_capture_to_diagnose` for `kind: bug-fix`. The promote-time gate stays as defense-in-depth. **`heyspex_promote_capture` creates an outline, not a finished hand-off** — the response's `research_still_stub`/`next_step` fields say so when the research doc still has unfilled `_TBD — fill in this section._` placeholders; run `/hs-res` against it before `heyspex_promote_research` (which refuses stubs with `RESEARCH_STILL_STUB` as a backstop). | Yes |
|
|
33
|
+
|
|
34
|
+
After beat 2, the two choices depend on the sufficiency verdict ([[HS-X8GS-T9T6-EPIC-capture-sufficiency-gate-grounding-time]]):
|
|
35
|
+
- **Verdict fails** → present **iterate** and **enhance to readiness** (elicit the missing elements; never invent content to pass the gate). Do **not** present "promote to research" as a live option — an explicit owner instruction to promote anyway still wins.
|
|
36
|
+
- **Verdict passes** → show the enhanced capture and ask if the owner is satisfied with it; on that yes, present exactly two choices: **promote to research** (or promote-to-diagnose for `kind: bug-fix`) or **iterate**. A promote call is spent only after the owner's confirmation (confirm-before-offer + confirm-before-spend).
|
|
37
|
+
|
|
38
|
+
Never present "do you want to expand" as a choice — expansion already happened.
|
|
39
|
+
|
|
40
|
+
**Open-the-doc offer (agent captures only, owner ruling 2026-08-11):** Companion / Chrome-extension captures auto-open the solo window; agent captures must **not**. When `heyspex_update_capture` returns `offer_open_viewer` (first materialization) — or the first time the capture doc exists on disk — print that offer verbatim alongside promote/iterate (or right after the first "captured" ack):
|
|
41
|
+
|
|
42
|
+
> Want to see `HS-…-CAP`? Say **yes** / **open** / **show** and I'll open the doc.
|
|
43
|
+
|
|
44
|
+
On `yes` / `open` / `show`, immediately run `node bin/hs.mjs view docs <spec_id>` from the repo root. Do not ask twice, do not open unprompted, do not nag on later iterates.
|
|
45
|
+
|
|
46
|
+
**Iterate is the default continuation (owner ruling 2026-07-12).** While the capture sits at that choice, the user's next prose that isn't an explicit "promote" or "discard" IS the iterate move — even when it reads like a new idea or a work order ("please add …"), and even though the user never says "iterate". Append it to the SAME capture: `heyspex_update_capture` with the **explicit `spec_id`** of the capture in flow (never no-arg `heyspex_active_capture({})`, which can mint a fresh capture), re-ground into `agent_expansion`, and re-present the two choices. Only open a new capture when the prose is clearly a separate idea with no thread back — say so in one line first.
|
|
47
|
+
|
|
48
|
+
**Kind suggestion (during beat 2, HS-RZQO):** when the content signals a non-default kind — bug/error/broken/regression language → `bug-fix`; a bare URL/link-only body → `clip`; a pointer to a doc/resource → `reference`; an open question → `question` — offer it in the same reply ("this reads like a bug-fix capture — reclassify?") and on the user's yes pass `kind` in the next `heyspex_update_capture` call. Suggest once, never auto-apply, never nag.
|
|
49
|
+
|
|
50
|
+
**Model routing & thread split/spawn (owner ruling 2026-08-11):** settings at `.heyspex/config.yaml` → `agent_behaviors.capture_on_idea.{default_model, model_switch_mode, thread_split_mode}`; full table in `capture-guardrails.md` §"Capture model routing & thread split/spawn" and `.cursor/skills/hs-capture/SKILL.md`. On a first/only-turn capture, offer or silently delegate a model switch per `model_switch_mode` (`ask`\|`silent_delegate`\|`off`) — never a live silent switch, that's not possible. When new mid-thread prose isn't a continuation, judge whether it benefits from this thread's context: benefits → split (`Agent(subagent_type:"fork")` on a new capture id); doesn't → spawn (fresh `Agent()`); genuinely unsure and `thread_split_mode: ask` → `AskUserQuestion` with exactly those two options.
|
|
51
|
+
|
|
52
|
+
On a **resume** (capture already has Core Idea + Summary), skip re-capturing: greet with what's already there and offer the two resume moves — **iterate** (refine with new verbatim input) or **promote**. Expansion is automatic during grounding, not a menu item — there is **no** separate `/hs-expand` command or skill.
|
|
53
|
+
|
|
54
|
+
## Hard prohibitions
|
|
55
|
+
|
|
56
|
+
- **Never** offer to file epics, tasks, or implementation plans — promote-to-research (or promote-to-diagnose) is the only exit.
|
|
57
|
+
- **Never** implement the captured idea straight from the capture — its only road to code is promote-to-research → `/hs-promote <research-id>` + `/hs-next <resulting-id> [front]`. Milestone/epic/task filing is never skipped; front mode (handheld/assisted/autonomous) controls supervision, never whether that filing happens. The old permission-gated direct-implementation bypass is retired (research-capture-protocol §"From research to code — always through milestone/epic/task (no bypass)").
|
|
58
|
+
- **Never** ask the user whether to expand — Ground=Expand auto-writes `agent_expansion` every time, with no confirmation gate.
|
|
59
|
+
- **Never** auto-open a browser / solo window for an agent-originated capture — offer once (`yes`/`open`/`show`) and only then run `hs view docs <id>`.
|
|
60
|
+
- **Never** alter words inside a `## Notes` quote (format-wrapping is fine; word substitution is not).
|
|
61
|
+
- **Never** create a `type: research` doc without beat-3 (or promote-intent) confirmation.
|
|
62
|
+
- **Never** commit or push.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Defer remaining work on the claimed task — file a split child with handoff envelope and route it on-deck for the next agent.
|
|
3
|
+
argument-hint: "[HS-XXXX-TASK] (optional — defaults to the task you are working)"
|
|
4
|
+
allowed-tools: mcp__heyspex__heyspex_defer_spec, mcp__heyspex__heyspex_next_on_deck
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **SaaS-safety note:** orchestration lives in `vendor/heyspex-mcp/cli.mjs` (`heyspex_defer_spec` → `POST /api/specs/:id/defer`). Do not re-implement the defer write path here.
|
|
8
|
+
|
|
9
|
+
## What to do
|
|
10
|
+
|
|
11
|
+
When the user sends `/hs-defer` (optionally with a bare `HS-TASK-*` id):
|
|
12
|
+
|
|
13
|
+
1. **Identify the parent task** — the optional arg, else the spec you currently hold a claim on.
|
|
14
|
+
|
|
15
|
+
2. **Author the handoff envelope** from session context (do not ask the user to paste a handoff prompt):
|
|
16
|
+
- `reason` — why you are deferring (context budget, blocked, lane hand-off, …)
|
|
17
|
+
- `summary_done` — verified work completed this session
|
|
18
|
+
- `remaining` — actionable items for whoever picks it up
|
|
19
|
+
- `success_criteria` — how the reviewer knows the deferred work is done
|
|
20
|
+
|
|
21
|
+
3. **Call** `mcp__heyspex__heyspex_defer_spec` with `{ spec_id, reason, summary_done, remaining, success_criteria }` plus optional `parent_status` (`in_review` default, or `in_progress` when the parent is not independently reviewable), `effort`, `child_name`.
|
|
22
|
+
|
|
23
|
+
4. **Tell the user** the returned `child_id` and that they can open a fresh window and run `/hs-next` to continue. The tool pins the child on-deck, releases the parent claim, and records WIP on the epic.
|
|
24
|
+
|
|
25
|
+
## Not this command
|
|
26
|
+
|
|
27
|
+
- `hs defer` / `hs undefer` — time-shifts a spec via `defer_until` ([[HS-ZZBN]]), not delegation split-child defer.
|
|
28
|
+
|
|
29
|
+
Cross-reference: [[HS-MS3T-1U0Z-TASK-hs-defer-mcp-tool-and-slash-command]], [[HS-DTL1-CX5K-CAP-task-split-handoff-when-context-runs-low]], [[HS-HXE2-YQ5A-EPIC-delegation-defer-work-from-one-agent-to]].
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show or switch the HeySpex dev/prod mode and dev-mode reliance (local vs cloud) — which console, read tier, and write mode everything points at.
|
|
3
|
+
argument-hint: "[mode:local|mode:cloud|mode:prod]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# HeySpex dev/prod mode (`/hs-dev`)
|
|
7
|
+
|
|
8
|
+
> Parity: `.commandcode/skills/hs-dev/SKILL.md` · `.cursor/skills/hs-dev/SKILL.md` · `.agents/skills/hs-dev/SKILL.md`
|
|
9
|
+
|
|
10
|
+
Admin/dev-only. Empty `$ARGUMENTS` → status; `mode:local` / `mode:cloud` / `mode:prod` (or bare `local|cloud|prod`) → switch. `mode:local`/`mode:cloud` imply dev mode with that reliance.
|
|
11
|
+
|
|
12
|
+
## What to do
|
|
13
|
+
|
|
14
|
+
1. **Call the MCP tool** (primary): `heyspex_dev_mode({ action: "get" })` for status, or `heyspex_dev_mode({ action: "set", mode: "<target>" })` to switch. Fallback when the `heyspex_*` tools are missing: `node bin/hs.mjs dev [mode:<target>]`.
|
|
15
|
+
2. **Report** the resolved mode / reliance / console URL / read tier / write mode WITH the source of each value. Flag a stale local override (`localOverride.staleAgainstCloud`) explicitly — `~/.heyspex/dev-mode.json` wins over the cloud setting on this machine.
|
|
16
|
+
3. On a switch, confirm what was written (`~/.heyspex/dev-mode.json`, `console_url` in `~/.heyspex/credentials.yaml`) and whether the cloud admin setting updated; an unreachable console never blocks the local switch — relay `cloud.error` plainly.
|
|
17
|
+
|
|
18
|
+
Semantics: `prod` and `dev+cloud` → cloud console (app.heyspex.com), Neon reads, cloud writes; `dev+local` → localhost:3000, disk reads, local writes.
|
|
19
|
+
|
|
20
|
+
Full method: `.commandcode/skills/hs-dev/SKILL.md`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Diagnose + repair the HeySpex install surfaces (MCP, hooks, skills, git hooks, deps) — the fallback when heyspex_* MCP tools are missing or broken.
|
|
3
|
+
argument-hint: "(no arguments)"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# HeySpex doctor (`/hs-doctor`)
|
|
7
|
+
|
|
8
|
+
> Parity: `.commandcode/skills/hs-doctor/SKILL.md` · `.cursor/skills/hs-doctor/SKILL.md` · `.agents/skills/hs-doctor/SKILL.md`
|
|
9
|
+
|
|
10
|
+
Works even when the `heyspex` MCP server is down — it shells out to the in-repo doctor script, no MCP tools required. **Run the commands yourself.**
|
|
11
|
+
|
|
12
|
+
## What to do
|
|
13
|
+
|
|
14
|
+
1. **Diagnose (read-only)** — parse per-surface status:
|
|
15
|
+
```bash
|
|
16
|
+
node scripts/heyspex-doctor.mjs --json
|
|
17
|
+
```
|
|
18
|
+
(Same as `npm run doctor` / `hs doctor --json`.) Result: `{ mode, ok, results: [{ id, label, status, detail, fix, human }] }` — `status` ∈ `ok | warn | fail`.
|
|
19
|
+
|
|
20
|
+
2. **Repair the fixable gaps** — if any surface is `fail` (or a `warn` you want cleared) with a `fix` array:
|
|
21
|
+
```bash
|
|
22
|
+
node scripts/heyspex-doctor.mjs --fix
|
|
23
|
+
```
|
|
24
|
+
(Same as `npm run setup` / `hs doctor --fix`.) Idempotent. **Do not run while the spex-console dev server is live** — check `hs server status` first.
|
|
25
|
+
|
|
26
|
+
3. **Hand un-fixable items to the human** — surfaces with a `human` field and no `fix` need a person: `deps` → `npm install`; `console-env` → copy `.env.example` to `.env.local` + fill `DATABASE_URL`/Clerk keys (ask owner); `node`/`git` → install the tool. Report each verbatim.
|
|
27
|
+
|
|
28
|
+
4. **Reconnect for MCP** — if any `mcp-*` surface or `node_modules` was just fixed, the `heyspex_*` tools won't appear until the session restarts (Claude Code reads MCP once at startup). Tell the human to reconnect, then confirm `/mcp` + `/hs-next`.
|
|
29
|
+
|
|
30
|
+
5. **Report** a short table: surface · status · fixed-or-needs-you, blockers first, then the reconnect reminder.
|
|
31
|
+
|
|
32
|
+
Full method: `.commandcode/skills/hs-doctor/SKILL.md`.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Pre-plan grounding — a single bounded (~2k-token) report (Scope · Relevant specs · Relevant code · Graph hints · Conflicts · Gaps) assembled from the vault via lexical retrieval. You are the reranker; do not re-read the vault.
|
|
3
|
+
argument-hint: "[topic words] [--summary <text>] [--areas a,b] [--tags x,y] [--max-tokens N]"
|
|
4
|
+
allowed-tools: mcp__heyspex__heyspex_ground_plan, mcp__heyspex__heyspex_recall_memories
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **Thin trigger.** Retrieval, scoring, conflict detection, caps, and report assembly all live in the MCP server (`vendor/heyspex-mcp/plan-ground.mjs`, `report:true` path). Do not re-implement grounding logic here, and do not turn the report into a vault-reading scaffold — that is the exact failure this command replaces ([[hs-ground-as-built-mcp-failure-modes]], [[HS-BZTV-G7R2-EPIC-hs-ground-three-tier-grounding-report]]).
|
|
8
|
+
|
|
9
|
+
## What to do
|
|
10
|
+
|
|
11
|
+
1. **Parse `$ARGUMENTS`** (topic is required — the bare words are the topic):
|
|
12
|
+
- free text → `topic` (and reuse as `summary` if no `--summary`)
|
|
13
|
+
- `--summary <text>` → `summary`
|
|
14
|
+
- `--areas a,b` → `areas` (subset of: console, companion, mcp, vault, indexer)
|
|
15
|
+
- `--tags x,y` → `tags`
|
|
16
|
+
- `--max-tokens N` → `max_tokens` (default 2000)
|
|
17
|
+
|
|
18
|
+
2. **Call** `mcp__heyspex__heyspex_ground_plan` with **`report: true`** plus the parsed args (and `check_conflicts: true`). The tool returns the bounded report as markdown directly.
|
|
19
|
+
|
|
20
|
+
3. **Output the returned report verbatim.** It is already capped and cited. Then **stop and act on it** — do **NOT** open the discovered specs, run broad `rg`, or read whole files. The report's "Relevant specs" list is a wide lexical-recall window and **you are the reranker**: open *only* the one or two specs you judge directly relevant to the task, if any.
|
|
21
|
+
|
|
22
|
+
4. **If the footer / report shows blocking conflicts** (`conflicts: N (BLOCKING …)`), resolve them via `/hs-resolve` before treating any conflicted spec as authoritative; re-run `/hs-ground` after resolution.
|
|
23
|
+
|
|
24
|
+
5. **Heed the Conflicts caveat.** The conflict detector is claim-level and blind to design-supersession / identifier drift — for substrate/decision questions, check the design-vs-decision axis yourself ([[drift-is-two-axes-as-built-and-design-supersession]]).
|
|
25
|
+
|
|
26
|
+
6. *(Optional)* If the task needs durable context, call `heyspex_recall_memories` with the report's `recall_memories_hint` tags — once, `limit: 10`.
|
|
27
|
+
|
|
28
|
+
Sibling skills: `/hs-next` (build pipeline), `/hs-resolve` (resolution lane), `/hs-review` (review pipeline). Hand off a grounded plan to `/hs-push`.
|
|
29
|
+
|
|
30
|
+
7. **When grounding a capture on deck, record it** (HS-KNJ8). Once the report is read and you have judged what is already built / already decided / the owner's own working reference / the residual delta, run `node scripts/record-grounding.mjs --capture <HS-CAP-id> --built "..." --decided "..." --reference "..." --delta "..."`. It writes `.heyspex/research-grounding.json` (the shape the deep-research gate reads) and marks the capture expanded. Until it runs, the capture-execution gate refuses research gathers, paid-model synthesis and routing-edit sub-agents for that capture.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Chat-surface form of `hs handoff` — resolves a short-code lane and resumes the spec it names, or (no code) runs close-out and hands back a fresh code + launch command.
|
|
3
|
+
argument-hint: "[<CODE>]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# HeySpex handoff (`/hs-handoff`)
|
|
7
|
+
|
|
8
|
+
> Parity: `.commandcode/skills/hs-handoff/SKILL.md` · `.cursor/skills/hs-handoff/SKILL.md` · `.agents/skills/hs-handoff/SKILL.md`
|
|
9
|
+
|
|
10
|
+
Chat harnesses intercept `/hs` before the agent sees it and split on the space in `/hs handoff <CODE>`, so the terminal-only CLI form is unreachable from chat. This command is that fix, one word — same contract, no new engine code. `hs handoff`, `heyspex_record_wip`, and `hs export-events` already exist.
|
|
11
|
+
|
|
12
|
+
Full contract: [[handoff-request-contract-close-out]] (vault decision) and `docs/admin/workflow/handoff.md`. Follow them; don't restate or reinvent them.
|
|
13
|
+
|
|
14
|
+
## What to do
|
|
15
|
+
|
|
16
|
+
1. **Parse `$ARGUMENTS`.** First token is a bare, non-flag string → resume flow, code = it. Empty → create flow.
|
|
17
|
+
|
|
18
|
+
2. **Resume flow (`$ARGUMENTS` = `<CODE>`):**
|
|
19
|
+
```bash
|
|
20
|
+
hs handoff load --lane <CODE>
|
|
21
|
+
```
|
|
22
|
+
Spelled-out `load --lane` form, NOT the bare shorthand — as of [[HS-RVKN]] (owner ruling 2026-09-01) `hs handoff <CODE>` LAUNCHES a new terminal session by default, and this command's resume flow must stay a read inside the current chat session.
|
|
23
|
+
- **Hit**: prints `lane <CODE> · spec <ID> · phase <label> · <time>`. Show that to the human, then continue from it the standard way — run `/hs-next <ID>` (same steps as that command: call `heyspex_next_on_deck`, print `user_prompt_markdown` verbatim, decode `agent_dispatch` on the reply). The human already asked for the handoff; don't ask again before pulling the brief.
|
|
24
|
+
- **Miss** (`(no current handoff context)`): the lane is empty or expired — say so, then ask which spec to resume instead of guessing.
|
|
25
|
+
|
|
26
|
+
3. **Create flow (no code)** — owner-locked contract, verbatim, do not invent steps or reorder them:
|
|
27
|
+
1. Close out first, automatically: `heyspex_record_wip` per worked epic, change-log rows + HS-REV companion at the review grain, `heyspex_release_spec` on open claims, then `hs export-events`. Skip silently anything already current.
|
|
28
|
+
2. Do NOT pick a code — it is MINTED. Owner ruling 2026-09-01: keys are minted, never invented (a hand-picked one once landed as `FLEET`).
|
|
29
|
+
3. Record the lane, minting the code in the same call: `hs handoff record --new-code --spec <next-target> --phase "<label>" --link <worked-epic-id...> --blocker "<open items, one line>"`. It prints `Handoff code: <CODE>` — that is the code you hand back.
|
|
30
|
+
4. Hand the human both forms, always: `/hs-handoff <CODE>` and `cd C:\dev-projects\heyspex-specs && claude "/hs-next <next-spec-id>"`.
|
|
31
|
+
5. Never treat the session as over — the human decides whether to continue here or launch the next one.
|
|
32
|
+
|
|
33
|
+
Full method: `.commandcode/skills/hs-handoff/SKILL.md`.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Watch a dev-time log live (spex-console, companion, or a generic `devlog`-captured process) instead of asking the human to paste terminal output. Filters to errors/warnings/failed-request lines by default.
|
|
3
|
+
argument-hint: "[console|companion|<name>] [--raw]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# HeySpex live log watch (`/hs-log`)
|
|
7
|
+
|
|
8
|
+
> Parity: `.commandcode/skills/hs-log/SKILL.md` · `.cursor/skills/hs-log/SKILL.md` · `.agents/skills/hs-log/SKILL.md`
|
|
9
|
+
|
|
10
|
+
Admin/dev-only — resolves paths via `dev-factory/watch-dev-log.mjs`, then watches with the harness's own background-process tooling. **Run the commands yourself.**
|
|
11
|
+
|
|
12
|
+
## What to do
|
|
13
|
+
|
|
14
|
+
1. **Resolve the target.** Default to `console` if `$ARGUMENTS` is empty; otherwise the first token is the target (`console`, `companion`, or any other name — treated as the generic `devlog` pwsh-helper convention).
|
|
15
|
+
```bash
|
|
16
|
+
node dev-factory/watch-dev-log.mjs <target>
|
|
17
|
+
```
|
|
18
|
+
If it reports `missing`, tell the human how to start it (`npm run console:log` for `console`; the companion tray host self-logs once running; a generic target needs `devlog <cmd>` in their own terminal) and stop — don't start a dev server yourself unprompted.
|
|
19
|
+
|
|
20
|
+
2. **Watch it.** Start a background `tail -f` over the resolved path(s) and stream it:
|
|
21
|
+
- Default: filtered to signal only — `grep -E --line-buffered -i "error|warn|exception|fatal|crash| 4[0-9][0-9] | 5[0-9][0-9] "` — so routine 200-OK request logs stay silent and only real problems surface.
|
|
22
|
+
- `--raw` in `$ARGUMENTS`: skip the filter, stream everything (useful for a first look, like the very first time this was set up).
|
|
23
|
+
- Multiple paths (e.g. `companion`'s 4 files) can be tailed together: `tail -n 0 -f path1 path2 ...`.
|
|
24
|
+
|
|
25
|
+
3. **Report** the resolved path(s) and whether you're running filtered or raw, then stay quiet until something actually worth flagging comes through — don't narrate routine matched lines individually if they're clearly benign.
|
|
26
|
+
|
|
27
|
+
Full method: `.commandcode/skills/hs-log/SKILL.md`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Pull the next on-deck execution prompt from the HeySpex roadmap (focus.yaml → in_progress → open).
|
|
3
|
+
argument-hint: "[handheld|assist|auto] [HS-XXXX-EPIC | HS-XXXX] [--include-horizon] [--ignore-focus] [--claim]"
|
|
4
|
+
allowed-tools: mcp__heyspex__heyspex_next_on_deck, mcp__heyspex__heyspex_claim_spec, mcp__heyspex__heyspex_release_spec, mcp__heyspex__heyspex_record_alignment
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **SaaS-safety note:** this file is a thin shim — the workflow orchestration (claim question wording, reply→action mapping, failure-mode handling) lives in `vendor/heyspex-mcp/cli.mjs` (`composeAgentOrchestration`) and is delivered to you as the structured `agent_dispatch` object. **Do not add orchestration prose here.** If a workflow detail needs to change, change it in the MCP server so customer workspaces can't corrupt it. See [[HS-CCKM-J6CD-RES-migrate-slash-command-orchestration-from]] and [[workflow-orchestration-belongs-in-mcp-not-claude-commands]].
|
|
8
|
+
|
|
9
|
+
## What to do
|
|
10
|
+
|
|
11
|
+
1. **Parse `$ARGUMENTS`** (all optional, order-flexible):
|
|
12
|
+
- **Run front** (default `handheld`): `handheld` · `assist` | `assisted` · `auto` | `autonomous` → canonical `front` for MCP (`handheld` | `assisted` | `autonomous`; omit when handheld/default)
|
|
13
|
+
- bare token `HS-EPIC-*` or `HS-*` → `spec_id`
|
|
14
|
+
- bare token `HS-ROADMAP-*` → `roadmap_id`
|
|
15
|
+
- `--include-horizon` → `include_horizon: true`
|
|
16
|
+
- `--ignore-focus` → `ignore_focus: true`
|
|
17
|
+
- `--claim` | `--auto-claim` → `auto_claim: true`. Skips the yes/proceed/confirm handshake and claims immediately — same mechanism `autonomous` front already triggers automatically (`shouldAutoClaimOnDeck` in `run-front.mjs`), just usable standalone at any front. `/hs-next HS-IUQO --claim` claims and starts handheld work with no ask; `/hs-next HS-IUQO assisted --claim` does the same at assisted supervision. (Redundant, never conflicting, with `autonomous` front, which already implies it.)
|
|
18
|
+
|
|
19
|
+
2. **Call** `mcp__heyspex__heyspex_next_on_deck` with `summary: true` plus the parsed args (including `front` when not handheld/default, and `auto_claim: true` when `--claim`/`--auto-claim` was passed).
|
|
20
|
+
|
|
21
|
+
3. **Output the `user_prompt_markdown` field verbatim** to the user. Do not summarize, paraphrase, or trim. **Do NOT echo the `agent_dispatch` field** — it is a structured routing object you decode, not prose you print. (The @deprecated `prompt_markdown` field mirrors `user_prompt_markdown`; either is safe to print, but prefer `user_prompt_markdown`.) Schema: `specs/schemas/agent-dispatch.schema.json`.
|
|
22
|
+
|
|
23
|
+
4. **On the user's reply**, decode `agent_dispatch`:
|
|
24
|
+
- Match the reply against each entry's `tokens` array under `on_user_reply` (or `drift_resolution_menu`, when present).
|
|
25
|
+
- If the matching entry has `actions`, invoke each `{ tool, args }` in order. If `execute_after: true`, begin executing the work in the same turn — no second permission ask. All listed tools (`heyspex_claim_spec`, `heyspex_record_alignment`, `heyspex_next_on_deck`, `heyspex_release_spec`) are pre-allowlisted.
|
|
26
|
+
- If the matching entry has `reply`, respond with that string verbatim.
|
|
27
|
+
- If the `default` entry is `"respond_to_user_question"`, treat the reply as a redirect: answer the user's actual question instead of claiming.
|
|
28
|
+
- For any tool error, look up its code in `agent_dispatch.failure_modes` and apply the named `handling` only when that error code was **returned by the tool call** — failure_modes are conditional, not a statement that the console is down. Trust `console_status.reachable` on the brief. Never hand-write vault files when `heyspex_file_spec` fails.
|
|
29
|
+
- On session hand-off, run the `on_handoff` actions (typically `heyspex_release_spec`).
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Promote whatever doc you hand it to its next stage — a capture (HS-CAP-*) to research, or a research doc (HS-RES-*) to a milestone with AI-assisted epic stubs. One verb, inferred by id prefix. Native command (carries full $ARGUMENTS; the MCP prompt only gets the first token).
|
|
3
|
+
argument-hint: "<HS-CAP-XXXX[,HS-CAP-YYYY...] | HS-RES-XXXX> [rest of args depend on which — see below]"
|
|
4
|
+
allowed-tools: mcp__heyspex__heyspex_active_capture, mcp__heyspex__heyspex_promote_capture, mcp__heyspex__heyspex_promote_capture_to_diagnose, mcp__heyspex__heyspex_promote_research, mcp__heyspex__heyspex_load_tools
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **Platform asymmetry — read this, it is load-bearing.** Claude Code delivers only the **first whitespace token** of an MCP prompt's argument (GitHub [#14210](https://github.com/anthropics/claude-code/issues/14210), closed *not planned*), so the namespaced MCP prompts (`/mcp__heyspex__hs-promote-capture`, `/mcp__heyspex__hs-promote-research`) can each carry at most a single token. This **native project command** is the only IDE surface that receives full `$ARGUMENTS`.
|
|
8
|
+
>
|
|
9
|
+
> **Why one command instead of two.** `/hs-promote-capture` and `/hs-promote-research` used to be separate commands — which meant typing the word "promote" twice (`/hs-promote-capture HS-CAP-XXXX promote`) when the command name already said what it does. There's exactly one verb here — *promote whatever doc you hand it to its next stage* — so there's one command. The **id prefix alone** tells you which flow applies (`HS-CAP-*` vs `HS-RES-*` are mutually exclusive and mechanical to detect); the two flows underneath are otherwise unrelated (different tools, different payload shapes, different two-phase mechanics) and stay fully separate below — only the entrypoint is shared.
|
|
10
|
+
|
|
11
|
+
## Step 0 — identify the doc
|
|
12
|
+
|
|
13
|
+
Read the **leading token** of `$ARGUMENTS` (case-insensitive; captures may be a comma/whitespace-separated list):
|
|
14
|
+
- Contains `-CAP` as its type label (legacy `HS-CAP-XXXX` or era-3 `HS-<fileKey>-<familyKey>-CAP-<slug>`) → go to **§A. Capture → research**.
|
|
15
|
+
- Contains `-RES` the same way → go to **§A2. Research → milestone**.
|
|
16
|
+
- **Era-3 short/display forms carry NO type label** — `HS-XV4W` (short id) and `HS-XV4W-HV6H` (file key + family key, the form humans see rendered) name a spec without saying its kind. Resolve the kind by fetching it: `heyspex_active_capture({ spec_id })` succeeding → it's a capture, §A. Otherwise treat it as research and try §A2. The tools accept any of these forms and collapse them to the stored short id themselves — never tell the user their id is wrong just because it carries (or lacks) the family key.
|
|
17
|
+
- None of the above → ask the user which doc they mean (don't guess).
|
|
18
|
+
|
|
19
|
+
If the capture tools are not already available in this session, call `heyspex_load_tools` first so `heyspex_active_capture` / `heyspex_promote_capture` / `heyspex_promote_capture_to_diagnose` are callable.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## §A. Capture → research (`HS-CAP-*`)
|
|
24
|
+
|
|
25
|
+
**1. Parse the rest of `$ARGUMENTS`:**
|
|
26
|
+
- Leading token(s) matching `HS-CAP-[A-Z0-9-]{3,}` (comma- and/or whitespace-separated) → `capture_ids` (1 or more).
|
|
27
|
+
- Next token: `HS-RES-[A-Z0-9-]{3,}` → `target_research` = that id. Or the literal word `new`/`NEW` (also the default when this token is omitted entirely) → `target_research = "NEW"`; any remaining words up to an `enhances:` token → `new_research_name`.
|
|
28
|
+
- A token shaped `enhances:HS-MIL-XXXX` anywhere in the string → `enhances`.
|
|
29
|
+
|
|
30
|
+
**2. Route by kind:**
|
|
31
|
+
- For each `capture_id`, read its `kind:` via `heyspex_active_capture({ spec_id: capture_id })`.
|
|
32
|
+
- Exactly one capture_id AND its `kind: bug-fix` → `heyspex_promote_capture_to_diagnose({ capture_id })` (creates `HS-DIAG-*`). Never mix a bug-fix capture into a multi-capture research promote.
|
|
33
|
+
- Otherwise → `heyspex_promote_capture({ capture_ids, target_research, new_research_name?, enhances? })`:
|
|
34
|
+
- `target_research === "NEW"` is **two-phase**: first call **omits** `accepted_outline` — it returns a proposed `{ name, outline, tags, enhances_suggestion }`. **Show it to the user and confirm** before calling again with the same args plus `accepted_outline` (Phase 2 performs the writes). Never skip straight to Phase 2.
|
|
35
|
+
- An existing `target_research` id is single-phase (direct, idempotent append) — no outline confirm needed.
|
|
36
|
+
- A `CAPTURE_INSUFFICIENT` error names the missing elements (core-idea, example, done-criteria, kind, user-stories) — the correct response is to elicit that detail from the user and improve the capture, not to pass `force_promote: true` unless the human explicitly says to promote anyway.
|
|
37
|
+
- **Check the outline against the capture's own Notes before presenting it.** Before showing `proposed_outline` (AI-proposed or agent-authored) to the user, walk every verbatim quote in the capture's `## Notes` and state plainly whether the outline addresses it. If a quote asks for something the outline doesn't cover, add a section for it or say so before asking for confirm — a missed verbatim quote is exactly what got two real items dropped from a milestone in this vault's own history ([[HS-GDT5-F16L-DIAG-promote-flow-drafts-research-and-stubs]]).
|
|
38
|
+
- **Outline confirm ≠ research done.** Phase 2 only writes the research **stub** — every section body is the literal placeholder `_TBD — fill in this section._`. Confirming the outline approves its *shape* (section headings), not its findings. As the very next step after Phase 2 creates the file, fill in every section with real content **by running the `/hs-res` method** (SpexCrawl gather via the Companion + DeepSeek synthesis — see `.claude/commands/hs-res.md`); **never author the research yourself in the main session** — main-session self-research skips the routed research seats and burns the expensive model on work the fleet owns. Do not report the research as complete, and do not move on to `/hs-promote-research`, until the TBD placeholders are gone. (`heyspex_promote_research` mechanically refuses with `RESEARCH_STILL_STUB` while any remain, but don't rely on that gate — write the research because it's the point of the flow, not because a check will otherwise fail.)
|
|
39
|
+
|
|
40
|
+
**3. Report the result** — the research id (created or extended) or diagnose id created, and confirm the capture(s)' `promoted_to` now points at it.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## §A2. Research → milestone (`HS-RES-*`)
|
|
45
|
+
|
|
46
|
+
**1. Parse the rest of `$ARGUMENTS`:**
|
|
47
|
+
- `research_id` is the leading `HS-RES-*` token (already identified in Step 0).
|
|
48
|
+
- Next word matching `spawn|augment|both` → `intent`. Default `spawn` when omitted.
|
|
49
|
+
- Next token: `HS-MIL-[A-Z0-9-]{3,}` → `target_milestone` = that id. Or the literal word `new`/`NEW` (also the default when this token is omitted entirely) → `target_milestone = "NEW"`; remaining words → `new_milestone_name`.
|
|
50
|
+
- If `intent` includes `augment`, any remaining `HS-EPIC-[A-Z0-9-]{3,}` tokens → `augment_epic_ids` (required in that case — ask for them if `augment` was requested but none were given).
|
|
51
|
+
|
|
52
|
+
**2. Default policy:** `target_milestone: "NEW"` unless the user names an **existing `status: open`** milestone that clearly extends the same thesis. Spawning into an `in_progress` milestone is blocked unless the owner explicitly passes `attach_to_in_progress_milestone: true` + `attach_override_reason` (≥40 chars audit trail) — never default to this path or infer the override on the agent's own judgment.
|
|
53
|
+
|
|
54
|
+
**3. Phase 1 — proposal.** Call `heyspex_promote_research({ research_id, target_milestone, new_milestone_name?, intent, spawn_epic_count?, augment_epic_ids? })` **without** `accepted_stubs`. Show the user the returned `proposed_stubs[]` and let them edit/remove/approve.
|
|
55
|
+
- **If `ai_proposal.ok === false` (e.g. `reason: "no_api_key"`), `proposed_stubs` comes back empty — the agent must author the stubs itself.** This is NOT a shortcut to skip the confirm step; it makes the confirm step *more* necessary, not less, because nothing upstream has vetted these stubs yet. Author them from the research doc's actual content, present them to the user exactly as you would an AI proposal (name/kind/effort/rationale per stub), and wait for a real approval turn before calling Phase 2. **Do not call Phase 2 in the same turn you authored the stubs in** — that is precisely the failure this line exists to prevent (observed 2026-08-12: an agent self-authored 3 epic stubs and executed `accepted_stubs` in the same tool-call batch with no human turn in between).
|
|
56
|
+
- **Check the stubs against the SOURCE CAPTURE's own Notes before presenting them.** Before showing `proposed_stubs` (AI-proposed or agent-authored) to the user, walk every verbatim quote in the source capture's `## Notes` — the capture(s) named in the research doc's `sources_captures`, not just the research doc's own prose, since a two-hop drift can lose fidelity the research doc's text won't show — and confirm each is addressed by a stub or explicitly named as out of scope. This check caught two real gaps missed by an agent-authored stub list in this vault's own history ([[HS-GDT5-F16L-DIAG-promote-flow-drafts-research-and-stubs]]).
|
|
57
|
+
|
|
58
|
+
**4. Phase 2 — execute (after human confirms).** Call again with the same args plus `accepted_stubs: [...]` (the confirmed, possibly-edited subset) to perform the transactional write.
|
|
59
|
+
|
|
60
|
+
**5. Report the result** — the milestone id (new or existing) plus spawned epic ids, or the augmented epic ids. Note that research stays `status: open` (research is evergreen) — only its `enhances:`/`spawned_epics:` links change.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Hard prohibitions
|
|
65
|
+
|
|
66
|
+
- **Never** execute a Phase-2 write (`accepted_outline` or `accepted_stubs`) without the human having seen and confirmed the Phase-1 proposal. For `accepted_stubs` the tool now refuses this mechanically: the proposal turn leaves a marker keyed on the research id, and an execute turn without one returns `STUB_REVIEW_REQUIRED`. If the human replaced every proposed stub, pass `stub_edit_note` (≥40 chars) saying what they changed — otherwise a fully-drifted execute returns `STUB_REVIEW_DRIFT`. As with `RESEARCH_STILL_STUB`, treat the mechanical refusal as the backstop, not the first line of defense.
|
|
67
|
+
- **Never** call `heyspex_promote_research` against a research doc that still carries `_TBD — fill in this section._` placeholders — fill it in via the `/hs-res` method first (§A step 2 above), never by authoring the research yourself in the main session. The tool refuses this mechanically (`RESEARCH_STILL_STUB`) but the agent should never rely on that as the first line of defense.
|
|
68
|
+
- **Never** route a bug-fix capture through `heyspex_promote_capture` — it goes to `heyspex_promote_capture_to_diagnose` instead.
|
|
69
|
+
- **Never** attach a research promote to an `in_progress` milestone without an explicit owner override (`attach_to_in_progress_milestone` + `attach_override_reason`).
|
|
70
|
+
- **Never** commit or push.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Push an epic implementation plan into the HeySpex vault, optionally pinning it on deck in the same call. Native command (carries full $ARGUMENTS; the MCP prompt only gets the first token). Consolidates the former hs-push / hs-push-next split into one command + flag.
|
|
3
|
+
argument-hint: "[<epic name>] [--next] [--reason <focus reason>]"
|
|
4
|
+
allowed-tools: mcp__heyspex__heyspex_push_plan
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **Platform asymmetry — read this, it is load-bearing.** Claude Code delivers only the **first whitespace token** of an MCP prompt's argument (GitHub [#14210](https://github.com/anthropics/claude-code/issues/14210), closed *not planned*), so the namespaced MCP prompts `/mcp__heyspex__hs-push` / `/mcp__heyspex__hs-push-next` can each carry at most a single token — never an epic name plus a `--next` flag plus a focus reason together. This **native project command** is the only IDE surface that receives full `$ARGUMENTS`. It also **consolidates** the old two-prompt split (`hs-push` vs `hs-push-next`) into one command: both ultimately call the same `heyspex_push_plan` tool with only `on_deck` differing, so there is no behavior lost by merging them here — just one flag instead of two command names.
|
|
8
|
+
|
|
9
|
+
## What to do
|
|
10
|
+
|
|
11
|
+
**1. Parse `$ARGUMENTS`:**
|
|
12
|
+
- `--next` (anywhere, case-insensitive) → `on_deck = true`. Absent → `on_deck = false` (file the epic without pinning focus).
|
|
13
|
+
- `--reason <text>` → `focus_reason` (only meaningful when `on_deck` is true; rest of that flag's value up to the next `--` flag or end of string).
|
|
14
|
+
- Remaining leading, non-flag text → an `epic_name` hint. Optional — if omitted, derive the title from the plan under discussion in chat.
|
|
15
|
+
|
|
16
|
+
**2. Gather the rest of the payload from the conversation** (a Cursor/proprietary `.plan.md` the user pasted or referenced, or a plan already discussed in chat):
|
|
17
|
+
- `summary` — required plain-language frontmatter summary (spec-summary-authoring contract).
|
|
18
|
+
- `plan_markdown` — epic body markdown (goal, phases, acceptance criteria).
|
|
19
|
+
- `milestone` — **required**: the parent `HS-MIL-*` wikilink. Ask the user if it isn't obvious from context; the tool call fails without it.
|
|
20
|
+
- `source_plan_paths` — any `.plan.md` file paths referenced (auto-detected from `plan_markdown` too).
|
|
21
|
+
- `kind` / `effort` / `tags` / `related` — optional scheduler/classification fields.
|
|
22
|
+
|
|
23
|
+
**3. Call** `heyspex_push_plan({ epic_name, summary, plan_markdown, milestone, on_deck, focus_reason?, source_plan_paths?, kind?, effort?, tags?, related? })`. This writes the epic **only** — `children: []`; tasks are never filed here, only later via `/hs-next` breakdown.
|
|
24
|
+
|
|
25
|
+
**4. After the call:**
|
|
26
|
+
- `on_deck: true` → the epic is set `in_progress`, `.heyspex/focus.yaml` is written, and a NEXT STEP block is added. Tell the user to run `/hs-next` next.
|
|
27
|
+
- `on_deck: false` → tell the user to re-run `/hs-push --next` (or `/hs-next <the new epic id>`) when ready to start work.
|
|
28
|
+
|
|
29
|
+
**5. Conflict handling:** if the tool returns a behavioral-conflict block against `related` specs and `on_deck` was requested, the write is blocked by default (no files written, no focus pinned). Surface the conflicts to the user — only pass `skip_conflict_check: true` on their explicit say-so, and note a `conflict_override` should be recorded afterward.
|
|
30
|
+
|
|
31
|
+
## Hard prohibitions
|
|
32
|
+
|
|
33
|
+
- **Never** file tasks here — epics only (`children: []`); tasks are just-in-time via `/hs-next` breakdown.
|
|
34
|
+
- **Never** silently bypass a conflict block — surface it and let the human decide.
|
|
35
|
+
- **Never** commit or push git.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Post-plan QC gut-check — stress-test a drafted plan before executing it (the plan→execute gate). Reason through the gut-check questions, launch explorers to fill gaps, fold findings into the plan, then record Proof-of-Use.
|
|
3
|
+
argument-hint: "[--plan <path>] (defaults to the most recent plan)"
|
|
4
|
+
allowed-tools: Task, AskQuestion, mcp__heyspex__heyspex_plan_qc, mcp__heyspex__heyspex_ground_plan, mcp__heyspex__heyspex_plan_review, mcp__heyspex__heyspex_recall_memories, Read, Grep, Glob, WebSearch, WebFetch
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
> **Where this sits.** `/hs-ground` (pre-plan) → draft → `heyspex_plan_review` → **`/hs-qc`** → `ExitPlanMode`. Both plan-review + QC markers required ([[HS-R4OY]]).
|
|
8
|
+
|
|
9
|
+
## What to do
|
|
10
|
+
|
|
11
|
+
**0. Mandatory drift passes** — Axis A (as-built code) + Axis B (design supersession per [[drift-is-two-axes-as-built-and-design-supersession]]). Re-run `heyspex_plan_review`; read `axis_b_drift`. Do not trust parent epic AC over newer memory decisions.
|
|
12
|
+
|
|
13
|
+
**0b. When `axis_b_drift` is non-empty — ask the user before recording QC:**
|
|
14
|
+
|
|
15
|
+
Present each conflict. **Default (Recommended):** re-scope the plan (remove dead work). **Override:** user explicitly confirms proceed anyway → `heyspex_plan_qc({ axis_b_user_confirmed: true, axis_b_confirmation_note: "…" })`. Tool returns `QC_AXIS_B_DRIFT` until resolved or user-confirmed. **The override is currently broken** per [[HS-EP8E-C1L2-DIAG-heyspex-plan-qc-override-path-ignores-ax]] (reproduced twice) — until fixed, `HEYSPEX_PLAN_QC_GATE_OFF=1` is the only working escape, and its use should be reported to the owner.
|
|
16
|
+
|
|
17
|
+
**1. Run the gut-check (verbatim — the owner's standard).**
|
|
18
|
+
|
|
19
|
+
Wonderful work! Can you please do a quality check and a gut-check? … *(full questions unchanged)*
|
|
20
|
+
|
|
21
|
+
**2. Act on what you find.** Fold findings into the plan; re-run `heyspex_plan_review` if material.
|
|
22
|
+
|
|
23
|
+
**3. Record Proof-of-Use.** `heyspex_plan_qc` with substantive `findings_summary` including **`Axis B:`** line.
|
|
24
|
+
|
|
25
|
+
**4. Then `ExitPlanMode`.**
|
|
26
|
+
|
|
27
|
+
(Break-glass: `HEYSPEX_PLAN_QC_GATE_OFF=1`.)
|