@hegemonart/get-design-done 1.0.7 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +129 -2
  4. package/README.md +186 -53
  5. package/SKILL.md +6 -4
  6. package/agents/design-authority-watcher.md +208 -0
  7. package/agents/design-component-generator.md +221 -0
  8. package/agents/design-context-builder.md +83 -6
  9. package/agents/design-discussant.md +1 -1
  10. package/agents/design-figma-writer.md +8 -8
  11. package/agents/design-paper-writer.md +131 -0
  12. package/agents/design-pencil-writer.md +99 -0
  13. package/agents/design-research-synthesizer.md +13 -1
  14. package/agents/design-update-checker.md +117 -0
  15. package/agents/design-verifier.md +51 -0
  16. package/agents/token-mapper.md +1 -1
  17. package/connections/21st-dev.md +98 -0
  18. package/connections/claude-design.md +0 -1
  19. package/connections/connections.md +50 -33
  20. package/connections/figma.md +81 -39
  21. package/connections/magic-patterns.md +105 -0
  22. package/connections/paper-design.md +137 -0
  23. package/connections/pencil-dev.md +88 -0
  24. package/connections/pinterest.md +0 -1
  25. package/hooks/budget-enforcer.js +13 -2
  26. package/hooks/gdd-read-injection-scanner.js +4 -9
  27. package/hooks/hooks.json +8 -0
  28. package/hooks/update-check.sh +251 -0
  29. package/package.json +1 -1
  30. package/reference/ai-native-tool-interface.md +102 -0
  31. package/reference/authority-feeds.md +72 -0
  32. package/reference/schemas/authority-snapshot.schema.json +42 -0
  33. package/reference/schemas/config.schema.json +4 -0
  34. package/reference/schemas/marketplace.schema.json +2 -2
  35. package/reference/schemas/plugin.schema.json +1 -1
  36. package/scripts/aggregate-agent-metrics.js +20 -0
  37. package/scripts/build-intel.cjs +13 -5
  38. package/scripts/injection-patterns.cjs +17 -0
  39. package/scripts/run-injection-scanner-ci.cjs +1 -10
  40. package/scripts/tests/test-authority-rejected-kinds.sh +58 -0
  41. package/scripts/tests/test-authority-watcher-diff.sh +113 -0
  42. package/scripts/validate-schemas.cjs +18 -1
  43. package/skills/audit/SKILL.md +11 -1
  44. package/skills/check-update/SKILL.md +135 -0
  45. package/skills/complete-cycle/SKILL.md +10 -0
  46. package/skills/design/SKILL.md +5 -5
  47. package/skills/discover/SKILL.md +2 -2
  48. package/skills/explore/SKILL.md +55 -3
  49. package/skills/health/SKILL.md +10 -0
  50. package/skills/help/SKILL.md +10 -0
  51. package/skills/progress/SKILL.md +10 -0
  52. package/skills/reflect/SKILL.md +1 -0
  53. package/skills/scan/SKILL.md +9 -19
  54. package/skills/ship/SKILL.md +10 -0
  55. package/skills/watch-authorities/SKILL.md +82 -0
  56. package/connections/figma-writer.md +0 -139
@@ -8,15 +8,18 @@ This directory contains connection specifications for external tools and MCPs th
8
8
 
9
9
  | Connection | Status | Spec File | Notes |
10
10
  |-----------|--------|-----------|-------|
11
- | Figma | Active | [`connections/figma.md`](connections/figma.md) | Uses `mcp__figma-desktop__*` tools (official Figma Desktop MCP) |
11
+ | Figma | Active | [`connections/figma.md`](connections/figma.md) | Uses `mcp__figma__*` tools (remote Figma MCP; reads + writes) |
12
12
  | Refero | Active | [`connections/refero.md`](connections/refero.md) | Uses `mcp__refero__*` tools (verify names via ToolSearch) |
13
13
  | Preview | Active | [`connections/preview.md`](connections/preview.md) | Uses `mcp__Claude_Preview__*` tools |
14
14
  | Storybook | Active | [`connections/storybook.md`](connections/storybook.md) | HTTP probe: `localhost:6006/index.json` |
15
15
  | Chromatic | Active | [`connections/chromatic.md`](connections/chromatic.md) | CLI: `npx chromatic`; env: `CHROMATIC_PROJECT_TOKEN` |
16
- | Figma Writer | Active | [`connections/figma-writer.md`](connections/figma-writer.md) | Uses `mcp__figma__use_figma` (remote MCP) |
17
16
  | Graphify | Active | [`connections/graphify.md`](connections/graphify.md) | CLI: `graphify`; `gsd-tools graphify *` |
18
17
  | Pinterest | Active | [`connections/pinterest.md`](connections/pinterest.md) | `mcp__mcp-pinterest__*` tools (ToolSearch-only probe; headless scraping, no API key) |
19
18
  | Claude Design | Active | [`connections/claude-design.md`](connections/claude-design.md) | No MCP — bundle file probe; enables `/gdd:handoff` pipeline + bidirectional write-back via figma-writer |
19
+ | paper.design | Active | [`connections/paper-design.md`](connections/paper-design.md) | Uses `mcp__paper-design__*` tools; free tier: 100 calls/week |
20
+ | pencil.dev | Active | [`connections/pencil-dev.md`](connections/pencil-dev.md) | File-based; `.pen` YAML specs; git-tracked; no MCP |
21
+ | 21st.dev Magic MCP | Active | [`connections/21st-dev.md`](connections/21st-dev.md) | Uses `mcp__21st*` tools; `TWENTY_FIRST_API_KEY` required |
22
+ | Magic Patterns | Active | [`connections/magic-patterns.md`](connections/magic-patterns.md) | Claude connector (`mcp__magic_patterns*`) + API key fallback |
20
23
 
