@hegemonart/get-design-done 1.19.6 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +11 -14
- package/.claude-plugin/plugin.json +9 -32
- package/CHANGELOG.md +138 -0
- package/README.md +54 -1
- package/agents/design-reflector.md +13 -0
- package/bin/gdd-sdk +55 -0
- package/connections/connections.md +3 -0
- package/connections/figma.md +2 -0
- package/connections/gdd-state.md +186 -0
- package/hooks/budget-enforcer.ts +716 -0
- package/hooks/context-exhaustion.ts +251 -0
- package/hooks/gdd-read-injection-scanner.ts +172 -0
- package/hooks/hooks.json +3 -3
- package/package.json +32 -51
- package/reference/codex-tools.md +53 -0
- package/reference/config-schema.md +2 -2
- package/reference/error-recovery.md +58 -0
- package/reference/gemini-tools.md +53 -0
- package/reference/registry.json +21 -0
- package/reference/schemas/budget.schema.json +42 -0
- package/reference/schemas/events.schema.json +55 -0
- package/reference/schemas/generated.d.ts +419 -0
- package/reference/schemas/iteration-budget.schema.json +36 -0
- package/reference/schemas/mcp-gdd-state-tools.schema.json +89 -0
- package/reference/schemas/rate-limits.schema.json +31 -0
- package/scripts/aggregate-agent-metrics.ts +282 -0
- package/scripts/codegen-schema-types.ts +149 -0
- package/scripts/e2e/run-headless.ts +514 -0
- package/scripts/lib/cli/commands/audit.ts +382 -0
- package/scripts/lib/cli/commands/init.ts +217 -0
- package/scripts/lib/cli/commands/query.ts +329 -0
- package/scripts/lib/cli/commands/run.ts +656 -0
- package/scripts/lib/cli/commands/stage.ts +468 -0
- package/scripts/lib/cli/index.ts +167 -0
- package/scripts/lib/cli/parse-args.ts +336 -0
- package/scripts/lib/context-engine/index.ts +116 -0
- package/scripts/lib/context-engine/manifest.ts +69 -0
- package/scripts/lib/context-engine/truncate.ts +282 -0
- package/scripts/lib/context-engine/types.ts +59 -0
- package/scripts/lib/discuss-parallel-runner/aggregator.ts +448 -0
- package/scripts/lib/discuss-parallel-runner/discussants.ts +430 -0
- package/scripts/lib/discuss-parallel-runner/index.ts +223 -0
- package/scripts/lib/discuss-parallel-runner/types.ts +184 -0
- package/scripts/lib/error-classifier.cjs +232 -0
- package/scripts/lib/error-classifier.d.cts +44 -0
- package/scripts/lib/event-stream/emitter.ts +88 -0
- package/scripts/lib/event-stream/index.ts +164 -0
- package/scripts/lib/event-stream/types.ts +127 -0
- package/scripts/lib/event-stream/writer.ts +154 -0
- package/scripts/lib/explore-parallel-runner/index.ts +294 -0
- package/scripts/lib/explore-parallel-runner/mappers.ts +290 -0
- package/scripts/lib/explore-parallel-runner/synthesizer.ts +295 -0
- package/scripts/lib/explore-parallel-runner/types.ts +139 -0
- package/scripts/lib/gdd-errors/classification.ts +124 -0
- package/scripts/lib/gdd-errors/index.ts +218 -0
- package/scripts/lib/gdd-state/gates.ts +216 -0
- package/scripts/lib/gdd-state/index.ts +167 -0
- package/scripts/lib/gdd-state/lockfile.ts +232 -0
- package/scripts/lib/gdd-state/mutator.ts +574 -0
- package/scripts/lib/gdd-state/parser.ts +523 -0
- package/scripts/lib/gdd-state/types.ts +179 -0
- package/scripts/lib/harness/detect.ts +90 -0
- package/scripts/lib/harness/index.ts +64 -0
- package/scripts/lib/harness/tool-map.ts +142 -0
- package/scripts/lib/init-runner/index.ts +396 -0
- package/scripts/lib/init-runner/researchers.ts +245 -0
- package/scripts/lib/init-runner/scaffold.ts +224 -0
- package/scripts/lib/init-runner/synthesizer.ts +224 -0
- package/scripts/lib/init-runner/types.ts +143 -0
- package/scripts/lib/iteration-budget.cjs +205 -0
- package/scripts/lib/iteration-budget.d.cts +32 -0
- package/scripts/lib/jittered-backoff.cjs +112 -0
- package/scripts/lib/jittered-backoff.d.cts +38 -0
- package/scripts/lib/lockfile.cjs +177 -0
- package/scripts/lib/lockfile.d.cts +21 -0
- package/scripts/lib/logger/index.ts +251 -0
- package/scripts/lib/logger/sinks.ts +269 -0
- package/scripts/lib/logger/types.ts +110 -0
- package/scripts/lib/pipeline-runner/human-gate.ts +134 -0
- package/scripts/lib/pipeline-runner/index.ts +527 -0
- package/scripts/lib/pipeline-runner/stage-handlers.ts +339 -0
- package/scripts/lib/pipeline-runner/state-machine.ts +144 -0
- package/scripts/lib/pipeline-runner/types.ts +183 -0
- package/scripts/lib/prompt-sanitizer/index.ts +435 -0
- package/scripts/lib/prompt-sanitizer/patterns.ts +173 -0
- package/scripts/lib/rate-guard.cjs +365 -0
- package/scripts/lib/rate-guard.d.cts +38 -0
- package/scripts/lib/session-runner/errors.ts +406 -0
- package/scripts/lib/session-runner/index.ts +715 -0
- package/scripts/lib/session-runner/transcript.ts +189 -0
- package/scripts/lib/session-runner/types.ts +144 -0
- package/scripts/lib/tool-scoping/index.ts +219 -0
- package/scripts/lib/tool-scoping/parse-agent-tools.ts +207 -0
- package/scripts/lib/tool-scoping/stage-scopes.ts +139 -0
- package/scripts/lib/tool-scoping/types.ts +77 -0
- package/scripts/mcp-servers/gdd-state/schemas/add_blocker.schema.json +67 -0
- package/scripts/mcp-servers/gdd-state/schemas/add_decision.schema.json +68 -0
- package/scripts/mcp-servers/gdd-state/schemas/add_must_have.schema.json +68 -0
- package/scripts/mcp-servers/gdd-state/schemas/checkpoint.schema.json +51 -0
- package/scripts/mcp-servers/gdd-state/schemas/frontmatter_update.schema.json +62 -0
- package/scripts/mcp-servers/gdd-state/schemas/get.schema.json +51 -0
- package/scripts/mcp-servers/gdd-state/schemas/probe_connections.schema.json +75 -0
- package/scripts/mcp-servers/gdd-state/schemas/resolve_blocker.schema.json +66 -0
- package/scripts/mcp-servers/gdd-state/schemas/set_status.schema.json +47 -0
- package/scripts/mcp-servers/gdd-state/schemas/transition_stage.schema.json +70 -0
- package/scripts/mcp-servers/gdd-state/schemas/update_progress.schema.json +58 -0
- package/scripts/mcp-servers/gdd-state/server.ts +288 -0
- package/scripts/mcp-servers/gdd-state/tools/add_blocker.ts +72 -0
- package/scripts/mcp-servers/gdd-state/tools/add_decision.ts +89 -0
- package/scripts/mcp-servers/gdd-state/tools/add_must_have.ts +113 -0
- package/scripts/mcp-servers/gdd-state/tools/checkpoint.ts +60 -0
- package/scripts/mcp-servers/gdd-state/tools/frontmatter_update.ts +91 -0
- package/scripts/mcp-servers/gdd-state/tools/get.ts +51 -0
- package/scripts/mcp-servers/gdd-state/tools/index.ts +51 -0
- package/scripts/mcp-servers/gdd-state/tools/probe_connections.ts +73 -0
- package/scripts/mcp-servers/gdd-state/tools/resolve_blocker.ts +84 -0
- package/scripts/mcp-servers/gdd-state/tools/set_status.ts +54 -0
- package/scripts/mcp-servers/gdd-state/tools/shared.ts +194 -0
- package/scripts/mcp-servers/gdd-state/tools/transition_stage.ts +80 -0
- package/scripts/mcp-servers/gdd-state/tools/update_progress.ts +81 -0
- package/scripts/validate-frontmatter.ts +114 -0
- package/scripts/validate-schemas.ts +401 -0
- package/skills/brief/SKILL.md +15 -6
- package/skills/design/SKILL.md +31 -13
- package/skills/explore/SKILL.md +41 -17
- package/skills/health/SKILL.md +15 -4
- package/skills/optimize/SKILL.md +3 -3
- package/skills/pause/SKILL.md +16 -10
- package/skills/plan/SKILL.md +33 -17
- package/skills/progress/SKILL.md +15 -11
- package/skills/resume/SKILL.md +19 -10
- package/skills/settings/SKILL.md +11 -3
- package/skills/todo/SKILL.md +12 -3
- package/skills/verify/SKILL.md +65 -29
- package/hooks/budget-enforcer.js +0 -329
- package/hooks/context-exhaustion.js +0 -127
- package/hooks/gdd-read-injection-scanner.js +0 -39
- package/scripts/aggregate-agent-metrics.js +0 -173
- package/scripts/validate-frontmatter.cjs +0 -68
- package/scripts/validate-schemas.cjs +0 -242
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
"name": "hegemonart"
|
|
5
5
|
},
|
|
6
6
|
"metadata": {
|
|
7
|
-
"description": "Get Design Done — 5-stage agent-orchestrated design pipeline with 9 connections, handoff-first workflow, bidirectional Figma write-back, 22+ specialized agents, queryable knowledge layer (intel store, dependency analysis, learnings extraction), and a self-improvement loop (reflector, frontmatter + budget feedback, global-skills layer).
|
|
8
|
-
"version": "1.
|
|
7
|
+
"description": "Get Design Done — 5-stage agent-orchestrated design pipeline with 9 connections, handoff-first workflow, bidirectional Figma write-back, 22+ specialized agents, queryable knowledge layer (intel store, dependency analysis, learnings extraction), and a self-improvement loop (reflector, frontmatter + budget feedback, global-skills layer). v1.20.0 ships the SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream, and resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) for rate-limit + 429 + context-overflow recovery. Full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows) and release automation (auto-tag + GitHub Release + release-time smoke test).",
|
|
8
|
+
"version": "1.21.0"
|
|
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. 22+ specialized agents, 9 connections (Figma, Refero, Preview, Storybook, Chromatic, Figma Writer, Graphify, Pinterest, Claude Design), Claude Design handoff, bidirectional Figma write-back, and a queryable intel store (.design/intel/) for dependency and learnings queries. Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings.
|
|
15
|
-
"version": "1.
|
|
14
|
+
"description": "Agent-orchestrated 5-stage design pipeline: Brief → Explore → Plan → Design → Verify. 22+ specialized agents, 9 connections (Figma, Refero, Preview, Storybook, Chromatic, Figma Writer, Graphify, Pinterest, Claude Design), Claude Design handoff, bidirectional Figma write-back, and a queryable intel store (.design/intel/) for dependency and learnings queries. Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings. Embeds NNG heuristics, WCAG thresholds, typographic systems, motion framework, and anti-pattern catalog. Ships with a full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows) and release automation. Optimization layer (v1.0.4.1, retroactive): gdd-router + gdd-cache-manager skills, PreToolUse budget-enforcer hook, tier-aware agent frontmatter, lazy checker gates, streaming synthesizer, /gdd:warm-cache + /gdd:optimize commands, and cost telemetry at .design/telemetry/costs.jsonl — targeting 50-70% per-task token-cost reduction with no quality-floor regression. v1.20.0 SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream at .design/telemetry/events.jsonl, resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) with rate-limit + 429 + context-overflow recovery, and TypeScript toolchain.",
|
|
15
|
+
"version": "1.21.0",
|
|
16
16
|
"author": {
|
|
17
17
|
"name": "hegemonart"
|
|
18
18
|
},
|
|
@@ -62,16 +62,13 @@
|
|
|
62
62
|
"cost-optimization",
|
|
63
63
|
"cache-aware",
|
|
64
64
|
"budget",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"form-patterns",
|
|
73
|
-
"data-viz",
|
|
74
|
-
"platforms"
|
|
65
|
+
"headless",
|
|
66
|
+
"cli",
|
|
67
|
+
"codex",
|
|
68
|
+
"gemini",
|
|
69
|
+
"mcp",
|
|
70
|
+
"parallel-agents",
|
|
71
|
+
"agent-sdk"
|
|
75
72
|
]
|
|
76
73
|
}
|
|
77
74
|
]
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "get-design-done",
|
|
3
3
|
"short_name": "gdd",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "Agent-orchestrated 5-stage design pipeline: Brief → Explore → Plan → Design → Verify. 22+ specialized agents, 9 connections (Figma, Refero, Preview, Storybook, Chromatic, Figma Writer, Graphify, Pinterest, Claude Design), handoff-first workflow via Claude Design bundles, bidirectional Figma write-back (annotations, Code Connect), queryable intel store (`.design/intel/`) for O(1) design surface lookups, and self-improvement loop (reflector agent, frontmatter + budget feedback, global-skills layer at `~/.claude/gdd/global-skills/`). Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings, reflect, apply-reflections.
|
|
4
|
+
"version": "1.21.0",
|
|
5
|
+
"description": "Agent-orchestrated 5-stage design pipeline: Brief → Explore → Plan → Design → Verify. 22+ specialized agents, 9 connections (Figma, Refero, Preview, Storybook, Chromatic, Figma Writer, Graphify, Pinterest, Claude Design), handoff-first workflow via Claude Design bundles, bidirectional Figma write-back (annotations, Code Connect), queryable intel store (`.design/intel/`) for O(1) design surface lookups, and self-improvement loop (reflector agent, frontmatter + budget feedback, global-skills layer at `~/.claude/gdd/global-skills/`). Standalone commands: style, darkmode, compare, figma-write, graphify, handoff, analyze-dependencies, skill-manifest, extract-learnings, reflect, apply-reflections. Embeds NNG heuristics, WCAG thresholds, typographic systems, motion framework, and anti-pattern catalog. Ships with a full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows, lint + schema + frontmatter + stale-ref + shellcheck + gitleaks + injection-scan + blocking size-budget) and release automation (auto-tag + GitHub Release + release-time smoke test). Optimization layer (v1.0.4.1, retroactive): gdd-router + gdd-cache-manager skills, PreToolUse budget-enforcer hook, tier-aware agent frontmatter, lazy checker gates, streaming synthesizer, /gdd:warm-cache + /gdd:optimize commands, and cost telemetry at .design/telemetry/costs.jsonl — targeting 50-70% per-task token-cost reduction with no quality-floor regression. v1.20.0 SDK foundation: gdd-state MCP server (11 typed tools), lockfile-safe STATE.md mutations, event stream at .design/telemetry/events.jsonl, resilience primitives (jittered-backoff, rate-guard, error-classifier, iteration-budget) with rate-limit + 429 + context-overflow recovery, and TypeScript toolchain.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "hegemonart",
|
|
8
8
|
"url": "https://github.com/hegemonart"
|
|
@@ -53,36 +53,13 @@
|
|
|
53
53
|
"cost-optimization",
|
|
54
54
|
"cache-aware",
|
|
55
55
|
"budget",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"make-interfaces-feel-better",
|
|
64
|
-
"palette-catalog",
|
|
65
|
-
"style-vocabulary",
|
|
66
|
-
"industry-palettes",
|
|
67
|
-
"ui-style-vocabulary",
|
|
68
|
-
"variable-fonts",
|
|
69
|
-
"container-queries",
|
|
70
|
-
"view-transitions",
|
|
71
|
-
"motion-vocabulary",
|
|
72
|
-
"motion-easings",
|
|
73
|
-
"transition-taxonomy",
|
|
74
|
-
"gesture-mechanics",
|
|
75
|
-
"clip-path-animation",
|
|
76
|
-
"component-specs",
|
|
77
|
-
"design-system-benchmarks",
|
|
78
|
-
"component-conformance",
|
|
79
|
-
"convergence-detector",
|
|
80
|
-
"i18n",
|
|
81
|
-
"user-research",
|
|
82
|
-
"information-architecture",
|
|
83
|
-
"form-patterns",
|
|
84
|
-
"data-viz",
|
|
85
|
-
"platforms"
|
|
56
|
+
"headless",
|
|
57
|
+
"cli",
|
|
58
|
+
"codex",
|
|
59
|
+
"gemini",
|
|
60
|
+
"mcp",
|
|
61
|
+
"parallel-agents",
|
|
62
|
+
"agent-sdk"
|
|
86
63
|
],
|
|
87
64
|
"skills": [
|
|
88
65
|
"./skills/"
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,144 @@ All notable changes to get-design-done are documented here. Versions follow [sem
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.21.0] — 2026-04-24
|
|
8
|
+
|
|
9
|
+
Phase 21 GDD SDK Headless milestone — the plugin now runs unchanged on Claude Code, OpenAI Codex CLI, and Gemini CLI, and ships a full `gdd-sdk` CLI that executes the design pipeline without a harness. 12 plans (21-01 through 21-12), 50+ commits, 936 tests.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Headless SDK** — new `bin/gdd-sdk` CLI that runs the full design pipeline
|
|
14
|
+
without Claude Code. Subcommands: `run`, `stage <name>`, `query <op>`,
|
|
15
|
+
`audit`, `init`. Publishes as `gdd-sdk` in `package.json` `bin`. See
|
|
16
|
+
`docs/HEADLESS.md` (Phase 23 deliverable) for CI integration guidance.
|
|
17
|
+
- **Session runner** (`scripts/lib/session-runner/`) — typed wrapper around
|
|
18
|
+
`@anthropic-ai/claude-agent-sdk` with USD/token budget caps, turn caps,
|
|
19
|
+
transcript capture, structured error mapping via `gdd-errors` taxonomy.
|
|
20
|
+
Emits `session.started`, `session.completed`, `session.budget_exceeded`
|
|
21
|
+
events on the shared event stream.
|
|
22
|
+
- **Context engine** (`scripts/lib/context-engine/`) — per-stage file
|
|
23
|
+
manifest + markdown-aware truncation that preserves frontmatter, every
|
|
24
|
+
heading, and the first paragraph of each section for files larger than
|
|
25
|
+
8 KiB. Keeps session prompts within budget without dropping load-bearing
|
|
26
|
+
context.
|
|
27
|
+
- **Tool scoping** (`scripts/lib/tool-scoping/`) — per-stage allowed-tools
|
|
28
|
+
enforcement at session creation. Verify is read-only; Explore adds web;
|
|
29
|
+
Design permits shell mutations. Per-agent frontmatter overrides via
|
|
30
|
+
`parseAgentTools()` for agent-level deviations.
|
|
31
|
+
- **Structured logger** (`scripts/lib/logger/`) — leveled (debug/info/warn/
|
|
32
|
+
error) with JSONL output in headless mode, ANSI-colored stderr in
|
|
33
|
+
interactive mode. `warn`/`error` also emit `ErrorEvent` on the event
|
|
34
|
+
stream for CI consumers.
|
|
35
|
+
- **Pipeline runner** (`scripts/lib/pipeline-runner/`) — brief → explore →
|
|
36
|
+
plan → design → verify state machine with retry-once, halt logic,
|
|
37
|
+
human-gate callbacks, config-driven step skipping. Emits
|
|
38
|
+
`pipeline.started`, `pipeline.completed`, `pipeline.halted`.
|
|
39
|
+
- **Explore parallel runner** (`scripts/lib/explore-parallel-runner/`) —
|
|
40
|
+
4 mappers (token, component-taxonomy, a11y, visual-hierarchy) concurrent
|
|
41
|
+
with streaming synthesizer. Honors `parallelism_safe` agent frontmatter
|
|
42
|
+
for opt-in isolation.
|
|
43
|
+
- **Discuss parallel runner** (`scripts/lib/discuss-parallel-runner/`) —
|
|
44
|
+
N discussant variants (user-journey, technical-constraint, brand-fit,
|
|
45
|
+
accessibility) concurrent, aggregator dedupes and clusters questions.
|
|
46
|
+
- **`gdd-sdk init`** (`scripts/lib/init-runner/`) — new-project bootstrap
|
|
47
|
+
spawning 4 parallel researchers (design-system-audit, brand-context,
|
|
48
|
+
accessibility-baseline, competitive-references) + synthesizer producing
|
|
49
|
+
`.design/DESIGN-CONTEXT.md` draft.
|
|
50
|
+
- **Cross-harness portability** (`scripts/lib/harness/`) — the plugin now
|
|
51
|
+
runs unchanged on Claude Code, OpenAI Codex CLI, and Gemini CLI. Ships
|
|
52
|
+
`reference/codex-tools.md`, `reference/gemini-tools.md`, `AGENTS.md`
|
|
53
|
+
(Codex), `GEMINI.md` (Gemini). The `gdd-state` MCP server works on all
|
|
54
|
+
three harnesses; harness detection is runtime-driven.
|
|
55
|
+
- **E2E headless integration test** — `tests/e2e-headless.test.ts` with a
|
|
56
|
+
dry-run variant (always runs) and a live variant (gated on
|
|
57
|
+
`ANTHROPIC_API_KEY`). CI workflow gains an `e2e-headless` job.
|
|
58
|
+
- **Phase 21 regression baseline** at `test-fixture/baselines/phase-21/` —
|
|
59
|
+
directory list, module list, agent list, connections list, CLI
|
|
60
|
+
subcommand list, event-type list. Enforced by
|
|
61
|
+
`tests/phase-21-baseline.test.cjs`.
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- `@anthropic-ai/claude-agent-sdk` added as a runtime dependency (was
|
|
66
|
+
previously only referenced in docs).
|
|
67
|
+
- `package.json` `bin` now exports `gdd-sdk` in addition to
|
|
68
|
+
`get-design-done` and `gdd-state-mcp`.
|
|
69
|
+
- `package.json` `files` adds `bin/` to the publish include list so the
|
|
70
|
+
`gdd-sdk` trampoline ships with the npm package.
|
|
71
|
+
- `package.json` `keywords` expanded with headless / CLI / cross-harness
|
|
72
|
+
tokens (`headless`, `cli`, `codex`, `gemini`, `mcp`, `parallel-agents`,
|
|
73
|
+
`agent-sdk`) for npm search surface.
|
|
74
|
+
|
|
75
|
+
### Infrastructure
|
|
76
|
+
|
|
77
|
+
- New regression baseline at `test-fixture/baselines/phase-21/`.
|
|
78
|
+
- CI workflow gains an `e2e-headless` job (dry-run on every PR; live on
|
|
79
|
+
main-branch push with `ANTHROPIC_API_KEY` secret).
|
|
80
|
+
- `tests/semver-compare.test.cjs` `OFF_CADENCE_VERSIONS` now includes
|
|
81
|
+
`1.21.0` as the second off-cadence minor bump after `1.20.0`.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## [1.20.0] — 2026-04-24
|
|
86
|
+
|
|
87
|
+
Phase 20 SDK foundation milestone — the shift from "design pipeline" to "typed SDK + MCP server + resilience primitives + event stream". 16 plans (20-00 through 20-15), 50+ commits, 645+ tests.
|
|
88
|
+
|
|
89
|
+
### Added
|
|
90
|
+
|
|
91
|
+
- **Resilience primitives** (headline upgrade) — pipeline now survives Anthropic API rate limits, 429 responses, and context-overflow errors without manual restart. New modules:
|
|
92
|
+
- `scripts/lib/jittered-backoff.cjs` — decorrelated-jitter exponential backoff with a pluggable clock for testability.
|
|
93
|
+
- `scripts/lib/rate-guard.cjs` — token-bucket rate limiter with `RateLimitSchema`-driven config.
|
|
94
|
+
- `scripts/lib/error-classifier.cjs` — three-class taxonomy (transient / retryable-after / fatal) mapping real Anthropic error codes.
|
|
95
|
+
- `scripts/lib/iteration-budget.cjs` — bounded-iteration guard for recovery loops with `IterationBudgetSchema`.
|
|
96
|
+
- See [`reference/error-recovery.md`](reference/error-recovery.md) for the recovery protocol.
|
|
97
|
+
- **`gdd-state` MCP server** at `scripts/mcp-servers/gdd-state/` — 11 typed tools replace ad-hoc `Read + regex + Write` patterns for STATE.md:
|
|
98
|
+
- `gdd_state__get`, `__update_progress`, `__transition_stage`, `__add_blocker`, `__resolve_blocker`, `__add_decision`, `__add_must_have`, `__set_status`, `__checkpoint`, `__probe_connections`, `__frontmatter_update`.
|
|
99
|
+
- Every tool has a JSON Schema at `scripts/mcp-servers/gdd-state/schemas/`; inputs and outputs are strict-validated.
|
|
100
|
+
- Every mutation emits a typed event to `.design/telemetry/events.jsonl`.
|
|
101
|
+
- **Typed state core** (`scripts/lib/gdd-state/`) — `parse()`, `serialize()`, `mutate()`, `transition()`, `read()`. Lockfile-safe concurrent writes validated by a 4-way race-condition test (`tests/race-condition-state-mutation.test.ts`) — 2000 concurrent ops, zero lost writes, <60s.
|
|
102
|
+
- **Event stream foundation** — `.design/telemetry/events.jsonl` append-only with a typed `EventBus`. Parallel stream to the existing `costs.jsonl` cost telemetry.
|
|
103
|
+
- **Prompt sanitizer** (`scripts/lib/prompt-sanitizer/`) — strips interactive-only constructs (AskUserQuestion, STOP, `/gdd:` slash commands) from skill bodies for future headless-runner support.
|
|
104
|
+
- **TypeScript toolchain** — strict `tsconfig.json`, schema codegen to `reference/schemas/generated.d.ts`, Node 22 `--experimental-strip-types` direct execution (no bundler step).
|
|
105
|
+
- **Transition gates** as pure functions (`briefToExplore`, `exploreToPlan`, `planToDesign`, `designToVerify`) with fixture-based tests.
|
|
106
|
+
- **`GDDError` 3-class taxonomy** (`ValidationError`, `StateConflictError`, `OperationFailedError`) at `scripts/lib/gdd-errors/`.
|
|
107
|
+
- **Phase 20 regression baseline** at `test-fixture/baselines/phase-20/` — agent list, skill list, frontmatter snapshot, MCP tools manifest (schema sha256), events schema hash, hook list, resilience primitives list. Enforced by `tests/regression-baseline-phase-20.test.cjs`.
|
|
108
|
+
|
|
109
|
+
### Changed
|
|
110
|
+
|
|
111
|
+
- All 5 stage skills (`brief`, `explore`, `plan`, `design`, `verify`) use `gdd_state__*` MCP tools for STATE.md operations instead of direct `Read + regex + Write`.
|
|
112
|
+
- Utility skills (`pause`, `resume`, `progress`, `health`, `todo`, `settings`) migrated to typed `gdd_state__get` + mutation tools.
|
|
113
|
+
- Three hooks (`budget-enforcer`, `context-exhaustion`, `gdd-read-injection-scanner`) rewritten in TypeScript and wired as event-stream consumers.
|
|
114
|
+
- Four Tier-1 scripts converted to `.ts` (`tests/helpers.ts`, `scripts/validate-schemas.ts`, `scripts/validate-frontmatter.ts`, `scripts/aggregate-agent-metrics.ts`).
|
|
115
|
+
- Connection probes (Figma MCP, update-check, watch-authorities) use jittered backoff instead of fixed sleeps.
|
|
116
|
+
- Reflector (`agents/design-reflector.md`) reads proposals from the event stream; legacy grep path preserved as fallback.
|
|
117
|
+
- `hooks.json` repointed from `.js` hooks to the new `.ts` hooks (via `--experimental-strip-types`).
|
|
118
|
+
|
|
119
|
+
### Security
|
|
120
|
+
|
|
121
|
+
- Lockfile-safe STATE.md mutations validated by 4-way concurrent race-condition test. Each mutation acquires `${path}.lock` (PID + timestamp), performs read-modify-write under the lock, writes to `${path}.tmp`, and atomic-renames. Windows EPERM/EBUSY from AV scanners is retried transparently.
|
|
122
|
+
- Prompt sanitizer strips untrusted interactive constructs before headless execution paths — reduces prompt-injection surface for future runner work.
|
|
123
|
+
|
|
124
|
+
### Fixed
|
|
125
|
+
|
|
126
|
+
- Race conditions in `<position>` `task_progress` and `<blockers>` updates under parallel executor load. The prior `Read + regex + Write` pattern could lose increments and corrupt blocker counts under concurrent agent writes; the new typed `mutate()` API guarantees zero lost writes.
|
|
127
|
+
|
|
128
|
+
### Deprecated
|
|
129
|
+
|
|
130
|
+
- `.js` hooks under `hooks/` — replaced by `.ts` equivalents running via `--experimental-strip-types`.
|
|
131
|
+
- Direct `Read → regex → Write` patterns against STATE.md — replaced by the 11 `gdd_state__*` MCP tools. Skills that still use the direct pattern will be migrated in a future phase.
|
|
132
|
+
|
|
133
|
+
### Migration notes
|
|
134
|
+
|
|
135
|
+
- Consumers of STATE.md should prefer the `gdd_state__*` MCP tools over direct file reads/writes — the typed tools emit events, enforce schemas, and are lockfile-safe. Direct reads for non-mutation cases remain supported.
|
|
136
|
+
- Node 22+ is required for `--experimental-strip-types` execution of `.ts` scripts. The CI matrix already pins Node 22 & 24.
|
|
137
|
+
- No breaking API changes. All legacy skills and agents continue to work unchanged; the MCP server is additive.
|
|
138
|
+
|
|
139
|
+
### Stats
|
|
140
|
+
|
|
141
|
+
- 16 plans (20-00 through 20-15) completed across 4 waves.
|
|
142
|
+
- 50+ per-task commits on the Phase 20 branch.
|
|
143
|
+
- 645+ tests across CJS + TS suites, 0 failures, 1 skipped.
|
|
144
|
+
- `tsc --noEmit` green; `validate:schemas` 11/11 green; `validate:frontmatter` 0 violations.
|
|
7
145
|
## [1.19.6] — 2026-04-24
|
|
8
146
|
|
|
9
147
|
### Added — Design Philosophy Layer
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ npx @hegemonart/get-design-done@latest
|
|
|
29
29
|
|
|
30
30
|
<br>
|
|
31
31
|
|
|
32
|
-
[Why I Built This](#why-i-built-this) · [How It Works](#how-it-works) · [Canvas Tools](#ai-native-canvas-tools) · [Component Generators](#component-generators) · [Commands](#commands) · [Connections](#connections) · [Why It Works](#why-it-works)
|
|
32
|
+
[Why I Built This](#why-i-built-this) · [How It Works](#how-it-works) · [Headless SDK](#headless-sdk) · [Canvas Tools](#ai-native-canvas-tools) · [Component Generators](#component-generators) · [Commands](#commands) · [Connections](#connections) · [Why It Works](#why-it-works)
|
|
33
33
|
|
|
34
34
|
</div>
|
|
35
35
|
|
|
@@ -104,6 +104,28 @@ Built-in quality gates catch real problems: Handoff Faithfulness scoring on Clau
|
|
|
104
104
|
- **Component generators** — 21st.dev Magic MCP adds a prior-art gate before any greenfield build; Magic Patterns generates DS-aware components with a `preview_url` for visual verification. Both feed into a shared `design-component-generator` agent.
|
|
105
105
|
- **Twelve tool connections** — Four new connections (paper.design, pencil.dev, 21st.dev, Magic Patterns) join the original eight. All are optional; the pipeline degrades gracefully to fallbacks when any connection is unavailable.
|
|
106
106
|
|
|
107
|
+
## What's New in v1.21.0
|
|
108
|
+
|
|
109
|
+
**Headless SDK** (headline upgrade) — the plugin now ships a `gdd-sdk` CLI that runs the full design pipeline without Claude Code. Five subcommands (`run`, `stage`, `query`, `audit`, `init`) work on any CI runner with Node 22+ and an `ANTHROPIC_API_KEY`. See the [Headless SDK](#headless-sdk) section below for examples.
|
|
110
|
+
|
|
111
|
+
**Parallel researchers** — four new runners execute concurrent specialized agents with a streaming synthesizer: `explore-parallel-runner` (4 mappers: token, component-taxonomy, a11y, visual-hierarchy), `discuss-parallel-runner` (N discussants: user-journey, technical-constraint, brand-fit, accessibility), and `init-runner` (4 researchers for `gdd-sdk init` bootstrap). A `pipeline-runner` state machine orchestrates brief → explore → plan → design → verify with retry-once, halt logic, and human-gate callbacks.
|
|
112
|
+
|
|
113
|
+
**Cross-harness portability** — the plugin runs unchanged on Claude Code, OpenAI Codex CLI, and Gemini CLI. Codex auto-loads [`AGENTS.md`](AGENTS.md); Gemini auto-loads [`GEMINI.md`](GEMINI.md). Tool-name translations live in [`reference/codex-tools.md`](reference/codex-tools.md) and [`reference/gemini-tools.md`](reference/gemini-tools.md). The `gdd-state` MCP server works on all three harnesses.
|
|
114
|
+
|
|
115
|
+
**Session primitives** — `session-runner` (typed wrapper around `@anthropic-ai/claude-agent-sdk` with USD/token budget caps, turn caps, transcript capture), `context-engine` (per-stage file manifest + markdown-aware truncation preserving frontmatter, headings, and first paragraph of each section), `tool-scoping` (per-stage allowed-tools enforcement with per-agent frontmatter overrides), and a structured `logger` (leveled, JSONL in headless mode, ANSI-colored in interactive mode).
|
|
116
|
+
|
|
117
|
+
**E2E headless integration test** — `tests/e2e-headless.test.ts` with a dry-run variant (always runs) and a live variant gated on `ANTHROPIC_API_KEY`. CI gains an `e2e-headless` job.
|
|
118
|
+
|
|
119
|
+
### Previously in v1.20.0
|
|
120
|
+
|
|
121
|
+
**Resilience primitives** — the pipeline survives Anthropic API rate limits, 429 responses, and context-overflow errors without manual restart. Modules: jittered backoff, rate-guard, error-classifier, iteration-budget. See [`reference/error-recovery.md`](reference/error-recovery.md).
|
|
122
|
+
|
|
123
|
+
**Typed state core** — `.design/STATE.md` mutations are lockfile-safe. Parallel executors concurrently update `task_progress` and `<blockers>` on the same file with zero corruption (validated by 4-way race-condition test, 2000 concurrent ops, <60s).
|
|
124
|
+
|
|
125
|
+
**`gdd-state` MCP server** — 11 typed tools (`gdd_state__get`, `__update_progress`, `__transition_stage`, `__add_blocker`, `__resolve_blocker`, `__add_decision`, `__add_must_have`, `__set_status`, `__checkpoint`, `__probe_connections`, `__frontmatter_update`) replace ad-hoc STATE.md edits. Every mutation emits a typed event to `.design/telemetry/events.jsonl`.
|
|
126
|
+
|
|
127
|
+
**TypeScript foundation** — `tsc --noEmit` typechecks the whole SDK; JSON schemas codegen to `reference/schemas/generated.d.ts`; hooks + Tier-1 scripts migrated to `.ts` and executed directly via Node 22 `--experimental-strip-types`.
|
|
128
|
+
|
|
107
129
|
---
|
|
108
130
|
|
|
109
131
|
## Getting Started
|
|
@@ -478,6 +500,37 @@ The watcher writes `.design/authority-report.md` — new entries classified into
|
|
|
478
500
|
|
|
479
501
|
---
|
|
480
502
|
|
|
503
|
+
## Headless SDK
|
|
504
|
+
|
|
505
|
+
Run the full GDD pipeline without Claude Code:
|
|
506
|
+
|
|
507
|
+
```bash
|
|
508
|
+
npx gdd-sdk init # bootstrap a new project
|
|
509
|
+
npx gdd-sdk run # full pipeline (brief → verify)
|
|
510
|
+
npx gdd-sdk stage explore --parallel # single stage with parallel mappers
|
|
511
|
+
npx gdd-sdk query position # typed STATE.md read
|
|
512
|
+
npx gdd-sdk audit --baseline <dir> # regression check
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
Requires Node 22+ and an `ANTHROPIC_API_KEY`. Works on any CI runner.
|
|
516
|
+
|
|
517
|
+
Internally the SDK stitches together the Phase-21 runner modules:
|
|
518
|
+
`session-runner` (budget + turn cap + transcript), `context-engine` (per-stage
|
|
519
|
+
file manifest + markdown truncation), `tool-scoping` (per-stage allowed-tools),
|
|
520
|
+
`pipeline-runner` (brief → verify state machine with retry-once + human-gate
|
|
521
|
+
callbacks), and `explore-parallel` / `discuss-parallel` / `init` for the
|
|
522
|
+
concurrent researcher stages.
|
|
523
|
+
|
|
524
|
+
### Cross-harness
|
|
525
|
+
|
|
526
|
+
The plugin runs unchanged on Claude Code, OpenAI Codex CLI, and Gemini CLI.
|
|
527
|
+
See [`reference/codex-tools.md`](reference/codex-tools.md) and
|
|
528
|
+
[`reference/gemini-tools.md`](reference/gemini-tools.md) for the tool
|
|
529
|
+
translations; Codex auto-loads [`AGENTS.md`](AGENTS.md) and Gemini auto-loads
|
|
530
|
+
[`GEMINI.md`](GEMINI.md). The `gdd-state` MCP server works on all three.
|
|
531
|
+
|
|
532
|
+
---
|
|
533
|
+
|
|
481
534
|
## AI-Native Canvas Tools
|
|
482
535
|
|
|
483
536
|
get-design-done integrates with canvas tools that treat the design canvas as both source AND destination — enabling a full canvas→code→verify→canvas round-trip.
|
|
@@ -22,6 +22,19 @@ writes:
|
|
|
22
22
|
|
|
23
23
|
You are a post-cycle reflection agent. You analyze what happened in a design cycle, compare outcomes to costs, and produce concrete, reviewable proposals — not generic advice. Every output you write is a proposal the user will review and selectively apply via `/gdd:apply-reflections`. You never auto-apply anything.
|
|
24
24
|
|
|
25
|
+
## Event-Stream Mode (Phase 20 onwards)
|
|
26
|
+
|
|
27
|
+
The reflector now reads proposals from `.design/telemetry/events.jsonl` — the append-only event stream introduced by Plan 20-06. It filters entries where `type === 'reflection.proposal'`. Each matching line is a JSON object whose `payload` carries fields like `{ source: <skill|hook>, proposal_kind: <string>, rationale: <string>, ... }` emitted by the producing skill or hook.
|
|
28
|
+
|
|
29
|
+
Read flow:
|
|
30
|
+
|
|
31
|
+
1. Check that `.design/telemetry/events.jsonl` exists. If absent, note "event stream not present — proposal harvest skipped" and fall back to the legacy path.
|
|
32
|
+
2. Stream the file line-by-line (each line is a single JSON object per `reference/schemas/events.schema.json`). Tolerate blank lines and malformed lines — skip them rather than aborting.
|
|
33
|
+
3. Collect every entry where `type === 'reflection.proposal'`. Render each payload into the appropriate Proposals section below.
|
|
34
|
+
4. Cross-reference the event's `stage`, `cycle`, and `_meta.source` fields when citing evidence.
|
|
35
|
+
|
|
36
|
+
Legacy grep-based parsing of skill outputs is preserved as a fallback for skills that haven't yet migrated to emit `reflection.proposal` events (Phase 22 scope). If no `reflection.proposal` events are present in the stream, run the legacy harvest across `.design/learnings/*.md` and `.design/intel/` exactly as before — both paths produce the same Proposals section format.
|
|
37
|
+
|
|
25
38
|
## Required Reading
|
|
26
39
|
|
|
27
40
|
The orchestrating stage supplies a `<required_reading>` block in the prompt. Read every listed file before acting — this is mandatory.
|
package/bin/gdd-sdk
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// bin/gdd-sdk — Plan 21-09 Task 7 (SDK-21).
|
|
3
|
+
//
|
|
4
|
+
// CJS trampoline: spawns `node --experimental-strip-types` against the
|
|
5
|
+
// real TS entry point in `scripts/lib/cli/index.ts` and forwards argv +
|
|
6
|
+
// exit code. Windows-compatible (npm's generated .cmd shim on Windows
|
|
7
|
+
// has no way to inject the --experimental-strip-types flag otherwise).
|
|
8
|
+
//
|
|
9
|
+
// Why a trampoline:
|
|
10
|
+
// POSIX shebangs can use `#!/usr/bin/env -S node --experimental-strip-types`,
|
|
11
|
+
// but Windows cmd.exe does not honor shebangs. npm's auto-generated
|
|
12
|
+
// .cmd shim invokes plain `node bin/gdd-sdk` without passing the
|
|
13
|
+
// experimental flag. The trampoline re-launches node with the flag
|
|
14
|
+
// explicitly so both platforms end up at the same TS entry.
|
|
15
|
+
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
const { spawn } = require('node:child_process');
|
|
19
|
+
const path = require('node:path');
|
|
20
|
+
|
|
21
|
+
const entry = path.resolve(
|
|
22
|
+
__dirname,
|
|
23
|
+
'..',
|
|
24
|
+
'scripts',
|
|
25
|
+
'lib',
|
|
26
|
+
'cli',
|
|
27
|
+
'index.ts',
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const child = spawn(
|
|
31
|
+
process.execPath,
|
|
32
|
+
['--experimental-strip-types', entry, ...process.argv.slice(2)],
|
|
33
|
+
{ stdio: 'inherit', shell: false },
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
child.on('exit', (code, signal) => {
|
|
37
|
+
if (signal) {
|
|
38
|
+
// Re-raise the signal to ourselves so the parent shell sees the same
|
|
39
|
+
// termination mode (e.g., Ctrl+C propagates as SIGINT exit).
|
|
40
|
+
try {
|
|
41
|
+
process.kill(process.pid, signal);
|
|
42
|
+
} catch {
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
process.exit(typeof code === 'number' ? code : 0);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
child.on('error', (err) => {
|
|
51
|
+
// Failure to spawn node itself — extremely rare; surface to stderr.
|
|
52
|
+
// eslint-disable-next-line no-console
|
|
53
|
+
console.error('gdd-sdk: failed to launch TypeScript entry:', err.message);
|
|
54
|
+
process.exit(3);
|
|
55
|
+
});
|
|
@@ -10,6 +10,7 @@ This directory contains connection specifications for external tools and MCPs th
|
|
|
10
10
|
|
|
11
11
|
| Connection | Status | Spec File | Notes |
|
|
12
12
|
|-----------|--------|-----------|-------|
|
|
13
|
+
| gdd-state | Active | [`connections/gdd-state.md`](connections/gdd-state.md) | Local stdio MCP shipped with the plugin; required for STATE.md mutation in Phase 20+ (skills fall back to direct module import when not registered) |
|
|
13
14
|
| Figma | Active | [`connections/figma.md`](connections/figma.md) | Auto-detects any Figma MCP variant (remote reads+writes, desktop reads-only); prefix resolved at probe time |
|
|
14
15
|
| Refero | Active | [`connections/refero.md`](connections/refero.md) | Uses `mcp__refero__*` tools (verify names via ToolSearch) |
|
|
15
16
|
| Preview | Active | [`connections/preview.md`](connections/preview.md) | Uses `mcp__Claude_Preview__*` tools |
|
|
@@ -31,6 +32,7 @@ Each cell describes what the connection contributes at that pipeline stage, or `
|
|
|
31
32
|
|
|
32
33
|
| Connection | scan | discover | plan | design | verify | canvas | generator |
|
|
33
34
|
|-----------|------|----------|------|--------|--------|--------|-----------|
|
|
35
|
+
| gdd-state | STATE mutation (init position, probe_connections, add_decision) | STATE mutation (add_decision, add_must_have, transition gate) | STATE mutation (locked decisions, must_haves, transition gate) | STATE mutation (update_progress, resolve_blocker, transition gate) | STATE mutation (must_have pass/fail, add_blocker, set_status) | — | — |
|
|
34
36
|
| Figma | token augmentation via `get_variable_defs` (CONN-03) | decisions pre-populate via `get_variable_defs` (CONN-04) | — | write tokens/annotations/Code Connect via `use_figma` (FWR-01..04) | — | — | — |
|
|
35
37
|
| Refero | — | reference search via `mcp__refero__search`; fallback → awesome-design-md (CONN-05) | — | — | — | — | — |
|
|
36
38
|
| Preview | — | — | — | — | screenshots for `? VISUAL` checks (VIS-02) | — | — |
|
|
@@ -227,6 +229,7 @@ To add a new connection to the pipeline:
|
|
|
227
229
|
- `connections/` is infrastructure scaffolding introduced in Phase 1. Stage integration (wiring detection and graceful degradation into each stage) is Phase 2 work.
|
|
228
230
|
- Phase 8 added five new active connections. Linear and GitHub remain planned for a future phase.
|
|
229
231
|
- Phase 14 added four AI-native design tool connections (paper.design, pencil.dev, 21st.dev, Magic Patterns) and the canvas/generator capability columns.
|
|
232
|
+
- Phase 20 added `gdd-state` — a local stdio MCP server shipped with the plugin that owns STATE.md mutation across every pipeline stage. Unlike external connections, `gdd-state` is required (fallback to direct module import preserves mutation safety but loses event telemetry). See [`connections/gdd-state.md`](connections/gdd-state.md).
|
|
230
233
|
- The capability matrix columns map to the five pipeline stages: `scan | discover | plan | design | verify`, plus `canvas` and `generator` sub-categories.
|
|
231
234
|
|
|
232
235
|
---
|
package/connections/figma.md
CHANGED
|
@@ -260,3 +260,5 @@ The `<connections>` schema is minimal by design. Traceability of which outputs c
|
|
|
260
260
|
- **OAuth re-auth.** If `get_metadata` starts returning auth errors after previously working, the OAuth session expired. Re-running the MCP install command is not required — the session refreshes on the next tool call that returns a `reauth` hint. A clean `claude mcp remove figma && claude mcp add ...` is always safe.
|
|
261
261
|
|
|
262
262
|
- **Desktop MCP reads-only.** The desktop MCP (typically `figma-desktop`) exposes read tools only. It is auto-detected by the probe and is a supported fallback when writes are not needed. Stages that require writes (figma-write) STOP with an instruction to register the remote MCP.
|
|
263
|
+
|
|
264
|
+
- **Transient probe errors.** When the live `get_metadata` call errors with a transient signal (5xx, rate-limit, network timeout), retry the probe with jittered exponential backoff — use `scripts/lib/jittered-backoff.cjs` (`delayMs(attempt)` or `await sleep(attempt)`) starting at 100ms, capped at 30s, 2× growth with 20% jitter. Do NOT use a fixed 1-second sleep: synchronized siblings (watch-authorities, update-check) can trigger rate limits in lockstep. Consult `scripts/lib/rate-guard.cjs` first — if the provider is flagged as rate-limited, wait for `resetAt` before retrying rather than burning through the backoff curve.
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# gdd-state MCP — Connection Specification
|
|
2
|
+
|
|
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
|
+
|
|
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.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
**Prerequisites:**
|
|
12
|
+
|
|
13
|
+
- The `@hegemonart/get-design-done` plugin installed (the server script ships in `scripts/mcp-servers/gdd-state/`).
|
|
14
|
+
- Node 22+ with `--experimental-strip-types` (the server is a TypeScript file run directly via strip-types — no build step).
|
|
15
|
+
|
|
16
|
+
### Option A — Project-scoped install (dev repo)
|
|
17
|
+
|
|
18
|
+
For local development against the plugin source tree:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
claude mcp add gdd-state --transport stdio "node --experimental-strip-types ./scripts/mcp-servers/gdd-state/server.ts"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Option B — Plugin-installed, global resolution
|
|
25
|
+
|
|
26
|
+
When the plugin is installed globally via `npm i -g @hegemonart/get-design-done`:
|
|
27
|
+
|
|
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"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Restart the Claude Code session after install.
|
|
33
|
+
|
|
34
|
+
**Configuration:**
|
|
35
|
+
|
|
36
|
+
The server resolves the STATE.md path from `process.env.GDD_STATE_PATH ?? .design/STATE.md`. Resolution is relative to the server's CWD at startup. When multiple projects run concurrently, each Claude Code session spawns its own server instance rooted at that session's project directory — the env override is only needed in the rare case where STATE.md lives somewhere other than `.design/`.
|
|
37
|
+
|
|
38
|
+
**Verification:**
|
|
39
|
+
|
|
40
|
+
After session restart:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
ToolSearch({ query: "mcp__gdd_state", max_results: 1 })
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
A single non-empty match is sufficient — the server ships 11 tools, all prefixed `mcp__gdd_state__`.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Probe Pattern
|
|
51
|
+
|
|
52
|
+
The `gdd-state` probe is **ToolSearch-only**. The server is local and always available once installed, so a keyword match on the tool prefix is sufficient evidence that the MCP is registered.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Step GS1 — ToolSearch check:
|
|
56
|
+
ToolSearch({ query: "mcp__gdd_state", max_results: 1 })
|
|
57
|
+
→ Empty result → gdd-state: not_configured (fall back to direct import — see Fallback Behavior)
|
|
58
|
+
→ Non-empty result → gdd-state: available
|
|
59
|
+
|
|
60
|
+
Write gdd-state status to STATE.md <connections>.
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
No live tool call is required in the probe. Unlike Figma (which can be registered but error on auth/network), `gdd-state` is a local process — its presence in the tool list implies it will respond to calls. Each stage skill that probes should call `gdd_state__probe_connections` to write the resolved status back; the server's own probe result is recorded alongside every other connection.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Tools
|
|
68
|
+
|
|
69
|
+
Tool names are static — the server always exposes `mcp__gdd_state__<tool>`. No prefix resolution is required.
|
|
70
|
+
|
|
71
|
+
| Tool | Mutates? | Emits event? | Purpose |
|
|
72
|
+
| ------------------------------------ | -------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
73
|
+
| `mcp__gdd_state__get` | No | — | Read current STATE.md (parsed). Optional `{ fields: string[] }` projection. |
|
|
74
|
+
| `mcp__gdd_state__update_progress` | Yes | `state.mutation` | Update `<position>.task_progress` and/or `<position>.status`. |
|
|
75
|
+
| `mcp__gdd_state__transition_stage` | Yes | `state.transition` (pass + fail) | Run the gate and advance `<position>.stage` on pass. Gate-veto returns `{success:false}`; server never crashes. |
|
|
76
|
+
| `mcp__gdd_state__add_blocker` | Yes | `state.mutation` | Append one entry to `<blockers>`. Defaults stage to current and date to today (UTC). |
|
|
77
|
+
| `mcp__gdd_state__resolve_blocker` | Yes | `state.mutation` | Remove one `<blockers>` entry by 0-based index or exact text match. |
|
|
78
|
+
| `mcp__gdd_state__add_decision` | Yes | `state.mutation` | Append one entry to `<decisions>`. Auto-allocates `D-N`. |
|
|
79
|
+
| `mcp__gdd_state__add_must_have` | Yes | `state.mutation` | Append one entry to `<must_haves>`. Auto-allocates `M-N`. |
|
|
80
|
+
| `mcp__gdd_state__set_status` | Yes | `state.mutation` | Update `<position>.status`. Thin wrapper for prose that only changes status. |
|
|
81
|
+
| `mcp__gdd_state__checkpoint` | Yes | `state.mutation` | Bump `frontmatter.last_checkpoint` and append a `<timestamps>` entry. |
|
|
82
|
+
| `mcp__gdd_state__probe_connections` | Yes | `state.mutation` | Merge probe results into `<connections>`. Overwrites keys; never deletes. |
|
|
83
|
+
| `mcp__gdd_state__frontmatter_update` | Yes | `state.mutation` | Patch frontmatter fields. Rejects `pipeline_state_version` and `stage` (use `transition_stage`). |
|
|
84
|
+
|
|
85
|
+
**Tool response envelope (consistent across all 11 tools):**
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"success": true,
|
|
90
|
+
"data": { /* tool-specific */ }
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
or
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"success": false,
|
|
99
|
+
"error": {
|
|
100
|
+
"code": "VALIDATION_STATUS_INVALID",
|
|
101
|
+
"message": "status \"running\" is not one of initialized/in_progress/completed/blocked",
|
|
102
|
+
"kind": "validation",
|
|
103
|
+
"context": { }
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
```
|
|
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`.
|
|
109
|
+
|
|
110
|
+
**Scoped out of Phase 20:**
|
|
111
|
+
|
|
112
|
+
- `gdd_state__config_update` (mentioned in the ROADMAP prose but NOT in the numerical success criterion of "11 tools"). `.design/config.json` is a separate artifact from STATE.md; its mutation surface is tracked for Phase 21+.
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Pipeline Integration
|
|
117
|
+
|
|
118
|
+
`gdd-state` is **required, not optional**. It replaces the pre-Phase-20 `Read+regex+Write` pattern that every stage skill used to mutate STATE.md by hand. Skipping this connection is the pre-Phase-20 regression path.
|
|
119
|
+
|
|
120
|
+
| Stage | Skill/Agent | Tool used | Purpose |
|
|
121
|
+
| ------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
122
|
+
| brief | `skills/brief/SKILL.md` | `gdd_state__get`, `gdd_state__update_progress`, `gdd_state__set_status`, `gdd_state__add_must_have`, `gdd_state__add_decision`, `gdd_state__checkpoint`, `gdd_state__transition_stage`, `gdd_state__frontmatter_update` | Initialize STATE.md position; record brief-derived decisions and must-haves; gate-advance to `explore` on completion. |
|
|
123
|
+
| explore | `skills/explore/SKILL.md` | `gdd_state__get`, `gdd_state__probe_connections`, `gdd_state__add_decision`, `gdd_state__update_progress`, `gdd_state__checkpoint`, `gdd_state__transition_stage` | Run the 12-connection probe and write all 12 results with a single `probe_connections` call; record exploration-phase decisions; gate-advance to `plan`. |
|
|
124
|
+
| plan | `skills/plan/SKILL.md` | `gdd_state__get`, `gdd_state__add_decision`, `gdd_state__add_must_have`, `gdd_state__update_progress`, `gdd_state__checkpoint`, `gdd_state__transition_stage` | Record locked decisions and plan-derived must-haves; gate-advance to `design`. |
|
|
125
|
+
| design | `skills/design/SKILL.md` | `gdd_state__get`, `gdd_state__update_progress`, `gdd_state__checkpoint`, `gdd_state__add_decision`, `gdd_state__resolve_blocker`, `gdd_state__transition_stage` | Tick task_progress; resolve design-stage blockers; gate-advance to `verify`. |
|
|
126
|
+
| verify | `skills/verify/SKILL.md` | `gdd_state__get`, `gdd_state__update_progress`, `gdd_state__add_must_have` (status updates), `gdd_state__add_blocker` (on failure), `gdd_state__set_status` (`completed`/`blocked`), `gdd_state__checkpoint` | Execute must-have checks, flip `pass`/`fail`, append blockers on regressions, finalize status. |
|
|
127
|
+
|
|
128
|
+
Stage SKILL rewrites in Plans 20-07 through 20-11 will switch each skill from `Read+Write` to these tools. Until those plans land, the tools are exposed but not yet consumed — Plan 20-05 ships only the surface.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Fallback Behavior
|
|
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:
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
import { read, mutate, transition } from '@hegemonart/get-design-done/scripts/lib/gdd-state/index.js';
|
|
138
|
+
```
|
|
139
|
+
|
|
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:
|
|
141
|
+
|
|
142
|
+
1. **Standalone CLI usage.** Users running `node` scripts against the plugin outside a Claude Code session do not have MCP; the direct import lets them still mutate STATE.md safely.
|
|
143
|
+
2. **Degraded operation.** If the MCP server fails to register for any reason (e.g. a session state bug), skills continue to function with the tradeoff of losing event telemetry for that session. Compared to crashing the stage, this is the right tradeoff — telemetry is observability; the STATE.md mutation is the user's primary concern.
|
|
144
|
+
|
|
145
|
+
Stages do not append a `<blocker>` for a missing `gdd-state` connection — the fallback path keeps mutation safety. If a downstream consumer specifically requires events (e.g. a Phase 22+ dashboard), that consumer is responsible for surfacing the absent MCP as its own problem.
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## STATE.md Integration
|
|
150
|
+
|
|
151
|
+
Unlike external MCPs, `gdd-state` is the thing that **writes** to `<connections>`. Stage skills record its own probe result alongside every other connection:
|
|
152
|
+
|
|
153
|
+
```xml
|
|
154
|
+
<connections>
|
|
155
|
+
gdd-state: available
|
|
156
|
+
figma: available
|
|
157
|
+
refero: not_configured
|
|
158
|
+
preview: available
|
|
159
|
+
</connections>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Status values:**
|
|
163
|
+
|
|
164
|
+
| Value | Meaning |
|
|
165
|
+
| ---------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
166
|
+
| `available` | `ToolSearch` returned ≥1 result matching `mcp__gdd_state`. Server is registered and tools are loadable. |
|
|
167
|
+
| `unavailable` | Never used for `gdd-state` — the server either is or is not in the session. Reserved for symmetry. |
|
|
168
|
+
| `not_configured` | `ToolSearch` returned empty. Fall back to the direct module import; events are not emitted this session. |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Caveats and Pitfalls
|
|
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.
|
|
175
|
+
|
|
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
|
+
|
|
178
|
+
- **`frontmatter_update` cannot patch `stage`.** It returns a validation error — stages must use `transition_stage` which runs the gate and emits the right event.
|
|
179
|
+
|
|
180
|
+
- **`resolve_blocker` returns `operation_failed` for no-match.** This is a non-throw failure: the caller's input was well-formed, the operation simply cannot complete. Branch on `kind === 'operation_failed'` to decide whether to retry with different inputs or surface to the operator.
|
|
181
|
+
|
|
182
|
+
- **Session-id is process-level, not pipeline-level.** Every event emitted by a single server process carries the same `sessionId`. Long-running sessions will emit many events under one ID; correlation across sessions is via the cycle / stage fields, not sessionId.
|
|
183
|
+
|
|
184
|
+
- **Schema files are loaded at server startup.** Edits to the per-tool JSON Schemas require a server restart to take effect. Restart the Claude Code session or re-run `claude mcp add` after schema edits.
|
|
185
|
+
|
|
186
|
+
- **STATE.md path resolution.** The server resolves `.design/STATE.md` relative to its CWD at startup. If the parent Claude Code session starts in a subdirectory of your repo, set `GDD_STATE_PATH` to the absolute path to avoid "file not found" errors on the first tool call.
|