@hegemonart/get-design-done 1.58.1 → 1.59.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.
@@ -4,15 +4,15 @@
4
4
  "name": "hegemonart"
5
5
  },
6
6
  "metadata": {
7
- "description": "Get Design Done — 5-stage agent-orchestrated design pipeline (Brief → Explore → Plan → Design → Verify) for AI coding agents. 61 agents, 94 skills, 42 connection integrations, two MCP servers, opt-in SQLite state backbone, bidirectional Figma write-back, and a reflector-driven self-improvement loop. Cross-runtime install for Claude Code, Codex, Cursor, OpenCode, Gemini, and more.",
8
- "version": "1.58.1"
7
+ "description": "Get Design Done — 5-stage agent-orchestrated design pipeline (Brief → Explore → Plan → Design → Verify) for AI coding agents. 61 agents, 95 skills, 42 connection integrations, two MCP servers, opt-in SQLite state backbone, bidirectional Figma write-back, and a reflector-driven self-improvement loop. Cross-runtime install for Claude Code, Codex, Cursor, OpenCode, Gemini, and more.",
8
+ "version": "1.59.1"
9
9
  },
10
10
  "plugins": [
11
11
  {
12
12
  "name": "get-design-done",
13
13
  "source": "./",
14
- "description": "Agent-orchestrated 5-stage design pipeline (Brief → Explore → Plan → Design → Verify) for AI coding agents. 61 specialized agents, 94 skills, 42 connection integrations (Figma, Refero, Preview, Storybook, Chromatic, Graphify, Linear, Jira, Notion, …), bidirectional Figma write-back, queryable intel store, opt-in SQLite state backbone, and a reflector-driven self-improvement loop. Two MCP servers (gdd-state for typed STATE mutators, gdd-mcp for 13 read-only project-priming tools), tier-aware routing with cost telemetry, and defense-in-depth hooks (protected paths, MCP circuit breaker, injection scanner, budget enforcer). Cross-runtime install for Claude Code, Codex, Cursor, OpenCode, Gemini, Copilot, and more.",
15
- "version": "1.58.1",
14
+ "description": "Agent-orchestrated 5-stage design pipeline (Brief → Explore → Plan → Design → Verify) for AI coding agents. 61 specialized agents, 95 skills, 42 connection integrations (Figma, Refero, Preview, Storybook, Chromatic, Graphify, Linear, Jira, Notion, …), bidirectional Figma write-back, queryable intel store, opt-in SQLite state backbone, and a reflector-driven self-improvement loop. Two MCP servers (gdd-state for typed STATE mutators, gdd-mcp for 13 read-only project-priming tools), tier-aware routing with cost telemetry, and defense-in-depth hooks (protected paths, MCP circuit breaker, injection scanner, budget enforcer). Cross-runtime install for Claude Code, Codex, Cursor, OpenCode, Gemini, Copilot, and more.",
15
+ "version": "1.59.1",
16
16
  "author": {
17
17
  "name": "hegemonart"
18
18
  },
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "get-design-done",
3
3
  "short_name": "gdd",
4
- "version": "1.58.1",
5
- "description": "Agent-orchestrated 5-stage design pipeline (Brief → Explore → Plan → Design → Verify) for AI coding agents. 61 specialized agents, 94 skills, 42 connection integrations (Figma, Refero, Preview, Storybook, Chromatic, Graphify, Linear, Jira, Notion, …), bidirectional Figma write-back, queryable intel store for O(1) design-surface lookups, opt-in SQLite state backbone, and a reflector-driven self-improvement loop. Two MCP servers (`gdd-state` for typed STATE mutators, `gdd-mcp` for 13 read-only project-priming tools), tier-aware agent routing with cost telemetry, defense-in-depth hooks (protected paths, MCP circuit breaker, injection scanner, budget enforcer), and a cross-runtime install layer for Claude Code, Codex, Cursor, OpenCode, Gemini, Copilot, and more.",
4
+ "version": "1.59.1",
5
+ "description": "Agent-orchestrated 5-stage design pipeline (Brief → Explore → Plan → Design → Verify) for AI coding agents. 61 specialized agents, 95 skills, 42 connection integrations (Figma, Refero, Preview, Storybook, Chromatic, Graphify, Linear, Jira, Notion, …), bidirectional Figma write-back, queryable intel store for O(1) design-surface lookups, opt-in SQLite state backbone, and a reflector-driven self-improvement loop. Two MCP servers (`gdd-state` for typed STATE mutators, `gdd-mcp` for 13 read-only project-priming tools), tier-aware agent routing with cost telemetry, defense-in-depth hooks (protected paths, MCP circuit breaker, injection scanner, budget enforcer), and a cross-runtime install layer for Claude Code, Codex, Cursor, OpenCode, Gemini, Copilot, and more.",
6
6
  "author": {
7
7
  "name": "hegemonart",
8
8
  "url": "https://github.com/hegemonart"
@@ -56,5 +56,19 @@
56
56
  ],
57
57
  "skills": [
58
58
  "./skills/"
59
- ]
59
+ ],
60
+ "mcpServers": {
61
+ "gdd-mcp": {
62
+ "command": "node",
63
+ "args": [
64
+ "${CLAUDE_PLUGIN_ROOT}/bin/gdd-mcp"
65
+ ]
66
+ },
67
+ "gdd-state": {
68
+ "command": "node",
69
+ "args": [
70
+ "${CLAUDE_PLUGIN_ROOT}/bin/gdd-state-mcp"
71
+ ]
72
+ }
73
+ }
60
74
  }
