manifest-contract

Rules for keeping a design manifest as the shared contract between agents that turn Figma designs into code. The manifest records design variables and values in defined places, and downstream agents treat it as read-only.

In plain words
What is it for?
Use it in Figma-to-code workflows involving design tokens, components, icons, stories, and tests. It governs who may write the manifest, how variable names are preserved, and how missing bindings are recorded.
Why use it?
It prevents agents from silently changing shared design data or resolving variable names inconsistently. Ambiguous or unbound values are flagged so they can be handled explicitly.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/punkadillo/figma-code-composer/manifest-contract
Clone the repo
git clone --depth 1 https://github.com/punkadillo/figma-code-composer

Made for: Cursor.

Per session 1,198 This file is loaded in full into every session.
When invoked 1,198 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01198 $0.01198
Opus 5 $0.00599 $0.00599
Sonnet 5 $0.00240 $0.00240
Haiku 4.5 $0.00120 $0.00120

Measured 2d ago against content hash ca53254be1a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

manifest-contract scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/manifest-contract.mdc · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rules 2 – 5 — The manifest is the contract

Rule 2 — Single source of truth

figma-fetcher is the only writer of /tmp/figma-<runId>/manifest.json. Every downstream agent (token-builder, component-builder, icon-generator, story-author, test-author) treats it as read-only input.

If you are not acting as figma-fetcher and you find yourself wanting to edit the manifest → STOP. Either re-spawn the fetcher with a corrective note, or escalate to the user.

Rule 3 — Variable names are preserved, never resolved

styledProperties[].figmaVariable always holds the raw Figma variable path (e.g. color/surface/brand-primary). Resolving it to a hex / rem / px value inside the manifest is a contract violation.

The tokens dict at the top of the manifest is the only place values appear — consumers map by name from styledProperties into tokens.

Rule 4 — Unbound values are flags, not invitations

When a Figma style has no variable binding, the fetcher records:

{ "property": "paddingX", "figmaVariable": null, "unbound": true, "rawValue": "14px" }

unbound: true REQUIRES a non-null rawValue. Builders (token-builder, component-builder, icon-generator) MUST stop-and-flag any unbound entry — never invent a token, never inline the raw value. Add the entry to your final-report's flags[] so the coordinator surfaces it to the user.

Rule 5 — Blocking ambiguities gate the run

When manifest.ambiguities[] contains any entry with blocking: true, the coordinator stops and asks the user one focused question before any build agent runs. Build agents that find a blocking ambiguity in their slice MUST refuse to proceed and report — never guess.

Schema invariants (always)

  • manifestVersion == "1.0" — pinned. Mismatch is a hard validation failure.
  • Required top-level keys: runId, intent, scope, source, configSnapshot, icons, components, tokens, ambiguities, injectionObservations.
  • configSnapshot is frozen at fetch time — mid-run edits to .figma-pipeline/config.json do not affect an in-flight run.
  • existsOnDisk: true → patch the file at diskPath. Never blind-overwrite.
  • components[].layer is advisory — the coordinator's think-once pass (Step 8.5) sets the authoritative resolvedLayer (see § buildPlan). components[].layerConfidence is high|medium|low.

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 80 lines · 1,198 tokens per session scan A ca53254be1a2

Subscribe to this mod's changes

manifest-contract is a cursor rule published in the GitHub repository punkadillo/figma-code-composer (3 stars, last pushed 14d ago), licensed MIT. It adds 1,198 tokens to every session, about $0.0060 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.