Logo de C2d

C2d

Comunidade
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).

Add to TypingMind

Visão geral

Publicado porBIAsia
Repositórioc2d2c
Nome da habilidadec2d
Estrelas
58
Forks
2
Arquivos incluídos
Somente instruções
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Sem arquivos extras

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por BIAsia no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA C2d no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/BIAsia/c2d2c/tree/main/skills/c2d
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative C2d em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega C2d automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, C2d não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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.

Perguntas frequentes

O que a habilidade de IA C2d faz?

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).

Por que usar C2d no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade C2d é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar C2d no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/BIAsia/c2d2c/tree/main/skills/c2d. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar C2d?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com C2d?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar C2d com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA C2d é gratuita?

Sim. A habilidade é publicada no GitHub por BIAsia sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