figma-sync
/figma-sync
Synchronizuje tokeny w kodzie ze zmianami zmiennych, stylów tekstu, efektów i wypełnień w Figma oraz obsługuje obcięte odpowiedzi odczytu.
- Autor
- moonklabs ↗
- Repozytorium
- aiwf ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 08.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 4
- Skrypty
- 3
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 08.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 3 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: scripts/check_figma_tokens.mjs, scripts/figma-readback.plugin.js, scripts/merge_readback.mjs
Co robi i kiedy
Synchronizuje tokeny w kodzie ze zmianami zmiennych, stylów tekstu, efektów i wypełnień w Figma oraz obsługuje obcięte odpowiedzi odczytu.
Wyzwalacze z opisu
Oryginalny opis (EN)
Use when Figma variables, text styles, effect or paint styles changed and code tokens must match, when the project's Figma token check reports a mismatch, or when a Figma readback response came back cut off ("truncated to 20kb") — "피그마 색·텍스트 스타일 바뀜", "토큰 동기화", "readback".
Jak działa
- Files
- Order
- Do not
- When you changed a script
Podgląd SKILL.md
---
name: figma-sync
description: Use when Figma variables, text styles, effect or paint styles changed and code tokens must match, when the project's Figma token check reports a mismatch, or when a Figma readback response came back cut off ("truncated to 20kb") — "피그마 색·텍스트 스타일 바뀜", "토큰 동기화", "readback".
---
# Figma values → code token sync
Copyright 2026 moonklabs. Licensed under Apache-2.0; see the plugin LICENSE and NOTICE.
**REQUIRED BACKGROUND:** aiwf-design:workflow confirms that the role is "sync". Figma is read-only. A person copies values into the code, and the check proves they are equal. Never generate CSS from the snapshot automatically.
Paths below are config keys of `design-spec.config.json` (schema in the plugin README). `<skills>` is the folder that holds this skill's folder.
## Files
| File | Role |
|---|---|
| [scripts/figma-readback.plugin.js](scripts/figma-readback.plugin.js) | Figma read script (run with `use_figma`, no writes). Reads the connected file's key; set `FILE_KEY` to `figma.fileKey` when the host does not expose it |
| `tokens.snapshot` | Snapshot (committed) |
| `tokens.map` | Figma name → code token. Every entry is a mapping or a `skip` reason |
| `tokens.sources` · `tokens.typography` | Hand-edited implementation sources (tokens such as `--group-name`, typography utilities such as `type-*`) |
| `tokens.dtcg` | DTCG tokens the check reads. When `commands.tokenExport` generates it, do not edit it by hand |
## Order
1. Load the figma:figma-use skill first. Run the whole read script with `use_figma` (`skillNames: "figma-use"`).
2. If the response was cut off or does not parse as JSON, discard it. Change the script's `PART` to `'variables'`, then `'styles'`, read twice, save each raw response to a file and merge them.
```bash
node <skills>/figma-sync/scripts/merge_readback.mjs --out <tokens.snapshot> <variables.json> <styles.json>
```
The merge refuses to write and fails when an array length differs from the `counts` Figma reported, when file keys are mixed, or when a section is missing.
3. `git diff <tokens.snapshot>` — confirm that only the changes the designer described appear. If other changes appear, ask the designer.
4. Run the token check: `commands.tokenCheck`, or `node <skills>/figma-sync/scripts/check_figma_tokens.mjs` when it is unset or cannot start; report which one ran. The failure list is the to-do list.
5. Reflect colors as tokens in `tokens.sources` (Figma `group/name` → `--group-name` unless the map's rules say otherwise), text styles as utilities in `tokens.typography`, and new or renamed Figma names in `tokens.map`.
6. Run `commands.tokenExport` when it is set, then pass the token check. This check compares declared values; it is not a render or pixel match.
7. Update the row in the traceability design-system table (aiwf-design:trace).
## Do not
- Save a cut-off response or fill in its gaps
- Change Figma to make a mismatch disappear (put it on the designer hand-off list)
- Edit the snapshot by hand, or edit `tokens.dtcg` by hand when it is generated
- Silently ignore a Figma item missing from the map (write a `skip` reason)
## When you changed a script
```bash
node <skills>/figma-sync/scripts/merge_readback.mjs --self-test
node <skills>/figma-sync/scripts/check_figma_tokens.mjs --self-test
```
The first runs the real read script against a mock Figma and confirms that a full read equals a split read, and that cut-off, missing-section, mixed-file and unknown-file-key reads are rejected. The second confirms that a matching fixture passes and that each broken token, alias, mapping and typography input is reported.
Pliki w paczce (4)
- SKILL.md 4 KB
- scripts/check_figma_tokens.mjs 27 KB
- scripts/figma-readback.plugin.js 6 KB
- scripts/merge_readback.mjs 8 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · moonklabs/aiwf | 100 | MIT |
| matthewzammit/skills | 90 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 9950958e2716 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 96figma-token-sync
Sprawdza różnice tokenów między projektem w Figmie a implementacją komponentów i je synchronizuje. - 90figma
Przenosi system projektowy repozytorium do biblioteki Figma: tokeny jako zmienne, style tekstu i cieni, komponenty, a potem raportuje różnice między Figmą a kodem. - 100pf-figma-token-check
Audytuje projekty względem architektury tokenów PatternFly 6 i mapuje style oraz zmienne z Figmy na semantyczne tokeny PF. - 100pf-figma-token-check
Audytuje projekty względem architektury tokenów PatternFly 6 i mapuje style oraz zmienne z Figmy na semantyczne tokeny PF. - 100figma-api
Automatyzuje pracę z REST API Figmy: odczyt plików, eksport ikon i obrazów, wyciąganie stylów jako tokenów projektowych oraz webhooki przy zmianach plików. - 100figma-core-workflow-a
Wyciąga tokeny projektowe, kolory, typografię i odstępy z plików Figmy przez REST API w potoku zamiany projektu na kod.