@noemuch/bridge-ds 2.5.0 → 2.5.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bridge-ds",
3
3
  "displayName": "Bridge Design System",
4
- "version": "2.5.0",
4
+ "version": "2.5.1",
5
5
  "description": "AI-powered design generation in Figma — spec-first, DS-native, with a learning loop that improves over time. Extracts your real design system, writes validated specs, and generates production-ready Figma designs using actual DS components and tokens.",
6
6
  "author": {
7
7
  "name": "noemuch",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bridge-ds",
3
3
  "displayName": "Bridge Design System",
4
- "version": "2.5.0",
4
+ "version": "2.5.1",
5
5
  "description": "AI-powered design generation in Figma — spec-first, DS-native, with a learning loop.",
6
6
  "author": "noemuch",
7
7
  "homepage": "https://github.com/noemuch/bridge",
package/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  All notable changes to Bridge DS are documented here.
4
4
 
5
+ ## [2.5.1] — 2026-03-25
6
+
7
+ ### Added
8
+ - **Rule 24**: Never screenshot a page or empty node — create a frame first
9
+ - **Rule 25**: Input/Select components — swap to `state=filled` for real values
10
+ - **Rule 26**: Validate registry keys before writing scripts — copy-paste from registries, never type manually
11
+ - `quick.md`: References Rules 24-26 in generation steps
12
+
13
+ ## [2.5.0] — 2026-03-25
14
+
15
+ ### Added
16
+ - **Dual MCP transport**: Support for both figma-console-mcp (preferred) and official Figma MCP server (fallback). Auto-detection picks the best available transport.
17
+ - **Express mode**: `/design-workflow quick` skips formal spec, generates from brief description with 2 questions max. Same DS quality guarantees.
18
+ - **Plugin packaging**: `.claude-plugin/plugin.json` and `.cursor-plugin/plugin.json` for marketplace distribution.
19
+ - **Transport adapter**: `transport-adapter.md` — central reference for tool mapping, script adaptation, and composite DS extraction.
20
+ - **Rule 23**: Transport-aware scripting in `figma-api-rules.md` (IIFE vs top-level await, official transport constraints).
21
+ - **KB path resolution**: `./bridge-ds/` (plugin mode) or `.claude/skills/` (npm scaffold mode).
22
+ - **`.mcp.json`**: MCP server dependency declaration for plugin installs.
23
+
24
+ ### Changed
25
+ - `mcp-setup.js`: Returns `{ console, official }` instead of boolean.
26
+ - `cli.js`: Reports both transports during init, offers dual setup instructions.
27
+ - `onboarding.md`: Dual transport detection + composite DS extraction for official transport.
28
+ - `quality-gates.md`: Quick mode section with relaxed gates (pattern matching best-effort, no formal spec/review).
29
+ - 6 schema files updated with transport notes.
30
+ - `package.json`: Bumped to v2.5.0, added plugin manifests to `files`.
31
+
5
32
  ## [2.4.1] — 2026-03-20
6
33
 
7
34
  ### Fixed
package/README.md CHANGED
@@ -8,8 +8,9 @@ Bridge turns [Claude Code](https://claude.ai/download) into a designer that know
8
8
  You describe what you want
9
9
  → Claude consults the knowledge base (your DS, documented)
10
10
  → Claude writes the spec (exact components, tokens, layout)
11
- → Claude generates in Figma via figma_execute (real DS components, bound variables)
11
+ → Claude generates in Figma (real DS components, bound variables)
12
12
  → You review in Figma
13
+ → Claude learns from your corrections (and improves next time)
13
14
  ```
14
15
 
15
16
  ## How it works
@@ -19,21 +20,23 @@ Bridge is two things:
19
20
  1. **A CLI** (`bridge-ds init`) that scaffolds your project with the design workflow skill
20
21
  2. **A Claude Code skill** (`/design-workflow`) that handles the intelligence — spec writing, DS knowledge, Figma generation
21
22
 
22
- The transport layer is [figma-console-mcp](https://github.com/southleft/figma-console-mcp), an MCP server that gives Claude native access to Figma (57+ tools).
23
+ Bridge supports two MCP transports:
23
24
 
24
25
  ```
25
- Claude Code ──MCP──> figma-console-mcp ──WebSocket──> Figma Desktop
26
- (your DS library,
27
- real components,
28
- bound variables)
26
+ Claude Code ──MCP──> figma-console-mcp ──WebSocket──> Figma Desktop (preferred)
27
+ Claude Code ──MCP──> Figma MCP Server ──Cloud──> Figma Cloud (official, fallback)
29
28
  ```
30
29
 
30
+ Auto-detection picks the best available transport. See [transport-adapter.md](skills/design-workflow/references/transport-adapter.md) for details.
31
+
31
32
  ## Prerequisites
32
33
 
33
34
  - [Claude Code](https://claude.ai/download) installed
34
35
  - [Node.js 18+](https://nodejs.org)
35
- - [Figma Desktop](https://www.figma.com/downloads/) (not the web app)
36
36
  - A Figma file with a published design system library
37
+ - One of:
38
+ - [figma-console-mcp](https://github.com/southleft/figma-console-mcp) + [Figma Desktop](https://www.figma.com/downloads/) (recommended, full capabilities)
39
+ - Official Figma MCP server (simpler setup, cloud-based)
37
40
 
38
41
  ## Quick Start
39
42
 
@@ -104,6 +107,9 @@ setup (once) → spec → design → review ──→ done
104
107
  extract preferences)
105
108
  ```
106
109
 
110
+ ### Express mode
111
+ For quick iterations, skip the formal spec: `/design-workflow quick "a settings page"`. 2 questions max, inline mini-spec, same DS quality guarantees.
112
+
107
113
  ### Spec-first
108
114
  No design without a validated specification. Claude knows exactly which components, tokens, and layout patterns to use because it has your DS documented.
109
115
 
@@ -139,6 +145,7 @@ knowledge-base/
139
145
  | `/design-workflow setup` | Extract DS + build knowledge base |
140
146
  | `/design-workflow spec {name}` | Write a component or screen spec |
141
147
  | `/design-workflow design` | Generate in Figma from active spec |
148
+ | `/design-workflow quick {description}` | Express generation — skip spec, generate directly |
142
149
  | `/design-workflow review` | Validate design against spec + tokens |
143
150
  | `/design-workflow done` | Archive spec and ship |
144
151
  | `/design-workflow drop` | Abandon with preserved learnings |
@@ -146,6 +153,10 @@ knowledge-base/
146
153
  | `/design-workflow sync` | Incremental DS sync (no full re-setup) |
147
154
  | `/design-workflow status` | Show current state, suggest next action |
148
155
 
156
+ ## Author
157
+
158
+ Built by [Noé Chagué](https://www.linkedin.com/in/noechague/) — Design System @ [Finary](https://finary.com)
159
+
149
160
  ## License
150
161
 
151
162
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noemuch/bridge-ds",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "AI-powered design generation in Figma — 100% design system compliant. Connects Claude Code to Figma via MCP for spec-first, token-bound, component-native design.",
5
5
  "main": "lib/cli.js",
6
6
  "bin": {
@@ -44,13 +44,15 @@ Show the mini-spec to the user and ask: "Generate this design?" (single yes/no c
44
44
  Follow the same generation procedure as design.md steps 3-6:
45
45
  1. Read figma-api-rules.md (MANDATORY — same rules apply in quick mode)
46
46
  2. Determine canvas dimensions based on screen type
47
- 3. **Pre-script audit** (MANDATORY — list every element, cross-reference against registries)
47
+ 3. **Pre-script audit** (MANDATORY — list every element, cross-reference against registries. Validate all keys per Rule 26.)
48
48
  4. Generate atomically in 4-6 scripts, ~30-80 lines each
49
- 5. Take screenshot after each atomic step for verification
50
- 6. Fix any issues before proceeding to next step
49
+ 5. Take screenshot after each atomic step for verification — **but NOT before Script 1** (Rule 24: empty pages/frames cannot be screenshotted)
50
+ 6. For form inputs with values, use `state=filled` variant (Rule 25)
51
+ 7. Fix any issues before proceeding to next step
51
52
 
52
53
  IMPORTANT: These gates are NOT relaxed in quick mode:
53
54
  - Pre-script element audit (Rule 18) — BLOCKING
55
+ - Registry key validation (Rule 26) — BLOCKING
54
56
  - Zero hardcoded hex colors — BLOCKING
55
57
  - Atomic generation with screenshots — MANDATORY
56
58
  - DS component reuse (never recreate) — BLOCKING
@@ -515,6 +515,55 @@ Script format depends on the active MCP transport. See `references/transport-ada
515
515
 
516
516
  ---
517
517
 
518
+ ## Rule 24: Never screenshot a page or empty node
519
+
520
+ `figma_take_screenshot` / `get_screenshot` will fail on:
521
+ - Page nodes (type PAGE) — they are not renderable
522
+ - Empty frames (0 children) — nothing to render
523
+
524
+ **Always create at least one visible frame before taking the first screenshot.** In quick mode and design mode, skip the initial screenshot attempt and wait until after Script 1 has created the root frame.
525
+
526
+ ---
527
+
528
+ ## Rule 25: Input/Select components — swap to `filled` state for values
529
+
530
+ When placing TextInput, SelectInput, or similar form components with actual values (not empty placeholders), **always swap to the `state=filled` variant** before setting text properties. The default variant is often `state=placeholder`, which hides the value text layer.
531
+
532
+ Pattern:
533
+ ```js
534
+ // 1. Import the component set
535
+ var inputSet = await figma.importComponentSetByKeyAsync(TEXTINPUT_KEY);
536
+
537
+ // 2. Find the filled variant (not placeholder)
538
+ var filled = inputSet.findChild(function(n) {
539
+ return n.name.includes("state=filled") || n.name.includes("state=filling");
540
+ });
541
+
542
+ // 3. Create instance from the filled variant
543
+ var instance = filled.createInstance();
544
+
545
+ // 4. Now set text properties — they will be visible
546
+ instance.setProperties({ "label#HASH": "First Name", "placeholder#HASH": "John" });
547
+ ```
548
+
549
+ If the DS has no `filled` variant, check for `default` or `rest` — but never leave `state=placeholder` when displaying real values.
550
+
551
+ ---
552
+
553
+ ## Rule 26: Validate registry keys before writing scripts
554
+
555
+ Variable and component keys are 40-char hex strings — typos crash scripts at runtime with unhelpful errors like `could not find variable with key "..."`.
556
+
557
+ **Before writing any figma_execute / use_figma script:**
558
+ 1. List every key you plan to use in the script
559
+ 2. Cross-reference each key against the exact values in `registries/variables.json`, `registries/components.json`, or `registries/text-styles.json`
560
+ 3. Copy-paste keys directly from the registry — never type them manually
561
+ 4. If a key is not found in registries, search with `Grep` before assuming the name
562
+
563
+ This is part of the pre-script audit (Rule 18). Every key in the script must have a verified source in the registries.
564
+
565
+ ---
566
+
518
567
  ## Standard Script Boilerplate
519
568
 
520
569
  ```js