Agent skill

Design System Structure Skill: Flutter Tokens, Theme and Shapes

The design-system-structure skill teaches an AI coding agent to structure a Flutter design system as tokens, theme, modifiers and shapes, with a gate that rejects raw values.

Install
npx skills add zakariaf/Flutter-Skills
View on GitHub

Stars, license and last push from GitHub. Install count as reported by the open skills directory.

What is the design system structure skill?

The design-system-structure skill makes an AI coding agent keep every aesthetic value of a Flutter app in one directory. Tokens come in two tiers, widgets read them through a ThemeExtension, and a script fails the build on stray raw values.

The design-system-structure skill structures a Flutter design system as tokens, then theme, then modifiers, then shapes. It owns how tokens, themes, components and shapes are structured and consumed, and your design source of truth owns which values to pick.

The aim is a design system that cannot hold a stray opinion. Every aesthetic value lives in one directory, and every widget reads it back through a named slot, so a reskin becomes a diff of lib/theme.

The rules it enforces

  • No raw aesthetic value outside lib/theme, with scripts/check_raw_values.sh as the gate.
  • Two token tiers, where widgets read only the semantic tier.
  • Tokens read through a ThemeExtension and an asserting of(context) with no fallback.
  • A hand authored ColorScheme instead of ColorScheme.fromSeed.
  • Light and dark authored by hand, each passing AA.
  • Reduced motion collapsing to Duration.zero.
  • The persisted theme restored before first paint.

Two tiers of tokens

Tier 1 primitives are named by the measured value, such as neutral12 for OKLCH lightness times 100, and never by rank, appearance or brand. Tier 2 semantic slots are named by role, such as surface, onSurface, hairline and accent.

A widget that reaches a Tier 1 primitive has hardcoded one theme. Rank scales have no room to insert and lie in dark mode, appearance names invert, and brand names die with the brand.

What ships with the skill

The skill folder holds the skill file plus examples, references and scripts. The references cover token tiers and ThemeExtension, motion and reduced motion, typography and fonts, and contrast with redundant encoding. The scripts are check_raw_values.sh and check_font_bundling.sh.

Who the design system structure skill is for

Best for

  • Creating or editing ThemeData, ThemeExtension or ColorScheme in a Flutter app.
  • Adding or renaming a design token, or structuring a theme or DesignSystem folder.
  • Wiring theme injection or theme mode persistence.
  • Reviewing any widget that renders a color, radius, duration or font.

Not for

  • Choosing which colors or radii to use, since the skill owns structure and not values, so for building color ramps, naming semantic color tokens and measuring contrast pairs the better-colors skill fits.
  • Token pipelines built on DTCG JSON or Style Dictionary, which this skill treats as an anti-pattern for a small single-package app, so for generating DTCG tokens in three tiers the design-tokens skill fits.
  • Reading colors, type and spacing from a public website, since the skill structures a Flutter design system with ThemeExtension and ColorScheme, so for writing a site's values as starter tokens the extract-design-system skill fits.
  • Web projects that theme with CSS variables, since the skill covers Flutter ThemeData and ThemeExtension, so for turning one request into tokens, components and dark mode theming the design-system-starter skill fits.