ds-import
Skill0 starsChanged 5 months agoMITView on GitHub
Import an external theme into the DTCG token SSoT — from a Google Stitch DESIGN.md, Figma variables (via MCP or exported JSON), or a Tokens Studio JSON. Always lands in imports/ first, maps to DTCG, then must pass /ds-gate before touching the SSoT.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Ask which source, or infer from what the user provided:
- Very specific: line 41
Run the engine's converters.
- Distinctive: line 88
Never fabricate token values the source didn't contain — proposed values are always labeled as proposed.
- Very specific: line 90
If a ui-gen/design-file capability is missing, say [capability not connected — skipping] and offer the local-file route.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Purpose
Bridge AI design tools INTO the token SSoT. External themes are treated as
untrusted input: they land in imports/, get mapped to DTCG, get audited,
and only then (with the user's confirmation on the diff) replace or extend
DESIGN/design-tokens.json.
Source detection (capability protocol — see docs/CONNECTORS.md)
Ask which source, or infer from what the user provided:
- Google
DESIGN.mdfile (Stitch export, awesome-design-md, or any source) — a markdown file whose YAML front matter holdscolors/typography/rounded/spacing/componentswith{path.to.token}references. - Stitch project — if a
ui-genMCP tool (stitch) is connected: list the user's projects, pull the screen/theme, and ask Stitch to emit a DESIGN.md (its documented extraction flow), then continue as (1). - Figma — if a
design-fileMCP tool is connected:get_variable_defson the user's selection; otherwise accept an exported variables/tokens JSON file. - Tokens Studio JSON — detect by
value/typekeys (no$prefix).
Save the raw artifact to imports/{date}-{source}/ before any transformation.
Conversion — deterministic first, judgment second
Run the engine's converters; never hand-map what they already handle. Both print findings one per line and use the standard exit codes (0/1/2/3).
Google DESIGN.md:
python -X utf8 ${CLAUDE_PLUGIN_ROOT}/scripts/design_md_convert.py --in imports/{date}-{source}/DESIGN.md --out imports/{date}-{source}/mapped.tokens.json --to tokens --profile design.profile.ymlTokens Studio legacy JSON or DTCG 2025.10 file (auto-detected):
python -X utf8 ${CLAUDE_PLUGIN_ROOT}/scripts/import_tokens.py --in imports/{date}-{source}/tokens.json --out imports/{date}-{source}/mapped.tokens.json --format auto --profile design.profile.ymlFigma variables (from get_variable_defs or an export): no deterministic
converter yet — map by hand into the SSoT shape (primitive DTCG objects with
hex $value; semantic.light/dark as "{primitive_name}" reference strings)
and note in $meta.source that it was a manual Figma mapping.
Then apply judgment ONLY where the converter's findings ask for it:
- Proposed semantic mappings (INFO finding listing role guesses like
primary/background): confirm each with the user — never acceptprimaryorbackgroundsilently. - Missing dark theme (INFO finding,
semantic.darkleft empty): propose a dark palette (darkened surfaces, lightened accents), each entry marked$description: "proposed — not from source". - Unconvertible values (FIX findings — oklch without hex fallback, unmapped Tokens Studio types): show the user exactly what was skipped and ask for hex replacements; never invent them.
Gate before merge (mandatory)
python -X utf8 ${CLAUDE_PLUGIN_ROOT}/scripts/validate_design.py --tokens imports/{date}-{source}/mapped.tokens.json --profile design.profile.yml --out reports --format both- BLOCK (usually a11y — AI-generated palettes frequently fail contrast): report each failing pair with the engine's numbers, propose nearest accessible shades, and re-validate. The import does not proceed to the SSoT while BLOCK stands.
- PASS/CONDITIONAL: show the user a diff against the current
DESIGN/design-tokens.json(added/changed/removed tokens) and ask replace or merge. Only then write the SSoT, then run/ds-gento rebuild the CSS.
Honesty rules
- Never fabricate token values the source didn't contain — proposed values are always labeled as proposed.
- If a
ui-gen/design-filecapability is missing, say[capability not connected — skipping]and offer the local-file route.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

