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

flutter-implement

Skill0 starsChanged 5 months agoMITView on GitHub

Build Flutter screens, widgets, ChangeNotifier ViewModels, navigation, and feature code. Use when implementing UI, view models, repositories, or on-device Dart work.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 1 is distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use when building or modifying in-app Dart code.

    line 8
  2. Very specific:

    Read docs/ARCHITECTURE.md and check for similar existing code

    line 12
  3. Very specific:

    No business logic in build

    line 40
  4. Very specific:

    Run flutter analyze --fatal-infos and flutter test

    line 69
  5. Very specific:

    Update docs/DECISIONS.md if architecture changed

    line 70
  6. Very specific:

    Use review-code skill when user requests review

    line 71
  7. Distinctive:

    Use Riverpod or flutter_riverpod

    line 88
  8. Very specific:

    Add dependencies without user approval + docs/DECISIONS.md

    line 90

≈ “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

Flutter implementation

Use when building or modifying in-app Dart code. Follow .cursor/rules/architecture.mdc, state-management.mdc, and design-system.mdc.

Before coding

  1. Read docs/ARCHITECTURE.md and check for similar existing code
  2. List files to create/modify (5–10 lines) — confirm with user if scope is unclear
  3. For new feature slices, prefer mason make feature from bricks/feature/, then adapt the generated files
  4. Match folder layout: features/<feature>/{data,domain?,presentation}/

Stack context

  • provider + ChangeNotifier ViewModels — no Riverpod
  • go_router, freezed for models and sealed UI/error states
  • Design tokens from lib/design_system/tokens/
  • l10n for user-visible strings
  • Repositories return Future<Result<T, Failure>>; inject via MultiProvider

Implementation checklist

Structure

  • One screen / ViewModel / repository per file
  • ViewModels in presentation/view_models/
  • Register new repos/services/ViewModels in app/dependencies.dart
  • data/services/ per data source; repositories above services

ViewModels

  • Extend ChangeNotifier; private repository fields
  • Explicit loading/error/data fields or sealed UI state
  • notifyListeners() after state changes; clean up in dispose()

Views

  • context.watch<ViewModel>() to rebuild; context.read<ViewModel>() in callbacks
  • No business logic in build
  • Semantics on interactive widgets; touch ≥48dp (Material) / ≥44pt (Cupertino)
  • ListView.builder for long lists; Selector to narrow rebuilds

Data

  • No Supabase.instance.client in widgets or ViewModels accessing globals
  • Map errors through core/errors/error_mapper.dart

Routing

  • GoRouter in app/router.dart
  • Inject ViewModels/repos in route builder via context.read()
  • Auth: refreshListenable on auth ViewModel (ChangeNotifier)
  • context.go() / context.push() — not Navigator.push

Tests to add (required)

Per .cursor/rules/testing.mdc — all rows apply; no skipping.

CodeTest
Pure function / mapperunit test
ViewModelunit test with fake repository
Repositoryunit test with fake service or Mockito client
Design-system widgetwidget + golden (light + dark)
Screenhappy path + one error path widget test

Before finishing

  • Run flutter analyze --fatal-infos and flutter test
  • Update docs/DECISIONS.md if architecture changed
  • Use review-code skill when user requests review

Output format

## Files touched
- ...

## Tests added
- ...

## Open questions
- ...

Never

  • Use Riverpod or flutter_riverpod
  • Ship code without required tests (testing.mdc)
  • Add dependencies without user approval + docs/DECISIONS.md
  • Hardcode secrets outside core/config/env.dart
  • Hardcode user-visible strings outside l10n
  • Let views call repositories directly

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.