Logo Craft Sync

Craft Sync

Cộng đồng
diego3g
craft-sync

Use when a design task is about to start in a project whose design system already lives in code (a UI package, design tokens, a component library) but isn't in the design tool, when asked to import or bring the design system, tokens or components into the design tool, or to apply, push or sync changes from the design tool's guide back to the code.

Tổng quan

Nhà phát hànhdiego3g
Kho mãcraft
Tên kỹ năngcraft-sync
Sao
546
Bản fork
29
Tệp đi kèm
8
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 8 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được diego3g công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Craft Sync trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/diego3g/craft/tree/main/skills/craft-sync
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/diego3g/craft.git /tmp/craft
mkdir -p .claude/skills
cp -r /tmp/craft/skills/craft-sync .claude/skills/craft-sync
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Craft Sync trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Craft Sync ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Craft Sync với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Design system sync

Overview

When a design system already lives in code, the design tool should mirror it, not reinvent it.

  • Import brings the code's tokens and the components the person picks into the tool, under the same names.
  • Export takes changes made in the tool's guide back to the code as a reviewed diff.

A small file at the project root, design-sync.json, remembers what was last synced. Code stays the source of truth until the person says otherwise: changes are drawn first in the tool and land in code through an approved export.

When to use

  • A design task is about to start in a project with a design system in code and no guide in the tool. craft-setup and craft hand off to this.
  • "Import / bring our design system (tokens, components) into Paper / Figma / the design tool."
  • "Apply / push / sync the guide's changes to the code."

When NOT to use

  • No design system in code: craft-system (create mode).
  • A review, options or a small edit in such a project: those skills work from the code as it is.
  • A single token value the person dictated ("make the accent #3d7f69 in code"): edit it directly, update design-sync.json for that name, say what it affects.

Before you start

  1. Read DESIGN.md (Brand says where the system lives) and design-sync.json if they exist.
  2. Pick your tool's adapter in references/adapters/ (paper.md, pen.md, figma.md, penpot.md, html.md). If no adapter matches your tool, do the same verbs in your tool and say which you mapped by hand. With no design tool at all, build in HTML (html.md). If an image is all you have, say that values read from it are estimates.

design-sync.json

json
{
  "source": "packages/ui/tokens.css",
  "tool": "paper: file 'Fieldnote', page 'Guide'",
  "naming": "CSS custom property names as written in the source",
  "synced": "2026-11-15",
  "tokens": { "--color-accent": "#2e6b57", "--radius-md": "10px" },
  "components": { "Button": "drawn", "Badge": "drawn", "Input": "in code only" }
}
  • tokens holds the values both sides agreed on at the last sync, and only those.
  • A component import changes only its own components entry.

Import (code → design tool)

  1. Detect with the signals. Find the source of truth for values (the token source, not a generated output) and the naming rule the tool will use. Two UI packages → list both and ask which is the source.

  2. Inventory, then stop. Use the inventory format:

    • tokens by role, with counts and paths;
    • components (grouped with counts when there are more than about 15);
    • guideline docs;
    • gaps;
    • conflicts: any name that already exists in the tool with a different value, and any token type the tool can't hold.

    Ask which components to draw now, suggesting 3–6 for the next screens, and how to settle each conflict. Never draw everything by default.

  3. Build in the tool after the answers:

    • register the tokens under the naming rule; never overwrite a tool value the person didn't settle;
    • make a foundations guide page, with guideline docs as the legend;
    • make a component index: name, code path, status (drawn / in code only), with variants filled in once drawn;
    • draw the picked components with their states matrix, using values from code. A state the code doesn't define is drawn and labelled "proposed".
  4. Self-check. Render the guide. If the code can render the component (Storybook, a demo page), compare at the same size. Otherwise say the values were read from code, unrendered.

  5. Record:

    • write design-sync.json (all token values now equal on both sides, plus component statuses);
    • in DESIGN.md, Brand gets "Design system source: <path>; the guide mirrors it", and the Decisions log gets a dated import line;
    • if there's no DESIGN.md, create one whose first line is <!-- sync record only: run craft-setup for the brief --> with just Brand and the Decisions log. craft treats a DESIGN.md without a Product section as missing.

Import of one component (from craft)

The person already agreed to mirror the system, so there's no inventory stop:

  • draw that component;
  • set its components entry to drawn;
  • leave tokens alone.

If the tool has no guide yet, or the person never agreed to an import (or declined it), ask once: "Input exists only in code. Import it into the guide first?"

Export (design tool → code)

  1. Read the guide's values (adapter) and the code's values, by name.

  2. Classify every name with design-sync.json and the diff format:

    • equal now → in sync;
    • guide changed → propose;
    • code changed → offer to refresh the guide;
    • both changed → show the three values and ask which wins.

    With no design-sync.json, list every difference and ask the direction for each.

  3. Propose the edits to the source files (never a generated output): file and line, what each affects, and the contrast for colours. "Proposed" states and substituted fonts aren't changes to export. Stop.

  4. Apply only what was approved, update the guide for anything decided in the code's favour, and run the project's checks (lint, typecheck, tests, visual tests), or say there are none.

  5. Record:

    • update design-sync.json with the values now equal on both sides;
    • add a dated line to DESIGN.md › Decisions log;
    • add open conflicts to Open questions.

Rules

RuleWhy
Same names in code and tool, by one written naming ruleOne name per decision; no mapping to drift
design-sync.json records only agreed valuesWithout the last agreed value, "who changed it?" is a guess
Inventory and pick before drawing; conflicts listed thereBig packages and existing tool tokens need the person's say
Values from code, never from screenshotsScreenshots round colours and sizes
Missing states drawn as "proposed"The guide must not claim the code does what it doesn't
Export proposes, then stops; edits the source, not generated outputCode ships to users; a generated file is overwritten by the next build
Both changed → askOverwriting either side loses someone's decision
Code is the source of truth until the person says otherwiseMatches "code beats a stale brief"

Done when

  • Import: inventory and conflicts settled; picked components drawn; guide rendered (or "unrendered" stated); design-sync.json and DESIGN.md written.
  • One component: drawn, with its status updated.
  • Export: approved edits applied, the checks run (or "none" stated), design-sync.json updated, conflicts decided or open.

Common mistakes

ThoughtReality
"The code has the system, so setup only needs the brief"Offer the import, or the tool never gets a guide and screens drift from the code.
"I'll build foundations and an index, components later"Show the inventory and ask which components to draw now.
"I'll rename --sand-200 to a role name while importing"Keep the code's name; propose a role as an open question.
"The tool already has --color-accent, I'll update it"That's a conflict for the inventory stop, not a silent overwrite.
"Guide and code differ, so the guide is out of date"Check design-sync.json: it may be the person's unexported change.
"The diff is tiny, I'll just apply it"Propose, stop, then apply and run the project's checks.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Craft Sync làm được gì?

Use when a design task is about to start in a project whose design system already lives in code (a UI package, design tokens, a component library) but isn't in the design tool, when asked to import or bring the design system, tokens or components into the design tool, or to apply, push or sync changes from the design tool's guide back to the code.

Vì sao nên dùng Craft Sync trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Craft Sync là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Craft Sync trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/diego3g/craft/tree/main/skills/craft-sync. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Craft Sync?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Craft Sync với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Craft Sync với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Craft Sync có miễn phí không?

Kỹ năng này được diego3g phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