What to put in an AGENTS.md for Flutter
Flutter publishes AI rules, agent skills and a Dart and Flutter MCP server (dart mcp-server), so point to those and keep AGENTS.md to this repo. The common slip is editing a generated *.g.dart file instead of rerunning build_runner.
Which commands should it list?
flutter pub getafter any pubspec.yaml changeflutter analyzenotdart analyzeflutter testunit and widget tests; notdart testdart format .formatdart run build_runner build --delete-conflicting-outputsregenerate*.g.dart
Write them as your repo runs them, with its package manager and flags, plus how to run one test.
What layout should it explain?
- Which directory holds the app and its pubspec.yaml, in a repo with several packages.
- Which packages use code generation, and which
part '*.g.dart'files come from it. - Where integration tests live (
integration_test/) and what device they need.
What do agents get wrong?
- Use
flutter analyze,flutter testandflutter pub, not the baredartcommands. *.g.dartfiles come from build_runner; change the source and regenerate them.- Integration tests run on a device:
flutter test integration_test/<file>.dartfrom the project root.
From the official docs: docs.flutter.dev/get-started (new tab) · docs.flutter.dev/flutter-cli (new tab) · docs.flutter.dev/json (new tab) · docs.flutter.dev/integration-tests (new tab) · docs.flutter.dev/formatting (new tab). The rest of the file is the same for any project: what goes in an AGENTS.md.
Flutter repos with an AGENTS.md or CLAUDE.md (3)
Built on Flutter; 3 pass the AGENTS.md check in full.
| Repo | File | Length | Language |
|---|---|---|---|
| localsend/ | AGENTS.md | 12,267 chars | |
| rustdesk/ | AGENTS.md | 18,208 chars | |
| immich-app/ | AGENTS.md | 2,449 chars |
More examples: Next.js · React · FastAPI · Django · Rails · Vue · Laravel · Android · all examples