21
24
  ---
22
25
 
@@ -24,17 +27,20 @@ This directory contains connection specifications for external tools and MCPs th
24
27
 
25
28
  Each cell describes what the connection contributes at that pipeline stage, or `—` if it is not used.
26
29
 
27
- | Connection | scan | discover | plan | design | verify |
28
- |-----------|------|----------|------|--------|--------|
29
- | Figma | token augmentation via `get_variable_defs` (CONN-03) | decisions pre-populate via `get_variable_defs` (CONN-04) | — | — | — |
30
- | Refero | — | reference search via `mcp__refero__search`; fallback → awesome-design-md (CONN-05) | — | — | — |
31
- | Preview | — | — | — | — | screenshots for `? VISUAL` checks (VIS-02) |
32
- | Storybook | — | component inventory (STB-01) | change-risk via story count (STB-02) | `.stories.tsx` stub (STB-03) | a11y per story (STB-02) |
33
- | Chromatic | — | — | change-risk scoping (CHR-02) | — | visual delta narration (CHR-01) |
34
- | Figma Writer | — | — | — | write tokens/annotations/Code Connect (FWR-01..04) | — |
35
- | Graphify | | | dependency scoping (GRF-03) | — | orphan detection (GRF-04) |
36
- | Pinterest | probe only | visual reference search via `pinterest_search`; fallbackRefero awesome-design-md | — | — | — |
37
- | Claude Design | bundle probe `claude_design: available` | synthesizer handoff mode parses bundle → D-XX decisions; discussant `--from-handoff` confirms | (skipped in handoff) | — (skipped in handoff) | Handoff Faithfulness section; bidirectional write-back via figma-writer `implementation-status` mode |
30
+ | Connection | scan | discover | plan | design | verify | canvas | generator |
31
+ |-----------|------|----------|------|--------|--------|--------|-----------|
32
+ | 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) | — | — | — |
33
+ | Refero | — | reference search via `mcp__refero__search`; fallback → awesome-design-md (CONN-05) | — | — | — | — | — |
34
+ | Preview | — | — | — | — | screenshots for `? VISUAL` checks (VIS-02) | — | — |
35
+ | Storybook | — | component inventory (STB-01) | change-risk via story count (STB-02) | `.stories.tsx` stub (STB-03) | a11y per story (STB-02) | — | — |
36
+ | Chromatic | — | — | change-risk scoping (CHR-02) | — | visual delta narration (CHR-01) | — | — |
37
+ | Graphify | — | — | dependency scoping (GRF-03) | — | orphan detection (GRF-04) | — | — |
38
+ | Pinterest | probe only | visual reference search via `pinterest_search`; fallback → Refero → awesome-design-md | — | | | — | — |
39
+ | Claude Design | bundle probe `claude_design: available` | synthesizer handoff mode parses bundleD-XX decisions; discussant `--from-handoff` confirms | — (skipped in handoff) | — (skipped in handoff) | Handoff Faithfulness section; bidirectional write-back via figma-writer `implementation-status` mode | — | — |
40
+ | paper.design | | canvas read: `get_selection`, `get_jsx`, `get_computed_styles` | — | paper-writer: annotate/tokenize/roundtrip | `get_screenshot` for `? VISUAL` | | — |
41
+ | pencil.dev | `.pen` discovery | `.pen` as canonical design source | — | pencil-writer: annotate/roundtrip | spec-vs-impl diff | ✓ | — |
42
+ | 21st.dev | — | prior-art gate: marketplace search before greenfield build | — | component-generator (21st impl) | — | — | ✓ |
43
+ | Magic Patterns | — | — | — | component-generator (magic-patterns impl) | preview_url → `? VISUAL` check | — | ✓ |
38
44
 
39
45
  **Column definitions:**
40
46
 
@@ -43,6 +49,8 @@ Each cell describes what the connection contributes at that pipeline stage, or `
43
49
  - **plan** — what the connection contributes to planning artifacts
44
50
  - **design** — what the connection provides during design execution
45
51
  - **verify** — what the connection checks or surfaces during verification
52
+ - **canvas** — whether the connection provides bidirectional canvas read+write (see `reference/ai-native-tool-interface.md`)
53
+ - **generator** — whether the connection provides AI component generation (see `reference/ai-native-tool-interface.md`)
46
54
 
47
55
  ---
48
56
 
@@ -75,16 +83,18 @@ refero: not_configured
75
83
 
76
84
  **Figma probe (execute at stage entry, after reading STATE.md):**
77
85
 
86
+ One probe covers both reads and writes — the remote Figma MCP is a single server exposing `get_metadata`, `get_variable_defs`, `get_design_context`, `get_screenshot`, and `use_figma` together.
87
+
78
88
  ```
79
89
  Step A1 — ToolSearch check:
80
- ToolSearch({ query: "select:mcp__figma-desktop__get_metadata", max_results: 1 })
90
+ ToolSearch({ query: "select:mcp__figma__get_metadata", max_results: 1 })
81
91
  → Empty result → figma: not_configured (skip all Figma steps)
82
92
  → Non-empty result → proceed to Step A2
83
93
 
84
94
  Step A2 — Live tool call:
85
- call mcp__figma-desktop__get_metadata
86
- → Success → figma: available
87
- → Error → figma: unavailable (skip all Figma steps)
95
+ call mcp__figma__get_metadata
96
+ → Success → figma: available (reads AND use_figma writes both available)
97
+ → Error → figma: unavailable (skip all Figma steps)
88
98
 
89
99
  Write figma status to STATE.md <connections>.
