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).
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/000-project.mdcCursor rule
- .cursor/rules/accessibility.mdcCursor rule
- .cursor/rules/api-integration.mdcCursor rule
- .cursor/rules/architecture.mdcCursor rule
- .cursor/rules/dart-style.mdcCursor rule
- .cursor/rules/design-system.mdcCursor rule
- .cursor/rules/flutter-ui.mdcCursor rule
- .cursor/rules/security.mdcCursor rule
- .cursor/rules/state-management.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- doubt-reviewSkill
- fix-dependenciesSkill
- flutter-implementSkill
- generate-mocksSkill
- grind-until-greenSkill
- implement-tddSkill
- monitor-terminalSkill
- plan-featureSkill
- repo-navigatorSkill
- review-codeSkill
- save-contextSkill
- suggest-ruleSkill
- write-commitSkill
- write-readmeSkill
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
- Distinctive: line 8
Use when adding or promoting a reusable UI primitive (button, chip, card, modal, etc.).
- Very specific: line 10
Read an existing component in lib/design_system/components/ first and match its patterns.
- Very specific: line 34
Use the same <prefix> as existing components (e.g.
- Distinctive: line 38
All visual values from tokens
- Very specific: line 57
Document in docs/DESIGN.md (component table)
≈ “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.
Files
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.dartwhen needed - Tappable:
Material+InkWell; static:DecoratedBox; alwaysSemantics
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 — requiredUse 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 semanticLabelparam 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
onTapwhen 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
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.

