Help us improve
Share bugs, ideas, or general feedback.
From bridge-ds
Diffs current Figma state against a saved snapshot, classifies changes as design-system learnings or hardcoded flags, persists learnings, and patches the active recipe.
npx claudepluginhub noemuch/bridge --plugin bridge-dsHow this skill is triggered — by the user, by Claude, or both
Slash command
/bridge-ds:learning-from-correctionsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
{{ACTIVE_RULES}}
Generates Figma components and screens from user requests by producing a CSpec, compiling to a scene graph, and executing via MCP with verification.
Automates design review, token extraction, component mapping, and implementation planning from Figma. Reduces design handoff from hours to minutes.
Conducts design interviews, generates five UI variations matching project styles, collects feedback, refines selections, and outputs implementation plans for new or redesigned components.
Share bugs, ideas, or general feedback.
{{ACTIVE_RULES}}
Closes the feedback loop from manual Figma edits back into Bridge's knowledge base. Diffs the live Figma state against the saved snapshot, classifies each correction as a LEARNING (DS-compliant → persisted) or a FLAG (hardcoded → surfaced), updates learnings.json, and auto-patches the active recipe when eligible.
Invoke when the user:
specs/active/ with a snapshotDo NOT use if:
make first (use generating-figma-design)generating-figma-design with a new descriptionshipping-and-archivingBefore starting, load:
references/transport-adapter.md (repo-root) — for Figma state re-readreferences/compiler-reference.md (repo-root) — for scene graph recompile (if re-executing after fix)specs/active/ (abort if missing: "No active CSpec. Run: make <description>")specs/active/{name}-snapshot.json (abort if missing: "No snapshot found. The design must have been generated with make. Run make first.")references/transport-adapter.md (repo-root) Section F)specs/active/{name}.cspec.yamlspecs/active/{name}-snapshot.jsonknowledge-base/learnings.json (create empty structure if file doesn't exist)knowledge-base/registries/variables.json for token resolutionRun a node tree extraction script via Plugin API execution, using the rootNodeId and fileKey from the snapshot's meta.
Console transport:
figma_execute({
code: "return (async function() { ... extraction script with rootNodeId ... })();"
})
Official transport:
use_figma({
fileKey: "{fileKey}",
description: "Re-extract node tree for fix diff",
code: "... extraction script without IIFE wrapper ..."
})
The extraction script walks the node tree and captures: id, name, type, layoutMode, itemSpacing, padding*, cornerRadius, fills, boundVariables, width, height, componentKey, children.
Compare the two JSON trees in context. Claude performs this comparison directly.
Match strategy:
id (stable across edits)layoutMode, itemSpacing, paddingTop/Bottom/Left/RightcornerRadius, fills, boundVariableswidth, heightcomponentKey (detect swapped components)Ignore:
For each detected change:
Does the new value use a DS token (bound variable)?
-> YES: Classify as LEARNING (DS-compliant correction)
-> NO (hardcoded hex, raw px, unbound): Classify as FLAG (needs attention)
Token resolution: Check boundVariables in the current tree. If the property has a bound variable ID, resolve it against registries/variables.json to get the token name.
For each LEARNING-classified change:
Determine context:
screenType: from the CSpec's meta.pattern or intentcomponent: nearest component ancestor name, or the node's own name if it's a component instancesection: parent frame name (e.g., "header", "content", "sidebar")Check for existing learning: Search learnings.json for a learning with matching context + change.property + change.to.token
signals, append to historyGenerate rule: Write a human-readable rule describing the preference (e.g., "For settings screens, cards use spacing/medium (not large)")
Check promotion: After updating signals, check if any contextual learning qualifies for global promotion:
signals >= 3screenType valuesFor each FLAG-classified change:
flags array in learnings.jsonIf a recipe was used (check snapshot.meta.recipe):
graph to reflect the learned changesversion, update lastEvolvedAtevolution_logIf a learning is promoted to global scope, scan ALL recipes and patch any where the change applies.
If learnings were extracted (DS-compliant changes):
Write updated learnings.json to knowledge-base/learnings.json.
Update meta.lastUpdated to today's date.
Re-save the snapshot with the current Figma state (so future fix runs diff against the latest corrections, not the original generation).
## Fix: {name}
### Changes detected: {total count}
### Learnings extracted: {count}
| # | Context | Property | From | To | Rule |
|---|---------|----------|------|----|------|
| 1 | settings / card | itemSpacing | spacing/large (24) | spacing/medium (16) | Cards in settings use medium spacing |
### Flags: {count}
| # | Node | Issue | Suggestion |
|---|------|-------|------------|
| 1 | StatusBadge | Hardcoded hex #FF5722 | Use $color/text/error/default |
### Recipe patches: {count}
- Recipe "{name}" v{version}: {description of patch}
### Promotions: {count}
- "{rule}" promoted to global (signals: {n}, screenTypes: {list})
### CSpec updated: {yes/no}
{list of CSpec changes if any}
Fix complete for {name}.
Learnings: {n} extracted ({n} new, {n} reinforced, {n} promoted)
Flags: {n} hardcoded values flagged
Recipe: {patched | not applicable}
Options:
- Continue editing in Figma, then run `fix` again
- "done" to archive and ship
fix again after more changesdone" (handled by shipping-and-archiving)Every LEARNING MUST reference a token from the current
registries/variables.json / registries/text-styles.json. A
LEARNING that points to a non-existent token is a gate failure.
Every FLAG MUST be surfaced to the user before saving the snapshot.
See the full catalog at references/red-flags-catalog.md (repo-root).
Top flags for this skill:
This skill is gated by references/verification-gates.md (repo-root):
Evidence to surface: diff summary, classification table, updated learnings.json diff.
digraph fix_flow {
"User says 'fix'" [shape=doublecircle];
"Diff Figma vs snapshot" [shape=box];
"DS-compliant changes?" [shape=diamond];
"Hardcoded primitives?" [shape=diamond];
"Persist as LEARNING" [shape=box];
"Surface as FLAG" [shape=box style=filled fillcolor=lightyellow];
"Recipe eligible?" [shape=diamond];
"Auto-patch recipe" [shape=box];
"Update snapshot" [shape=doublecircle style=filled fillcolor=lightgreen];
"User says 'fix'" -> "Diff Figma vs snapshot";
"Diff Figma vs snapshot" -> "DS-compliant changes?";
"DS-compliant changes?" -> "Persist as LEARNING" [label="yes"];
"DS-compliant changes?" -> "Hardcoded primitives?" [label="check next"];
"Hardcoded primitives?" -> "Surface as FLAG" [label="yes"];
"Persist as LEARNING" -> "Recipe eligible?";
"Recipe eligible?" -> "Auto-patch recipe" [label="yes"];
"Auto-patch recipe" -> "Update snapshot";
"Recipe eligible?" -> "Update snapshot" [label="no"];
"Surface as FLAG" -> "Update snapshot";
}