90
100
  ```
@@ -156,19 +166,6 @@ Write chromatic status to STATE.md <connections>.
156
166
 
157
167
  Note: First Chromatic run has no baseline — all stories become new snapshots. This is expected; it establishes the baseline.
158
168
 
159
- **Figma Writer probe (execute before any write operation):**
160
-
161
- ```
162
- Step R1 — ToolSearch check:
163
- ToolSearch({ query: "mcp__figma__use_figma", max_results: 1 })
164
- → Empty result → figma_writer: not_configured
165
- → Non-empty result → figma_writer: available
166
-
167
- Write figma_writer status to STATE.md <connections>.
168
- ```
169
-
170
- Note: figma_writer is a separate connection key from figma (desktop). Both can be active simultaneously. There is no `unavailable` state for figma_writer — the ToolSearch-only probe cannot detect auth failures; those surface at execution time.
171
-
172
169
  **Graphify probe (execute at agent entry, before using graph):**
173
170
 
174
171
  ```
@@ -189,7 +186,7 @@ Write graphify status to STATE.md <connections>.
189
186
 
190
187
  **Graceful degradation required:** stages MUST continue when a connection is `unavailable` or `not_configured`. Skip connection-dependent steps. If a missing connection prevents a `must_have` from being satisfied, append a `<blocker>` to `.design/STATE.md` and continue.
191
188
 
192
- For full per-connection fallback details, see the spec files: [`connections/figma.md`](connections/figma.md), [`connections/refero.md`](connections/refero.md), [`connections/preview.md`](connections/preview.md), [`connections/storybook.md`](connections/storybook.md), [`connections/chromatic.md`](connections/chromatic.md), [`connections/figma-writer.md`](connections/figma-writer.md), and [`connections/graphify.md`](connections/graphify.md).
189
+ For full per-connection fallback details, see the spec files: [`connections/figma.md`](connections/figma.md), [`connections/refero.md`](connections/refero.md), [`connections/preview.md`](connections/preview.md), [`connections/storybook.md`](connections/storybook.md), [`connections/chromatic.md`](connections/chromatic.md), and [`connections/graphify.md`](connections/graphify.md).
193
190
 
194
191
  ---
195
192
 
@@ -203,7 +200,7 @@ To add a new connection to the pipeline:
203
200
 
204
201
  3. **Update the Capability Matrix.** Add a row for the new connection. Mark the stages it feeds with a short capability noun; use `—` for stages it does not affect.
205
202
 
206
- 4. **Declare the MCP.** If the connection uses an MCP server, ensure the server is declared in `.claude-plugin/plugin.json` or documented as a user-supplied MCP in the spec file. For read-only MCP connections, use `connections/figma.md` as the model. For remote MCP write connections, use `connections/figma-writer.md` as the model.
203
+ 4. **Declare the MCP.** If the connection uses an MCP server, ensure the server is declared in `.claude-plugin/plugin.json` or documented as a user-supplied MCP in the spec file. For read+write remote MCPs, use `connections/figma.md` as the model. For read-only remote MCPs with headless / API-key-free setup, use `connections/pinterest.md`.
207
204
 
208
205
  5. **Wire into stage skills (Phase 2+ work).** Update the relevant stage `SKILL.md` files to probe the connection at entry and write its status to `.design/STATE.md <connections>`.
209
206
 
@@ -215,4 +212,24 @@ To add a new connection to the pipeline:
215
212
 
216
213
  - `connections/` is infrastructure scaffolding introduced in Phase 1. Stage integration (wiring detection and graceful degradation into each stage) is Phase 2 work.
217
214
  - Phase 8 added five new active connections. Linear and GitHub remain planned for a future phase.
218
- - The capability matrix columns map to the five pipeline stages: `scan | discover | plan | design | verify`.
215
+ - Phase 14 added four AI-native design tool connections (paper.design, pencil.dev, 21st.dev, Magic Patterns) and the canvas/generator capability columns.
216
+ - The capability matrix columns map to the five pipeline stages: `scan | discover | plan | design | verify`, plus `canvas` and `generator` sub-categories.
217
+
218
+ ---
219
+
220
+ ## Future AI-Native Tools (Backlog)
221
+
222
+ Candidate tools to integrate using the contract in `reference/ai-native-tool-interface.md`.
223
+
224
+ | Tool | Sub-category | Priority |
225
+ |------|-------------|----------|
226
+ | Subframe | canvas | high |
227
+ | v0.dev | generator | high |
228
+ | Galileo AI | generator | medium |
229
+ | Builder.io Visual Copilot | canvas + generator | medium |
230
+ | Locofy | generator | low |
231
+ | Anima | canvas | low |
232
+ | Plasmic | generator | medium |
233
+ | TeleportHQ | generator | low |
234
+
235
+ To add any of these: follow the steps in `reference/ai-native-tool-interface.md §Extending with Future Tools`.
@@ -1,6 +1,6 @@
1
1
  # Figma MCP — Connection Specification
2
2
 
3
- This file is the connection specification for the official Figma Desktop MCP within the get-design-done pipeline. It provides the setup guide, tool inventory, per-stage usage, probe pattern, fallback behavior, and anti-patterns. See `connections/connections.md` for the full connection index and capability matrix.
3
+ This file is the connection specification for the Figma MCP (remote, read + write) within the get-design-done pipeline. One server exposes both read tools (`get_metadata`, `get_design_context`, `get_variable_defs`, `get_screenshot`) and the write tool `use_figma`. See `connections/connections.md` for the full connection index and capability matrix.
4
4
 
5
5
  ---
6
6
 
@@ -8,49 +8,77 @@ This file is the connection specification for the official Figma Desktop MCP wit
8
8
 
9
9
  **Prerequisites:**
10
10
 
11
- - Figma desktop app installed and running
12
- - Dev Mode enabled in the Figma desktop app (File menu Enable Dev Mode, or toggle in the toolbar)
11
+ - A Figma account (OAuth on first use at `mcp.figma.com`).
12
+ - Figma file access for any file you intend to read or write. No desktop app install required.
13
13
 
