Logotipo de C2d

C2d

Comunidad
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

Descripción general

EditorBIAsia
Repositorioc2d2c
Nombre de la habilidadc2d
Estrellas
58
Forks
2
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por BIAsia en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA C2d en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/BIAsia/c2d2c/tree/main/skills/c2d
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese 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
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa C2d en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga C2d automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que C2d no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu 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.

Preguntas frecuentes

¿Qué hace la habilidad de IA 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).

¿Por qué usar C2d en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. C2d está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo C2d en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/BIAsia/c2d2c/tree/main/skills/c2d. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar C2d?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar C2d?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar C2d con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA C2d?

Sí. BIAsia la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