@hegemonart/get-design-done 1.14.4 → 1.14.7
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 +7 -2
- package/.claude-plugin/plugin.json +6 -1
- package/CHANGELOG.md +106 -0
- package/README.md +17 -0
- package/agents/design-executor.md +41 -0
- package/agents/design-figma-writer.md +61 -1
- package/agents/design-verifier.md +2 -2
- package/connections/connections.md +2 -0
- package/connections/figma.md +10 -0
- package/connections/preview.md +9 -5
- package/hooks/budget-enforcer.js +2 -2
- package/hooks/gdd-bash-guard.js +49 -0
- package/hooks/gdd-decision-injector.js +196 -0
- package/hooks/gdd-mcp-circuit-breaker.js +140 -0
- package/hooks/gdd-protected-paths.js +114 -0
- package/hooks/hooks.json +36 -0
- package/package.json +1 -1
- package/reference/STATE-TEMPLATE.md +10 -1
- package/reference/config-schema.md +29 -0
- package/reference/cycle-handoff-preamble.md +22 -0
- package/reference/figma-sandbox.md +19 -0
- package/reference/mcp-budget.default.json +13 -0
- package/reference/meta-rules.md +66 -0
- package/reference/protected-paths.default.json +18 -0
- package/reference/registry.json +34 -0
- package/reference/registry.schema.json +52 -0
- package/reference/retrieval-contract.md +30 -0
- package/reference/schemas/mcp-budget.schema.json +21 -0
- package/reference/schemas/protected-paths.schema.json +19 -0
- package/reference/shared-preamble.md +6 -57
- package/scripts/aggregate-agent-metrics.js +9 -0
- package/scripts/build-intel.cjs +20 -0
- package/scripts/injection-patterns.cjs +42 -1
- package/scripts/lib/blast-radius.cjs +97 -0
- package/scripts/lib/dangerous-patterns.cjs +118 -0
- package/scripts/lib/glob-match.cjs +57 -0
- package/scripts/lib/reference-registry.cjs +101 -0
- package/skills/connections/SKILL.md +477 -0
- package/skills/new-project/SKILL.md +1 -1
- package/skills/pause/SKILL.md +3 -0
- package/skills/progress/SKILL.md +12 -0
- package/skills/reflect/SKILL.md +2 -0
- package/skills/resume/SKILL.md +3 -0
- package/skills/scan/SKILL.md +8 -0
- package/skills/verify/SKILL.md +4 -3
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
},
|
|
6
6
|
"metadata": {
|
|
7
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). Ships with a full CI/CD pipeline (Node 22/24 × Linux/macOS/Windows) and release automation (auto-tag + GitHub Release + release-time smoke test).",
|
|
8
|
-
"version": "1.14.
|
|
8
|
+
"version": "1.14.7"
|
|
9
9
|
},
|
|
10
10
|
"plugins": [
|
|
11
11
|
{
|
|
12
12
|
"name": "get-design-done",
|
|
13
13
|
"source": "./",
|
|
14
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.",
|
|
15
|
-
"version": "1.14.
|
|
15
|
+
"version": "1.14.7",
|
|
16
16
|
"author": {
|
|
17
17
|
"name": "hegemonart"
|
|
18
18
|
},
|
|
@@ -53,6 +53,11 @@
|
|
|
53
53
|
"release-automation",
|
|
54
54
|
"gitleaks",
|
|
55
55
|
"shellcheck",
|
|
56
|
+
"safety-hardening",
|
|
57
|
+
"protected-paths",
|
|
58
|
+
"decision-injector",
|
|
59
|
+
"reference-registry",
|
|
60
|
+
"mcp-circuit-breaker",
|
|
56
61
|
"schema-validation",
|
|
57
62
|
"cost-optimization",
|
|
58
63
|
"cache-aware",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "get-design-done",
|
|
3
3
|
"short_name": "gdd",
|
|
4
|
-
"version": "1.14.
|
|
4
|
+
"version": "1.14.7",
|
|
5
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.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "hegemonart",
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"intel-store",
|
|
39
39
|
"self-improvement",
|
|
40
40
|
"reflection",
|
|
41
|
+
"safety-hardening",
|
|
42
|
+
"protected-paths",
|
|
43
|
+
"decision-injector",
|
|
44
|
+
"reference-registry",
|
|
45
|
+
"mcp-circuit-breaker",
|
|
41
46
|
"tested",
|
|
42
47
|
"ci",
|
|
43
48
|
"cicd",
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,112 @@ All notable changes to get-design-done are documented here. Versions follow [sem
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.14.7] — 2026-04-24
|
|
8
|
+
|
|
9
|
+
### Phase 14.6 — Test Coverage Completion (Phase 12 Wave C closeout)
|
|
10
|
+
|
|
11
|
+
Closes the Phase 12 test-coverage slate that had Waves A + B shipped but Wave C (plans `12-05` / `12-06` / `12-07`) never executed. The plans were migrated to **Phase 14.6** (`.planning/phases/14.6-test-coverage-completion/`) and the gdd-unique test files those plans targeted are now validated end-to-end alongside the pre-existing suite.
|
|
12
|
+
|
|
13
|
+
### Verified — gdd-unique test coverage (no code diff vs 1.14.6)
|
|
14
|
+
|
|
15
|
+
Inspection during Phase 14.6 execution confirmed that all 13 gdd-unique test files from the Wave-C migration are present in `tests/` and pass under `npm test`. No net-new test source ships with this release — Phase 14.6's substantive deliverable is the validation, documentation, and closeout bump.
|
|
16
|
+
|
|
17
|
+
| Area | Test files covered |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Pipeline + data | `pipeline-smoke`, `mapper-schema`, `parallelism-engine`, `touches-analysis`, `cycle-lifecycle`, `intel-consistency` |
|
|
20
|
+
| Feature correctness | `sketch-determinism`, `connection-probe`, `figma-writer-dry-run`, `reflection-proposal`, `deprecation-redirect`, `nng-coverage`, `read-injection-scanner` |
|
|
21
|
+
|
|
22
|
+
Full suite: **343 tests, 342 pass, 1 skipped, 0 fail**.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` (outer + `plugins[0]`), `package.json` — version `1.14.6` → `1.14.7`.
|
|
27
|
+
- `tests/semver-compare.test.cjs` — `1.14.7` registered in `OFF_CADENCE_VERSIONS`.
|
|
28
|
+
|
|
29
|
+
### Notes
|
|
30
|
+
|
|
31
|
+
- Phase 12 ROADMAP entry remains **Complete** (scope-reduced); Phase 14.6 is now marked **Complete** with the Wave-C + closeout scope that was split out on 2026-04-24.
|
|
32
|
+
- Phase 14.7 (First-Run Proof Path) retains its reserved release slot and will ship as a subsequent PATCH bump (the original `v1.14.7` reservation shifts forward to the next available patch when Phase 14.7 ships).
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## [1.14.6] — 2026-04-24
|
|
37
|
+
|
|
38
|
+
### Phase 14.5 — Safety + Recall Floor
|
|
39
|
+
|
|
40
|
+
Closes two unrelated risks before the Phase 15–19 reference-library expansion and the Phase 20+ autonomy ramp: (a) agents had no typed reference index and no cache-stable L0 preamble; (b) no defense-in-depth around prompt-injected bash, protected-paths violations, runaway blast radius, or the Figma plugin-sandbox hill-climb failure mode. Ships the minimum-viable version of both tracks as one cohesive release.
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
**Safety hooks**
|
|
45
|
+
- `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.
|
|
46
|
+
- `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.
|
|
47
|
+
- `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.
|
|
48
|
+
|
|
49
|
+
**Injection-scanner extension**
|
|
50
|
+
- `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`.
|
|
51
|
+
|
|
52
|
+
**Decision-injector hook (first cross-cycle recall primitive)**
|
|
53
|
+
- `hooks/gdd-decision-injector.js` — PreToolUse:Read on any `.design/**.md | reference/**.md | .planning/**.md` ≥ 1500 bytes. Surfaces the top-15 matching D-XX decisions, L-NN learnings, and cycle-N summary excerpts that reference the opened file's basename or path. Grep backend (ripgrep when available, Node fs fallback); Phase 19.5 will swap in FTS5 transparently.
|
|
54
|
+
|
|
55
|
+
**Reference registry + L0/L2 cache split**
|
|
56
|
+
- `reference/registry.schema.json` + `reference/registry.json` — typed index of every `reference/*.md` and `.default.json` file (18 entry types: `preamble | meta-rules | heuristic | output-contract | defaults | schema | data | motion | surfaces | authority-feed | influences | easing | taxonomy | principles | emotional-design | experience | palette | style-vocabulary`). Round-trip enforced by `scripts/lib/reference-registry.cjs.validateRegistry()`.
|
|
57
|
+
- `scripts/build-intel.cjs` re-runs `validateRegistry()` on any `reference/**` change.
|
|
58
|
+
- `reference/meta-rules.md` (tier L0) — 5 framework-invariant subsections extracted verbatim from `reference/shared-preamble.md`. `shared-preamble.md` becomes an L0 aggregator (imports `meta-rules.md` first), shrunk from ~6.5KB to <4KB. Stabilizes the Anthropic 5-min prompt-cache prefix.
|
|
59
|
+
- `reference/cycle-handoff-preamble.md` — "reference, not current requests" framing prose imported by `/gdd:pause` and `/gdd:resume`.
|
|
60
|
+
- `reference/retrieval-contract.md` — 3-layer `search → metadata → full-doc` protocol with per-row token-cost labels. Imported by `/gdd:progress`, `/gdd:resume`, `/gdd:reflect`, `/gdd:pause`.
|
|
61
|
+
|
|
62
|
+
**Figma authoring-intent guard + MCP circuit-breaker**
|
|
63
|
+
- `reference/figma-sandbox.md` — 4 Figma plugin-sandbox pitfalls encoded as hard rules (`loadFontAsync` no-cache, `findOne` O(N), `appendChild` AutoLayout recomputation, per-call ~5–10s timeout).
|
|
64
|
+
- `reference/mcp-budget.default.json` + `reference/schemas/mcp-budget.schema.json` — defaults: `max_calls_per_task: 30`, `max_consecutive_timeouts: 3`, `reset_on_success: true`, tracked tools `mcp__*use_figma | use_paper | use_pencil`.
|
|
65
|
+
- `agents/design-figma-writer` Step 0.5 **Authoring-Intent Guard** — bilingual EN/RU pattern set classifies invocations as author-intent vs decision-intent. Author-intent STOPs with a redirect to `figma:figma-generate-design` and cites the 4 pitfalls. Decision-intent proceeds. Bumped `size_budget` LARGE → XL.
|
|
66
|
+
- `hooks/gdd-mcp-circuit-breaker.js` — PostToolUse on `mcp__*use_figma | use_paper | use_pencil`. Appends `{ts, tool, outcome, consecutive_timeouts, total_calls}` rows to `.design/telemetry/mcp-budget.jsonl`. Breaks with `{continue:false}` at threshold + appends a STATE.md blocker.
|
|
67
|
+
- README.md + `connections/figma.md` gain the authoring-redirect callout + 4-pitfalls summary.
|
|
68
|
+
|
|
69
|
+
**Tests** (8 new files, ~60 new assertions):
|
|
70
|
+
- `bash-guard`, `protected-paths`, `blast-radius`, `decision-injector`, `reference-registry`, `meta-rules-split`, `figma-authoring-guard`, `mcp-circuit-breaker` all added. `read-injection-scanner.test.cjs` extended with bidi-override + HTML-comment hijack + secret-exfil + benign-regression cases.
|
|
71
|
+
|
|
72
|
+
### Changed
|
|
73
|
+
|
|
74
|
+
- `agents/design-executor.md` — new Preflight Blast-Radius Check + MCP Budget sections.
|
|
75
|
+
- `agents/design-figma-writer.md` — Step 0.5 Authoring-Intent Guard; `size_budget: XL`.
|
|
76
|
+
- `reference/shared-preamble.md` — rewritten as L0 aggregator.
|
|
77
|
+
- `scripts/build-intel.cjs` — registry round-trip on `reference/**` changes.
|
|
78
|
+
- `skills/{progress,resume,reflect,pause}/SKILL.md` — import `reference/retrieval-contract.md` (+ `cycle-handoff-preamble.md` for pause + resume).
|
|
79
|
+
- `hooks/hooks.json` — registers bash-guard, protected-paths, decision-injector, MCP circuit-breaker.
|
|
80
|
+
- Plugin manifests — add `safety-hardening`, `protected-paths`, `decision-injector`, `reference-registry`, `mcp-circuit-breaker` keywords.
|
|
81
|
+
- `tests/semver-compare.test.cjs` — `1.14.6` added to `OFF_CADENCE_VERSIONS`.
|
|
82
|
+
|
|
83
|
+
### Security
|
|
84
|
+
|
|
85
|
+
- Bash guard normalizes Unicode (NFKC + strip zero-width + bidi) and ANSI escapes before pattern match — blocks bidi-override obfuscation, zero-width-injected verbs, and ANSI-colored reformulations.
|
|
86
|
+
- Read-injection scanner flags invisible-Unicode sequences, HTML-comment hijacks, and secret-exfil triggers (7 → 22 patterns).
|
|
87
|
+
- Protected-paths enforces a merge-only glob list — user configs cannot reduce the default-protected set.
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## [1.14.5] — 2026-04-23
|
|
92
|
+
|
|
93
|
+
### Fixed — Preview MCP silently skipped in verify even when available ([#19](https://github.com/hegemonart/get-design-done/issues/19))
|
|
94
|
+
|
|
95
|
+
`design-verifier` was spawned with `tools: Read, Write, Bash, Grep, Glob` only. The verify skill's orchestrator-level probe correctly classified the session as `preview: available` and wrote it to `STATE.md`, but the subagent's tool allowlist blocked every `mcp__Claude_Preview__*` call, causing Phase 4B to silently skip screenshot capture and leave all `? VISUAL` heuristic flags unresolved.
|
|
96
|
+
|
|
97
|
+
**Fix:** Added six Preview MCP tools to `design-verifier`'s `tools:` frontmatter — `preview_list`, `preview_navigate`, `preview_screenshot`, `preview_eval`, `preview_snapshot`, `preview_inspect` — so Phase 4B runs in the same permission context as the probe.
|
|
98
|
+
|
|
99
|
+
**Probe hardening:** The availability probe in `connections/preview.md` and `skills/verify/SKILL.md` now distinguishes three failure modes instead of collapsing them to `not_configured`/`unavailable`:
|
|
100
|
+
|
|
101
|
+
| New status | Meaning |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `not_loaded` | ToolSearch empty — MCP not registered in this session |
|
|
104
|
+
| `permission_denied` | ToolSearch found the tool but the live call was rejected by the tool permission layer |
|
|
105
|
+
| `unreachable` | Tool loaded but live call errored for a non-permission reason (no dev server, timeout) |
|
|
106
|
+
|
|
107
|
+
The Phase 4B gate in `design-verifier` skips on all non-`available` statuses and emits a targeted message on `permission_denied` to aid diagnosis.
|
|
108
|
+
|
|
109
|
+
`connections/preview.md` now documents the **execution-context requirement**: the probe and the `preview_*` calls must run in the same context; a parent-session probe does not transfer to a spawned subagent.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
7
113
|
## [1.14.4] — 2026-04-20
|
|
8
114
|
|
|
9
115
|
### Fixed — Figma MCP install URL was stale
|
package/README.md
CHANGED
|
@@ -489,6 +489,21 @@ See [`connections/magic-patterns.md`](connections/magic-patterns.md) for probe p
|
|
|
489
489
|
|
|
490
490
|
---
|
|
491
491
|
|
|
492
|
+
## Safety + Recall Floor
|
|
493
|
+
|
|
494
|
+
Starting with v1.14.6, GDD ships three defense-in-depth hooks, the first cross-cycle recall primitive, and a typed reference index:
|
|
495
|
+
|
|
496
|
+
- **Bash guard** (`hooks/gdd-bash-guard.js`) — PreToolUse:Bash blocks ~45 dangerous shell patterns after Unicode NFKC + ANSI + zero-width/bidi normalization, so `rm\u200B -rf /`, bidi-override obfuscations, and hex-encoded exec sequences fail closed.
|
|
497
|
+
- **Protected paths** (`hooks/gdd-protected-paths.js`) — PreToolUse:Edit|Write|Bash refuses to mutate `reference/**`, `skills/**`, `commands/**`, `hooks/**`, `.design/archive/**`, `.design/config.json`, `.design/telemetry/**`, `.git/**`, both plugin manifests, and anything the user appends under `.design/config.json.protected_paths` (merge-only — user configs cannot reduce the default set).
|
|
498
|
+
- **Blast-radius preflight** (`scripts/lib/blast-radius.cjs`) — `design-executor` refuses tasks above `.design/config.json.blast_radius.max_files_per_task` (default 10), `max_lines_per_task` (default 400), or `max_mcp_calls_per_task` (default 30); writes a blocker to STATE.md with a diff summary.
|
|
499
|
+
- **Decision-injector** (`hooks/gdd-decision-injector.js`) — PreToolUse:Read on any `.design/**.md | reference/**.md | .planning/**.md` ≥ 1500 bytes surfaces the top-15 matching D-XX decisions, L-NN learnings, and prior-cycle summary excerpts that reference the opened file. Grep backend; Phase 19.5 upgrades to FTS5 transparently.
|
|
500
|
+
|
|
501
|
+
**Reference index** — `reference/registry.json` (schema: `reference/registry.schema.json`) indexes every `reference/*.md` by typed category (`heuristic | preamble | motion | defaults | meta-rules | …`). Agents can query `list({type: "heuristic"})` instead of grep-hunting import strings. `scripts/build-intel.cjs` enforces round-trip on every `reference/**` change: missing entries, dangling entries, and duplicates fail the build.
|
|
502
|
+
|
|
503
|
+
**L0/L2 cache-locality split** — the 5 framework-invariant rules (Required Reading Discipline, Writes Protocol, Deviation Handling, Completion Markers, Context-Exhaustion & Budget Awareness) now live in `reference/meta-rules.md` (tier L0). `reference/shared-preamble.md` becomes an L0 aggregator importing `meta-rules.md` first, so Phase 15+ L2 churn (heuristics, anti-patterns, checklists) no longer invalidates the L0 prompt-cache prefix.
|
|
504
|
+
|
|
505
|
+
**Figma authoring-redirect** — `/gdd:figma-write` is a decision-writer (annotations, token bindings, Code Connect, implementation-status). For authoring new Figma content (create pages, populate library components, build layouts from scratch), use `figma:figma-generate-design` from the Figma plugin — it runs outside the Figma plugin sandbox. `design-figma-writer` Step 0.5 detects author-intent (EN + RU) and emits a bilingual redirect citing the four sandbox pitfalls in `reference/figma-sandbox.md`. The MCP circuit-breaker (`hooks/gdd-mcp-circuit-breaker.js`) caps `use_figma | use_paper | use_pencil` at 30 calls/task and 3 consecutive timeouts by default (see `reference/mcp-budget.default.json`), logging per-call JSONL at `.design/telemetry/mcp-budget.jsonl`.
|
|
506
|
+
|
|
492
507
|
## Commands
|
|
493
508
|
|
|
494
509
|
All commands use the `/gdd:` namespace.
|
|
@@ -621,6 +636,8 @@ claude mcp add --transport http figma https://mcp.figma.com/mcp
|
|
|
621
636
|
|
|
622
637
|
Setup: [`connections/figma.md`](connections/figma.md). If you previously registered the remote MCP with the legacy URL `https://mcp.figma.com/v1/sse`, remove and re-add with the current URL `https://mcp.figma.com/mcp` (Streamable HTTP).
|
|
623
638
|
|
|
639
|
+
> ⚠︎ **Authoring new Figma content?** `/gdd:figma-write` is a *decision-writer* (annotations, token bindings, Code Connect). For **creating pages, populating with library components, building doc layouts from scratch**, use `figma:figma-generate-design` from the Figma plugin — it runs outside the plugin sandbox. See [`reference/figma-sandbox.md`](reference/figma-sandbox.md) for the four sandbox pitfalls the MCP circuit-breaker (`hooks/gdd-mcp-circuit-breaker.js`) protects you from (defaults: 30 calls/task, 3 consecutive timeouts → break).
|
|
640
|
+
|
|
624
641
|
### Refero MCP
|
|
625
642
|
|
|
626
643
|
When Refero is active, `explore` pulls visual references to ground design decisions. Requires an API token in `~/.claude.json`:
|
|
@@ -39,6 +39,47 @@ The orchestrating stage supplies a `<required_reading>` block in the prompt. Rea
|
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
+
## Preflight — Blast-Radius Check
|
|
43
|
+
|
|
44
|
+
Before the FIRST Edit/Write of this task, run a blast-radius preflight:
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
const { estimate, formatDiffSummary, loadConfig } = require('scripts/lib/blast-radius.cjs');
|
|
48
|
+
const cfg = loadConfig();
|
|
49
|
+
const result = estimate({
|
|
50
|
+
touchedPaths: <paths this task declares>,
|
|
51
|
+
diffStats: { insertions: <estimate>, deletions: <estimate> },
|
|
52
|
+
config: cfg,
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Ceilings** (defaults; user may override in `.design/config.json.blast_radius`):
|
|
57
|
+
- `max_files_per_task: 10`
|
|
58
|
+
- `max_lines_per_task: 400`
|
|
59
|
+
- `max_mcp_calls_per_task: 30` (see MCP Budget section)
|
|
60
|
+
|
|
61
|
+
**If `result.exceeds === true`:** STOP. Do NOT Edit/Write. Append `formatDiffSummary({touchedPaths, diffStats, result})` to `.design/STATE.md` under a new blocker line, then emit a structured deviation:
|
|
62
|
+
|
|
63
|
+
> Rule 3 — Blast-Radius Exceeds: this task would touch `<files>` files / `<lines>` lines, above the per-task ceiling. Proposed split: <suggest 2–3 sub-tasks that each stay under the limit>. User must explicitly approve a single ceiling raise or accept the split.
|
|
64
|
+
|
|
65
|
+
Proceed only after the user confirms. The preflight is skipped entirely when both ceilings are set to `0` in config.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## MCP Budget — Per-Task
|
|
70
|
+
|
|
71
|
+
Before every `mcp__*use_figma`, `mcp__*use_paper`, `mcp__*use_pencil`, or equivalent mutation-side MCP call, check the rolling counter:
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
const { estimateMCPCalls, loadConfig } = require('scripts/lib/blast-radius.cjs');
|
|
75
|
+
const r = estimateMCPCalls({ toolCalls: <calls-issued-so-far>, config: loadConfig() });
|
|
76
|
+
if (r.exceeds) STOP;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The MCP circuit-breaker (`hooks/gdd-mcp-circuit-breaker.js`) enforces the same ceiling at the tool boundary; the preflight here avoids wasting a MCP round-trip before the hook blocks you. Surface in `/gdd:stats` as "MCP calls this task: N/limit".
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
42
83
|
## Prompt Context Fields
|
|
43
84
|
|
|
44
85
|
The stage embeds the following fields in the prompt. Use them to locate and execute the correct task:
|
|
@@ -6,7 +6,7 @@ color: purple
|
|
|
6
6
|
model: inherit
|
|
7
7
|
default-tier: sonnet
|
|
8
8
|
tier-rationale: "Writer proposes + executes Figma write-backs — Sonnet handles structured proposal synthesis well"
|
|
9
|
-
size_budget:
|
|
9
|
+
size_budget: XL
|
|
10
10
|
parallel-safe: never
|
|
11
11
|
typical-duration-seconds: 120
|
|
12
12
|
reads-only: false
|
|
@@ -40,6 +40,66 @@ Note: the remote Figma MCP (canonical server name `figma`, URL `https://mcp.figm
|
|
|
40
40
|
|
|
41
41
|
---
|
|
42
42
|
|
|
43
|
+
## Step 0.5 — Authoring-Intent Guard
|
|
44
|
+
|
|
45
|
+
BEFORE proceeding to Step 1, analyze the invocation text (prompt + task description + any user-facing message in the agent dispatch) for **authoring-intent**. `design-figma-writer` is a *decision-writer* (annotations, token bindings, Code Connect, implementation-status). When the user wants to *author* new Figma content (create pages, populate with library components, build doc layouts from scratch), the correct tool is `figma:figma-generate-design` from the Figma plugin — it runs outside the sandbox and has no per-call timeout.
|
|
46
|
+
|
|
47
|
+
Apply the patterns below (case-insensitive, whitespace-tolerant). If ANY author-intent pattern matches AND NO decision-intent pattern dominates the text, STOP with the redirect response and do not proceed to the remote-MCP probe or any `use_figma` call.
|
|
48
|
+
|
|
49
|
+
**Author-intent patterns (EN):**
|
|
50
|
+
- `create .{0,30}(page|file|frame|layout|doc)`
|
|
51
|
+
- `(populate|fill|build) .{0,40}(with )?(components|library)`
|
|
52
|
+
- `(author|write|generate|produce|build) .{0,30}(doc|documentation|spec|design)`
|
|
53
|
+
- `make .{0,30}(layout|frame|page|template)`
|
|
54
|
+
- `spin up .{0,30}Figma`
|
|
55
|
+
- `design .{0,30}(page|doc|spec|layout) .{0,20}(from|in) (scratch|Figma)`
|
|
56
|
+
|
|
57
|
+
**Author-intent patterns (RU):**
|
|
58
|
+
- `(создай|сделай|построй|свёрстай|собери|оформи) .{0,30}(страниц|макет|документац|страницу|документ|файл|лейаут|шаблон)`
|
|
59
|
+
- `(новую?|новый) страниц[уыа]`
|
|
60
|
+
- `документац[иия] .{0,40}токен`
|
|
61
|
+
- `сгенерируй .{0,30}Figma`
|
|
62
|
+
|
|
63
|
+
**Decision-intent patterns (EN) — these WIN over ambiguous author-intent:**
|
|
64
|
+
- `annotate .{0,30}(selection|frame|component)`
|
|
65
|
+
- `bind .{0,30}token`
|
|
66
|
+
- `code connect`
|
|
67
|
+
- `code-connect`
|
|
68
|
+
- `update .{0,30}(status|implementation)`
|
|
69
|
+
- `write .{0,30}D-\d+`
|
|
70
|
+
- `sync .{0,30}(tokens?|variables?)`
|
|
71
|
+
|
|
72
|
+
**Decision-intent patterns (RU):**
|
|
73
|
+
- `привяжи .{0,30}токен`
|
|
74
|
+
- `аннотируй`
|
|
75
|
+
- `синхронизируй .{0,30}токен`
|
|
76
|
+
|
|
77
|
+
### Decision rule
|
|
78
|
+
- If decision-intent matches AND author-intent doesn't match, proceed normally.
|
|
79
|
+
- If author-intent matches AND NO decision-intent match, STOP with redirect.
|
|
80
|
+
- If BOTH match (mixed), favor decision-intent (the guard is permissive; the circuit-breaker catches runaway cases downstream).
|
|
81
|
+
- If NEITHER matches, proceed normally (default is decision-writing — the guard doesn't block the common case).
|
|
82
|
+
|
|
83
|
+
### Redirect response (emit verbatim and STOP)
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
This task reads as authoring new Figma content. `design-figma-writer` is a decision-writer — it uses `use_figma` inside the Figma plugin sandbox with ~5–10s per-call timeout, so multi-row docs-authoring hill-climbs against the timeout and burns MCP quota.
|
|
87
|
+
|
|
88
|
+
Use `figma:figma-generate-design` from the Figma plugin instead — it runs outside the sandbox and has no per-call timeout.
|
|
89
|
+
|
|
90
|
+
Four sandbox pitfalls you would hit here on raw `use_figma` calls:
|
|
91
|
+
1. `loadFontAsync` does not cache across calls — preload once, clone existing nodes.
|
|
92
|
+
2. `figma.root.findOne()` is O(tree-size) — pass node IDs and use `getNodeById`.
|
|
93
|
+
3. `appendChild` on large trees forces full AutoLayout recomputation — build subtrees off-tree.
|
|
94
|
+
4. Per-call timeout is ~5–10s — budget ≤2 row-equivalents per call.
|
|
95
|
+
|
|
96
|
+
See `reference/figma-sandbox.md`.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
After emitting the redirect, STOP with the marker `## FIGMA AUTHORING-INTENT REDIRECT` and do NOT proceed to Step 1.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
43
103
|
## Step 1 — Read State and Flags
|
|
44
104
|
|
|
45
105
|
Read `.design/STATE.md` to confirm `figma: available` in the `<connections>` block. If `figma: not_configured` or `figma: unavailable`, write to output: "Figma connection not configured. Run the scan probe or set figma: available in .design/STATE.md." and STOP.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-verifier
|
|
3
3
|
description: Goal-backward verification of design outcomes against .design/STATE.md must-haves, NNG heuristics, and audit rubric. Returns pass result or structured gap list. Spawned by the verify stage.
|
|
4
|
-
tools: Read, Write, Bash, Grep, Glob
|
|
4
|
+
tools: Read, Write, Bash, Grep, Glob, mcp__Claude_Preview__preview_list, mcp__Claude_Preview__preview_navigate, mcp__Claude_Preview__preview_screenshot, mcp__Claude_Preview__preview_eval, mcp__Claude_Preview__preview_snapshot, mcp__Claude_Preview__preview_inspect
|
|
5
5
|
color: green
|
|
6
6
|
model: inherit
|
|
7
7
|
default-tier: haiku
|
|
@@ -267,7 +267,7 @@ Record each response. For `no` responses, capture the user's issue description v
|
|
|
267
267
|
|
|
268
268
|
## Phase 4B — Screenshot Evidence (when preview: available)
|
|
269
269
|
|
|
270
|
-
**Gate:** Skip this entire Phase 4B block if `preview` is `not_configured` or `unavailable` in STATE.md `<connections>`. The `? VISUAL` flags from Phase 3 remain as-is; mark them `[SKIPPED — browser not available]` and proceed to Phase 5.
|
|
270
|
+
**Gate:** Skip this entire Phase 4B block if `preview` is `not_loaded`, `not_configured`, `permission_denied`, `unreachable`, or `unavailable` in STATE.md `<connections>`. The `? VISUAL` flags from Phase 3 remain as-is; mark them `[SKIPPED — browser not available]` and proceed to Phase 5. When skipping due to `permission_denied`, also log: `Preview MCP tools missing from agent allowlist — contact the pipeline maintainer.`
|
|
271
271
|
|
|
272
272
|
**Step 1 — ToolSearch first:**
|
|
273
273
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
This directory contains connection specifications for external tools and MCPs that the get-design-done pipeline integrates with. Each connection has its own spec file. This file is the index.
|
|
4
4
|
|
|
5
|
+
**Getting started:** run `/gdd:connections` for the interactive onboarding wizard — it probes all 12 connections, recommends setup based on your project type, and walks you through installing each one (auto-run for reversible MCP adds, copy-command for everything else). You can also run `/gdd:connections list` for a read-only status check or `/gdd:connections <name>` to jump to a single connection's setup.
|
|
6
|
+
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
## Active Connections
|
package/connections/figma.md
CHANGED
|
@@ -63,6 +63,16 @@ No data is lost — the remote MCP reads the same Figma files.
|
|
|
63
63
|
|
|
64
64
|
---
|
|
65
65
|
|
|
66
|
+
> ⚠︎ **Authoring-redirect** — `/gdd:figma-write` (and the `design-figma-writer` agent behind it) is a *decision-writer*: annotations, token bindings, Code Connect mappings, implementation-status write-back. For **authoring new Figma content** — create pages, populate with library components, build doc layouts from scratch — use `figma:figma-generate-design` from the Figma plugin. It runs outside the plugin sandbox and has no per-call timeout.
|
|
67
|
+
>
|
|
68
|
+
> **Four sandbox pitfalls `use_figma` hits in authoring loops (see `reference/figma-sandbox.md`):**
|
|
69
|
+
> 1. `loadFontAsync` does not cache across calls — preload once, clone existing nodes.
|
|
70
|
+
> 2. `figma.root.findOne()` is O(tree-size) — pass node IDs and use `getNodeById`.
|
|
71
|
+
> 3. `appendChild` on large trees forces full AutoLayout recomputation — build subtrees off-tree.
|
|
72
|
+
> 4. Per-call timeout is ~5–10s — budget ≤2 row-equivalents per call for docs-authoring.
|
|
73
|
+
>
|
|
74
|
+
> The MCP circuit-breaker (`hooks/gdd-mcp-circuit-breaker.js`) enforces a per-task ceiling of 30 calls and 3 consecutive timeouts by default; see `reference/mcp-budget.default.json`.
|
|
75
|
+
|
|
66
76
|
## Tools
|
|
67
77
|
|
|
68
78
|
Tool names take the form `mcp__<prefix>__<tool>` where `<prefix>` is the resolved server name from the probe (commonly `figma` for remote or `figma-desktop` for local). The pipeline discovers the prefix at runtime — see **Availability Probe** below. The `mcp__figma__` examples shown here assume a server registered as `figma`.
|
package/connections/preview.md
CHANGED
|
@@ -67,16 +67,19 @@ All tools use the `mcp__Claude_Preview__` prefix.
|
|
|
67
67
|
|
|
68
68
|
**Preview probe sequence:**
|
|
69
69
|
|
|
70
|
+
> **Execution-context requirement:** The probe and the subsequent `preview_*` calls must run in the **same execution context**. If the probe runs in the orchestrator and the calls run inside a spawned subagent, the subagent's tool allowlist may block the calls even when the probe succeeds. Run the probe where the calls will actually happen, or ensure the spawned agent's `tools:` frontmatter includes `mcp__Claude_Preview__*` tools.
|
|
71
|
+
|
|
70
72
|
```
|
|
71
73
|
Step P1 — ToolSearch check:
|
|
72
74
|
ToolSearch({ query: "Claude_Preview", max_results: 5 })
|
|
73
|
-
→ Empty result → preview:
|
|
75
|
+
→ Empty result → preview: not_loaded (MCP not registered in this session — skip all Preview steps)
|
|
74
76
|
→ Non-empty result → proceed to Step P2
|
|
75
77
|
|
|
76
78
|
Step P2 — Live tool call:
|
|
77
79
|
call mcp__Claude_Preview__preview_list
|
|
78
|
-
→ Success (returns array, even empty)
|
|
79
|
-
→ Error
|
|
80
|
+
→ Success (returns array, even empty) → preview: available
|
|
81
|
+
→ Error containing "permission" or blocked → preview: permission_denied
|
|
82
|
+
→ Any other error → preview: unreachable
|
|
80
83
|
```
|
|
81
84
|
|
|
82
85
|
Write the result to `.design/STATE.md <connections>` immediately after probing.
|
|
@@ -142,8 +145,9 @@ preview: available
|
|
|
142
145
|
| Value | Meaning |
|
|
143
146
|
|-------|---------|
|
|
144
147
|
| `available` | `preview_list` returned a successful response (array, even empty) |
|
|
145
|
-
| `
|
|
146
|
-
| `
|
|
148
|
+
| `permission_denied` | Tool is in the session (ToolSearch found it) but the live call was rejected by the tool permission layer — likely missing from the agent's `tools:` frontmatter |
|
|
149
|
+
| `unreachable` | Tool is in the session but the live call errored for a non-permission reason (no running server, timeout, internal error) |
|
|
150
|
+
| `not_loaded` | ToolSearch returned empty for `Claude_Preview` — MCP not registered in this session |
|
|
147
151
|
|
|
148
152
|
**Which stages probe vs. read:**
|
|
149
153
|
|
package/hooks/budget-enforcer.js
CHANGED
|
@@ -288,8 +288,8 @@ async function main() {
|
|
|
288
288
|
process.stdout.write(JSON.stringify(response));
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
// 80% soft-threshold downgrade (D-03)
|
|
292
|
-
if (budget.auto_downgrade_on_cap &&
|
|
291
|
+
// 80% soft-threshold downgrade (D-03): task-scoped, per reference/model-tiers.md
|
|
292
|
+
if (budget.auto_downgrade_on_cap && estCost >= (0.80 * budget.per_task_cap_usd)) {
|
|
293
293
|
toolInput._tier_override = 'haiku';
|
|
294
294
|
toolInput._tier_downgraded = true;
|
|
295
295
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
/**
|
|
4
|
+
* hooks/gdd-bash-guard.js — PreToolUse:Bash guard
|
|
5
|
+
* Blocks ~50 dangerous shell patterns after Unicode NFKC + ANSI-strip normalization.
|
|
6
|
+
* See scripts/lib/dangerous-patterns.cjs for the canonical pattern list.
|
|
7
|
+
*
|
|
8
|
+
* Contract:
|
|
9
|
+
* Input (stdin JSON): { tool_name, tool_input: { command } }
|
|
10
|
+
* Output (stdout JSON):
|
|
11
|
+
* - match → { continue: false, stopReason: "..." }
|
|
12
|
+
* - no match → { continue: true }
|
|
13
|
+
* Exit: always 0 (soft failure; the hook never short-circuits the user via exit code).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const path = require('path');
|
|
17
|
+
const { match } = require(path.join(__dirname, '..', 'scripts', 'lib', 'dangerous-patterns.cjs'));
|
|
18
|
+
|
|
19
|
+
async function main() {
|
|
20
|
+
let buf = '';
|
|
21
|
+
for await (const chunk of process.stdin) buf += chunk;
|
|
22
|
+
|
|
23
|
+
let payload;
|
|
24
|
+
try { payload = JSON.parse(buf || '{}'); } catch {
|
|
25
|
+
process.stdout.write(JSON.stringify({ continue: true }));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (payload?.tool_name && payload.tool_name !== 'Bash') {
|
|
30
|
+
process.stdout.write(JSON.stringify({ continue: true }));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const command = payload?.tool_input?.command ?? '';
|
|
35
|
+
const r = match(command);
|
|
36
|
+
if (r.matched) {
|
|
37
|
+
process.stdout.write(JSON.stringify({
|
|
38
|
+
continue: false,
|
|
39
|
+
stopReason: `gdd-bash-guard: dangerous command blocked (${r.severity}): ${r.description} [${r.pattern}]`,
|
|
40
|
+
}));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
process.stdout.write(JSON.stringify({ continue: true }));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
main().catch(() => {
|
|
48
|
+
process.stdout.write(JSON.stringify({ continue: true }));
|
|
49
|
+
});
|