14
14
  **Install command (Claude Code):**
15
15
 
16
16
  ```
17
- claude mcp add --transport http figma-desktop http://127.0.0.1:3845/mcp
17
+ claude mcp add figma --transport http https://mcp.figma.com/v1/sse
18
18
  ```
19
19
 
20
- After running this command, restart the Claude Code session. The MCP server connects via HTTP to the Figma desktop app's local MCP endpoint.
20
+ After running this command, restart the Claude Code session. On first use, Claude Code prompts you to complete the OAuth flow at `mcp.figma.com`. One `claude mcp add` unlocks both reads and writes — there is no separate writer MCP.
21
21
 
22
22
  **Verification:**
23
23
 
24
24
  After session restart, run:
25
25
 
26
26
  ```
27
- ToolSearch({ query: "figma-desktop", max_results: 10 })
27
+ ToolSearch({ query: "select:mcp__figma__get_metadata,mcp__figma__use_figma", max_results: 2 })
28
28
  ```
29
29
 
30
- Expect non-empty results listing `mcp__figma-desktop__*` tools. If results are empty, the desktop app is not running or Dev Mode is not enabled fix both and restart.
30
+ Expect two non-empty results. If results are empty, the remote MCP is not registered re-run the install command above and restart the session.
31
31
 
32
- **Warning wrong MCP confusion:**
32
+ **Migration from the legacy dual-MCP setup:**
33
33
 
34
- This spec targets the **official Figma Desktop MCP** (`mcp__figma-desktop__*` prefix, server name `figma-desktop`, HTTP transport).
34
+ Earlier versions of this plugin used two separate Figma MCPs `figma-desktop` (local HTTP, read-only) and `figma` (remote, writes-only). As of **v1.0.7.1**, the remote MCP exposes full read parity and is the single supported Figma connection. If you installed `figma-desktop` previously, you can remove it:
35
35
 
36
- Do NOT confuse with the southleft `figma-console-mcp` package (registered as `"figma-console"` in `~/.claude/mcp.json`, uses `figma_*` prefix). Both can be active simultaneously. The pipeline uses `mcp__figma-desktop__*` exclusively — it is stable, official, and requires no external package dependency beyond the Figma desktop app.
36
+ ```
37
+ claude mcp remove figma-desktop
38
+ ```
39
+
40
+ No data is lost — the remote MCP reads the same Figma files.
37
41
 
38
42
  ---
39
43
 
40
44
  ## Tools
41
45
 
42
- All tools use the `mcp__figma-desktop__` prefix.
46
+ All tools use the `mcp__figma__` prefix (remote MCP).
43
47
 
44
- | Tool | Full name | Returns | Phase 4 use |
45
- |------|-----------|---------|-------------|
46
- | `get_variable_defs` | `mcp__figma-desktop__get_variable_defs` | Variable collection tree: collection ID, mode names, variable names (hierarchical, e.g. `colors/primary/500`), resolved values (hex for COLOR, float for FLOAT), descriptions, scopes | **In scope** — scan: token augmentation (CONN-03); discover: decisions pre-population (CONN-04) |
47
- | `get_design_context` | `mcp__figma-desktop__get_design_context` | Structured React+Tailwind component tree of the current Figma selection | **In scope (secondary)** — discover: existing design decisions for established Figma systems |
48
- | `get_screenshot` | `mcp__figma-desktop__get_screenshot` | Screenshot image of the selected Figma layer or frame | Out of scope Phase 4 |
49
- | `get_metadata` | `mcp__figma-desktop__get_metadata` | Lightweight XML outline: layer IDs, names, types, position/size. Works with no selection open. | **In scope** — used as the availability probe (no file must be open) |
50
- | `get_code_connect_map` | `mcp__figma-desktop__get_code_connect_map` | Maps Figma component instances to code implementations (file paths, framework labels) | Out of scope Phase 4 |
51
- | `create_design_system_rules` | `mcp__figma-desktop__create_design_system_rules` | Generates rule files for design system alignment during code generation | Out of scope Phase 4 |
48
+ | Tool | Full name | Returns | Pipeline use |
49
+ |------|-----------|---------|--------------|
50
+ | `get_metadata` | `mcp__figma__get_metadata` | Lightweight outline: node IDs, names, types, position/size. Also the availability probe. | **In scope** — probe (works without a selection); metadata snapshot for figma-write proposal review |
51
+ | `get_variable_defs` | `mcp__figma__get_variable_defs` | Variable collection tree: collection ID, mode names, variable names (hierarchical, e.g. `colors/primary/500`), resolved values, descriptions, scopes | **In scope** — scan: token augmentation (CONN-03); discover: decisions pre-population (CONN-04); figma-write: tokenize mode source |
52
+ | `get_design_context` | `mcp__figma__get_design_context` | Structured React+Tailwind component tree of the current Figma selection | **In scope (secondary)** discover: existing design decisions for established Figma systems |
53
+ | `get_screenshot` | `mcp__figma__get_screenshot` | Screenshot image of the selected Figma layer or frame | **In scope (opt-in)** — visual reference capture for discovery; not invoked by default |
54
+ | `use_figma` | `mcp__figma__use_figma` | Write operation result | **In scope** figma-write: all three modes (annotate, tokenize, mappings) |
55
+ | `get_code_connect_map` | `mcp__figma__get_code_connect_map` | Maps Figma component instances to code file paths | Out of scope this phase (reserved for future Code Connect work) |
56
+ | `add_code_connect_map` | `mcp__figma__add_code_connect_map` | Adds Code Connect mapping entries | Out of scope this phase (reserved for future Code Connect work) |
57
+ | `create_design_system_rules` | `mcp__figma__create_design_system_rules` | Generates rule files for design system alignment during code generation | Out of scope this phase |
52
58
 
