manifest-contract

manifest-contract is a cursor rule for Cursor from punkadillo/figma-code-composer. It costs 1,198 tokens per session, scanned A, original, MIT.

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

Written for Cursor: installed under .cursor/.

Good fit 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.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/punkadillo/figma-code-composer/manifest-contract
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.

Clone the repo
git clone --depth 1 https://github.com/punkadillo/figma-code-composer

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for manifest-contract

README.md
[![agentmods](https://agentmods.dev/badge/rules/punkadillo/figma-code-composer/manifest-contract/github.svg)](https://agentmods.dev/rules/punkadillo/figma-code-composer/manifest-contract)
Your own site
<a href="https://agentmods.dev/rules/punkadillo/figma-code-composer/manifest-contract"><img src="https://agentmods.dev/badge/rules/punkadillo/figma-code-composer/manifest-contract/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for manifest-contract

Your own site · 80×15
<a href="https://agentmods.dev/rules/punkadillo/figma-code-composer/manifest-contract"><img src="https://agentmods.dev/badge/rules/punkadillo/figma-code-composer/manifest-contract.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01198 $0.01198
Opus 5.5 $0.00479 $0.00479
Sonnet 5.5 $0.00240 $0.00240
Haiku 4.5 $0.00120 $0.00120

Measured 1mo ago against content hash ca53254be1a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 2mo ago), licensed MIT. It adds 1,198 tokens to every session, about $0.0048 per session on Opus 5.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.