/utopia-design:syncfrom Utopia Design
Regenerate every generated surface of the Utopia Design Protocol from design/tokens.json after it changes: the Flutter theme code (generate_theme) and the HTML twin (generate_twin: tokens.css, tokens.tailwind.css, DESIGN.md front matter, and gallery.html when the twin composes one). Runs validate_tokens first and never regenerates from a failing token document; runs a packageVersion drift check (validate_manifest); optionally runs validate_twin after. Applies when: design/tokens.json was just edited or imported and the surfaces need to catch up. Without utopia_ui resolved it stops at its usage gate and surfaces install guidance. Does NOT cover editing or rebranding design/tokens.json itself (-> utopia-design:tokens), importing an external design source (-> utopia-design:import), building screens (-> utopia-design:screen), or hand-editing the generated theme Dart or twin CSS (regenerated, never hand-patched). Layered on the upstream utopia-hooks plugin - silent on Screen/State/View, hooks, and Dart conventions.
Ships in Utopia Design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Sync is the fan-out step of the Utopia Design Protocol: one edited
design/tokens.json, regenerate every surface from it. Nothing is ever
generated from a token document that fails validation - a broken source
must never reach a rendered surface. See the frontmatter description
above for the exact positive/negative boundary. This skill owns the
regenerate workflow and the drift/verify checks around it; it does not own
editing the token document (that's utopia-design:tokens) and it does
not own the generated output's content (that's whatever generate_theme /
generate_twin write - never hand-edited).
Before touching anything, confirm the project actually resolves utopia_ui:
pubspec.yaml declares utopia_ui: directly, or pubspec.lock resolves it
transitively. This mirrors the plugin's own SessionStart / PostToolUse
hook gate and the same check utopia-design:tokens and
utopia-design:import run - the protocol is meaningless without the
library present.
flutter pub add utopia_ui
flutter pub get
Only proceed once the project resolves the package.Second, separate prerequisite: every command this skill runs (validate_tokens,
validate_manifest, generate_theme, generate_twin, validate_twin) ships
in the utopia_ui_tools package, not utopia_ui itself. Confirm it
resolves the same inspect-first way: pubspec.yaml (under dev_dependencies)
or pubspec.lock lists utopia_ui_tools. If it does not - or if
dart run utopia_ui_tools:<command> fails with a package-resolution
error anyway - install it first:
flutter pub add --dev utopia_ui_tools
This is the identical prerequisite utopia-design:tokens's
validation.md documents
for validate_tokens - do not assume the tools are available, install
then run.
Once both gates above pass, run this sequence in order. Full command contracts, what each reads/writes, and exit-code handling live in regeneration.md; the why-first reasoning behind steps 1-2 and 5 lives in drift-and-verify.md.
Where SPEC.md / VERSIONING.md live (cited by the steps below): the
protocol documents ship inside the utopia_ui package under protocol/
(hence the protocol/SPEC.md citations), alongside the protocol/schemas/
the validators check against. Resolve the installed copy the same way this
plugin resolves every packaged artifact: read
.dart_tool/package_config.json for utopia_ui's rootUri (the snippet
lives in utopia-design:tokens's getting-started.md), then open
<root>/protocol/. If it does not resolve, treat every SPEC.md /
VERSIONING.md citation in this skill as background rationale and continue -
never block on the missing file.
validate_tokens FIRST. If it fails (exit 1 or 2), STOP - refuse
to regenerate from a broken source. Never propagate an invalid token
document into the theme or the twin. This is the same gate
utopia-design:tokens uses; do not re-run its full contract here, see
regeneration.md for the cross-link.validate_manifest. Confirms the manifest's
packageVersion matches the resolved utopia_ui (SPEC.md 3.7). A
mismatch means the generated artifacts would not match the resolved
library - treat it as a real error, not a warning to shrug off. See
drift-and-verify.md.generate_theme. Produces the app's Dart theme code
(buildUtopiaTheme()) from design/tokens.json. On the FIRST sync, also
confirm the app wires it - UtopiaTheme(data: buildUtopiaTheme(), child: ...) - or the rebrand silently changes nothing; see
regeneration.md. The generated theme is the light branch
only: if the app switches by brightness, the dark palette stays in Dart
(UtopiaThemeData.darkTheme or UtopiaThemeData.fromTokens(colors: myDarkColors)) and a rebrand does not reach it - say so. Then prove the result with --check:
the same command plus that flag regenerates in memory and byte-compares
against the file on disk, so exit 0 is machine-proof that the committed
theme is exactly what these tokens produce (the theme-side equivalent of
validate_twin's tokens.css freshness gate). Pass --check the SAME
arguments as the generating run - the comparison is byte-exact, and the
generated header embeds the tokens path AS GIVEN, so a different working
directory or a differently-spelled path reports a false "stale". The same
run is also the cheapest entry triage: because it writes nothing, ever, it
may be run at the top of a sync to answer "is the theme stale at all?"
(exit 1 = stale or missing) - but ONLY after recovering the original
arguments from the existing file: read its // Regenerate: header line
and reuse that exact tokens path and output path. Never triage with
guessed paths.generate_twin - conditional by presence. Produces twin/tokens.css,
twin/tokens.tailwind.css, and the DESIGN.md front matter from the same
design/tokens.json, and recomposes twin/gallery.html when the twin holds
a gallery.src.html. Run it when the project already HAS a twin/
directory (it materialized the design surface) or when the user explicitly
asks; creating the twin for the FIRST time is an explicit choice, never a
rebrand side effect. "Regeneration fans out to every surface" (SPEC.md
6.1) means every surface the consumer has - an app-only project has no
twin surface, so writing one unasked is friction, not fan-out. Steps 3
and 4 are independent - both read only design/tokens.json, so either
order works.validate_twin (optional). Literals linter + data-utopia-id
coverage check against the manifest + freshness of the generated
stylesheets and DESIGN.md front matter. Not required to consider the sync
done, but recommended whenever the twin output is going to be viewed or
shipped. On a generated-only project twin the coverage gate auto-skips
(no components.html = the signal) while the literals + freshness gates
still run - see regeneration.md for the consumer-scope
note.tokens.css, tokens.tailwind.css, the DESIGN.md front matter
block, or a composed gallery.html). If something looks wrong, fix design/tokens.json and re-run
this workflow instead.design/tokens.json was just edited (via utopia-design:tokens) or
imported (via utopia-design:import) and the Flutter theme and/or the
HTML twin need to catch uputopia_ui and the
manifest before trusting a regenerated surfacevalidate_twin to catch literal-value drift or
missing data-utopia-id coverage in hand-authored twin markupdesign/tokens.json itself -> use
utopia-design:tokenstokens.css /
Tailwind @theme, a handoff bundle, a DESIGN.md) -> use
utopia-design:importtwin/tokens.css,
twin/tokens.tailwind.css, the DESIGN.md front matter block, or a
composed twin/gallery.html - all are regenerated outputs; re-run this skill's workflow instead| Priority | Reference | Impact | Description |
|---|---|---|---|
| 1 | regeneration.md | CRITICAL | The validated fan-out: exact commands (where contracted), what each reads/writes, exit-code handling, the "no runtime sync, explicit step" principle |
| 2 | drift-and-verify.md | HIGH | Why-first: packageVersion drift, profileVersion compatibility, the literals linter + data-utopia-id coverage, and the refuse-on-failure rationale |
utopia_ui resolves, and that utopia_ui_tools resolves,
before running anything (the two gates above).validate_tokens runs BEFORE any regeneration, every time. A failure
means STOP - never regenerate the theme or the twin from a token document
that fails validation.design/tokens.json and
re-running this workflow.tokens.css,
tokens.tailwind.css, the DESIGN.md front matter block, and a composed
gallery.html are all regenerated by generate_theme / generate_twin; a hand-edit is silently
destroyed by the next regeneration and, in the meantime, lies about what
design/tokens.json actually says.packageVersion mismatch (validate_manifest) is a real error. It
means the resolved utopia_ui and the manifest describing it disagree;
do not regenerate against a moving target (SPEC.md 3.7).defaultTheme and then
running generate_theme on that export MUST reproduce defaultTheme up to
8-bit color quantization - colors compare by their ARGB32 value
(SPEC.md 5). Never "improve" or hand-tune generated theme code to work
around an apparent mismatch - report it as a bug in the generator instead.After running this skill's workflow, verify:
validate_tokens was run and passed (or every finding was fixed and it
was re-run) before any generate step.twin/ directory (or the user asked for one) - a present surface never
stays stale, and an absent one is never created as a side effect.tokens.css, tokens.tailwind.css,
DESIGN.md front matter) was hand-edited.validate_manifest drift check was run and passed (packageVersion
matches the resolved utopia_ui).profileVersion (on the token document) and packageVersion (on the
manifest) are both coherent with what was actually resolved - see
drift-and-verify.md.validate_twin was run whenever the twin output is going to be viewed or
shipped (it stays optional for a purely app-side token change).generate_theme --check, run with
the same arguments as the generate step, exits 0.validate_tokens contract this skill refuses to skip.design/tokens.json.Built on utopia_ui and the Utopia Design Protocol, by UtopiaSoftware.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub utopia-uss/utopia-flutter-skills --plugin utopia-design5 skills in this plugin
/componentTurn a reported component GAP (or any need for a custom component) into a LIVE manifest id: scaffold it from utopia_ui primitives, write its overlay YAML (design/overlay/<local-part>.yaml), regenerate the project + merged manifests (generate_manifest), validate, and hand back the namespaced id. Applies when: scaffolding a custom component, registering one in the project manifest, making something reusable, turning a utopia-design:screen gap report's component-spec seed into a live id. Without utopia_ui resolved it stops at its usage gate and surfaces install guidance. Does NOT cover deciding whether something is a gap, or building screens (-> utopia-design:screen); editing design/tokens.json (-> utopia-design:tokens); regenerating the theme or the HTML twin (-> utopia-design:sync); widget-authoring and state conventions (-> utopia-hooks); or contributing it UPSTREAM into utopia_ui. Layered on the upstream utopia-hooks plugin - silent on Screen/State/View, hooks, and Dart conventions.
/importBring an external design source into a utopia_ui project's design/tokens.json: a Figma DTCG export, a foreign tokens.css / Tailwind @theme, a Claude Design handoff bundle, or a DESIGN.md. Applies when: identifying the source type and parsing its values; mapping them onto the closed utopia token tree; showing a proposal and diff before any write, then applying via the tokens skill's edit loop; reporting unmapped external tokens or uncovered utopia slots as gaps; running a re-import 3-way diff against already-synced values. Without utopia_ui resolved it stops at its usage gate and surfaces install guidance. Does NOT cover hand-editing design/tokens.json with no external source (-> utopia-design:tokens), regenerating the theme or the HTML twin (-> utopia-design:sync), building screens (-> utopia-design:screen), or a Figma write-API sync (out of scope; Figma only via DTCG export). Layered on the upstream utopia-hooks plugin - silent on Screen/State/View, hooks, and Dart conventions.
/screenBuild or update a Flutter screen from an outside design input using ONLY components from the utopia_ui component manifest (the merged manifest when the project registers custom components). Applies when: implementing or recreating an HTML mockup, a screenshot, a handoff bundle, a DESIGN.md, or the packaged HTML twin gallery; deciding which utopia_ui component a design element maps to; reporting an unmappable element as a gap instead of hand-rolling it. Without utopia_ui resolved it stops at its usage gate and surfaces install guidance. Does NOT cover editing design/tokens.json (-> utopia-design:tokens); importing external design VALUES such as colors or spacing (-> utopia-design:import - VALUES onto tokens there, STRUCTURE onto components here); regenerating the theme or the HTML twin (-> utopia-design:sync); or state management, screen scaffolding, navigation (-> utopia-hooks). Layered on the upstream utopia-hooks plugin - silent on Screen/State/View, hooks, and Dart conventions.
/tokensEdit or rebrand a consumer app's design/tokens.json - the DTCG design-tokens document that is the single source of truth for the Utopia Design Protocol on top of utopia_ui. Applies when: bootstrapping design/tokens.json from the packaged utopia_ui default theme; changing theme colors, the spacing/radius scale (rescaling the base unit x), typography (textStyle roles and their textStyle-colors siblings), or semantic theme.* slots; running validate_tokens after an edit. Without utopia_ui resolved it stops at its usage gate and surfaces install guidance. Does NOT cover regenerating the Flutter theme or the HTML twin (-> utopia-design:sync), importing external design sources (Figma exports, foreign tokens.css / Tailwind @theme files, handoff bundles) (-> utopia-design:import), building screens from a design (-> utopia-design:screen), or editing utopia_ui library internals. Layered on the upstream utopia-hooks plugin - silent on Screen/State/View, hooks, and Dart conventions.