heyspex 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +14 -0
- package/bin/hs.mjs +181 -15
- package/dist/cli/hs-check.mjs +88 -46
- package/dist/cli/hs-claim.mjs +84 -39
- package/dist/cli/hs-connect.mjs +583 -129
- package/dist/cli/hs-defer.mjs +251 -30
- package/dist/cli/hs-dev.mjs +20 -8
- package/dist/cli/hs-env.mjs +62 -34
- package/dist/cli/hs-index-rebuild.mjs +288 -83
- package/dist/cli/hs-index-reconcile.mjs +397 -111
- package/dist/cli/hs-init.mjs +2143 -91
- package/dist/cli/hs-install.mjs +628 -106
- package/dist/cli/hs-join.mjs +686 -236
- package/dist/cli/hs-vault-pull.mjs +3189 -179
- package/dist/cli/hs-vault-push.mjs +6433 -0
- package/dist/cli/hs-vault.mjs +396 -178
- package/dist/cli/hs-workspace.mjs +289 -151
- package/dist/cli-templates/harness-commands/claude/hs-backfill.md +28 -28
- package/dist/cli-templates/harness-commands/claude/hs-capture.md +62 -62
- package/dist/cli-templates/harness-commands/claude/hs-defer.md +29 -29
- package/dist/cli-templates/harness-commands/claude/hs-ground.md +30 -28
- package/dist/cli-templates/harness-commands/claude/hs-next.md +29 -29
- package/dist/cli-templates/harness-commands/claude/hs-promote.md +70 -70
- package/dist/cli-templates/harness-commands/claude/hs-push.md +35 -35
- package/dist/cli-templates/harness-commands/claude/hs-qc.md +27 -27
- package/dist/cli-templates/harness-commands/claude/hs-resolve.md +23 -23
- package/dist/cli-templates/harness-commands/claude/hs-review.md +23 -23
- package/dist/cli-templates/harness-commands/claude/hs-view.md +28 -26
- package/dist/cli-templates/harness-commands/claude/kill-ports.md +32 -32
- package/dist/cli-templates/harness-commands/claude/prototype.md +91 -91
- package/dist/cli-templates/harness-commands/cursor/hs-backfill.md +22 -22
- package/dist/cli-templates/harness-commands/cursor/hs-capture.md +56 -56
- package/dist/cli-templates/harness-commands/cursor/hs-defer.md +23 -23
- package/dist/cli-templates/harness-commands/cursor/hs-ground.md +24 -22
- package/dist/cli-templates/harness-commands/cursor/hs-next.md +23 -23
- package/dist/cli-templates/harness-commands/cursor/hs-promote.md +64 -64
- package/dist/cli-templates/harness-commands/cursor/hs-push.md +29 -29
- package/dist/cli-templates/harness-commands/cursor/hs-qc.md +21 -21
- package/dist/cli-templates/harness-commands/cursor/hs-resolve.md +17 -17
- package/dist/cli-templates/harness-commands/cursor/hs-review.md +17 -17
- package/dist/cli-templates/harness-commands/cursor/hs-view.md +24 -22
- package/dist/cli-templates/harness-commands/cursor/kill-ports.md +26 -26
- package/dist/cli-templates/harness-commands/cursor/prototype.md +86 -86
- package/docs/copilot-plugin-install.md +177 -0
- package/docs/driving-heyspex-from-copilot.md +165 -0
- package/package.json +21 -2
- package/plugins/heyspex/.claude-plugin/plugin.json +12 -12
- package/plugins/heyspex/.cursor-plugin/plugin.json +15 -15
- package/plugins/heyspex/README.md +312 -0
- package/plugins/heyspex/bin/run-hook.mjs +20 -2
- package/plugins/heyspex/hooks/cursor-hooks.json +81 -0
- package/plugins/heyspex/hooks/hooks.json +94 -37
- package/scripts/claude-hooks/_intent-classifier-router.mjs +456 -410
- package/scripts/claude-hooks/_intent-classifier-semantic.mjs +5 -0
- package/scripts/claude-hooks/_run.mjs +316 -23
- package/scripts/claude-hooks/capture-execution-gate.mjs +51 -0
- package/scripts/claude-hooks/claim-liveness-shared.mjs +2 -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/inject-communication-style.mjs +20 -0
- package/scripts/claude-hooks/intent-classifier-trigger.mjs +279 -247
- package/scripts/claude-hooks/session-end.mjs +2 -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 +5 -1
- package/scripts/cursor-hooks/manifest.mjs +46 -0
- package/scripts/heyspex-mode.mjs +20 -0
- package/scripts/hs-mode.mjs +1 -1
- package/scripts/hs-view.mjs +180 -17
- package/scripts/install-claude-code-hooks.mjs +3 -1
- package/scripts/install-copilot-hooks.mjs +288 -0
- package/scripts/lib/console-url-resolver.mjs +3 -2
- package/scripts/lib/customer-kit.mjs +327 -10
- package/scripts/lib/dev-mode.mjs +7 -6
- package/scripts/lib/directive-obligations.mjs +349 -0
- package/scripts/lib/hook-dispositions.mjs +210 -0
- package/scripts/lib/hook-vault-header.mjs +30 -0
- package/scripts/lib/hs-source-branch.mjs +196 -0
- package/scripts/lib/hs-source-log.mjs +2 -1
- package/scripts/lib/hs-source-preflight.mjs +18 -4
- package/scripts/lib/hs-source-push.mjs +386 -356
- package/scripts/lib/window-placement.mjs +109 -0
- package/spexharness/src/adapters/claude-code.mjs +11 -3
- package/spexharness/src/adapters/copilot.mjs +236 -0
- package/spexharness/src/adapters/detect-harness.mjs +34 -0
- package/spexharness/src/gates/_shell-write-targets.mjs +77 -0
- package/spexharness/src/gates/deep-research-cost-gate.mjs +4 -3
- 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/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/intent-classifier.mjs +4 -2
- package/spexharness/src/intent-directive.mjs +626 -541
- package/spexharness/src/rule-table.mjs +31 -1
- package/vendor/heyspex-mcp/account-switch.mjs +6 -5
- package/vendor/heyspex-mcp/capture-buffer-patches.mjs +31 -3
- package/vendor/heyspex-mcp/capture-console-client.mjs +37 -2
- package/vendor/heyspex-mcp/capture-focus.mjs +26 -2
- package/vendor/heyspex-mcp/capture-outbox.mjs +10 -4
- package/vendor/heyspex-mcp/capture-sources.mjs +195 -0
- package/vendor/heyspex-mcp/capture-tools.mjs +56 -11
- package/vendor/heyspex-mcp/claim-tools.mjs +25 -2
- package/vendor/heyspex-mcp/cli-verbs.mjs +19 -21
- package/vendor/heyspex-mcp/cli.mjs +7 -1
- package/vendor/heyspex-mcp/close-branch-report.mjs +102 -0
- package/vendor/heyspex-mcp/cloud-vault-writes.mjs +197 -7
- package/vendor/heyspex-mcp/console-fetch.mjs +192 -28
- package/vendor/heyspex-mcp/console-transport.mjs +7 -1
- package/vendor/heyspex-mcp/credentials.mjs +9 -8
- package/vendor/heyspex-mcp/dev-tools.mjs +7 -0
- package/vendor/heyspex-mcp/filing-tools.mjs +35 -0
- package/vendor/heyspex-mcp/fleet-queue-tools.mjs +2 -1
- package/vendor/heyspex-mcp/folder-trust-store.mjs +2 -1
- package/vendor/heyspex-mcp/http-transport.mjs +2 -0
- package/vendor/heyspex-mcp/list-tools.mjs +1 -1
- package/vendor/heyspex-mcp/mcp-config.mjs +14 -1
- package/vendor/heyspex-mcp/memory-tools.mjs +523 -523
- package/vendor/heyspex-mcp/obligation-backstop.mjs +103 -0
- package/vendor/heyspex-mcp/occupied-keys.mjs +1 -0
- package/vendor/heyspex-mcp/on-deck-brief.mjs +19 -2
- package/vendor/heyspex-mcp/on-deck-scheduler.mjs +1708 -1708
- package/vendor/heyspex-mcp/plan-push.mjs +3 -2
- package/vendor/heyspex-mcp/preflight-gate.mjs +1 -0
- package/vendor/heyspex-mcp/procedure-handlers.mjs +327 -325
- package/vendor/heyspex-mcp/procedure-tools.mjs +1181 -1159
- package/vendor/heyspex-mcp/promote-capture.mjs +2 -0
- package/vendor/heyspex-mcp/promote-research.mjs +6 -0
- package/vendor/heyspex-mcp/read-path.mjs +162 -6
- package/vendor/heyspex-mcp/request-context.mjs +25 -1
- package/vendor/heyspex-mcp/research-handlers.mjs +6 -4
- package/vendor/heyspex-mcp/roadmap-default.mjs +70 -0
- package/vendor/heyspex-mcp/session-owner.mjs +3 -2
- package/vendor/heyspex-mcp/session-tools.mjs +10 -0
- package/vendor/heyspex-mcp/spec-edit-tools.mjs +8 -1
- package/vendor/heyspex-mcp/split-research.mjs +3 -0
- package/vendor/heyspex-mcp/submit-for-review.mjs +18 -1
- package/vendor/heyspex-mcp/summary-write-tools.mjs +5 -1
- package/vendor/heyspex-mcp/test-helpers.mjs +18 -3
- package/vendor/heyspex-mcp/tool-catalog.mjs +7 -1
- package/vendor/heyspex-mcp/tool-dispatch.mjs +18 -0
- package/vendor/heyspex-mcp/vault-io.mjs +720 -724
- package/vendor/heyspex-mcp/vault-resolve.mjs +197 -9
- package/vendor/heyspex-mcp/whoami.mjs +2 -1
- package/vendor/heyspex-mcp/write-outbox.mjs +512 -0
|
@@ -7,20 +7,20 @@ description: Pull the top open item from the HeySpex Resolution lane (conflicts,
|
|
|
7
7
|
|
|
8
8
|
**Usage:** `/hs-resolve [HS-XXXX-EPIC | <item-key> | --ignore-focus]`
|
|
9
9
|
|
|
10
|
-
Invoke the `heyspex_next_resolution` MCP tool to fetch the top open resolution item from the HeySpex vault, then paste the returned `prompt_markdown` verbatim so the user can act on the fix brief.
|
|
11
|
-
|
|
12
|
-
Argument parsing for `$ARGUMENTS` (all optional; if empty, call the tool with no parameters):
|
|
13
|
-
|
|
14
|
-
- A token containing `:` (e.g. `dangling_ref:hs-epic-x:hs-task-y`) → pass as `item_key` (fetch that specific item's brief; bypasses the focus pin).
|
|
15
|
-
- A bare spec id matching `HS-EPIC-*` / `HS-TASK-*` / `HS-MIL-*` / `HS-*-*` → pass as `scope` (deck-aware: restrict detection to that spec so its gating prerequisite/conflicts surface). This is what the On-Deck `resolve_command: /hs-resolve <epic-id>` passes.
|
|
16
|
-
- `--ignore-focus` → set `ignore_focus: true` (skip the Neon resolution focus pin; lead with the top-ranked open item).
|
|
17
|
-
|
|
18
|
-
Resolution precedence (built into the tool — do not re-implement): `item_key` → `scope`/`ignore_focus` (top-ranked of the open list) → the Neon focus pin (server-applied) → top-ranked open item. Items are ordered with **gating** and **errors first** (`orderResolutionItems`).
|
|
19
|
-
|
|
20
|
-
After the tool returns, output the `prompt_markdown` field as-is, then on a final line state the source: `_Source: {source} · {item.kind} · {item.key}_`. Do not summarize, paraphrase, or start executing actions from the brief without the user's go-ahead.
|
|
21
|
-
|
|
22
|
-
This is the surviving `/hs-resolve` (the legacy conflict-only prompt that errored **"Not an Epic"** on a milestone has been retired — the resolver is item-centric and never type-checks the target). Authority from the brief's resolution menu: **Re-scan / clear** is agent-autonomous; **Switch to this**, **Defer**, **edge removal**, and **override** require explicit user confirmation. `stale_index` items expose **only** re-scan/clear — never an edge-mutating action.
|
|
23
|
-
|
|
24
|
-
Detection is HTTP-only (the tool reads the console aggregator — the one detection path — it does not re-detect). If the tool errors with `CONSOLE_UNREACHABLE`, tell the user to **start the console dev server (port 3000, or run `hs server status` to see which port it actually bound)** — this only happens on a dev machine; SaaS console is always up. On `CONSOLE_TIMEOUT`, suggest retrying shortly (the server may be cold-compiling). On `ITEM_NOT_FOUND`, the `item_key` is not in the open set — list items with `/hs-resolve` (no args).
|
|
25
|
-
|
|
26
|
-
This skill does NOT claim or build anything; it presents the fix brief. Sibling skills: `/hs-next` (build pipeline), `/hs-review` (review pipeline), `/hs-resolve` (this — resolution lane). See [[HS-0EJ6-RMCP-EPIC-hs-resolve-mcp-tool-and-skill]] and [[HS-I8FM-RSRF-EPIC-resolution-surface-api-and-pin]].
|
|
10
|
+
Invoke the `heyspex_next_resolution` MCP tool to fetch the top open resolution item from the HeySpex vault, then paste the returned `prompt_markdown` verbatim so the user can act on the fix brief.
|
|
11
|
+
|
|
12
|
+
Argument parsing for `$ARGUMENTS` (all optional; if empty, call the tool with no parameters):
|
|
13
|
+
|
|
14
|
+
- A token containing `:` (e.g. `dangling_ref:hs-epic-x:hs-task-y`) → pass as `item_key` (fetch that specific item's brief; bypasses the focus pin).
|
|
15
|
+
- A bare spec id matching `HS-EPIC-*` / `HS-TASK-*` / `HS-MIL-*` / `HS-*-*` → pass as `scope` (deck-aware: restrict detection to that spec so its gating prerequisite/conflicts surface). This is what the On-Deck `resolve_command: /hs-resolve <epic-id>` passes.
|
|
16
|
+
- `--ignore-focus` → set `ignore_focus: true` (skip the Neon resolution focus pin; lead with the top-ranked open item).
|
|
17
|
+
|
|
18
|
+
Resolution precedence (built into the tool — do not re-implement): `item_key` → `scope`/`ignore_focus` (top-ranked of the open list) → the Neon focus pin (server-applied) → top-ranked open item. Items are ordered with **gating** and **errors first** (`orderResolutionItems`).
|
|
19
|
+
|
|
20
|
+
After the tool returns, output the `prompt_markdown` field as-is, then on a final line state the source: `_Source: {source} · {item.kind} · {item.key}_`. Do not summarize, paraphrase, or start executing actions from the brief without the user's go-ahead.
|
|
21
|
+
|
|
22
|
+
This is the surviving `/hs-resolve` (the legacy conflict-only prompt that errored **"Not an Epic"** on a milestone has been retired — the resolver is item-centric and never type-checks the target). Authority from the brief's resolution menu: **Re-scan / clear** is agent-autonomous; **Switch to this**, **Defer**, **edge removal**, and **override** require explicit user confirmation. `stale_index` items expose **only** re-scan/clear — never an edge-mutating action.
|
|
23
|
+
|
|
24
|
+
Detection is HTTP-only (the tool reads the console aggregator — the one detection path — it does not re-detect). If the tool errors with `CONSOLE_UNREACHABLE`, tell the user to **start the console dev server (port 3000, or run `hs server status` to see which port it actually bound)** — this only happens on a dev machine; SaaS console is always up. On `CONSOLE_TIMEOUT`, suggest retrying shortly (the server may be cold-compiling). On `ITEM_NOT_FOUND`, the `item_key` is not in the open set — list items with `/hs-resolve` (no args).
|
|
25
|
+
|
|
26
|
+
This skill does NOT claim or build anything; it presents the fix brief. Sibling skills: `/hs-next` (build pipeline), `/hs-review` (review pipeline), `/hs-resolve` (this — resolution lane). See [[HS-0EJ6-RMCP-EPIC-hs-resolve-mcp-tool-and-skill]] and [[HS-I8FM-RSRF-EPIC-resolution-surface-api-and-pin]].
|
|
@@ -7,20 +7,20 @@ description: Pull the next review-ready spec from the HeySpex review queue (revi
|
|
|
7
7
|
|
|
8
8
|
**Usage:** `/hs-review [HS-XXXX-TASK | HS-XXXX-EPIC] [--ignore-focus]`
|
|
9
9
|
|
|
10
|
-
Invoke the `heyspex_next_review` MCP tool to fetch the next review-ready spec from the HeySpex vault, then paste the returned `prompt_markdown` verbatim so the user (reviewer) can walk acceptance against the parent spec + HS-REV companion.
|
|
11
|
-
|
|
12
|
-
Argument parsing for `$ARGUMENTS` (all optional; if `$ARGUMENTS` is empty, call the tool with no parameters):
|
|
13
|
-
|
|
14
|
-
- A bare token matching `HS-TASK-*` / `HS-EPIC-*` / `HS-*-*` → pass as `spec_id`.
|
|
15
|
-
- A bare token matching `HS-ROADMAP-*` → pass as `roadmap_id`.
|
|
16
|
-
- `--ignore-focus` → set `ignore_focus: true`.
|
|
17
|
-
|
|
18
|
-
Resolution precedence (built into the tool, do not re-implement here): `args.spec_id` → `.heyspex/review-focus.yaml` pin → manifest traversal for `status: in_review` specs with an `HS-REV-<suffix>-*.md` companion → folder scan as fallback. Sorted by `updated:` ascending (oldest first).
|
|
19
|
-
|
|
20
|
-
After the tool returns, output the `prompt_markdown` field as-is, then on a final line state the source: `_Source: {source_kind} · {spec_id} · phase {phase_id} · age {age_in_review_days}d_`. Do not summarize, paraphrase, or start executing the returned prompt.
|
|
21
|
-
|
|
22
|
-
This skill does NOT claim the spec. Reviewing is a human-in-loop activity by design (CLAUDE.md §Session Completion); the reviewer walks the four sections of the HS-REV companion (`## Acceptance verification`, `## Reviewer notes`, `## Memory candidates`, `## Decision: close or reopen`) and decides pass/reopen. Memory candidates are scored against the four-axis rubric (non-derivability / reusability / surprise-cost / concreteness, 0–3 each, threshold ≥ 7/12) — the prompt body includes the rubric and the conflict-check instruction.
|
|
23
|
-
|
|
24
|
-
If the tool errors with `NO_REVIEW_READY`, tell the user the review queue is empty (no specs at `status: in_review` with an HS-REV companion) and suggest checking `specs/reviews/` for stale companions or filing the missing review doc. If `SPEC_NOT_IN_REVIEW`, surface the spec's actual status so the user can pick the right `/hs-review HS-XXXX` target. If `NO_REVIEW_DOC`, the parent spec is `in_review` but has no `HS-REV-<suffix>-*.md` companion — point the user at CLAUDE.md §Session Completion §3 for the four-section template.
|
|
25
|
-
|
|
26
|
-
Cross-reference: [[HS-XRO1-RVDC-TASK-heyspex-review-on-deck-mcp-and-hs-review]] (spec), [[HS-UKD6-CLR4-RES-close-out-review-screen-jtbd-architecture]] §J17 (downstream Review surface that will call this tool from the "Copy `/hs-review`" affordance).
|
|
10
|
+
Invoke the `heyspex_next_review` MCP tool to fetch the next review-ready spec from the HeySpex vault, then paste the returned `prompt_markdown` verbatim so the user (reviewer) can walk acceptance against the parent spec + HS-REV companion.
|
|
11
|
+
|
|
12
|
+
Argument parsing for `$ARGUMENTS` (all optional; if `$ARGUMENTS` is empty, call the tool with no parameters):
|
|
13
|
+
|
|
14
|
+
- A bare token matching `HS-TASK-*` / `HS-EPIC-*` / `HS-*-*` → pass as `spec_id`.
|
|
15
|
+
- A bare token matching `HS-ROADMAP-*` → pass as `roadmap_id`.
|
|
16
|
+
- `--ignore-focus` → set `ignore_focus: true`.
|
|
17
|
+
|
|
18
|
+
Resolution precedence (built into the tool, do not re-implement here): `args.spec_id` → `.heyspex/review-focus.yaml` pin → manifest traversal for `status: in_review` specs with an `HS-REV-<suffix>-*.md` companion → folder scan as fallback. Sorted by `updated:` ascending (oldest first).
|
|
19
|
+
|
|
20
|
+
After the tool returns, output the `prompt_markdown` field as-is, then on a final line state the source: `_Source: {source_kind} · {spec_id} · phase {phase_id} · age {age_in_review_days}d_`. Do not summarize, paraphrase, or start executing the returned prompt.
|
|
21
|
+
|
|
22
|
+
This skill does NOT claim the spec. Reviewing is a human-in-loop activity by design (CLAUDE.md §Session Completion); the reviewer walks the four sections of the HS-REV companion (`## Acceptance verification`, `## Reviewer notes`, `## Memory candidates`, `## Decision: close or reopen`) and decides pass/reopen. Memory candidates are scored against the four-axis rubric (non-derivability / reusability / surprise-cost / concreteness, 0–3 each, threshold ≥ 7/12) — the prompt body includes the rubric and the conflict-check instruction.
|
|
23
|
+
|
|
24
|
+
If the tool errors with `NO_REVIEW_READY`, tell the user the review queue is empty (no specs at `status: in_review` with an HS-REV companion) and suggest checking `specs/reviews/` for stale companions or filing the missing review doc. If `SPEC_NOT_IN_REVIEW`, surface the spec's actual status so the user can pick the right `/hs-review HS-XXXX` target. If `NO_REVIEW_DOC`, the parent spec is `in_review` but has no `HS-REV-<suffix>-*.md` companion — point the user at CLAUDE.md §Session Completion §3 for the four-section template.
|
|
25
|
+
|
|
26
|
+
Cross-reference: [[HS-XRO1-RVDC-TASK-heyspex-review-on-deck-mcp-and-hs-review]] (spec), [[HS-UKD6-CLR4-RES-close-out-review-screen-jtbd-architecture]] §J17 (downstream Review surface that will call this tool from the "Copy `/hs-review`" affordance).
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: hs-view
|
|
3
|
-
description: Open one console surface in a chromeless app-mode browser window (solo console gauge) —
|
|
3
|
+
description: Open one console surface in a chromeless app-mode browser window (solo console gauge) — the inspector's Pipeline tab first; follows the focus pin when no doc id is given. Thin wrapper over `hs view`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- Generated by scripts/sync-skills.mjs from .claude/commands/hs-view.md — do not edit by hand. Run `npm run skills:sync`. -->
|
|
7
7
|
|
|
8
8
|
**Usage:** `/hs-view [surface] [doc id] [--width N] [--height N] [--browser edge|chrome]`
|
|
9
9
|
|
|
10
|
-
# HeySpex solo-surface viewer (`/hs-view`)
|
|
11
|
-
|
|
12
|
-
> Parity: `.commandcode/skills/hs-view/SKILL.md` · `.cursor/skills/hs-view/SKILL.md` · `.agents/skills/hs-view/SKILL.md`
|
|
13
|
-
|
|
14
|
-
Optional macro over the one core ([[capability-three-faces-no-per-capability-slash]]): shell to `hs view`, never reimplement it. Design: [[HS-RU2R-I87U-RES-solo-surface-cli-launcher-single]].
|
|
15
|
-
|
|
16
|
-
## What to do
|
|
17
|
-
|
|
18
|
-
1. **Resolve `$ARGUMENTS` by smart first-token detection** — grammar is positional, token-identical with the CLI:
|
|
19
|
-
- First token
|
|
20
|
-
- First token is a surface slug (`
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
# HeySpex solo-surface viewer (`/hs-view`)
|
|
11
|
+
|
|
12
|
+
> Parity: `.commandcode/skills/hs-view/SKILL.md` · `.cursor/skills/hs-view/SKILL.md` · `.agents/skills/hs-view/SKILL.md`
|
|
13
|
+
|
|
14
|
+
Optional macro over the one core ([[capability-three-faces-no-per-capability-slash]]): shell to `hs view`, never reimplement it. Design: [[HS-RU2R-I87U-RES-solo-surface-cli-launcher-single]].
|
|
15
|
+
|
|
16
|
+
## What to do
|
|
17
|
+
|
|
18
|
+
1. **Resolve `$ARGUMENTS` by smart first-token detection** — grammar is positional, token-identical with the CLI:
|
|
19
|
+
- First token is not a surface slug → it is the doc id, in any form (`hlfj`, `hs-hlfj`, `HS-HLFJ`, a full basename); opens the inspector on its Pipeline tab. Pass it through as typed — the CLI normalises it.
|
|
20
|
+
- First token is a surface slug (`inspector`, `docs`, `whats-next`, `captures`, `session-log`, `settings`) → second token, if present, is the doc id (anchors `inspector` and `docs` only).
|
|
21
|
+
- `pipeline` is accepted but is not its own window: it is the inspector on its Pipeline tab.
|
|
22
|
+
- `docs` opens two panes: the doc beside the inspector on its Pipeline tab.
|
|
23
|
+
- No arguments → the inspector on its Pipeline tab, anchored on the focus pin (live-follow).
|
|
24
|
+
- Pass `--width` / `--height` / `--browser edge|chrome` through unchanged.
|
|
25
|
+
2. **Run it yourself** from the repo root:
|
|
26
|
+
```bash
|
|
27
|
+
node bin/hs.mjs view [<surface>] [<doc-id>] [flags]
|
|
28
|
+
```
|
|
29
|
+
3. The verb probes ground-truth dev-server status first — if the console is down, relay its message and offer `npm run dev` (don't start the server unprompted).
|
|
30
|
+
4. Relay the one-line result (URL + window size); closing the window closes it, re-running reopens it.
|
|
31
|
+
|
|
32
|
+
Never hand-build `msedge --app=…` invocations — the CLI verb owns server probing, URL resolution, and browser mechanics.
|
|
@@ -7,29 +7,29 @@ description: Kill every process listening on a TCP port in the range 3000–5999
|
|
|
7
7
|
|
|
8
8
|
**Usage:** `/kill-ports (no arguments)`
|
|
9
9
|
|
|
10
|
-
**Always use the PowerShell tool for this command — never the Bash tool.** Bash routes to a POSIX shell in this environment and the PowerShell syntax below will fail there.
|
|
11
|
-
|
|
12
|
-
Kill all processes that are **listening** on TCP ports in the range **3000–5999** inclusive. This clears orphaned dev servers (Next.js, console, companion bridges, etc.) that are holding ports.
|
|
13
|
-
|
|
14
|
-
Run this single command via the **PowerShell** tool. It discovers the listening connections in range, reports each `port → pid (process name)` it is about to kill, then force-kills the unique owning PIDs and confirms:
|
|
15
|
-
|
|
16
|
-
```powershell
|
|
17
|
-
$conns = Get-NetTCPConnection -State Listen -ErrorAction SilentlyContinue |
|
|
18
|
-
Where-Object { $_.LocalPort -ge 3000 -and $_.LocalPort -le 5999 }
|
|
19
|
-
if (-not $conns) { Write-Output 'No listeners on ports 3000-5999. Nothing to kill.'; return }
|
|
20
|
-
$pids = $conns | Select-Object -ExpandProperty OwningProcess -Unique
|
|
21
|
-
foreach ($c in $conns) {
|
|
22
|
-
$p = Get-Process -Id $c.OwningProcess -ErrorAction SilentlyContinue
|
|
23
|
-
$name = if ($p) { $p.ProcessName } else { '?' }
|
|
24
|
-
Write-Output ("port {0,-5} -> pid {1} ({2})" -f $c.LocalPort, $c.OwningProcess, $name)
|
|
25
|
-
}
|
|
26
|
-
foreach ($procId in $pids) {
|
|
27
|
-
try { Stop-Process -Id $procId -Force -ErrorAction Stop; Write-Output ("killed pid {0}" -f $procId) }
|
|
28
|
-
catch { Write-Output ("could not kill pid {0}: {1}" -f $procId, $_.Exception.Message) }
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Notes:
|
|
33
|
-
- Only TCP **listeners** are targeted, so client/outbound connections in that range are left alone.
|
|
34
|
-
- If `Stop-Process` fails on a PID (e.g. a Windows system process like `svchost`, which needs admin and shouldn't be killed anyway, or a process that already exited), report the `Access is denied` / error and continue with the rest — do not abort the whole run.
|
|
35
|
-
- After running, briefly summarize how many ports were freed.
|
|
10
|
+
**Always use the PowerShell tool for this command — never the Bash tool.** Bash routes to a POSIX shell in this environment and the PowerShell syntax below will fail there.
|
|
11
|
+
|
|
12
|
+
Kill all processes that are **listening** on TCP ports in the range **3000–5999** inclusive. This clears orphaned dev servers (Next.js, console, companion bridges, etc.) that are holding ports.
|
|
13
|
+
|
|
14
|
+
Run this single command via the **PowerShell** tool. It discovers the listening connections in range, reports each `port → pid (process name)` it is about to kill, then force-kills the unique owning PIDs and confirms:
|
|
15
|
+
|
|
16
|
+
```powershell
|
|
17
|
+
$conns = Get-NetTCPConnection -State Listen -ErrorAction SilentlyContinue |
|
|
18
|
+
Where-Object { $_.LocalPort -ge 3000 -and $_.LocalPort -le 5999 }
|
|
19
|
+
if (-not $conns) { Write-Output 'No listeners on ports 3000-5999. Nothing to kill.'; return }
|
|
20
|
+
$pids = $conns | Select-Object -ExpandProperty OwningProcess -Unique
|
|
21
|
+
foreach ($c in $conns) {
|
|
22
|
+
$p = Get-Process -Id $c.OwningProcess -ErrorAction SilentlyContinue
|
|
23
|
+
$name = if ($p) { $p.ProcessName } else { '?' }
|
|
24
|
+
Write-Output ("port {0,-5} -> pid {1} ({2})" -f $c.LocalPort, $c.OwningProcess, $name)
|
|
25
|
+
}
|
|
26
|
+
foreach ($procId in $pids) {
|
|
27
|
+
try { Stop-Process -Id $procId -Force -ErrorAction Stop; Write-Output ("killed pid {0}" -f $procId) }
|
|
28
|
+
catch { Write-Output ("could not kill pid {0}: {1}" -f $procId, $_.Exception.Message) }
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Notes:
|
|
33
|
+
- Only TCP **listeners** are targeted, so client/outbound connections in that range are left alone.
|
|
34
|
+
- If `Stop-Process` fails on a PID (e.g. a Windows system process like `svchost`, which needs admin and shouldn't be killed anyway, or a process that already exited), report the `Access is denied` / error and continue with the rest — do not abort the whole run.
|
|
35
|
+
- After running, briefly summarize how many ports were freed.
|
|
@@ -7,89 +7,89 @@ description: Build an HTML/frontend prototype for the HeySpex Console. Files MUS
|
|
|
7
7
|
|
|
8
8
|
**Usage:** `/prototype <slug> [--from-spec HS-XXXX] [--bump] [--variant <name>]`
|
|
9
9
|
|
|
10
|
-
This skill is the **implementation** of `specs/protocols/prototype-lifecycle-protocol.md`. The protocol is the SSOT — when they conflict, the protocol wins and this skill is the bug. Fetch it with `heyspex_get_procedure({ name: "prototype-lifecycle-protocol" })` when you need the full rules.
|
|
11
|
-
|
|
12
|
-
It applies to:
|
|
13
|
-
|
|
14
|
-
- explicit `/prototype` invocation
|
|
15
|
-
- any natural-language "build me an HTML prototype / mock / preview / canvas" ask
|
|
16
|
-
- `/frontend-design` invocations in this repo (the plugin builds the artifact; this skill governs placement)
|
|
17
|
-
|
|
18
|
-
## The contract — no exceptions
|
|
19
|
-
|
|
20
|
-
**Required output paths** (both files, same commit):
|
|
21
|
-
|
|
22
|
-
1. `spex-console/public/design-previews/<slug>-v<N>[-<variant>].html` — the self-contained prototype.
|
|
23
|
-
2. `spex-console/public/design-previews/<slug>-v<N>[-<variant>].meta.json` — the sidecar.
|
|
24
|
-
|
|
25
|
-
Anything outside this folder — including a stray top-level `prototypes/` directory — is **invisible** to the console. The route at `spex-console/src/app/api/ui-design/prototypes/route.ts` reads this folder flat (no recursion, no nested folders). A prototype that doesn't show up in the Prototypes surface does not exist for the user.
|
|
26
|
-
|
|
27
|
-
## Naming
|
|
28
|
-
|
|
29
|
-
- **`<slug>`** (lineage slug) — kebab-case, describes the surface (`capture-canvas`, `shipped-surface`, `review-inbox`). May contain hyphens. **Match an existing lineage if you're iterating on a known surface** — grep `spex-console/public/design-previews/` before inventing a new slug.
|
|
30
|
-
- **`-v<N>`** — version, starts at `-v1`. **Bump rather than overwrite.** The console groups versions into a lineage with full history. If `--bump`, increment from the highest existing `-v<N>` for that slug.
|
|
31
|
-
- **`-<variant>`** (optional) — sibling variant within a version (e.g. `-v2-alt`, `-v2-minimal`, `-v2-terminal`). May contain hyphens. The console nests variants under their parent version and shows a `+N variants at vK` chip on the lineage card. Variants are for "A/B explorations of the same version", not new lineages.
|
|
32
|
-
- **No `index.html`, no nested folders, no dated filenames.** Just `<slug>-v<N>[-<variant>].html`.
|
|
33
|
-
|
|
34
|
-
## meta.json schema
|
|
35
|
-
|
|
36
|
-
Validate against `specs/schemas/prototype-meta.schema.json`. Required: `title` + `status`. Always set `surface_area` and 1–4 `tags` on new sidecars (the console's filter rail depends on them — leaving them empty makes the prototype harder to find).
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"title": "Human-readable name (e.g. 'Capture canvas v2')",
|
|
41
|
-
"description": "One-paragraph summary: what it demonstrates, key interactions, aesthetic direction, technical notes. The console hides this on the card and shows it in the drawer Notes tab — write for that context.",
|
|
42
|
-
"status": "draft",
|
|
43
|
-
"surface_area": "capture | on-deck | preloader | shell | review | roadmap | other",
|
|
44
|
-
"tags": ["kebab-case", "1-to-4"],
|
|
45
|
-
"updated_at": "2026-06-03T18:17:00.000Z",
|
|
46
|
-
"design_doc": "specs/ui/<slug>-design.md (optional but required for promotion to accepted)",
|
|
47
|
-
"linked_specs": [
|
|
48
|
-
"HS-XXXX-CAP-...",
|
|
49
|
-
"HS-XXXX-EPIC-..."
|
|
50
|
-
],
|
|
51
|
-
"parent": "<slug>-v<N-1>.html (optional, when this iterates on a prior version)",
|
|
52
|
-
"embeds": ["other-prototype-slug (optional)"]
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
- **`status` MUST be `"draft"` at create time.** Promotion to `"accepted"` runs through the console's `/api/ui-design/prototypes/<slug>/promote` route and requires both a linked `design_doc` AND a review entry under `specs/reviews/`. The skill does not write `accepted` — refuse if the user asks. (`"archived"` is for superseded versions; usually set later, not at create time.)
|
|
57
|
-
- **Compute `updated_at` as `new Date().toISOString()`** at write time.
|
|
58
|
-
- **`linked_specs`** accepts vault basenames (no `.md` extension) and `HS-*` IDs. Always include the capture/epic/task the prototype embodies. Pull from `--from-spec` if provided. Never invent IDs.
|
|
59
|
-
- Reference siblings in this folder for examples — `shipped-surface-v1.meta.json` (thorough) or `on-deck-v2.meta.json` (minimal).
|
|
60
|
-
|
|
61
|
-
## Workflow
|
|
62
|
-
|
|
63
|
-
When this skill is invoked or matched:
|
|
64
|
-
|
|
65
|
-
1. **Resolve lineage slug.** Match an existing slug if iterating on a known surface; otherwise pick a new kebab-case slug.
|
|
66
|
-
2. **Resolve version.** Default `-v1`. If a file with the same slug already exists, default to bumping to the next integer; honour explicit `--bump`. **Never silently overwrite** — if the target file exists and `--bump` was not passed, surface the conflict and ask.
|
|
67
|
-
3. **Resolve variant.** `--variant <name>` produces `<slug>-v<N>-<name>.html`. Without it, you produce the base variant.
|
|
68
|
-
4. **Pull source spec context.** If `--from-spec HS-XXXX` is passed or the user references a spec, Read it first so the prototype reflects real content, not invented filler.
|
|
69
|
-
5. **Aesthetic.** Defer to the user's brief (e.g. "Claude-in-PowerShell terminal aesthetic" overrides defaults). Otherwise honour console design-system tokens — fetch via `heyspex_design_*` MCP tools, do not grep `spex-console/DESIGN.md`. Recall UI memories first: `heyspex_recall_memories({ tags: ["ui", "console", "design-system"] })`.
|
|
70
|
-
6. **Decide `surface_area` and `tags`.** Pick `surface_area` from the enum based on what the prototype shows. Pick 1–4 lowercase kebab-case `tags` covering the dominant patterns (e.g. `empty-state`, `dark-mode`, `keyboard-nav`).
|
|
71
|
-
7. **Write both files in the same commit.** HTML at `spex-console/public/design-previews/<slug>-v<N>[-<variant>].html`, sidecar at the matching `.meta.json` path. Single self-contained HTML file (inline CSS/JS).
|
|
72
|
-
8. **Validate the sidecar shape** against the schema before saving. Required: `title` + `status`. `status` MUST be `"draft"`. `tags` MUST match `^[a-z0-9-]+$`. `surface_area` MUST be in the enum. `linked_specs[]` items MUST match `^HS-[A-Z0-9]+-` (family keys contain digits, e.g. `HS-9HVY-CAP`). Fix and re-write if any fail.
|
|
73
|
-
9. **Confirm.** After writing, report the gallery URL (`/design-previews/<slug>-v<N>[-<variant>].html`). The console's UI-Design → Prototypes surface picks it up via `/api/ui-design/prototypes` and groups it into the matching lineage automatically.
|
|
74
|
-
|
|
75
|
-
## Anti-patterns — do not do these
|
|
76
|
-
|
|
77
|
-
- Do **not** create a new `prototypes/` folder at the repo root.
|
|
78
|
-
- Do **not** nest as `<slug>/index.html`.
|
|
79
|
-
- Do **not** overwrite an existing `<slug>-v<N>[-<variant>].html` — bump or use a new variant.
|
|
80
|
-
- Do **not** ship without a sibling sidecar.
|
|
81
|
-
- Do **not** write `status: "accepted"` from this skill — promotion runs through the console's `/promote` route only.
|
|
82
|
-
- Do **not** invent linked specs. Only reference `HS-*` IDs that exist in the vault.
|
|
83
|
-
- Do **not** leave `surface_area` and `tags` empty on new sidecars — the console's filter rail depends on them.
|
|
84
|
-
- Do **not** Read `spex-console/DESIGN.md` for token lookups; use `heyspex_design_get_token` / `heyspex_design_get_pattern` MCP tools.
|
|
85
|
-
|
|
86
|
-
## Reference
|
|
87
|
-
|
|
88
|
-
- **Protocol (SSOT):** `specs/protocols/prototype-lifecycle-protocol.md` — fetch with `heyspex_get_procedure({ name: "prototype-lifecycle-protocol" })`
|
|
89
|
-
- **Schema (SSOT):** `specs/schemas/prototype-meta.schema.json`
|
|
90
|
-
- **Discovery route:** `spex-console/src/app/api/ui-design/prototypes/route.ts`
|
|
91
|
-
- **Surface component:** `spex-console/src/components/surfaces/ui-design-surface.tsx`
|
|
92
|
-
- **Lineage parser:** `spex-console/src/lib/prototype-lineage.ts`
|
|
93
|
-
- **Folder:** `spex-console/public/design-previews/`
|
|
94
|
-
- **Thorough sidecar example:** `shipped-surface-v1.meta.json`
|
|
95
|
-
- **Minimal sidecar example:** `on-deck-v2.meta.json`
|
|
10
|
+
This skill is the **implementation** of `specs/protocols/prototype-lifecycle-protocol.md`. The protocol is the SSOT — when they conflict, the protocol wins and this skill is the bug. Fetch it with `heyspex_get_procedure({ name: "prototype-lifecycle-protocol" })` when you need the full rules.
|
|
11
|
+
|
|
12
|
+
It applies to:
|
|
13
|
+
|
|
14
|
+
- explicit `/prototype` invocation
|
|
15
|
+
- any natural-language "build me an HTML prototype / mock / preview / canvas" ask
|
|
16
|
+
- `/frontend-design` invocations in this repo (the plugin builds the artifact; this skill governs placement)
|
|
17
|
+
|
|
18
|
+
## The contract — no exceptions
|
|
19
|
+
|
|
20
|
+
**Required output paths** (both files, same commit):
|
|
21
|
+
|
|
22
|
+
1. `spex-console/public/design-previews/<slug>-v<N>[-<variant>].html` — the self-contained prototype.
|
|
23
|
+
2. `spex-console/public/design-previews/<slug>-v<N>[-<variant>].meta.json` — the sidecar.
|
|
24
|
+
|
|
25
|
+
Anything outside this folder — including a stray top-level `prototypes/` directory — is **invisible** to the console. The route at `spex-console/src/app/api/ui-design/prototypes/route.ts` reads this folder flat (no recursion, no nested folders). A prototype that doesn't show up in the Prototypes surface does not exist for the user.
|
|
26
|
+
|
|
27
|
+
## Naming
|
|
28
|
+
|
|
29
|
+
- **`<slug>`** (lineage slug) — kebab-case, describes the surface (`capture-canvas`, `shipped-surface`, `review-inbox`). May contain hyphens. **Match an existing lineage if you're iterating on a known surface** — grep `spex-console/public/design-previews/` before inventing a new slug.
|
|
30
|
+
- **`-v<N>`** — version, starts at `-v1`. **Bump rather than overwrite.** The console groups versions into a lineage with full history. If `--bump`, increment from the highest existing `-v<N>` for that slug.
|
|
31
|
+
- **`-<variant>`** (optional) — sibling variant within a version (e.g. `-v2-alt`, `-v2-minimal`, `-v2-terminal`). May contain hyphens. The console nests variants under their parent version and shows a `+N variants at vK` chip on the lineage card. Variants are for "A/B explorations of the same version", not new lineages.
|
|
32
|
+
- **No `index.html`, no nested folders, no dated filenames.** Just `<slug>-v<N>[-<variant>].html`.
|
|
33
|
+
|
|
34
|
+
## meta.json schema
|
|
35
|
+
|
|
36
|
+
Validate against `specs/schemas/prototype-meta.schema.json`. Required: `title` + `status`. Always set `surface_area` and 1–4 `tags` on new sidecars (the console's filter rail depends on them — leaving them empty makes the prototype harder to find).
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"title": "Human-readable name (e.g. 'Capture canvas v2')",
|
|
41
|
+
"description": "One-paragraph summary: what it demonstrates, key interactions, aesthetic direction, technical notes. The console hides this on the card and shows it in the drawer Notes tab — write for that context.",
|
|
42
|
+
"status": "draft",
|
|
43
|
+
"surface_area": "capture | on-deck | preloader | shell | review | roadmap | other",
|
|
44
|
+
"tags": ["kebab-case", "1-to-4"],
|
|
45
|
+
"updated_at": "2026-06-03T18:17:00.000Z",
|
|
46
|
+
"design_doc": "specs/ui/<slug>-design.md (optional but required for promotion to accepted)",
|
|
47
|
+
"linked_specs": [
|
|
48
|
+
"HS-XXXX-CAP-...",
|
|
49
|
+
"HS-XXXX-EPIC-..."
|
|
50
|
+
],
|
|
51
|
+
"parent": "<slug>-v<N-1>.html (optional, when this iterates on a prior version)",
|
|
52
|
+
"embeds": ["other-prototype-slug (optional)"]
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- **`status` MUST be `"draft"` at create time.** Promotion to `"accepted"` runs through the console's `/api/ui-design/prototypes/<slug>/promote` route and requires both a linked `design_doc` AND a review entry under `specs/reviews/`. The skill does not write `accepted` — refuse if the user asks. (`"archived"` is for superseded versions; usually set later, not at create time.)
|
|
57
|
+
- **Compute `updated_at` as `new Date().toISOString()`** at write time.
|
|
58
|
+
- **`linked_specs`** accepts vault basenames (no `.md` extension) and `HS-*` IDs. Always include the capture/epic/task the prototype embodies. Pull from `--from-spec` if provided. Never invent IDs.
|
|
59
|
+
- Reference siblings in this folder for examples — `shipped-surface-v1.meta.json` (thorough) or `on-deck-v2.meta.json` (minimal).
|
|
60
|
+
|
|
61
|
+
## Workflow
|
|
62
|
+
|
|
63
|
+
When this skill is invoked or matched:
|
|
64
|
+
|
|
65
|
+
1. **Resolve lineage slug.** Match an existing slug if iterating on a known surface; otherwise pick a new kebab-case slug.
|
|
66
|
+
2. **Resolve version.** Default `-v1`. If a file with the same slug already exists, default to bumping to the next integer; honour explicit `--bump`. **Never silently overwrite** — if the target file exists and `--bump` was not passed, surface the conflict and ask.
|
|
67
|
+
3. **Resolve variant.** `--variant <name>` produces `<slug>-v<N>-<name>.html`. Without it, you produce the base variant.
|
|
68
|
+
4. **Pull source spec context.** If `--from-spec HS-XXXX` is passed or the user references a spec, Read it first so the prototype reflects real content, not invented filler.
|
|
69
|
+
5. **Aesthetic.** Defer to the user's brief (e.g. "Claude-in-PowerShell terminal aesthetic" overrides defaults). Otherwise honour console design-system tokens — fetch via `heyspex_design_*` MCP tools, do not grep `spex-console/DESIGN.md`. Recall UI memories first: `heyspex_recall_memories({ tags: ["ui", "console", "design-system"] })`.
|
|
70
|
+
6. **Decide `surface_area` and `tags`.** Pick `surface_area` from the enum based on what the prototype shows. Pick 1–4 lowercase kebab-case `tags` covering the dominant patterns (e.g. `empty-state`, `dark-mode`, `keyboard-nav`).
|
|
71
|
+
7. **Write both files in the same commit.** HTML at `spex-console/public/design-previews/<slug>-v<N>[-<variant>].html`, sidecar at the matching `.meta.json` path. Single self-contained HTML file (inline CSS/JS).
|
|
72
|
+
8. **Validate the sidecar shape** against the schema before saving. Required: `title` + `status`. `status` MUST be `"draft"`. `tags` MUST match `^[a-z0-9-]+$`. `surface_area` MUST be in the enum. `linked_specs[]` items MUST match `^HS-[A-Z0-9]+-` (family keys contain digits, e.g. `HS-9HVY-CAP`). Fix and re-write if any fail.
|
|
73
|
+
9. **Confirm.** After writing, report the gallery URL (`/design-previews/<slug>-v<N>[-<variant>].html`). The console's UI-Design → Prototypes surface picks it up via `/api/ui-design/prototypes` and groups it into the matching lineage automatically.
|
|
74
|
+
|
|
75
|
+
## Anti-patterns — do not do these
|
|
76
|
+
|
|
77
|
+
- Do **not** create a new `prototypes/` folder at the repo root.
|
|
78
|
+
- Do **not** nest as `<slug>/index.html`.
|
|
79
|
+
- Do **not** overwrite an existing `<slug>-v<N>[-<variant>].html` — bump or use a new variant.
|
|
80
|
+
- Do **not** ship without a sibling sidecar.
|
|
81
|
+
- Do **not** write `status: "accepted"` from this skill — promotion runs through the console's `/promote` route only.
|
|
82
|
+
- Do **not** invent linked specs. Only reference `HS-*` IDs that exist in the vault.
|
|
83
|
+
- Do **not** leave `surface_area` and `tags` empty on new sidecars — the console's filter rail depends on them.
|
|
84
|
+
- Do **not** Read `spex-console/DESIGN.md` for token lookups; use `heyspex_design_get_token` / `heyspex_design_get_pattern` MCP tools.
|
|
85
|
+
|
|
86
|
+
## Reference
|
|
87
|
+
|
|
88
|
+
- **Protocol (SSOT):** `specs/protocols/prototype-lifecycle-protocol.md` — fetch with `heyspex_get_procedure({ name: "prototype-lifecycle-protocol" })`
|
|
89
|
+
- **Schema (SSOT):** `specs/schemas/prototype-meta.schema.json`
|
|
90
|
+
- **Discovery route:** `spex-console/src/app/api/ui-design/prototypes/route.ts`
|
|
91
|
+
- **Surface component:** `spex-console/src/components/surfaces/ui-design-surface.tsx`
|
|
92
|
+
- **Lineage parser:** `spex-console/src/lib/prototype-lineage.ts`
|
|
93
|
+
- **Folder:** `spex-console/public/design-previews/`
|
|
94
|
+
- **Thorough sidecar example:** `shipped-surface-v1.meta.json`
|
|
95
|
+
- **Minimal sidecar example:** `on-deck-v2.meta.json`
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Installing the HeySpex (SpexCode) plugin in GitHub Copilot CLI
|
|
2
|
+
|
|
3
|
+
Instructions written to be handed verbatim to a GitHub Copilot CLI agent. Follow the steps in
|
|
4
|
+
order and stop at any step that fails, reporting the exact output.
|
|
5
|
+
|
|
6
|
+
This guide is for a team that installs only the `heyspex` npm package. The heyspex-app repository
|
|
7
|
+
is not needed and is not available to customers.
|
|
8
|
+
|
|
9
|
+
Source of truth for the Copilot commands and file layout:
|
|
10
|
+
<https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-plugin-reference>.
|
|
11
|
+
Hook behaviour under Copilot: <https://docs.github.com/en/copilot/reference/hooks-configuration>.
|
|
12
|
+
Both pages were read on 2026-10-16. The plugin itself is documented in `node_modules/heyspex/plugins/heyspex/README.md`.
|
|
13
|
+
|
|
14
|
+
## 0. The short version
|
|
15
|
+
|
|
16
|
+
From the root of your repo, after `npm install heyspex`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx heyspex setup copilot # plugin route (Copilot CLI): registers the marketplace and installs the plugin
|
|
20
|
+
npx heyspex setup copilot --hooks # hooks route (Copilot cloud agent / no plugin): writes .github/hooks/heyspex.json
|
|
21
|
+
npx heyspex setup copilot --check # which route is active; warns if both are
|
|
22
|
+
npx heyspex setup copilot --uninstall
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
To have an agent do it, paste it the output of `npx heyspex setup copilot --print` (this document,
|
|
26
|
+
preceded by the exact next command). If `copilot` is not on PATH, the plugin route prints the two
|
|
27
|
+
commands to run instead. Pick ONE route, never both. The manual commands below remain the fallback.
|
|
28
|
+
|
|
29
|
+
## 1. Prerequisites
|
|
30
|
+
|
|
31
|
+
The heyspex-app repository is not required and is not available to customers. Everything below
|
|
32
|
+
works from the published npm package `heyspex` (or a tarball your HeySpex contact hands you), which
|
|
33
|
+
carries the plugin, the marketplace manifest, the hooks and the MCP server.
|
|
34
|
+
|
|
35
|
+
- Node.js 20 or newer on PATH (`node --version`).
|
|
36
|
+
- GitHub Copilot CLI installed and signed in (`copilot --version`).
|
|
37
|
+
- A git repo of your own (the one you want governed). From its root, install the package:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install heyspex
|
|
41
|
+
# or, from a tarball you were given:
|
|
42
|
+
npm install ./heyspex-0.2.0.tgz
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- Sign the machine in to the HeySpex console so hooks and MCP tools can reach the vault:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx hs login
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 2. Pick ONE: the plugin or the repo hooks (never both)
|
|
52
|
+
|
|
53
|
+
Copilot reads hooks from an installed plugin and from `.github/hooks/` in the repo. With both,
|
|
54
|
+
every hook runs twice. Choose one.
|
|
55
|
+
|
|
56
|
+
**Option A: the plugin (recommended).** One command registers the marketplace shipped inside the
|
|
57
|
+
package and installs the plugin:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx heyspex setup copilot
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
(`npx hs install --target . --copilot-plugin-apply` does the same.) By hand, the equivalent Copilot commands are:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
copilot plugin marketplace add ./node_modules/heyspex
|
|
67
|
+
copilot plugin install heyspex@heyspex-marketplace
|
|
68
|
+
copilot plugin list
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`./node_modules/heyspex/.claude-plugin/marketplace.json` is a Claude-format marketplace named
|
|
72
|
+
`heyspex-marketplace`; its plugin `source` (`./plugins/heyspex`) resolves inside the package.
|
|
73
|
+
`npx hs install --target . --copilot-plugin` (no `-apply`) only prints these commands.
|
|
74
|
+
|
|
75
|
+
**Option B: repo hooks, for teammates and the Copilot cloud agent.** Writes
|
|
76
|
+
`.github/hooks/heyspex.json` into your repo; commit it. Each command runs
|
|
77
|
+
`node_modules/heyspex/scripts/claude-hooks/_run.mjs` and exits 0 if the package is not installed,
|
|
78
|
+
so a checkout without `npm install` is never blocked.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npx heyspex setup copilot --hooks
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
(`npx hs install --target . --copilot-hooks` does the same.) `setup copilot --hooks` refuses when the plugin is already installed. If you pass `--copilot-hooks` together with `--copilot-plugin[-apply]`, the installer warns and
|
|
85
|
+
skips the hooks file.
|
|
86
|
+
|
|
87
|
+
Then restart the Copilot session (`/restart`) so hooks load, and verify:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
copilot plugin list # Option A: heyspex is enabled
|
|
91
|
+
npx hs doctor # MCP, hooks and account surfaces healthy
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## 3. What the plugin loads
|
|
95
|
+
|
|
96
|
+
| Component | Source | Behaviour under Copilot |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| Hooks | `node_modules/heyspex/plugins/heyspex/hooks/hooks.json` | PreToolUse, PostToolUse, Stop, UserPromptSubmit and SessionStart gates. Every command locates the runtime itself and exits 0 if it cannot, so a missing variable never denies a tool call. A real deny arrives as a top-level `permissionDecision` with a reason. |
|
|
99
|
+
| MCP server | `node_modules/heyspex/plugins/heyspex/.mcp.json` | The `heyspex_*` vault tools and `hs-*` prompts. |
|
|
100
|
+
| Slash commands | not loaded | Claude Code commands are not a Copilot component. Use MCP prompts or the `hs` CLI. |
|
|
101
|
+
|
|
102
|
+
## 4. Verify the install
|
|
103
|
+
|
|
104
|
+
1. In a Copilot session inside any repo, run a harmless tool call, for example read a file. It
|
|
105
|
+
must succeed. A message containing "Denied by preToolUse hook" means a hook failed; go to
|
|
106
|
+
section 7.
|
|
107
|
+
2. Confirm the MCP server is up by listing MCP servers in Copilot (`/mcp`) and calling
|
|
108
|
+
`heyspex_recall_memories` with `{ "limit": 3 }`. If the server is missing, go to section 7.
|
|
109
|
+
3. Confirm the gates work: send a prompt that contains a new product idea of more than 60
|
|
110
|
+
characters, then try to edit a source file without capturing. The edit should be refused with a
|
|
111
|
+
reason that names `directive-obligation-gate`. Call `heyspex_update_capture` with the prompt
|
|
112
|
+
text, then retry the edit. It should pass.
|
|
113
|
+
|
|
114
|
+
## 5. Turning HeySpex off and on
|
|
115
|
+
|
|
116
|
+
Run from the repo you are working in:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
hs mode status # on | off, and why
|
|
120
|
+
hs mode off # every hook exits 0 immediately, no restart needed
|
|
121
|
+
hs mode on
|
|
122
|
+
hs mode toggle
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Use `npx hs mode off` when `hs` is not on PATH. The switch writes
|
|
126
|
+
`.heyspex/mode.json` in the project and is git-ignored.
|
|
127
|
+
|
|
128
|
+
Per-shell variants that touch no files:
|
|
129
|
+
|
|
130
|
+
| Variable | Effect |
|
|
131
|
+
| --- | --- |
|
|
132
|
+
| `HEYSPEX_MODE=off` | Silences hooks for every harness in that shell |
|
|
133
|
+
| `HEYSPEX_COPILOT_HOOKS_OFF=1` | Silences hooks only when the caller is Copilot; Claude Code and Cursor keep theirs |
|
|
134
|
+
|
|
135
|
+
The config twin of the Copilot switch is `agent_behaviors.harness_hooks.copilot.enabled: false` in
|
|
136
|
+
the vault's `.heyspex/config.yaml`.
|
|
137
|
+
|
|
138
|
+
Four security gates ignore all of these by design: `env-vault-guard`, `research-method-guard`,
|
|
139
|
+
`research-protocol-gate` and `git-identity-guard`. They only act on secret writes, built-in
|
|
140
|
+
deep-research skills, unprotocolled web research and git identity changes.
|
|
141
|
+
|
|
142
|
+
## 6. Everyday loop
|
|
143
|
+
|
|
144
|
+
With MCP available: `heyspex_next_on_deck`, `heyspex_claim_spec`, `heyspex_report_progress`,
|
|
145
|
+
`heyspex_submit_for_review`. Without MCP, the `hs` CLI (`npx hs`) covers the same loop; see
|
|
146
|
+
`docs/driving-heyspex-from-copilot.md`.
|
|
147
|
+
|
|
148
|
+
## 7. Troubleshooting
|
|
149
|
+
|
|
150
|
+
- **Every tool call is denied.** Run `hs mode off` to unblock immediately, then capture the exact
|
|
151
|
+
deny text and the hook command it names. If the command still starts with
|
|
152
|
+
`node "$CLAUDE_PROJECT_DIR/...`, the package is old; run `npm install heyspex@latest` and reinstall the plugin.
|
|
153
|
+
- **MCP server does not start.** Copilot documents `${PLUGIN_ROOT}` for its own plugin format, and
|
|
154
|
+
whether it expands `${CLAUDE_PLUGIN_ROOT}` in a Claude-format plugin is unverified. Register the
|
|
155
|
+
server explicitly:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
copilot mcp add heyspex -- node ./node_modules/heyspex/plugins/heyspex/bin/launch-mcp.mjs
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
- **A hook denies with no reason shown.** That is a hook exiting 2 the old way. Report the hook
|
|
162
|
+
name; it should be answering in Copilot's JSON format.
|
|
163
|
+
- **Hooks run twice.** The repo you are in also carries HeySpex rows in its own
|
|
164
|
+
`.claude/settings.json` from `hs install`. Use either the plugin or the install kit (or `.github/hooks`) in one repo,
|
|
165
|
+
not both.
|
|
166
|
+
|
|
167
|
+
## 8. Report back
|
|
168
|
+
|
|
169
|
+
State the Copilot CLI version, the output of `copilot plugin list`, the result of the three checks
|
|
170
|
+
in section 4, and the exact text of any deny or MCP error.
|
|
171
|
+
|
|
172
|
+
## Status of this document
|
|
173
|
+
|
|
174
|
+
The install commands come from GitHub's plugin reference, and the hook behaviour was verified by
|
|
175
|
+
replaying Copilot-shaped payloads through the registered commands, not by a live Copilot session.
|
|
176
|
+
The first agent that completes section 4 is the real test. Fix history: diagnose HS-20SW and
|
|
177
|
+
capture HS-HNO1 (2026-10-16).
|