figma-code-composer: Agent for Claude Code

.claude/agents/token-builder.md

token-builder is an agent for Claude Code from punkadillo/figma-code-composer. It costs 50 tokens per session (2,976 once invoked), scanned A, original, MIT.

A tool that turns design tokens—reusable values such as colors, spacing, and type settings—into files for the project's CSS system.

In plain words
What is it for?
It helps create or update token files for the configured CSS system and token strategy, including values with different modes such as light and dark.
Why use it?
It removes the manual work of translating design-system values into the format a project uses, while keeping token output separate from component code.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

This is punkadillo/figma-code-composer's own configuration. It tells Claude Code how to work on figma-code-composer itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything figma-code-composer configures →

Reuse

Borrowing it

Nothing to install: this file belongs to punkadillo/figma-code-composer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/punkadillo/figma-code-composer/main/.claude/agents/token-builder.md
Clone the repo
git clone --depth 1 https://github.com/punkadillo/figma-code-composer

Made for: Claude Code.

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 token-builder

README.md
[![agentmods](https://agentmods.dev/badge/agents/punkadillo/figma-code-composer/token-builder/github.svg)](https://agentmods.dev/agents/punkadillo/figma-code-composer/token-builder)
Your own site
<a href="https://agentmods.dev/agents/punkadillo/figma-code-composer/token-builder"><img src="https://agentmods.dev/badge/agents/punkadillo/figma-code-composer/token-builder/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 token-builder

Your own site · 80×15
<a href="https://agentmods.dev/agents/punkadillo/figma-code-composer/token-builder"><img src="https://agentmods.dev/badge/agents/punkadillo/figma-code-composer/token-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,976 The whole file, excluding the scripts and references it only reads on demand.
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.00050 $0.02976
Opus 5.5 $0.00020 $0.01190
Sonnet 5.5 $0.00010 $0.00595
Haiku 4.5 $0.00005 $0.00298

Measured 2mo ago against content hash c6fba52b5d4a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

token-builder 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 2mo 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.

.claude/agents/token-builder.md · 124 lines

How it starts

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

Role

Token writer. Given { tokens, intent, configSnapshot }, emit per-CSS-system token files inside config.tokens.outputDir. Never write components, stories, tests, icons, or docs.

Binding: protocols/token-strategy.md (per-CSS-system recipes) + adapters/css/<cssSystem>.md (adapter overrides) + protocols/skills.md (skills per CSS+DS combo) + agent additions: design-system-patterns, ui-design-system.

Inputs

  • tokens — flat dict: { "color/surface/brand-primary": { type: "color", value: "#FF6E1D", modes: { default: "#FF6E1D", dark: "#FF8A4A" } }, … }.
  • intent — create or update.
  • configSnapshot — frozen { cssSystem, tokenStrategy, designSystemName, designSystemThemeName }.

Emission discipline — comment economy

Minimal, single-line comments only (hard cap ≤80 chars, leader→EOL excl. indentation) in emitted token files — no /* … */ banners, no per-token restating comments, no layer-divider blocks. At most one short header line per file (e.g. /* semantic — references primitives */) where a layer genuinely needs labelling; otherwise none. Cuts output tokens every build. Full rule: protocols/figma-manifest.md § Emission discipline.

Write scope

ONLY files under config.tokens.outputDir/**. Any other write → abort.

Design-system override

designSystemName != "none" → load adapters/design-systems/<designSystemName>.md § Token-builder behaviour. Many DS (MUI / Chakra / Mantine) own their token surface — emit ONLY a mapping file (e.g. mui-map.json) and SKIP strategy-driven CSS/JS output. atomic does NOT override — tokens emit normally per tokens.strategy. Adapter is authoritative when it conflicts with tokens.strategy.

Protocol

  1. Re-read full config for tokens.* (output paths, naming convention, prefix) and cssSystem.config (e.g. Tailwind v4 prefix).
  2. Read prior tokenSet from KG (when enabled). npx fcc kg:query --kind tokenSet --strategy <tokenStrategy> --output-dir <outputDir> --top-k 1. Load its tokens[] array — lineage of every prior token's name, figmaVariableId, tokenHash, emittedAs. Skip when knowledgeGraph.enabled == false (fall through to disk-only diffing).
  3. Per-token diff. tokenHash = sha256({ name, type, modes-sorted }):
    • Name match AND hash match → unchanged, skip emission.
    • Name match, hash differs → modified, re-emit.
    • Not in prior → added, emit.
    • In prior but not in incoming → removed, emit delete-token directive (per CSS-system adapter), record in flags.

Read the full file on GitHub · 124 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. 2mo ago First seen · 124 lines · 50 tokens per session scan A c6fba52b5d4a

Subscribe to this mod's changes

token-builder is an agent published in the GitHub repository punkadillo/figma-code-composer (3 stars, last pushed 2mo ago), licensed MIT. It adds 50 tokens to every session and 2,976 once invoked, about $0.0002 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.

Related

token-builder compared with agents from other repositories

token-builder next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
token-builderpunkadillo/figma-code-composerAgent32mo agoMITA50Claude Code
css-architectspacehendrix/clauderAgent5922d agoApache-2.0A91Claude Code
godmode-ui-uxhybridlabor-api/bdb-dev-optimized-agent-skillsAgent65d agoApache-2.0A38Claude Code
AEM Front-End Specialistarchubbuck/workspace-architectAgent192d agoISCA31Claude Code
gem-designerarchubbuck/workspace-architectAgent192d agoISCA22Claude Code
cli-ui-designerJustdvp/claude-code-templatesAgent725d agoMITA40Claude Code
html-css-layout-expertrben01/agentic-coder-configAgent15mo agononeA0Claude Code