token-map
Skill này làm gì
Chương trình này giúp sắp xếp các kiểu dáng hình ảnh của thiết kế (như màu sắc và phông chữ) để chúng hoạt động tốt với một hệ thống thiết kế có sẵn. Nó so sánh kiểu dáng của thiết kế với các kiểu dáng được định nghĩa trong hệ thống thiết kế và tạo một bản đồ để đảm bảo mọi thứ khớp nhau nhất quán.
Khi nào nên dùng
- ✓Khi bạn chuyển một thiết kế từ Figma sang mã.
- ✓Khi bạn cập nhật một thiết kế hiện có để dùng hệ thống thiết kế mới.
- ✓Khi bạn muốn đảm bảo mọi kiểu dáng hình ảnh (màu sắc, phông chữ, khoảng cách) nhất quán giữa thiết kế và hệ thống thiết kế.
Liên kết skill
https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/token-map/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Vui lòng ánh xạ các token màu sắc và kiểu chữ từ thiết kế của tôi sang hệ thống thiết kế đang dùng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Chương trình phân tích các kiểu dáng hình ảnh (token) từ thiết kế của bạn, được trích xuất từ Figma hoặc mã. Nó cố đoán mục đích của từng kiểu dáng (ví dụ màu chính hay tiêu đề) dựa trên cách nó được dùng trong thiết kế. Sau đó, nó tạo một tệp thể hiện mỗi kiểu dáng của thiết kế tương ứng với kiểu dáng nào trong hệ thống thiết kế.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Token map
Spec §10 / §21.3.1: every figma-migration / code-migration run crosses the same boundary — "the source has its own tokens; the target uses the active OD design system; we need a deterministic mapping". This atom produces that mapping.
Inputs
figma/tokens.jsonfromfigma-extract(figma-migration), ORcode/tokens.jsonfromdesign-extract(code-migration).- The active design system DESIGN.md (already injected into the prompt; the atom reads from the staged design-system context).
Output
project-cwd/
└── token-map/
├── colors.json # { source: '#hex' | 'tokenName', target: '--ds-token' }[]
├── typography.json # font + size + weight pairings
├── spacing.json # spacing scale crosswalk
├── unmatched.json # { source: ..., reason: 'no-target-equivalent' }[]
└── meta.json # { sourceKind: 'figma' | 'code', generatedAt, atomDigest }
unmatched.json is the audit list a human reviews; the agent must
not invent target tokens silently.
Semantic token inference
Figma often exports anonymous source names such as color-3,
paint/17, or raw #5B8DEF. Do not ask the user to rename those
before mapping. First infer the semantic role from usage evidence:
- Node path, component name, instance overrides, variant/state labels,
frame name, layer name, and nearby text such as
Primary,Selected,Link,Error,Focus,Nav,Button, orCTA. - CSS-like position in the rendered tree: background fill, foreground text/icon, border, divider, overlay, shadow tint, focus ring, status badge, chart series, or brand/accent treatment.
- Contrast relationships: a color paired repeatedly with the main canvas is likely foreground; one paired with foreground inside CTA components is likely primary/accent background; a thin outline around interactive elements is likely border or focus-ring.
- Reuse topology: a value that appears across primary buttons,
selected tabs, and active nav items is stronger evidence for
--ds-color-primarythan a value that appears once in an illustration.
Use that role evidence to choose among existing active design-system
tokens and to decide whether an anonymous token should be renamed or
left unmatched before the executable mapping pass. Keep the on-disk
token-map contract unchanged: the atom still writes the existing bucket
files, unmatched.json, and meta.json only.
For example, this is a useful reasoning note for deciding whether
color-3 should map to the active primary token:
{
"source": "color-3",
"value": "#5B8DEF",
"role": "primary",
"targetCandidates": ["--ds-color-primary", "--ds-color-link"],
"evidence": [
"Button/Primary fill",
"Selected tab indicator",
"Link text in Settings frame"
]
}
Then map to an active design-system token only when the evidence is
role-based, not value-only. If the top candidates are too close to
call, or if the evidence points to conflicting roles (primary vs
link vs focus-ring), leave the source token unmatched using the
existing no-target-equivalent reason and include the competing
candidates in the hint. This keeps automation useful for common
anonymous-token cases while preserving human review for ambiguous
brand decisions.
Before / after expectation
Without semantic inference, an anonymous Figma token can only produce an uncertain value-level mapping:
{
"source": "color-3",
"value": "#5B8DEF",
"target": null,
"reason": "no-target-equivalent"
}
With semantic inference, the same token should carry role evidence before it is accepted:
{
"source": "color-3",
"value": "#5B8DEF",
"target": "--ds-color-primary",
"via": "name"
}
This deterministic v1 atom does not claim a measured accuracy lift by
itself. Treat the expected improvement as coverage of previously
manual anonymous-token cases when the Figma tree contains enough role
evidence. Real accuracy numbers require a fixture suite with known
source tokens, expected semantic roles, and a before/after agent run.
See examples/semantic-inference-before-after.json for a deterministic
same-token-batch simulation that compares the old value-level output
with the semantic inference output.
Convergence
The atom completes when every input token is either mapped or
explicitly recorded under unmatched.json with a non-empty
reason. The until evaluator reads tokens.unmatched.length === 0
…
Câu hỏi thường gặp
“Tokens” là gì?
Tokens là các khối xây dựng cơ bản của kiểu dáng hình ảnh, như một màu cụ thể (ví dụ xanh dương #0000FF), một cỡ chữ (ví dụ 16px) hoặc một giá trị khoảng cách (ví dụ 8px).
Điều gì xảy ra nếu một kiểu dáng trong thiết kế của tôi không có tương đương trong hệ thống thiết kế?
Chương trình sẽ liệt kê các kiểu dáng này trong một tệp tên là “unmatched.json”, kèm giải thích lý do không thể ghép. Bạn có thể xem xét và tự quyết định cách xử lý, thay vì chương trình tự bịa ra.
Chương trình biết kiểu dáng nào trong thiết kế tương ứng với kiểu dáng nào trong hệ thống thiết kế không?
Nó dựa vào các manh mối từ thiết kế, như tên thành phần, bối cảnh nơi kiểu dáng được dùng (ví dụ chữ trên nút bấm) và mối quan hệ màu sắc, để suy ra mục đích của kiểu dáng và tìm sự tương đồng tốt nhất trong hệ thống thiết kế.
Chi tiết
Mô tả gốc của tác giả
Map an extracted Figma / source-code token bag onto the active OD design system, producing a deterministic mapping the generate stage can consume.
repo: nexu-io/open-design
Độ phổ biến
- Sao GitHub
- 101k
- Vị trí xếp hạng
- #990
- Giấy phép
- Apache-2.0
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
sample-plugin
101kGiúp agent của bạn tạo một tệp metadata cho các bài kiểm thử. Nó giúp đảm bảo mã nguồn chạy đúng trong nhiều tình huống khác nhau.
aster-atelier
101kGiúp agent của bạn tạo một website nghệ thuật theo phong cách cổ điển. Nó dùng hình ảnh tinh tế, bầu trời xanh và phông chữ serif để tạo cảm giác điện ảnh.
audio-jingle
101kGiúp agent của bạn tạo âm thanh như nhạc hiệu và hiệu ứng âm thanh. Nó có thể tạo nhạc và giọng nói, rồi lưu kết quả thành tệp âm thanh.
blog-post
101kGiúp agent của bạn viết bài báo dài hoặc bài blog. Có chỗ dành cho hình ảnh, trích dẫn và thông tin tác giả.
Skill tương tự
canvas
394kCho phép agent của bạn hiện một widget trực quan được lưu trữ trên bảng Mac đã kết nối, rồi ẩn bảng hoặc chuyển nó sang trang khác.
control-ui
394kGiúp agent của bạn sắp xếp và khắc phục sự cố Control UI của OpenClaw, gồm các phiên, bảng điều khiển và Gateway đã kết nối.
diagram-maker
394kGiúp agent của bạn vẽ sơ đồ rõ ràng dạng SVG, HTML hoặc Excalidraw có thể sửa, cho quy trình, kiến trúc hệ thống và bản phác bảng trắng.