/flutter-design-fidelity:design-tokensfrom flutter-design-fidelity
Resolves Flutter visual values (colors, spacing, radii, shadows, durations, text styles) through the project's existing theme, constants, or token extension. Honors projects with no token layer and guides token naming conventions.
Ships in flutter-design-fidelity. 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.
Profile first. Read
.agents/flutter-profile.yamlin the project root, falling back to legacy.claude/flutter-profile.yaml.tokensdecides whether this skill applies at all:theme_extension(use the existing extension API),theme_only— resolve throughTheme.of(context)and itsColorSchemeandTextThemeinstead ofcontext.tokens,constants— resolve through the project's constants class, ornone— the project has no token layer and hardcoded values are not a finding. Undernone, do not ask the user to introduce a token layer. Field list:references/flutter-profile.md.
With a configured token layer, widget code describes structure and resolves visual values through that source. Missing profile fields require discovery first. Every color, spacing unit, radius, shadow, duration, and text style should follow that configured source. For theme_only values without a ThemeData equivalent, preserve the existing layout constants or local conventions rather than inventing a ThemeExtension.
Move the following visual literals to the existing token source when that source represents the concept. These restrictions do not apply under tokens: none:
Color(0xFF...), Colors.blue, or any literal colorEdgeInsets.all(16) or any numeric padding, margin, or gapBorderRadius.circular(12) or any numeric radiusTextStyle(fontSize: 14, fontWeight: FontWeight.w600) inlineDuration(milliseconds: 300) for animationsBoxShadow definitionsWrite instead:
Container(
padding: context.tokens.space.md,
decoration: BoxDecoration(
color: context.tokens.color.surfaceRaised,
borderRadius: context.tokens.radius.card,
boxShadow: context.tokens.elevation.low,
),
child: Text('Balance', style: context.tokens.text.titleMedium),
)
First look for an equivalent semantic token. If a new design concept is intentional, add a semantic token even if its first use is on one screen. Avoid numeric aliases that merely disguise a literal. Under tokens: none, inline values are allowed; under theme_only or constants, extend the existing source only where it makes sense.
If a design uses a value that does not fit the existing scale — 14px spacing where the
scale is 4/8/12/16 — do not add a space.s14 token. Report the mismatch and check whether it is an intentional optical adjustment. Follow
explicit design intent; ask only if choosing a value would materially change the result.
Continue independent work while that decision is unresolved.
Figma variable paths map directly to Dart getters in camelCase:
| Figma variable | Dart getter |
|---|---|
color/surface/raised | tokens.color.surfaceRaised |
color/text/secondary | tokens.color.textSecondary |
spacing/md | tokens.space.md |
radius/card | tokens.radius.card |
type/title/medium | tokens.text.titleMedium |
Semantic names only. color.danger, never color.red. A semantic name survives a
rebrand; a literal one does not, and renaming three hundred usages of red when the
brand changes is the exact cost this convention exists to avoid.
Tokens are defined per theme, resolved at call time. A widget that reads
context.tokens.color.surfaceRaised works in both themes with no conditional logic.
Repeated brightness-dependent visual values suggest a missing semantic token; theme
checks for genuinely different behavior are not automatically wrong.
build(). Tokens must resolve per
build or theme switching silently stops working.See references/theme-extension-template.dart for the token class structure to follow
when setting this up in a project that does not have one yet.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/figma-to-widgetImplement Flutter UI from a Figma frame or supplied design image, preserving layout intent and reusing project components. Not for unrelated mentions of Figma./golden-testsAdd or review Flutter visual regression tests for stable, significant UI states; investigate golden mismatches. Do not add goldens for every small widget edit./visual-verificationCapture and compare Flutter UI against a supplied reference after substantial visual changes or an explicit fidelity check. Report missing capture inputs honestly.npx claudepluginhub draz26648/flutter_craft_skills --plugin flutter-design-fidelityOther plugins' skills for the same job