53
- `get_metadata` is preferred for probing because it works without a file or selection open, keeping the probe lightweight. `get_variable_defs` is the primary workhorse for token extraction and decisions pre-population.
59
+ `get_metadata` is preferred for probing because it works without a file or selection open, keeping the probe lightweight. `get_variable_defs` is the primary workhorse for token extraction and decisions pre-population. `use_figma` is the single entry point for every write.
60
+
61
+ ---
62
+
63
+ ## Writes (`use_figma`)
64
+
65
+ `use_figma` is the single write tool. The `design-figma-writer` agent (`agents/design-figma-writer.md`) wraps it in a **proposal → confirm** UX — it builds a numbered operation list and presents it to the user before executing any write. The user must confirm before `use_figma` is called.
66
+
67
+ ### Three Modes
68
+
69
+ The figma-writer operates in one of three modes per invocation:
70
+
71
+ | Mode | Description | Source data | Figma target |
72
+ |------|-------------|-------------|--------------|
73
+ | `annotate` | Write design-decision annotations onto Figma layer comments | D-XX decisions from DESIGN-CONTEXT.md | Layer comments on affected frames/components |
74
+ | `tokenize` | Replace hard-coded color/spacing/type literals with Figma variable references | Color/spacing/typography values from DESIGN-CONTEXT.md; existing variables from `get_variable_defs` | Variable bindings on layer fill/stroke/spacing properties |
75
+ | `mappings` | Write Code Connect mappings linking component instances to code file paths | Component names and file paths from DESIGN-CONTEXT.md | Code Connect entries on Figma component nodes |
76
+
77
+ ### Write-Time Safety
78
+
79
+ 1. **`--dry-run`** — emit the full operation list without calling `use_figma`. Safe to run on production Figma files.
80
+ 2. **`--confirm-shared`** — when the proposal includes shared team-library components, the agent halts and requires this flag. Prevents accidental team-wide token modification.
81
+ 3. **Sequential, not atomic execution.** If one operation fails mid-sequence, the agent logs the error and continues with remaining operations. The summary lists all failures for manual follow-up. The Figma file may be left in a partially-updated state — this is a property of `use_figma`, not of the wrapper.
54
82
 
55
83
  ---
56
84
 
@@ -59,9 +87,11 @@ All tools use the `mcp__figma-desktop__` prefix.
59
87
  | Stage | Skill/Agent | Tool used | Purpose |
60
88
  |-------|------------|-----------|---------|
61
89
  | scan | `skills/scan/SKILL.md` | `get_variable_defs` | Token augmentation — supplements grep-based CSS token extraction with Figma variable definitions (CONN-03) |
62
- | discover | `agents/design-context-builder.md` | `get_variable_defs` | Decisions pre-population — pre-fills D-XX color/spacing/typography decisions from Figma variables before the interview (CONN-04) |
63
- | plan | | — | Not currently used |
64
- | verify | | | Not currently used |
90
+ | discover | `agents/design-context-builder.md` | `get_variable_defs`, `get_design_context` | Decisions pre-population — pre-fills D-XX color/spacing/typography decisions from Figma variables before the interview (CONN-04) |
91
+ | design | `skills/design/SKILL.md` (dispatch only) | — | Offer to spawn design-figma-writer after design-executor completes, when `figma: available` |
92
+ | figma-write | `agents/design-figma-writer.md` | `use_figma` (writes), `get_metadata` + `get_variable_defs` (proposal-time reads) | Write design decisions back to Figma in three modes (annotate / tokenize / mappings) |
93
+ | plan | — | — | Not used |
94
+ | verify | — | — | Not used |
65
95
 
66
96
  Both scan and discover call `get_variable_defs` with no explicit selection to retrieve all variables in the active Figma file. If no file is open, the call errors and the stage falls back to its non-Figma path.
67
97
 
@@ -69,29 +99,31 @@ Both scan and discover call `get_variable_defs` with no explicit selection to re
69
99
 
70
100
  ## Availability Probe
71
101
 
72
- **Call ToolSearch first — always.** In Claude Code sessions with many MCP servers, `mcp__figma-desktop__*` tools may be in the deferred tool set (not loaded into context at session start). Calling a deferred tool directly fails silently or errors. ToolSearch loads the tools into context and confirms their presence in a single call.
102
+ **Call ToolSearch first — always.** In Claude Code sessions with many MCP servers, `mcp__figma__*` tools may be in the deferred tool set (not loaded into context at session start). Calling a deferred tool directly fails silently or errors. ToolSearch loads the tools into context and confirms their presence in a single call.
103
+
104
+ One probe covers both reads and writes — the remote MCP is a single server that exposes `get_metadata`, `get_variable_defs`, `get_design_context`, `get_screenshot`, and `use_figma` together. Presence of `get_metadata` implies `use_figma` is available on the same server.
73
105
 
74
106
  **Figma probe sequence:**
75
107
 
76
108
  ```
77
109
  Step 1 — ToolSearch check:
78
- ToolSearch({ query: "select:mcp__figma-desktop__get_metadata", max_results: 1 })
79
- → Empty result → figma: not_configured (MCP not registered or app not running)
110
+ ToolSearch({ query: "select:mcp__figma__get_metadata", max_results: 1 })
111
+ → Empty result → figma: not_configured (MCP not registered; OAuth not completed)
80
112
  → Non-empty result → proceed to Step 2
81
113
 
82
114
  Step 2 — Live tool call:
83
- call mcp__figma-desktop__get_metadata
84
- → Success → figma: available
85
- → Error → figma: unavailable
115
+ call mcp__figma__get_metadata
116
+ → Success → figma: available (reads AND writes both available on this server)
117
+ → Error → figma: unavailable (auth expired, rate-limited, or no file open)
86
118
  ```