package/CHANGELOG.md CHANGED
@@ -4,6 +4,38 @@ All notable changes to get-design-done are documented here. Versions follow [sem
4
4
 
5
5
  ---
6
6
 
7
+ ## [1.59.1] - 2026-06-04
8
+
9
+ First point release of the **v1.59 "Audit Closeout & Honesty Pass"** milestone. The two bundled MCP servers now come up for users automatically, plus the cheapest correctness/honesty fixes.
10
+
11
+ ### MCP servers register automatically on Claude Code
12
+
13
+ The two bundled MCP servers - `gdd-state` (typed STATE mutators) and `gdd-mcp` (read-only project-priming tools) - are now declared under `mcpServers` in `.claude-plugin/plugin.json`, so a fresh Claude Code marketplace install exposes both servers' tools with no manual `--register-mcp` step. They launch through the plugin-local `bin/` trampolines via `${CLAUDE_PLUGIN_ROOT}`, so the git-clone install path works without `npm install`.
14
+
15
+ ### Added
16
+
17
+ - **`/gdd:bandit-reset`** - a confirm-then-reset maintenance skill for the bandit posterior (`.design/telemetry/posterior.json`): backs the file up to `posterior.json.bak`, then clears it to a fresh envelope. The mutation companion to the read-only `/gdd:bandit-status`. Resolves the previously-dangling `/gdd:bandit-reset` reference. (Skill count 94 → 95.)
18
+
19
+ ### Fixed
20
+
21
+ - **Installer parity** - `get-design-done --register-mcp` now registers BOTH `gdd-mcp` and `gdd-state` for Claude Code and Codex (previously `gdd-mcp` only). `--no-register-mcp` is unchanged.
22
+ - **MCP launch warning** - the servers no longer print a `MODULE_TYPELESS_PACKAGE_JSON` warning on startup (suppressed in the dev/source launch path; the compiled npm-install path is unaffected).
23
+ - **`gdd-sdk audit`** now degrades gracefully with no active cycle (no `.design/STATE.md`): it prints a "no active cycle" notice, runs the static checks, and exits 0 instead of throwing.
24
+ - **Dead path references** - repointed stale `scripts/mcp-servers/...` and `scripts/lib/{gdd-state,event-stream,gdd-errors}/...` references (relocated to `sdk/...` in v1.33.0) to their live locations, including a broken `claude mcp add` command in the `gdd-state` connection doc.
25
+
26
+ ### Changed
27
+
28
+ - Removed two dead npm scripts (`typecheck:session-runner`, `validate:skill-surface`) and pointed the `gdd-sdk` script at the Windows-safe `bin/gdd-sdk` trampoline.
29
+ - Regenerated `reference/schemas/generated.d.ts` from source schemas.
30
+
31
+ ### Breaking changes
32
+
33
+ None.
34
+
35
+ 5,013/5,013 tests pass.
36
+
37
+ ---
38
+
7
39
  ## [1.58.1] - 2026-06-04
8
40
 
9
41
  ### Hotfix - restore committed skills/ for Claude Code marketplace install
@@ -1828,7 +1860,7 @@ The `gsd-build/get-shit-done` rug-pull in May 2026 (TÂCHES drained $GSD Solana
1828
1860
  - **`.design/graph/`** replaces upstream's `.planning/graphs/` location (per D-02 - aligns with the rest of GDD's `.design/` artifact convention).
1829
1861
  - **`connections/graphify.md`** rewritten for native CLI (no external `graphifyy` dependency).
1830
1862
  - **`reference/start-interview.md`** updated to reference `/gdd:discuss` (our equivalent) instead of `/gsd-discuss-phase`.
1831
- - **`README.md`** at the `gsd-build/get-shit-done (MIT see NOTICE)` citation gains the redux-pointer parenthetical "(now archived; community continuation at `open-gsd/get-shit-done-redux`)". Citation preserved verbatim - only annotated for reader clarity.
1863
+ - **`README.md`** at the `gsd-build/get-shit-done (MIT - see NOTICE)` citation gains the redux-pointer parenthetical "(now archived; community continuation at `open-gsd/get-shit-done-redux`)". Citation preserved verbatim - only annotated for reader clarity.
1832
1864
  - **Graphify enable/disable state** (D-09) lives in `.design/config.json` at `{ "graphify": { "enabled": bool } }`. Read directly by `gdd-graph` via fs; no `config-set` / `config-get` CLI subcommand.
1833
1865
 
1834
1866
  ### Removed
@@ -1858,7 +1890,7 @@ The `gsd-build/get-shit-done` rug-pull in May 2026 (TÂCHES drained $GSD Solana
1858
1890
 
1859
1891
  ### Attribution preservation
1860
1892
 
1861
- Phase 27 / Phase 28.5 / Phase 28.7 attribution subsections in `NOTICE` are preserved verbatim per D-06. The architectural ports they describe are historical MIT-licensed code transplants; this release removes a runtime touchpoint, **NOT** a historical port. The `gsd-build/get-shit-done (MIT see NOTICE)` citation in `README.md` is preserved verbatim; only the redux-pointer parenthetical was added.
1893
+ Phase 27 / Phase 28.5 / Phase 28.7 attribution subsections in `NOTICE` are preserved verbatim per D-06. The architectural ports they describe are historical MIT-licensed code transplants; this release removes a runtime touchpoint, **NOT** a historical port. The `gsd-build/get-shit-done (MIT - see NOTICE)` citation in `README.md` is preserved verbatim; only the redux-pointer parenthetical was added.
1862
1894
 
1863
1895
  ---
1864
1896
 
@@ -1880,7 +1912,7 @@ Decimal sub-phase building on Phase 30's `/gdd:report-issue` triage gate. Expand
1880
1912
  ### Changed
1881
1913
 
1882
1914
  - **Reflector capability-gap aggregator** (`scripts/lib/reflector-capability-gap-aggregator.cjs`) - adds lazy-loaded `proposeKfmDraftsForClusters(clusters, options)` export that invokes the KFM proposer as an additional pass after Phase 29 aggregation. Phase 29's existing 5 proposal classes are untouched (additive).
1883
- - **Authority-watcher agent prompt** (`agents/design-authority-watcher.md`) - gains a new `Step 7.5 Emit kfm-candidate events` section documenting the whitelist patterns + payload shape. Phase 13.2's existing fetch/diff/classify/write loop is unchanged.
1915
+ - **Authority-watcher agent prompt** (`agents/design-authority-watcher.md`) - gains a new `Step 7.5 - Emit kfm-candidate events` section documenting the whitelist patterns + payload shape. Phase 13.2's existing fetch/diff/classify/write loop is unchanged.
1884
1916
  - **OFF_CADENCE_VERSIONS** (`tests/semver-compare.test.cjs`) - registers `'1.30.5'` per Phase 29/30 precedent.
1885
1917
 
1886
1918
  ### Documentation
@@ -3345,7 +3377,7 @@ Closes two unrelated risks before the Phase 15–19 reference-library expansion
3345
3377
  **Safety hooks**
3346
3378
  - `hooks/gdd-bash-guard.js` - PreToolUse:Bash guard. 45 dangerous-pattern regexes across 10 families (filesystem destruction, permission escalation, pipe-to-shell, git destruction, system mutation, process nuking, credential exfil, shell obfuscation, path traversal, npm/docker/firewall abuse). `scripts/lib/dangerous-patterns.cjs` normalizes Unicode NFKC + strips ANSI escapes + strips zero-width / bidi overrides before matching so obfuscated attacks (`rm\u200B -rf /`, bidi overrides, hex-encoded `\x72\x6d\x20\x2d\x72\x66`) fail closed.
3347
3379
  - `hooks/gdd-protected-paths.js` + `reference/protected-paths.default.json` - PreToolUse:Edit|Write|Bash guard blocking mutation of `reference/**`, `skills/**`, `commands/**`, `hooks/**`, `.design/archive/**`, `.design/config.json`, `.design/telemetry/**`, `.git/**`, both plugin manifests. User additions in `.design/config.json.protected_paths` MERGE into the default list - users cannot reduce the default-protected set. `scripts/lib/glob-match.cjs` ships a dependency-free `**` glob matcher.
3348
- - `scripts/lib/blast-radius.cjs` - `estimate({touchedPaths, diffStats})` + `estimateMCPCalls({toolCalls})` preflight called by `design-executor` before the first Edit/Write of each task. Defaults: `max_files_per_task: 10`, `max_lines_per_task: 400`, `max_mcp_calls_per_task: 30`. Zero-value limits disable that ceiling. `design-executor` gains a new `## Preflight Blast-Radius Check` section.
3380
+ - `scripts/lib/blast-radius.cjs` - `estimate({touchedPaths, diffStats})` + `estimateMCPCalls({toolCalls})` preflight called by `design-executor` before the first Edit/Write of each task. Defaults: `max_files_per_task: 10`, `max_lines_per_task: 400`, `max_mcp_calls_per_task: 30`. Zero-value limits disable that ceiling. `design-executor` gains a new `## Preflight - Blast-Radius Check` section.
3349
3381
 
3350
3382
  **Injection-scanner extension**
3351
3383
  - `scripts/injection-patterns.cjs` extended from 7 to 22 patterns: classic prompt-injection verbs (incl. `forget previous`), **invisible-Unicode** (zero-width, BOM, bidi overrides), **HTML-comment instruction hijacks** (`<!-- system: …`, hidden divs/spans, zero-font-size tricks), **secret-exfil triggers** (`curl $OPENAI_API_KEY`, `cat .env`, `tar ~ | nc`, `process.env._KEY fetch`, SSH private-key reads). Single source of truth consumed by `hooks/gdd-read-injection-scanner.js`.
@@ -3452,7 +3484,7 @@ Cherry-picked from `c11cd7b` on `claude/upbeat-fermi-199627` - the Figma MCP fix
3452
3484
 
3453
3485
  - **URL entry point**: detect `https://api.anthropic.com/v1/design/h/<hash>` in agent prompt (native "Send to local coding agent" flow); `WebFetch` with `Content-Type` routing - HTML parsed directly, ZIP downloaded and extracted
3454
3486
  - **ZIP bundle**: extract to `.design/handoff/`, find primary HTML + readme, parse normally, clean up after
3455
- - **PDF format**: `pdftotext` text extraction; grep for token values; all decisions tagged `(tentative text-only)` since no CSS is present
3487
+ - **PDF format**: `pdftotext` text extraction; grep for token values; all decisions tagged `(tentative - text-only)` since no CSS is present
3456
3488
  - **PPTX format**: slide XML text extraction (`ppt/slides/*.xml`); same tentative-only tagging as PDF
3457
3489
  - Updated synthesizer parsing algorithm step 1 with format dispatch before parsing
3458
3490
  - Updated probe pattern: URL detection takes priority over file path lookup
package/README.md CHANGED
@@ -307,7 +307,7 @@ Targets 50–70% per-task token-cost reduction with no quality-floor regression.
307
307
 
308
308
  ## Commands
309
309
 
310
- GDD ships 94 skills. The most common ones are below; for the full reference see [SKILL.md](SKILL.md).
310
+ GDD ships 95 skills. The most common ones are below; for the full reference see [SKILL.md](SKILL.md).
311
311
 
312
312
  ### Core Pipeline
313
313
 
package/SKILL.md CHANGED
@@ -99,6 +99,7 @@ Each stage produces artifacts in `.design/` inside the current project.
99
99
  | `quality-gate` | `get-design-done:quality-gate` | Phase 25 - parallel lint/type/test/visual command runner; classifies failures via quality-gate-runner agent |
100
100
  | `turn-closeout` | `get-design-done:turn-closeout` | Phase 25 - Stop-hook mirror skill; finalizes per-turn STATE blocks and emits closeout events |
101
101
  | `bandit-status` | `get-design-done:bandit-status` | Phase 27.5 - read-only diagnostic surface for the bandit posterior; per-(agent, bin, delegate, tier) snapshots (alpha, beta, mean, stddev, count, last-used). Use `/gdd:bandit-reset` to mutate. |
102
+ | `bandit-reset [--yes]` | `get-design-done:bandit-reset` | Phase 23.5 - confirm-then-reset mutation companion to `bandit-status`; backs up `.design/telemetry/posterior.json` to `posterior.json.bak`, then clears it to a fresh empty envelope so the next pull rebootstraps from informed priors. |
102
103
  | `openrouter-status [--refresh]` | `get-design-done:gdd-openrouter-status` | Phase 33.6 - read-only OpenRouter catalog + tier-mapping diagnostic; surfaces catalog freshness (vs 24h TTL), last-fetch, resolved opus/sonnet/haiku → model mappings, per-tier preview. `--refresh` re-fetches (needs `OPENROUTER_API_KEY`). |
103
104
  | `peers` | `get-design-done:peers` | Phase 27 - `/gdd:peers` capability matrix command; shows installed peer-CLIs (codex/gemini/cursor/copilot/qwen), allowlist status, claimed roles, posterior delta vs local |
104
105
  | `peer-cli-customize` | `get-design-done:peer-cli-customize` | Phase 27 - rewire role→peer mappings on a per-agent basis (edits frontmatter `delegate_to:` directly) |
package/bin/gdd-mcp CHANGED
@@ -49,7 +49,18 @@ const useCompiled = fs.existsSync(compiled);
49
49
  const entry = useCompiled ? compiled : source;
50
50
  const nodeArgs = useCompiled
51
51
  ? [entry, ...process.argv.slice(2)]
52
- : ['--experimental-strip-types', entry, ...process.argv.slice(2)];
52
+ : [
53
+ // Dev/source path type-strips the raw .ts. The .ts entry has no sibling
54
+ // package.json "type", so Node would emit a one-time
55
+ // MODULE_TYPELESS_PACKAGE_JSON warning. Adding {"type":"module"} is NOT a
56
+ // fix: it only relocates the warning to transitive .ts imports AND breaks
57
+ // the esbuild-CJS compiled path below. Suppress that one cosmetic warning
58
+ // for the server process; the compiled path needs no flag. (Phase 59.1 A4)
59
+ '--disable-warning=MODULE_TYPELESS_PACKAGE_JSON',
60
+ '--experimental-strip-types',
61
+ entry,
62
+ ...process.argv.slice(2),
63
+ ];
53
64
 
54
65
  const child = spawn(process.execPath, nodeArgs, {
55
66
  stdio: 'inherit',
package/bin/gdd-state-mcp CHANGED
@@ -49,7 +49,18 @@ const useCompiled = fs.existsSync(compiled);
49
49
  const entry = useCompiled ? compiled : source;
50
50
  const nodeArgs = useCompiled
51
51
  ? [entry, ...process.argv.slice(2)]
52
- : ['--experimental-strip-types', entry, ...process.argv.slice(2)];
52
+ : [
53
+ // Dev/source path type-strips the raw .ts. The .ts entry has no sibling
54
+ // package.json "type", so Node would emit a one-time
55
+ // MODULE_TYPELESS_PACKAGE_JSON warning. Adding {"type":"module"} is NOT a
56
+ // fix: it only relocates the warning to transitive .ts imports AND breaks
57
+ // the esbuild-CJS compiled path below. Suppress that one cosmetic warning
58
+ // for the server process; the compiled path needs no flag. (Phase 59.1 A4)
59
+ '--disable-warning=MODULE_TYPELESS_PACKAGE_JSON',
60
+ '--experimental-strip-types',
61
+ entry,
62
+ ...process.argv.slice(2),
63
+ ];
53
64
 
54
65
  const child = spawn(process.execPath, nodeArgs, {
55
66
  stdio: 'inherit',
@@ -2,7 +2,7 @@
2
2
 
3
3
  This file is the connection specification for the `gdd-state` MCP server within the get-design-done pipeline. `gdd-state` is a **local stdio MCP server** that ships with the plugin. It exposes 11 typed tools for reading and mutating `.design/STATE.md` and emits typed telemetry events on every successful mutation. Starting in Phase 20+, `gdd-state` is the **sole mutation surface** for STATE.md — stage SKILLs stop using `Read+regex+Write` and call these tools instead.
4
4
 
5
- Unlike the remote/desktop connections (Figma, Refero, Preview, …), `gdd-state` is an **internal** connection: it does not reach out to any external service. It wraps the existing `scripts/lib/gdd-state/` module (see Plans 20-01, 20-02, 20-04) and emits events via `scripts/lib/event-stream/` (Plan 20-06). Every mutation tool emits a `state.mutation` event; `transition_stage` additionally emits `state.transition` on both pass and gate-veto.
5
+ Unlike the remote/desktop connections (Figma, Refero, Preview, …), `gdd-state` is an **internal** connection: it does not reach out to any external service. It wraps the existing `sdk/state/` module (see Plans 20-01, 20-02, 20-04) and emits events via `sdk/event-stream/` (Plan 20-06). Every mutation tool emits a `state.mutation` event; `transition_stage` additionally emits `state.transition` on both pass and gate-veto.
6
6
 
7
7
  ---
8
8
 
@@ -10,7 +10,7 @@ Unlike the remote/desktop connections (Figma, Refero, Preview, …), `gdd-state`
10
10
 
11
11
  **Prerequisites:**
12
12
 
13
- - The `@hegemonart/get-design-done` plugin installed (the server script ships in `scripts/mcp-servers/gdd-state/`).
13
+ - The `@hegemonart/get-design-done` plugin installed (the server script ships in `sdk/mcp/gdd-state/`).
14
14
  - Node 22+ with `--experimental-strip-types` (the server is a TypeScript file run directly via strip-types — no build step).
15
15
 
16
16
  ### Option A — Project-scoped install (dev repo)
@@ -18,7 +18,7 @@ Unlike the remote/desktop connections (Figma, Refero, Preview, …), `gdd-state`
18
18
  For local development against the plugin source tree:
19
19
 
20
20
  ```
21
- claude mcp add gdd-state --transport stdio "node --experimental-strip-types ./scripts/mcp-servers/gdd-state/server.ts"
21
+ claude mcp add gdd-state --transport stdio "node --experimental-strip-types ./sdk/mcp/gdd-state/server.ts"
22
22
  ```
23
23
 
24
24
  ### Option B — Plugin-installed, global resolution
@@ -26,7 +26,7 @@ claude mcp add gdd-state --transport stdio "node --experimental-strip-types ./sc
26
26
  When the plugin is installed globally via `npm i -g @hegemonart/get-design-done`:
27
27
 
28
28
  ```
29
- claude mcp add gdd-state --transport stdio "node --experimental-strip-types $(npm root -g)/@hegemonart/get-design-done/scripts/mcp-servers/gdd-state/server.ts"
29
+ claude mcp add gdd-state --transport stdio "node --experimental-strip-types $(npm root -g)/@hegemonart/get-design-done/sdk/mcp/gdd-state/server.ts"
30
30
  ```
31
31
 
32
32
  Restart the Claude Code session after install.
@@ -105,7 +105,7 @@ or
105
105
  }
106
106
  ```
107
107
 
108
- `kind` is one of `validation`, `state_conflict`, `operation_failed`, `unknown` — matching the GDDError taxonomy in `scripts/lib/gdd-errors/`. Callers branch on `kind` to decide whether to retry, surface to the operator, or fall back. Full Draft-07 schemas live at `scripts/mcp-servers/gdd-state/schemas/*.schema.json` and the combined manifest is at `reference/schemas/mcp-gdd-state-tools.schema.json`.
108
+ `kind` is one of `validation`, `state_conflict`, `operation_failed`, `unknown` — matching the GDDError taxonomy in `sdk/errors/`. Callers branch on `kind` to decide whether to retry, surface to the operator, or fall back. Full Draft-07 schemas live at `sdk/mcp/gdd-state/schemas/*.schema.json` and the combined manifest is at `reference/schemas/mcp-gdd-state-tools.schema.json`.
109
109
 
110
110
  **Scoped out of Phase 20:**
111
111
 
@@ -131,10 +131,10 @@ Stage SKILL rewrites in Plans 20-07 through 20-11 will switch each skill from `R
131
131
 
132
132
  ## Fallback Behavior
133
133
 
134
- If the `gdd-state` MCP is **not_configured** (ToolSearch returned empty), skills fall back to the pre-Phase-20 path by importing the `scripts/lib/gdd-state/` module directly:
134
+ If the `gdd-state` MCP is **not_configured** (ToolSearch returned empty), skills fall back to the pre-Phase-20 path by importing the `sdk/state/` module directly:
135
135
 
136
136
  ```ts
137
- import { read, mutate, transition } from '@hegemonart/get-design-done/scripts/lib/gdd-state/index.js';
137
+ import { read, mutate, transition } from '@hegemonart/get-design-done/sdk/state/index.js';
138
138
  ```
139
139
 
140
140
  This path bypasses the event stream (no `state.mutation` or `state.transition` events are emitted) but preserves mutation safety through the same lockfile + atomic-rename protocol. It exists for two reasons:
@@ -171,7 +171,7 @@ preview: available
171
171
 
172
172
  ## Caveats and Pitfalls
173
173
 
174
- - **Do not run multiple `gdd-state` instances against the same `.design/`.** The module's lockfile (see `scripts/lib/gdd-state/lockfile.ts`) guarantees per-process safety, but spawning two separate MCP servers against the same STATE.md wastes locks and produces duplicate events. One server per Claude Code session is the design contract.
174
+ - **Do not run multiple `gdd-state` instances against the same `.design/`.** The module's lockfile (see `sdk/state/lockfile.ts`) guarantees per-process safety, but spawning two separate MCP servers against the same STATE.md wastes locks and produces duplicate events. One server per Claude Code session is the design contract.
175
175
 
176
176
  - **Event ordering follows successful mutation, not request receipt.** `appendEvent()` is called only after `mutate()` returns successfully. A failed mutation produces a `{success:false, error}` response with no event emitted. The `state.transition` event is a deliberate exception: gate vetoes emit `state.transition` with `pass:false` because gate failures are themselves observable telemetry.
177
177
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hegemonart/get-design-done",
3
- "version": "1.58.1",
3
+ "version": "1.59.1",
4
4
  "description": "A design-quality pipeline for AI coding agents: brief, explore, plan, design, and verify UI work against your design system.",
5
5
  "author": "Hegemon",
6
6
  "homepage": "https://github.com/hegemonart/get-design-done",
@@ -94,11 +94,9 @@
94
94
  "scan:outbound": "node scripts/scan-outbound-network.cjs",
95
95
  "scan:ws-bind": "node scripts/scan-ws-bind.cjs",
96
96
  "test:size-budget": "node --test test/suite/agent-size-budget.test.cjs",
97
- "validate:skill-surface": "node --test test/suite/skill-surface-sync.test.cjs",
98
97
  "release:extract-changelog": "node scripts/extract-changelog-section.cjs",
99
98
  "verify:version-sync": "node scripts/verify-version-sync.cjs",
100
- "typecheck:session-runner": "tsc --noEmit",
101
- "gdd-sdk": "node --experimental-strip-types sdk/cli/index.ts"
99
+ "gdd-sdk": "node bin/gdd-sdk"
102
100
  },
103
101
  "devDependencies": {
104
102
  "@types/node": "^25.6.0",
@@ -29,7 +29,7 @@ it by adding to `~/.codex/config.toml`:
29
29
  [[mcp_servers]]
30
30
  name = "gdd-state"
31
31
  command = "node"
32
- args = ["--experimental-strip-types", "<pkg-root>/scripts/mcp-servers/gdd-state/server.ts"]
32
+ args = ["--experimental-strip-types", "<pkg-root>/sdk/mcp/gdd-state/server.ts"]
33
33
  ```
34
34
 
35
35
  All 11 tools exposed by the server appear as `mcp__gdd_state__*` in Codex.
@@ -30,7 +30,7 @@ it by adding to `~/.gemini/settings.json`:
30
30
  "mcpServers": {
31
31
  "gdd-state": {
32
32
  "command": "node",
33
- "args": ["--experimental-strip-types", "<pkg-root>/scripts/mcp-servers/gdd-state/server.ts"]
33
+ "args": ["--experimental-strip-types", "<pkg-root>/sdk/mcp/gdd-state/server.ts"]
34
34
  }
35
35
  }
36
36
  }
@@ -223,12 +223,12 @@ on them fail with a clear connection-refused class of error.
223
223
  id: KFM-008
224
224
  pattern: '(MCP.*(unreachable|ECONNREFUSED|not connected)|mcp.*server.*not.*running|connection refused.*ws://)'
225
225
  diagnosis: 'An MCP server (Figma, GDD-state, or GDD-tools) is not reachable; the plugin cannot route tool calls through it.'
226
- remedy: 'Start the relevant MCP server (see scripts/mcp-servers/) and confirm `claude mcp list` shows it as connected.'
226
+ remedy: 'Start the relevant MCP server (see sdk/mcp/) and confirm `claude mcp list` shows it as connected.'
227
227
  severity: medium
228
228
  propose_report: true
229
229
  symptom: 'A command depending on an MCP server fails with `MCP unreachable`, `ECONNREFUSED`, `mcp server not running`, or `connection refused ws://...`. Tool calls routed through MCP never reach their target.'
230
230
  root_cause: 'The local MCP transport (WebSocket or stdio bridge) is not bound. The MCP server process is either not started, crashed silently, or is listening on a different port than the client expects.'
231
- fix: '1) Run `claude mcp list` and check the status column for the failing server. 2) If it shows `disconnected`, start it: `scripts/mcp-servers/<name>.cjs` or the launcher script for that server. 3) Confirm the port matches the value in `mcp.json` or `.mcp.json`. 4) Re-run the failing command. If the server crashes on start, this is a maintainer report path (propose_report:true).'
231
+ fix: '1) Run `claude mcp list` and check the status column for the failing server. 2) If it shows `disconnected`, start it: `sdk/mcp/<name>/server.ts` or the launcher script for that server. 3) Confirm the port matches the value in `mcp.json` or `.mcp.json`. 4) Re-run the failing command. If the server crashes on start, this is a maintainer report path (propose_report:true).'
232
232
  related_phases: [27.7, 33.6]
233
233
  first_observed_cycle: 'pre-30.5'
234
234
  ```
@@ -502,7 +502,7 @@
502
502
  "path": "reference/schemas/mcp-gdd-tools.schema.json",
503
503
  "type": "schema",
504
504
  "phase": 27.7,
505
- "description": "Draft-07 input/output schemas for the 12 read-only tools in scripts/mcp-servers/gdd-mcp/ (gdd-mcp MCP server)"
505
+ "description": "Draft-07 input/output schemas for the 12 read-only tools in sdk/mcp/gdd-mcp/ (gdd-mcp MCP server)"
506
506
  },
507
507
  {
508
508
  "name": "meta-rules",
@@ -160,6 +160,108 @@ export interface DesignConfigJson {
160
160
 
161
161
  export type ConfigSchema = DesignConfigJson;
162
162
 
163
+ // ---- design-context.schema.json ----
164
+ /**
165
+ * The canonical typed knowledge graph of a design system, persisted at .design/context-graph.json. Nodes are design entities (tokens, components, screens, patterns); edges are typed relationships between them (uses-token, composes, transitions-to). Built by a two-phase mapper: a deterministic extract pass emits node/edge skeletons, then an LLM summary pass fills each node summary. Validated structurally by scripts/validate-design-context.cjs and queried by scripts/lib/design-context-query.cjs.
166
+ */
167
+ export interface DesignContextGraph {
168
+ /**
169
+ * Schema version of this graph document (e.g. "52.0").
170
+ */
171
+ schema_version: string;
172
+ /**
173
+ * ISO-8601 timestamp the graph was last assembled (optional).
174
+ */
175
+ generated_at?: string;
176
+ /**
177
+ * All design entities in the graph. Node ids must be unique.
178
+ */
179
+ nodes: Node[];
180
+ /**
181
+ * All typed relationships. Every source/target must resolve to a node id.
182
+ */
183
+ edges: Edge[];
184
+ [k: string]: unknown;
185
+ }
186
+ export interface Node {
187
+ /**
188
+ * Stable unique identifier for the node (referenced by edge source/target).
189
+ */
190
+ id: string;
191
+ /**
192
+ * The kind of design entity this node represents.
193
+ */
194
+ type:
195
+ | 'token'
196
+ | 'component'
197
+ | 'variant'
198
+ | 'state'
199
+ | 'motion-fragment'
200
+ | 'a11y-pattern'
201
+ | 'screen'
202
+ | 'layer'
203
+ | 'pattern'
204
+ | 'anti-pattern';
205
+ /**
206
+ * Human-readable name of the entity.
207
+ */
208
+ name: string;
209
+ /**
210
+ * One-line LLM-authored description of what the entity is and does. A stub summary (empty or identical to name) is flagged by the validator as a soft warning.
211
+ */
212
+ summary: string;
213
+ /**
214
+ * Controlled-vocabulary tags grouping the node by concern (see reference/design-context-tag-vocab.md). Unknown tags are a soft warning, not a hard error.
215
+ */
216
+ tags?: string[];
217
+ /**
218
+ * Coarse complexity bucket for the entity.
219
+ */
220
+ complexity: 'simple' | 'moderate' | 'complex';
221
+ /**
222
+ * Optional finer classification. For token nodes one of color/spacing/typography/radius/shadow; for layer nodes one of Atomic/Molecular/Organism/Template. Free-form for other node types.
223
+ */
224
+ subtype?: string;
225
+ [k: string]: unknown;
226
+ }
227
+ export interface Edge {
228
+ /**
229
+ * Node id the edge originates from.
230
+ */
231
+ source: string;
232
+ /**
233
+ * Node id the edge points to.
234
+ */
235
+ target: string;
236
+ /**
237
+ * The kind of relationship between source and target.
238
+ */
239
+ type:
240
+ | 'uses-token'
241
+ | 'composes'
242
+ | 'extends'
243
+ | 'transitions-to'
244
+ | 'depends-on'
245
+ | 'mirrors'
246
+ | 'conflicts-with'
247
+ | 'referenced-by'
248
+ | 'tested-by'
249
+ | 'documented-by'
250
+ | 'consumes-context'
251
+ | 'provides-context';
252
+ /**
253
+ * Whether the relationship reads source-to-target (forward), target-to-source (backward), or both ways (bidirectional).
254
+ */
255
+ direction: 'forward' | 'backward' | 'bidirectional';
256
+ /**
257
+ * Relationship strength in the inclusive range 0..1.
258
+ */
259
+ weight: number;
260
+ [k: string]: unknown;
261
+ }
262
+
263
+ export type DesignContextSchema = DesignContextGraph;
264
+
163
265
  // ---- events.schema.json ----
164
266
  /**
165
267
  * One line of .design/telemetry/events.jsonl — the append-only telemetry stream produced by Plan 20-06. Each event is a single JSON object followed by a newline. See .planning/phases/20-gdd-sdk-foundation/20-06-PLAN.md.
@@ -168,7 +270,7 @@ export type Event = {
168
270
  [k: string]: unknown;
169
271
  } & {
170
272
  /**
171
- * Free-form event type identifier. Pre-registered seeds: state.mutation, state.transition, stage.entered, stage.exited, hook.fired, error, capability_gap, kfm-candidate, router_pick, verify_outcome, rollout_started, rollout_advanced, rollout_stuck, budget_forecast, project_cap_warning, project_cap_halt.
273
+ * Free-form event type identifier. Pre-registered seeds: state.mutation, state.transition, stage.entered, stage.exited, hook.fired, error, capability_gap, kfm-candidate, router_pick, verify_outcome, rollout_started, rollout_advanced, rollout_stuck, budget_forecast, project_cap_warning, project_cap_halt, live_session_start, live_pick, live_generate, live_accept, live_discard, live_session_end, instinct_emitted, instinct_promoted, instinct_decayed, risk_assessment.
172
274
  */
173
275
  type: string;
174
276
  /**
@@ -266,6 +368,73 @@ export interface AgentInsightLine {
266
368
 
267
369
  export type InsightLineSchema = AgentInsightLine;
268
370
 
371
+ // ---- instinct.schema.json ----
372
+ /**
373
+ * An atomic, confidence-weighted design instinct learned across cycles. Validates the YAML frontmatter object of an instinct unit (see reference/instinct-format.md). Project-scoped units live at <root>/instincts/instincts.json; promoted global units live at ~/.claude/gdd/global-instincts.json. Persisted + queried by scripts/lib/instinct-store.cjs.
374
+ */
375
+ export type InstinctUnit = {
376
+ [k: string]: unknown;
377
+ } & {
378
+ /**
379
+ * Kebab-case stable identifier, e.g. "prefer-token-over-hex". Lowercase letters, digits, single hyphens.
380
+ */
381
+ id: string;
382
+ /**
383
+ * One sentence naming the situation that fires the instinct, e.g. "When a color literal appears in a component, reach for a design token first."
384
+ */
385
+ trigger: string;
386
+ /**
387
+ * Posterior trust in the instinct. Floor 0.3 (a fresh instinct is advisory, never directive); ceiling 0.9 (no instinct is ever certain). TTL decay multiplies this by 0.9 when the instinct goes unsurfaced.
388
+ */
389
+ confidence: number;
390
+ /**
391
+ * Lifecycle stage the instinct applies to, aligned to the Phase 50 lifecycle stages.
392
+ */
393
+ domain: 'intake' | 'explore' | 'decide' | 'build' | 'verify' | 'operate' | 'utility';
394
+ /**
395
+ * project = learned from one repository; global = promoted after the K/M gate across distinct projects.
396
+ */
397
+ scope: 'project' | 'global';
398
+ /**
399
+ * 8-char hex sha of the normalized git origin the instinct was first learned from. Required for project scope; optional for global (a promoted instinct is no longer tied to one origin).
400
+ */
401
+ project_id?: string;
402
+ /**
403
+ * Which producer minted the instinct: a reflection pass, the extract-learnings step, or a direct user assertion.
404
+ */
405
+ source: 'reflection' | 'extract-learnings' | 'user';
406
+ /**
407
+ * How many distinct design cycles have surfaced this instinct. Feeds the K=2 half of the promotion gate.
408
+ */
409
+ cycles_seen?: number;
410
+ /**
411
+ * Set of distinct project ids that have surfaced this instinct. Its length feeds the M=2 half of the promotion gate.
412
+ */
413
+ project_ids?: string[];
414
+ /**
415
+ * ISO date (YYYY-MM-DD) the instinct was first recorded.
416
+ */
417
+ first_seen?: string;
418
+ /**
419
+ * ISO date (YYYY-MM-DD) the instinct was last surfaced. Resets the TTL decay window.
420
+ */
421
+ last_seen?: string;
422
+ /**
423
+ * Beta posterior success weight. Seeded from the Beta(2,8) prior on promotion.
424
+ */
425
+ alpha?: number;
426
+ /**
427
+ * Beta posterior failure weight. Seeded from the Beta(2,8) prior on promotion.
428
+ */
429
+ beta?: number;
430
+ /**
431
+ * Tag recording which prior class seeded the posterior, e.g. "instinct".
432
+ */
433
+ prior_class?: string;
434
+ };
435
+
436
+ export type InstinctSchema = InstinctUnit;
437
+
269
438
  // ---- intel.schema.json ----
270
439
  /**
271
440
  * Shape of intel-store slice files per reference/intel-schema.md. Each slice has a generated timestamp and one array-valued payload key matching the slice name.
@@ -394,6 +563,57 @@ export interface IterationBudget {
394
563
 
395
564
  export type IterationBudgetSchema = IterationBudget;
396
565
 
566
+ // ---- live-session.schema.json ----
567
+ /**
568
+ * A single `/gdd:live` session record persisted at .design/live-sessions/<session-id>.json. Captures the pick -> generate -> accept/discard loop as an append-only event log so a session survives a crash or --resume. Written atomically by scripts/lib/live/session-store.cjs.
569
+ */
570
+ export interface LiveSession {
571
+ /**
572
+ * Schema version of this session record (e.g. "47.0").
573
+ */
574
+ schema_version: string;
575
+ /**
576
+ * Stable id; also the basename of the on-disk file (no path separators).
577
+ */
578
+ session_id: string;
579
+ /**
580
+ * Lifecycle status. Only in_progress sessions are resumable.
581
+ */
582
+ status: 'in_progress' | 'completed' | 'abandoned';
583
+ /**
584
+ * ISO-8601 timestamp the session was created.
585
+ */
586
+ started_at: string;
587
+ /**
588
+ * ISO-8601 timestamp the session was closed; null while in_progress.
589
+ */
590
+ ended_at: string | null;
591
+ /**
592
+ * The page the element was picked from (optional).
593
+ */
594
+ url?: string;
595
+ /**
596
+ * Dev-server descriptor (url/port/command, or a plain string). Free-form by design.
597
+ */
598
+ dev_server?: string | {} | null;
599
+ /**
600
+ * Append-only log of session events, oldest first.
601
+ */
602
+ events: {
603
+ /**
604
+ * Event kind.
605
+ */
606
+ kind: 'pick' | 'generate' | 'accept' | 'discard';
607
+ /**
608
+ * ISO-8601 timestamp the event was recorded.
609
+ */
610
+ at: string;
611
+ [k: string]: unknown;
612
+ }[];
613
+ }
614
+
615
+ export type LiveSessionSchema = LiveSession;
616
+
397
617
  // ---- marketplace.schema.json ----
398
618
  /**
399
619
  * Shape of .claude-plugin/marketplace.json — the plugin marketplace descriptor.
@@ -448,7 +668,7 @@ export type McpBudgetSchema = MCPBudget;
448
668
 
449
669
  // ---- mcp-gdd-state-tools.schema.json ----
450
670
  /**
451
- * Combined manifest of all 11 gdd-state MCP tool input+output schemas (Plan 20-05). Individual tool schemas live under scripts/mcp-servers/gdd-state/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface.
671
+ * Combined manifest of all 11 gdd-state MCP tool input+output schemas (Plan 20-05). Individual tool schemas live under sdk/mcp/gdd-state/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface.
452
672
  */
453
673
  export interface McpGddStateTools {
454
674
  tools: {
@@ -482,11 +702,11 @@ export type McpGddStateToolsSchema = McpGddStateTools;
482
702
 
483
703
  // ---- mcp-gdd-tools.schema.json ----
484
704
  /**
485
- * Combined manifest of all gdd-mcp tool input+output schemas (Plan 27.7-02). Individual tool schemas live under scripts/mcp-servers/gdd-mcp/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface (D-11).
705
+ * Combined manifest of all gdd-mcp tool input+output schemas (Plan 27.7-02). Individual tool schemas live under sdk/mcp/gdd-mcp/schemas/ and the tool handlers reference them; this combined schema exists so downstream validators and codegen can compile a single surface (D-11).
486
706
  */
487
707
  export interface McpGddTools {
488
708
  /**
489
- * Per-tool input/output schemas keyed by tool name. Exactly 12 entries (D-03 hard cap).
709
+ * Per-tool input/output schemas keyed by tool name. Exactly 13 entries (D-03 cap, raised 12 -> 13 in Phase 52 for gdd_context_query).
490
710
  */
491
711
  tools?: {
492
712
  gdd_status?: {
@@ -499,6 +719,22 @@ export interface McpGddTools {
499
719
  blocker_count: number;
500
720
  };
501
721
  };
722
+ gdd_context_query?: {
723
+ input: {
724
+ op: 'nodes' | 'edges' | 'path' | 'consumers-of' | 'unreachable' | 'cycles' | 'coverage';
725
+ type?: string;
726
+ tag?: string;
727
+ from?: string;
728
+ to?: string;
729
+ id?: string;
730
+ };
731
+ output: {
732
+ op: string;
733
+ graph_present: boolean;
734
+ path?: string;
735
+ result: unknown[] | {} | null;
736
+ };
737
+ };
502
738
  gdd_phase_current?: {
503
739
  input: {};
504
740
  output: {