C2d logo

C2d

Community
BIAsia
c2d

c2d2c c2d pipeline — the rules and process for exporting anything from code INTO Figma (code-to-design), UI components, state matrices, and design tokens/variables alike, and for keeping the token snapshot and its CI gate honest when tokens change. Use whenever the user wants code state reflected in Figma — "export/write/sync this component (or these tokens) to Figma", "update the Figma variables", "I changed a token, regenerate the snapshot", "the figma-variables gate is red". Not for implementing code from Figma designs (that is c2d2c:d2c).

Overview

PublisherBIAsia
Repositoryc2d2c
Skill namec2d
Stars
58
Forks
2
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by BIAsia on GitHub. Read the source before you install it.

Installation

Install the C2d AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/BIAsia/c2d2c/tree/main/skills/c2d
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/BIAsia/c2d2c.git /tmp/c2d2c
mkdir -p .claude/skills
cp -r /tmp/c2d2c/skills/c2d .claude/skills/c2d
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable C2d in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads C2d on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so C2d is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

c2d2c:c2d — code to design, every state

Pre-flight: verify the token bridge

Before drawing anything, check that the target file actually has the project's synced tokens — rule 2 below binds against them, and binding into a file where they're missing or stale silently produces raw values or wrong colors.

  1. Probe the file (get_variable_defs or a small use_figma query) for the VAR_COLLECTIONS collections; spot-check a few variables' values and $codeSyntax.WEB entries against VAR_SNAPSHOT.
  2. Missing → sync them in first: the companion plugin's Pull if the project adopted it, otherwise create the collections via use_figma following the snapshot's layout (see the Tokens section).
  3. Present but diverged from the snapshot → refresh them the same way before binding, and mention the drift to the user (it usually means someone skipped the snapshot discipline).

Only then start the export; from here on, binding is automatic — every value the code expresses as a token lands bound to its variable, per rule 2.

Project parameters

