agentleFS
ZAidBinAsifZAidBinAsif/flutter-ai-starter/.cursor/skills/flutter-component/SKILL.md

flutter-component

Skill0 starsChanged 5 months agoMITView on GitHub

Create a reusable design-system component in lib/design_system/components/. Covers tokens, variants, accessibility, widget tests, and golden tests (light + dark).

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 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.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when adding or promoting a reusable UI primitive (button, chip, card, modal, etc.).

    line 8
  2. Very specific:

    Read an existing component in lib/design_system/components/ first and match its patterns.

    line 10
  3. Very specific:

    Use the same <prefix> as existing components (e.g.

    line 34
  4. Distinctive:

    All visual values from tokens

    line 38
  5. Very specific:

    Document in docs/DESIGN.md (component table)

    line 57

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Create a design-system component

Use when adding or promoting a reusable UI primitive (button, chip, card, modal, etc.).

Read an existing component in lib/design_system/components/ first and match its patterns.

Conventions

  • Imports: relative from ../tokens/ and siblings — not package self-imports
  • Colors: token classes (e.g. AppColors.*) — no raw hex in components
  • Text: Theme.of(context).textTheme — wired by app theme
  • Spacing/radii/sizes/durations: from token files only
  • Icons: project icon set — not raw Icons.*
  • Variants: separate *_variant.dart when needed
  • Tappable: Material + InkWell; static: DecoratedBox; always Semantics

File layout

lib/design_system/components/
  <prefix>_<name>.dart
  <prefix>_<name>_variant.dart          # if variants

test/design_system/components/
  <prefix>_<name>_test.dart
  <prefix>_<name>_golden_test.dart       # light + dark — required

Use the same <prefix> as existing components (e.g. app_button.dart → AppButton).

Required behaviors

  • All visual values from tokens
  • Light + dark via shared AppTheme — no hardcoded brightness
  • semanticLabel param with fallback to visible label
  • Disabled state obvious visually + in semantics
  • Touch targets ≥48dp (Material) / ≥44pt (Cupertino)
  • Respect MediaQuery.disableAnimationsOf(context)

Widget test minimum

  • Renders label/content
  • Calls onTap when tappable
  • Semantics reflect selected/disabled/semanticLabel

Golden test

  • One golden per meaningful state × theme (light, dark)

After creating

  • Document in docs/DESIGN.md (component table)
  • Features import the component — component must not know feature data

Anti-patterns

  • Inline hex, sizes, radii, durations
  • Network or state access inside design-system widgets
  • Missing golden test, semantics, or dark mode
  • Touch target below ≥48dp (Material) / ≥44pt (Cupertino) minimum

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.