Install
$ agentstack add skill-as9978-designfit-skill ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README — it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming — see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps — measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
designfit — Design-Fidelity Loop
Implement a Figma screen as code, then prove it matches by validating with the designfit_validate MCP tool and fixing what it reports. Repeat until pass: true.
Prerequisites
- The
designfitMCP server is connected (exposesdesignfit_validate). - Figma's MCP server is connected (
get_metadata,get_variable_defs,get_screenshot). - A dev server is running and the target screen is reachable at a URL.
The loop
1. Read the design from Figma
get_metadataon the target frame → node tree with ids, names, and frames (x,y,width,height).get_variable_defs→ resolved token values and their variable names.
2. Build the UI, tagging as you go
For every Figma node you implement as a distinct element, add data-designfit-id="" to that element. The screen's root container gets the root node id. You know the mapping because you are the one building it — record it.
3. Assemble the DesignSpec
Transform the Figma data into designfit's shape (one root node, nested children). For each node:
id— the Figma node id (same value you used fordata-designfit-id).name— the Figma layer name (e.g."Button/Primary").frame—{ x, y, w, h }fromget_metadata(renamewidth→w,height→h).tokens— only the properties the design actually specifies. Colors as hex (fill,color,borderColor); numbers in px (fontSize,lineHeight,letterSpacing,borderRadius,borderWidth);fontWeightnumeric;fontFamilythe family name;opacity0..1.tokenSources— map each token property to its Figma variable name (e.g.{ "fill": "color/primary" }). This makes fix hints semantic and marks the property as enforced: token-bound properties are harderrors on mismatch, while properties absent fromtokenSourcesare treated as hardcoded literals and downgraded to advisorywarns.children— nested design nodes.
4. Validate
Call designfit_validate with:
{
"url": "",
"viewport": { "width": , "height": },
"design": { "root": { /* DesignSpec */ } },
"componentMap": [{ "figmaNodeId": "root" }, { "figmaNodeId": "btn" }, ...]
}
Set viewport to the Figma frame's intended size. List every tagged node in componentMap.
5. Fix and repeat
Read violations. Each has a component, check (token | geometry | presence), property, expected (with the token source when known), actual, delta, and a fixHint. Apply the fixes:
- token → use the named token / set the property to
expected. - geometry → adjust size or position;
x/yare relative to the screen root. - presence
exists→ render the missing element (and tag it);unexpected→ remove the straydata-designfit-idor add it to the map.
Re-run designfit_validate. Stop when pass is true. If the score does not improve across two consecutive runs, stop and report the remaining violations rather than thrashing — designfit is deterministic, so an unchanged score means your last edit had no effect on what it measures.
Notes
- Token enforcement follows
tokenSources: a property bound to a Figma variable (listed intokenSources) is enforced as anerror— a mismatch fails the run and lowers the score. A hardcoded value with notokenSourcesentry is advisory: a mismatch is awarnthat surfaces in the fix-list but does not failpassor lower the score. So bind a value to its token when you want designfit to enforce it; leave it hardcoded when it's informational. - v1 validates one viewport. Validate the breakpoint the frame was designed at.
- Geometry is compared relative to the root, so a correctly-built screen that's merely centered or offset still passes.
- Tolerances default to ±2px geometry and ΔE ≤ 2 color. Pass
tolerancesto loosen/tighten per project.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: as9978
- Source: as9978/designfit
- License: MIT
- Homepage: https://www.npmjs.com/package/designfit
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.