Логотип C2d

C2d

Сообщество
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

Обзор

ИздательBIAsia
Репозиторийc2d2c
Название навыкаc2d
Звёзды
58
Форки
2
Файлы в комплекте
Только инструкции
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Издатель навыка на GitHub — BIAsia. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ C2d в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/BIAsia/c2d2c/tree/main/skills/c2d
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

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
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык C2d в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык C2d, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык C2d не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

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.

Часто задаваемые вопросы

Что делает навык ИИ 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).

Зачем использовать C2d в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. C2d — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить C2d в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/BIAsia/c2d2c/tree/main/skills/c2d. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать C2d?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать C2d?

С любым количеством. В TypingMind вы можете использовать C2d с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ C2d?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — BIAsia. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