Resolve parameters from C2D2C.md at the repo root (fallback: .claude/c2d2c.md); if absent, offer to bootstrap one from the template at ../../templates/C2D2C.template.md (plugin root; standalone installs without that file fetch https://raw.githubusercontent.com/BIAsia/c2d2c/main/templates/C2D2C.template.md). This skill uses EXPORT_FILE (if the user gives a link, the link wins), VAR_COLLECTIONS, VAR_SNAPSHOT, ICON_SOURCE, DS_ROUTE, and for token work TOKEN_HOME, TOKEN_EXPORT.

Three hard rules

1. Enumerate every state first (code census before drawing)

Before drawing anything, enumerate from source every piece of information, content, field, and state the element can show, and put each one on the canvas:

  • Every variant axis: tone/size/kind/interactive etc., read from tv()/cx branches and type unions, never guessed from screenshots.
  • Every data shape: value/empty/fallback (e.g. favicon fails → initial letter → globe icon), truncation/long text, loading, error.
  • Every interaction state: rest/hover/focus/selected/disabled, plus hover popovers (tooltips/hover cards).
  • The DS_ROUTE regression pages are a ready-made state checklist; read them first, then patch gaps from render source.
  • Put a small gray annotation next to each state (state name + key class/token) for the designers.

2. Bind everything to tokens; no raw styles left behind

  • Bind every color, radius, and text style to the already-synced variables and styles in VAR_COLLECTIONS; the inventory of record is VAR_SNAPSHOT.
  • CSS var name → Figma variable name resolves through $codeSyntax.WEB (e.g. var(--primary) → Product primary/default).
  • Spread paints with alpha become paint opacity or layer opacity bound to the same variable; never fork a new raw color.
  • Values Figma cannot express (color-mix/oklch): bind the closest existing variable; if none exists, use the computed literal and record the derivation in the layer name/annotation. Never leave a silent raw color.
  • If Figma already has the component/style (from earlier exports, Core/radius/* etc.), bind or instance it; don't redraw.
  • Brand assets (third-party logos, favicon bitmaps) are exempt; placeholders are fine.

3. Ask before componentizing

Ask once before exporting: create Figma components (component/variant set) or flat frames? Follow the answer; don't decide unilaterally.

Known gotchas (use_figma, earned over 4+ export jobs)

  • Read the /figma-use skill before calling use_figma.
  • The code must explicitly return a result or you get nothing back.
  • resize flips auto-layout to FIXED along the primary axis and collapses it: resize first, then set sizing back to AUTO (do one recursive fix-up pass at the end).
  • Wrap grids need a fixed-width container.
  • get_metadata times out on large frames; prefer get_design_context or query in small chunks.
  • Switching pages requires await figma.setCurrentPageAsync(page).
  • Inter's weight name is "Semi Bold" (with the space).
  • Local fonts are invisible to the MCP session: leave a FONT TODO annotation on title layers.
  • Split long jobs into multiple small idempotent calls (find-or-create, then mutate) so failures can re-run.
  • Never rely on figma.currentPage: the user switching pages mid-run sends later calls to the wrong page. Re-resolve with getNodeByIdAsync(targetPageId) + setCurrentPageAsync on every call, and check for strays at the end.
  • setBoundVariableForPaint discards any preset paint opacity, and variables that carry their own alpha get that alpha converted into paint opacity on bind. Correct order: bind first, then set opacity on the returned paint; for alpha-carrying variables the final opacity = variable alpha × CSS multiplier (e.g. /80 → 0.05×0.8=0.04), don't overwrite with 0.8.
  • Instance root fills snapshot the master's values at creation time: changing master fills later may not flow into existing instances. Fix: copy master.fills back onto the instance, or delete and recreate it.

Tokens: the same pipeline, different payload

Design tokens are exported state too; the difference is they carry a generated snapshot and a CI gate that keeps the two sides honest.

  • Code is the source of truth. When tokens change in TOKEN_HOME (mind every registration point: CSS variable + theme alias + class ladder), run TOKEN_EXPORT to regenerate VAR_SNAPSHOT, and commit the CSS change and the snapshot together. A red check:figma-variables gate means exactly "one side moved without the other" — that is the gate doing its job, not an error to silence. Never hand-edit the snapshot; it is generated output.
  • Getting variables into Figma: if the project adopted the companion Token Sync plugin (../../figma-plugin/, source: https://github.com/BIAsia/c2d2c/tree/main/figma-plugin), designers Pull and everything — including bound foundation posters — updates in place. Without the plugin, create/update the variable collections yourself via use_figma, following the same collection/mode/$codeSyntax.WEB layout that VAR_SNAPSHOT records.
  • Renames start from the code side: a Figma-side rename arrives as delete + add and orphans every binding.
  • Designer-side edits: with the plugin adopted, designer pushes arrive as figma-sync/* MRs, red by design, with safe literal values already written back into the CSS and everything ambiguous itemized for a human. The engineer-side review flow lives in ../../ADAPTING.md (Token sync section; standalone: https://github.com/BIAsia/c2d2c/blob/main/ADAPTING.md).

After exporting

  • Self-check with get_screenshot: alignment, lost variable bindings (scan for raw colors), clipped text.
  • Reply with the Figma node link.

Frequently asked questions

What does the C2d AI skill do?

c2d2c c2d pipeline — the rules and process for exporting anything from code INTO Figma (code-to-design), UI components, state matrices, and design tokens/variables alike, and for keeping the token snapshot and its CI gate honest when tokens change. Use whenever the user wants code state reflected in Figma — "export/write/sync this component (or these tokens) to Figma", "update the Figma variables", "I changed a token, regenerate the snapshot", "the figma-variables gate is red". Not for implementing code from Figma designs (that is c2d2c:d2c).

Why use C2d on TypingMind?

Because you install it once and use it with any model. C2d is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install C2d in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/BIAsia/c2d2c/tree/main/skills/c2d. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use C2d?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with C2d?

As many as you like. As long as a model supports skills, you can use C2d with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the C2d AI skill free?

Yes. It is published on GitHub by BIAsia under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