87
119
 
88
- Write the result to `.design/STATE.md <connections>` immediately after probing.
120
+ Write the result to `.design/STATE.md` `<connections>` immediately after probing.
89
121
 
90
122
  ---
91
123
 
92
124
  ## Fallback Behavior
93
125
 
94
- When figma is `not_configured` or `unavailable`, stages degrade gracefully — no error is raised.
126
+ When `figma` is `not_configured` or `unavailable`, stages degrade gracefully — no error is raised.
95
127
 
96
128
  **scan stage:**
97
129
 
@@ -106,7 +138,13 @@ When figma is `not_configured` or `unavailable`, stages degrade gracefully — n
106
138
  - Populate D-XX decisions via interview only (manual elicitation from the user)
107
139
  - DESIGN-CONTEXT.md omits the "Token decisions pre-populated from Figma variables" note
108
140
 
109
- Neither stage appends a `<blocker>` for a missing Figma connection — Figma is an enhancement, not a requirement. If a `must_have` explicitly requires Figma data, THEN append a blocker.
141
+ **design stage + figma-write:**
142
+
143
+ - `figma: not_configured` or `figma: unavailable` → skip the figma-write dispatch offer entirely (no prompt, no output)
144
+ - `figma: available` → offer opt-in prompt after design-executor completes
145
+ - Standalone `/gdd:figma-write` invocation against `figma: not_configured` → STOP with install note
146
+
147
+ Stages do not append a `<blocker>` for a missing Figma connection — Figma is an enhancement, not a requirement. If a `must_have` explicitly requires Figma data (reads or writes), THEN append a blocker.
110
148
 
111
149
  ---
112
150
 
@@ -125,11 +163,11 @@ refero: not_configured
125
163
 
126
164
  | Value | Meaning |
127
165
  |-------|---------|
128
- | `available` | `get_metadata` returned a successful response |
129
- | `unavailable` | Tool is in the session but errored (app offline, no file open, rate-limited) |
130
- | `not_configured` | ToolSearch returned empty for `figma-desktop` — MCP not registered |
166
+ | `available` | `get_metadata` returned a successful response; both reads and `use_figma` writes are expected to work |
167
+ | `unavailable` | Tool is in the session but errored (auth expired, no file open, rate-limited) |
168
+ | `not_configured` | ToolSearch returned empty for `mcp__figma__*` — MCP not registered |
131
169
 
132
- The `<connections>` schema is minimal by design. Traceability of which outputs came from Figma is handled via source annotations in DESIGN.md (`source: figma-variables`) and DESIGN-CONTEXT.md ("pre-populated from Figma variables"), not via richer STATE.md fields.
170
+ The `<connections>` schema is minimal by design. Traceability of which outputs came from Figma is handled via source annotations in DESIGN.md (`source: figma-variables`) and DESIGN-CONTEXT.md ("pre-populated from Figma variables"), not via richer STATE.md fields. There is no separate `figma_writer:` key — one remote server, one status.
133
171
 
134
172
  ---
135
173
 
@@ -137,10 +175,14 @@ The `<connections>` schema is minimal by design. Traceability of which outputs c
137
175
 
138
176
  - **`get_variable_defs` returns resolved values, not alias chains.** If a semantic token (`colors/semantic/brand`) aliases a primitive (`colors/blue/500`), only the resolved hex is returned. When recording variables in DESIGN.md, use the variable NAME alongside the hex: `colors/semantic/brand = #3B82F6`. Add a note: "resolved value — may alias a primitive; verify in Figma if the token layer matters."
139
177
 
140
- - **`get_variable_defs` requires an open Figma file.** If no file is open in the desktop app, the call errors. The probe falls to `unavailable` in this case — the stage skips Figma steps and continues with non-Figma fallbacks.
178
+ - **`get_variable_defs` requires an open Figma file.** If no file is open or none is in the current context, the call errors. The probe falls to `unavailable` in this case — the stage skips Figma steps and continues with non-Figma fallbacks.
141
179
 
142
180
  - **Multi-mode variables (Light/Dark).** Variables may carry values for multiple modes. When present, extract both: `#3B82F6 (light) / #60A5FA (dark)`. DESIGN.md can note dark-mode token existence in the color section.
143
181
 
144
- - **Deferred-tool loading.** Always call `ToolSearch` before any `mcp__figma-desktop__*` tool invocation. This applies at every stage entry, even if Figma was `available` in a previous run — tool availability can change between sessions.
182
+ - **Deferred-tool loading.** Always call `ToolSearch` before any `mcp__figma__*` tool invocation. This applies at every stage entry, even if Figma was `available` in a previous run — tool availability can change between sessions.
183
+
184
+ - **All writes require user confirmation.** The proposal→confirm UX in `design-figma-writer` ensures the user reviews all operations before any write is executed. There is no auto-approve mode. See `agents/design-figma-writer.md` for the proposal contract.
185
+
186
+ - **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.
145
187
 
