figma-context-budget — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited figma-context-budget (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This is a framework template, not drop-in. To use this skill you need:
This is a framework, not a drop-in tool.
get_design_context on a full Frame can return 50k+ tokens of raw node JSON and blow the context window. This skill enforces four rules that keep Figma MCP usage context-efficient.
This skill complements figma-implement-design / implement-design — it adds context discipline on top of the code-generation workflow. Do not skip the code-gen skill; run this one alongside it.
mcp__figma-desktop__* tool.use_figma) — that is figma-use.figma-generate-design.Plan phase is lightweight. Implement phase is per-component. Never mix.
| Phase | Goal | Allowed tools | Forbidden |
|---|---|---|---|
| Plan | Understand overall structure, slice into tasks | get_screenshot, get_metadata | get_design_context |
| Implement | Build a single component/section | get_design_context on the selected component ONLY | Calling on a whole Frame or Page |
/clear or open a new session. Main session should not hold plan artifacts during implementation.get_design_context → generate code → validate.get_design_context but no plan exists yet → go to Plan phase first.get_design_context on a selection that is a Frame, Page, or Section → narrow to a single component or the smallest meaningful sub-tree.get_design_context on a complex multi-section page → split into multiple calls, one per section, ideally across sessions.Never call `get_variable_defs` if a cached tokens file exists in the project.
get_variable_defs, check whether your project's design tokens module exists and is non-empty.get_variable_defs ONCE, then write the output to the cache file as typed constants. Do this before writing any component code.export const color = { primary: '#1890FF', /* ... */ } as const
export const spacing = { xs: 4, sm: 8, md: 16, lg: 24 } as const
export const typography = { /* ... */ } as constIf a Figma component has an existing Code Connect mapping to a local React component, skip Figma MCP entirely for that component.
get_metadata reveals an instance of a mapped component, note its mainComponent name.components/, features/*/components/, or shared monorepo package directories) for the mapped React component.<LocalComponent {...propsFromFigma} /> directly. Do NOT call get_design_context on the instance — the component's own implementation is the source of truth, not Figma's node data.get_design_context when the component is net-new or intentionally being redesigned.A mapped component's visual spec is already captured in code. Re-fetching its Figma node data duplicates information and inflates context for no gain.
The user's Figma selection determines context size. Coach the user on selection before calling.
get_design_context call, confirm what is selected. If unknown, call get_metadata first — its output reveals the current selection scope.get_design_context until selection is component-level."Your current Figma selection looks like the entireHomepageFrame. Please select just theProductCardcomponent and confirm — I'll then fetch its design context."
`get_design_context` returns annotations as `data-annotations="..."` and `data-link-annotations="..."` attributes. These are part of the spec, not optional decoration. Skipping them ships visually-correct but behaviorally-wrong code.
data-annotations="Zendesk" / "GTM" / "關閉後當天不再顯示" → behavioral spec: which integration wires up, dismissal persistence, trigger events, accessibility hintsdata-link-annotations="[text](url)" → designer-specified URL: button targets, form endpoints, external link destinationsget_design_context call, immediately scan for data-(link-)?annotations in the response. Run it as the first action, before reading layout/copy.Annotations encode the things that aren't visually obvious: which trigger behavior wires up to which UI control, what URL a button goes to, dismissal persistence, accessibility hints. Visual layout alone cannot communicate these. Designers commonly use annotations as the canonical way to attach behavioral spec to design components.
get_screenshot / get_metadata?get_variable_defs if so)/clear or sub-agent isolation if so)docs/ or a plan file. Prompt the user to /clear before starting implementation.get_design_context output from a previous component in context while working on the next one.get_metadata first).get_screenshot alone (no node JSON is returned).This skill enforces HOW to talk to Figma MCP efficiently (context engineering). It does NOT cover WHAT Figma-driven feature work produces (spec / plan / QA artifacts, multi-stage workflow, retro discipline).
If the project has a workflow-side companion skill, invoke both:
.claude/skills/ for figma-* workflow skills (e.g. figma-to-production with 5-stage process: figma-scan → spec/plan → implement → QA → ship). Invoke at first Figma MCP call alongside this skill..claude/skills/ for figma-* workflow skills. If none, this skill alone is sufficient.Phase split discipline (resolves a workflow skill's "raw attributes in spec" requirement vs this skill's get_design_context-forbidden Plan phase):
get_metadata + get_screenshot → produce structure / node-ID map / component breakdown in figma-spec.md, leave raw-attr columns as TODOget_design_context → fills raw fills/dimensions/typography + scans annotations into the same figma-spec.md (Rule 5 applies)This hybrid is the canonical split; do not try to satisfy "raw attributes in Plan phase" by full-frame get_design_context — that violates Rule 1.
The paths and stack details below are from my work monorepo. These are concrete examples, not requirements — adapt to your project structure.
Stack (Rule 2):
utils/theme.ts.utils/design-tokens.ts (create if missing). For monorepo sub-app work, use <sub-app>/libs/design-tokens/ instead.Code Connect component locations (Rule 3):
components/, features/*/components/, or <sub-app>/libs/*/components/.Annotation conventions (Rule 5):
Workflow companion skill (Cross-skill section):
akocommerce repo has .claude/skills/figma-to-production/SKILL.md — 5-stage process (figma-scan → spec/plan → implement → QA → ship), artifact templates, retrospective references. Invoke at first Figma MCP call alongside this skill.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.