figma-context-budget
Use BEFORE any Figma MCP tool call during design-to-code work — reading, planning, or implementing a Figma design.
Skill by GGGODLIN
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/gggodlin-figma-context-budget
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: design, writing, productivity, finance
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/figma-context-budget
What's inside
- Skill name
figma-context-budget- Description
- Use BEFORE any Figma MCP tool call during design-to-code work — reading, planning, or implementing a Figma design. Complements implement-design by adding context-budget discipline on top of its code-generation workflow. Do not use when writing back to Figma or when generating new Figma files from code — no budget rules apply there.
- License
- MIT
- Instructions
- 164 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Figma Context Budget
## Purpose
`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** `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.
## Skill Boundaries
- Triggers when the user asks to read, plan, or implement Figma designs using any Figma MCP tool that返回 design context (`get_design_context` / `get_metadata` / `get_screenshot` 等——不釘 server namespace,因為 `mcp__figma-desktop__*` 與 `mcp__claude_ai_Figma__*` 兩個 connector 都可能命中).
- Does not apply when writing back to Figma (`use_figma`) or when building new Figma files from code — no budget rules needed there.
---
## Rule 1 — Phase Separation (hard rule)
**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 (full-Frame JSON blows the window, see Purpose) | Calling on a whole Frame or Page |
### Required flow
1. Plan phase: screenshot + metadata → produce a task list (save to a markdown file if non-trivial).
2. Between phases: prompt the user to `/clear` or open a new session. Main session should not hold plan artifacts during implementation.
3. Implement phase: per component, repeat `get_design_context` → generate code → validate. After every `get_design_context`, immediately scan annotations (Rule 5).
### Red flags (stop and re-check)
- About to call `get_design_context` but no plan exists yet → go to Plan phase first.
- About to call `get_design_context` on a selection that is a Frame, Page, or Section → narrow to a single component or the smallest meaningful sub-tree.
- About to call `get_design_context` on a complex multi-section page → split into multiple calls, one per section, ideally across sessions.
---
## Rule 2 — Design Tokens Cache (one-time extraction, then read from disk)
**Never call `get_variable_defs` if a cached tokens file exists in the project.**
### Cache location (per repo)
- Check that repo's existing design-token convention first (theme / tokens file); if none, write the first extraction to a sensible location in that repo and treat it as the cache from then on.
### Protocol
1. Before calling `get_variable_defs`, check whether the repo's token cache file (see Cache location above) exists and is non-empty.
2. If it exists: read that file instead of calling MCP. Treat it as source of truth for colors, spacing, typography.
3. If it does NOT exist: call `get_variable_defs` once (a single extraction is enough — the cache file becomes source of truth), then write the output to the cache file as typed constants. Do this before writing any component code.
4. Never re-extract tokens mid-implementation. If a new token is genuinely missing, add it to the cache file in a dedicated call.
### Shape
```typescript
export const color = { primary: '#1890FF', /* ... */ } as const
export const spacing = { xs: 4, sm: 8, md: 16, lg: 24 } as const
export const typography = { /* ... */ } as const
```
---
## Rule 3 — Code Connect Short-Circuit
**If a Figma component has an existing Code Connect mapping to a local React component, skip Figma MCP entirely for that component.**
### Protocol
1. When `get_metadata` reveals an instance of a mapped component, note its `mainComponent` name.
2. Check `components/`, `features/*/components/`, or `proj-app/libs/*/components/` for the mapped React component.
3. If found: emit `<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.
4. Only call `get_design_context` when the component is net-new or intentionally being redesigned.
### Why
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.
---
## Rule 4 — Selection Granularity (figma-desktop MCP only)
**The user's Figma selection determines context size. Coach the user on selection before calling.**
### Protocol
- Before any `get_design_context` call, confirm what is selected. If unknown, call `get_metadata` first — its output reveals the current selection scope.
- If the selection is a Frame / Page / Section, instruct the user to narrow selection in Figma to a single component or the smallest meaningful sub-tree.
- Do not proceed with `get_design_context` until selection is component-level.
### Example dialogue
> "Your current Figma selection looks like the entire `Homepage` Frame. Please select just the `ProductCard` component and confirm — I'll then fetch its design context."
---
## Rule 5 — Annotation Extraction (hard rule)
**`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.**
### What annotations encode
- `data-annotations="Zendesk"` / `"GTM"` / `"關閉後當天不再顯示"` → behavioral spec: which integration wires up, dismissal persistence, trigger events, accessibility hints
- `data-link-annotations="[text](url)"` → designer-specified URL: button targets, form endpoints, external link destinations
- Other free-text annotations → constraints, edge-case behavior, designer notes
### Protocol
1. After EVERY `get_design_context` call, immediately scan for `data-(link-)?annotations` in the response. Run it as the first action, before reading layout/copy.
2. Treat each annotation as a hard requirement equal in weight to layout and text content.
3. When summarizing a component's spec for a plan or implementation, list extracted annotations alongside layout and copy. Do not silently drop them.
4. Annotation conflicts with Asana / Google Doc / Slack thread → annotation wins (consistent with Figma-source-of-truth rule).
5. Component has annotations but implementation ignores them → STOP. The spec is incomplete; do not write code yet.
### Why
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.
---From GGGODLIN/gggodlin-cc-harness, MIT.
More from GGGODLIN/gggodlin-cc-harness
- 0.674score
workflow-hardening
GGGODLIN
Use when writing or designing any inline/dynamic Claude Code Workflow script, including short single-pass scripts, Ultracode or multi-agent orchestration…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
research-before-answer
GGGODLIN
Use when answering a factual question about a named repo, package, library, framework, SDK, API, version, release note, deprecation, company, product, market…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
to-spec
GGGODLIN
Turn the current conversation into a spec — no interview, just synthesis of what was already discussed.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
review-implement
GGGODLIN
Use after a spec-backed implementation reaches closeout and before shipping when a post-implementation scope or YAGNI review is needed, or when the user…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
agent-dispatch
GGGODLIN
Run one repo's ticket batch in a terminal worker inside a target worktree through Herdr — Claude Code by default, or Codex CLI or pi when the user picks that…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
e2e-contract
GGGODLIN
Use when e2e-route 已選派文件/補丁行為確認或既有契約回歸工作,或使用者手動點名 /e2e-contract;包含同題確認案例、重跑已確認案例與改選工具。Do not use for 從自然語言 E2E 任務自行選用(先用 e2e-route)、普通探索固化、單元或純 API…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
check-my-stack
GGGODLIN
Evaluate whether a popular or hyped agent/dev tool is worth adopting or borrowing from, measured against the user's OWN existing stack — never in the abstract.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
gate-authoring
GGGODLIN
Use when 使用者要「寫 / 改 / 加一個 hook」「設計 gate / detector / tripwire」「動 settings.json hooks 段」——涵蓋全域 ~/.claude/hooks/、任一 repo 專案級 .claude/hooks/、任何 settings.json /…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
agent-authoring
GGGODLIN
建立或修改 subagent 定義檔(~/.claude/agents/*.md 或專案 .claude/agents/*.md)前必讀的流程 skill——frontmatter 欄位語意、tools 欄陷阱、載入時機、上線前 smoke test。觸發:「建 / 寫 / 加一個 agent」「改 agent…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
implement
GGGODLIN
Use when a spec or ticket set is ready to build and the user says implement / 開工 / 照 ticket 做 / start building, or the local pipeline reaches its…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
handoff-impl
GGGODLIN
跨 session 實作委外信道(handoff 單在 ~/.claude/handoffs/*.md,發單 session 驗收、另一 session 實作;信道預設手動搬單,自動接力屬未穩定實驗路徑、僅使用者明確要求實驗才走)。Use when 使用者說「開 handoff 單」「把這個實作交給 GPT /…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
write-pr-description
GGGODLIN
Use when a pull request title or description needs drafting or revising — before running `gh pr create`, `gh pr edit --body`, or any other command that opens…
SkillAFreshness: A★ 72Claude Code +9
Compare and alternatives
Featured in
Signals
- Stars
- 72
- Forks
- 5
- Open issues
- 0
- Last commit (this folder)
- Oct 9, 2026 (18 days ago)
- Last release
- Oct 19, 2026 (8 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/GGGODLIN/gggodlin-cc-harness
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from GGGODLIN
- 0.674score
gate-authoring
GGGODLIN
Use when 使用者要「寫 / 改 / 加一個 hook」「設計 gate / detector / tripwire」「動 settings.json hooks 段」——涵蓋全域 ~/.claude/hooks/、任一 repo 專案級 .claude/hooks/、任何 settings.json /…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
e2e-contract
GGGODLIN
Use when e2e-route 已選派文件/補丁行為確認或既有契約回歸工作,或使用者手動點名 /e2e-contract;包含同題確認案例、重跑已確認案例與改選工具。Do not use for 從自然語言 E2E 任務自行選用(先用 e2e-route)、普通探索固化、單元或純 API…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
check-my-stack
GGGODLIN
Evaluate whether a popular or hyped agent/dev tool is worth adopting or borrowing from, measured against the user's OWN existing stack — never in the abstract.
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
agent-authoring
GGGODLIN
建立或修改 subagent 定義檔(~/.claude/agents/*.md 或專案 .claude/agents/*.md)前必讀的流程 skill——frontmatter 欄位語意、tools 欄陷阱、載入時機、上線前 smoke test。觸發:「建 / 寫 / 加一個 agent」「改 agent…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
agent-dispatch
GGGODLIN
Run one repo's ticket batch in a terminal worker inside a target worktree through Herdr — Claude Code by default, or Codex CLI or pi when the user picks that…
SkillAFreshness: A★ 72Claude Code +9 - 0.674score
handoff-impl
GGGODLIN
跨 session 實作委外信道(handoff 單在 ~/.claude/handoffs/*.md,發單 session 驗收、另一 session 實作;信道預設手動搬單,自動接力屬未穩定實驗路徑、僅使用者明確要求實驗才走)。Use when 使用者說「開 handoff 單」「把這個實作交給 GPT /…
SkillAFreshness: A★ 72Claude Code +9
Cite this page
figma-context-budget skill. Agent Mart. https://agentmart.dev/skills/gggodlin-figma-context-budget (last updated 2026-10-24)