146
- - **Wrong-MCP confusion.** This spec covers `mcp__figma-desktop__*` (official Figma Desktop MCP). The southleft `figma-console-mcp` uses `figma_*` prefix and serves different use cases. Do not mix them. If ToolSearch returns results prefixed `figma_` but not `mcp__figma-desktop__`, the Figma Desktop MCP is still not configured.
188
+ - **No `figma-desktop` fallback.** As of v1.0.7.1 the desktop MCP is no longer a supported read path. If you need offline/no-network reads for some reason, run the pipeline's non-Figma fallbacks (grep-based token extraction, interview-only decisions).
@@ -0,0 +1,105 @@
1
+ # Magic Patterns — Connection Specification
2
+
3
+ This file is the connection specification for Magic Patterns within the get-design-done pipeline. Magic Patterns is a component-generator tool — it generates DS-aware UI components from natural-language descriptions. It integrates via the Magic Patterns Claude connector (no manual setup when enabled) or via a direct API key. See `connections/connections.md` for the full connection index and capability matrix.
4
+
5
+ ---
6
+
7
+ ## Setup
8
+
9
+ ### Prerequisites
10
+
11
+ **Path A — Claude connector (preferred):**
12
+ - Magic Patterns Claude connector enabled in your Claude environment
13
+ - No additional setup required
14
+
15
+ **Path B — API key fallback:**
16
+ - A Magic Patterns account and API key at [magicpatterns.com](https://magicpatterns.com)
17
+ - `MAGIC_PATTERNS_API_KEY` environment variable set
18
+ - MCP server install:
19
+ ```bash
20
+ claude mcp add magic-patterns --transport http https://mcp.magicpatterns.com/sse \
21
+ -e MAGIC_PATTERNS_API_KEY=$MAGIC_PATTERNS_API_KEY
22
+ ```
23
+
24
+ ### Verification
25
+
26
+ ```
27
+ ToolSearch({ query: "mcp__magic_patterns", max_results: 5 })
28
+ ```
29
+
30
+ Non-empty results including `magic_patterns_generate` → Claude connector available (Path A).
31
+ Empty → install Path B and restart Claude Code session.
32
+
33
+ ---
34
+
35
+ ## Probe Pattern
36
+
37
+ Magic Patterns uses a two-path probe. Check Claude connector first; fall back to API key path.
38
+
39
+ ```
40
+ ToolSearch({ query: "mcp__magic_patterns", max_results: 5 })
41
+ → Non-empty → magic-patterns: available (Claude connector)
42
+ → Empty → check MAGIC_PATTERNS_API_KEY env var
43
+ set → magic-patterns: available (API key path)
44
+ unset → magic-patterns: not_configured
45
+ ```
46
+
47
+ Write result to STATE.md `<connections>`: `magic-patterns: <status>`
48
+
49
+ Fallback: when `not_configured`, the design stage skips Magic Patterns and falls back to 21st.dev (if available) or manual component build.
50
+
51
+ ---
52
+
53
+ ## Magic Patterns Tools
54
+
55
+ | Tool | Stage | Purpose |
56
+ |------|-------|---------|
57
+ | `magic_patterns_generate` | design | Generate component from description; returns `{ code, preview_url, component_id }` |
58
+ | `magic_patterns_annotate` | design | Post DESIGN-DEBT findings back to a component by ID |
59
+ | `magic_patterns_regenerate` | design | Roundtrip: regenerate with updated description |
60
+
61
+ ### `magic_patterns_generate` parameters
62
+
63
+ | Parameter | Values | Notes |
64
+ |-----------|--------|-------|
65
+ | `description` | string | Natural-language component spec |
66
+ | `design_system` | `"shadcn" \| "tailwind" \| "mantine" \| "chakra"` | Auto-detected from project in explore stage |
67
+ | `quality_mode` | `"fast" \| "best"` | `fast` for explore iterations; `best` for final design stage output |
68
+
69
+ ---
70
+
71
+ ## Pipeline Integration
72
+
73
+ | Stage | What Magic Patterns provides |
74
+ |-------|------------------------------|
75
+ | explore | DS detection → STATE.md `<design_system>` block for generator targeting |
76
+ | design | `magic_patterns_generate(description, design_system, quality_mode: "best")` → component source + `preview_url` |
77
+ | verify | `preview_url` from generate response → feeds Phase 8 Preview `? VISUAL` check |
78
+ | design | `magic_patterns_annotate(component_id, feedback)` → roundtrip mode; post DESIGN-DEBT notes back |
79
+
80
+ ### Design-System Auto-Detection
81
+
82
+ Before invoking `magic_patterns_generate`, the explore stage detects the project's active design system (see `agents/design-context-builder.md` Step 0C):
83
+
84
+ 1. Check `gdd.config.json` (if present): read `designSystem` field → use directly if set.
85
+ 2. Scan `package.json` dependencies:
86
+ - `@shadcn/ui` or `shadcn` present → `"shadcn"`
87
+ - `@mantine/core` or `@mantine/hooks` present → `"mantine"`
88
+ - `@chakra-ui/react` present → `"chakra"`
89
+ - `tailwindcss` present → `"tailwind"`
90
+ 3. Default: `"tailwind"`
91
+
92
+ Write result to STATE.md `<design_system>` block.
93
+
94
+ ### Preview Integration
95
+
96
+ `magic_patterns_generate` returns `preview_url`. The design-component-generator agent writes this URL to STATE.md `<generator>` block. The verify stage's `? VISUAL` check reads `preview_url` from STATE.md and opens it in Phase 8 Preview for visual comparison.
97
+
98
+ ---
99
+
100
+ ## Fallback Behavior
101
+
102
+ When `magic-patterns: not_configured`:
103
+ - Print: `Magic Patterns not configured — component generator skipped.`
104
+ - Falls back to 21st.dev if `21st-dev: available`.
105
+ - If both not configured, design stage proceeds with manual component build.
@@ -0,0 +1,137 @@
1
+ # paper.design MCP — Connection Specification
2
+
3
+ This file is the connection specification for paper.design within the get-design-done pipeline. paper.design is a canvas tool — it treats the design canvas as both source AND destination, enabling a full canvas→code→verify→canvas round-trip. See `connections/connections.md` for the full connection index and capability matrix.
4
+
5
+ ---
6
+
7
+ ## Setup
8
+
9
+ ### Prerequisites
10
+ - A paper.design account
11
+ - paper.design MCP server registered in your Claude Code session
12
+
13
+ ### Install command (Claude Code)
14
+
15
+ ```bash
16
+ claude mcp add paper-design --transport http https://mcp.paper.design/sse
17
+ ```
18
+
19
+ After running this command, restart the Claude Code session.
20
+
21
+ ### Verification
22
+
23
+ ```
24
+ ToolSearch({ query: "mcp__paper", max_results: 5 })
25
+ ```
26
+
27
+ Expect non-empty results including `mcp__paper-design__get_selection` or similar. If empty, re-run the install command above and restart the Claude Code session.
28
+
29
+ ### Budget
30
+
31
+ paper.design **free tier**: 100 MCP calls/week. Pro tier: 1M calls/week. The pipeline tracks `budget_used` in STATE.md `<connections>` and warns at 90 calls.
32
+
33
+ ---
34
+
35
+ ## Probe Pattern
36
+
37
+ ```
38
+ ToolSearch({ query: "mcp__paper", max_results: 5 })
39
+ → Empty → paper-design: not_configured (skip all paper.design steps)
40
+ → Non-empty → proceed to live call
41
+
42
+ call mcp__paper-design__get_selection
43
+ → Success → paper-design: available
44
+ → Error → paper-design: unavailable
45
+ ```
46
+
47
+ Write result to STATE.md `<connections>`: `paper-design: <status>`
48
+
49
+ Also write initial budget state:
50
+ ```xml
51
+ <connections>
52
+ paper-design: available | budget_used: 0 | budget_limit: 100
53
+ </connections>
54
+ ```
55
+
56
+ ---
57
+
58
+ ## paper.design MCP Tools
59
+
60
+ | Tool | Stage | Purpose |
61
+ |------|-------|---------|
62
+ | `mcp__paper-design__get_selection` | explore | JSON of selected canvas elements (id, type, name, bounds) |
63
+ | `mcp__paper-design__get_jsx` | explore | React JSX string of selected component tree |
64
+ | `mcp__paper-design__get_computed_styles` | explore | CSS computed styles for current selection |
65
+ | `mcp__paper-design__get_screenshot` | verify | Base64 PNG screenshot of selected canvas element |
66
+ | `mcp__paper-design__add_comment` | design | Add annotation comment to a canvas node |
67
+ | `mcp__paper-design__update_styles` | design | Update CSS properties of a canvas node |
68
+ | `mcp__paper-design__set_text_content` | design | Write text content to a canvas text layer |
69
+ | `mcp__paper-design__write_html` | design | Write HTML snippet to a canvas layer |
70
+
71
+ ---
72
+
73
+ ## Pipeline Integration
74
+
75
+ | Stage | What paper.design provides |
76
+ |-------|---------------------------|
77
+ | explore | Canvas read: `get_selection` (node list), `get_jsx` (React component tree), `get_computed_styles` (CSS values) → merged into DESIGN-CONTEXT.md |
78
+ | design | `design-paper-writer` agent: annotate / tokenize / roundtrip modes via write tools |
79
+ | verify | `get_screenshot` for components flagged `? VISUAL` — element-scoped (complements route-scoped Preview screenshots) |
80
+
81
+ ### Canvas Read (Explore Stage)
82
+
83
+ The explore stage context-builder reads the paper.design canvas via:
84
+
85
+ 1. `mcp__paper-design__get_selection` — get selected element IDs and names
86
+ 2. `mcp__paper-design__get_jsx` — get full React component tree of selection
87
+ 3. `mcp__paper-design__get_computed_styles` — get computed CSS values
88
+
89
+ Results are merged into DESIGN-CONTEXT.md as a `<canvas_sources>` block alongside Figma variables, Refero refs, and other sources.
90
+
91
+ ### Write-Back (Design Stage)
92
+
93
+ The `design-paper-writer` agent handles write-back in three modes:
94
+ - **annotate** — add design-decision comments to canvas nodes (`add_comment`)
95
+ - **tokenize** — sync CSS token values to paper.design node styles (`update_styles`)
96
+ - **roundtrip** — write implementation status back as text/HTML layers (`set_text_content`, `write_html`)
97
+
98
+ All writes require user confirmation via proposal→confirm flow. See `agents/design-paper-writer.md`.
99
+
100
+ ### Screenshot Verification (Verify Stage)
101
+
102
+ `mcp__paper-design__get_screenshot(node_id)` captures a PNG of a specific canvas element.
103
+
104
+ - Canvas-element-scoped (NOT route-scoped like Phase 8 Preview)
105
+ - Both are complementary: paper.design → canvas component view; Preview → rendered browser route
106
+ - Screenshots saved to `.design/screenshots/paper-<component>-<date>.png`
107
+
108
+ ---
109
+
110
+ ## Budget Tracking
111
+
112
+ After every write tool call, increment `budget_used` in STATE.md:
113
+
114
+ ```xml
115
+ <connections>
116
+ paper-design: available | budget_used: 12 | budget_limit: 100
117
+ </connections>
118
+ ```
119
+
120
+ Warn when `budget_used >= 90`: `Warning: paper.design budget at 90/100 calls this week.`
121
+
122
+ Read tools (`get_selection`, `get_jsx`, `get_computed_styles`, `get_screenshot`) also consume budget — track them as well.
123
+
124
+ ---
125
+
126
+ ## Fallback Behavior
127
+
128
+ When `paper-design: not_configured`:
129
+ - Skip all paper.design steps. Print: `paper.design not configured — canvas integration skipped.`
130
+ - Explore stage proceeds with code-only context (grep + Figma + Storybook if available).
131
+ - Verify stage uses Preview screenshots only (no canvas-element screenshots).
132
+ - Design stage does not offer paper-writer.
133
+
134
+ When `paper-design: unavailable`:
135
+ - Update STATE.md to `paper-design: unavailable`.
136
+ - Print: `paper.design unavailable — check MCP connection and try again.`
137
+ - Degrade as above.