Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/tsnanh/flutter-agentic-starter/fluttergit clone --depth 1 https://github.com/tsnAnh/flutter-agentic-starterWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01132 |
| Opus 5 | $0.00000 | $0.00566 |
| Sonnet 5 | $0.00000 | $0.00226 |
| Haiku 4.5 | $0.00000 | $0.00113 |
Grade A, and why
flutter scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 73 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Flutter Agent Rules
Use flutter-agentic-starter only while implementing Flutter application code
or its Flutter tests. It does not apply to documentation, setup tooling,
repository automation, or other non-app maintenance.
Karpathy Guidelines
- Think before coding. State assumptions and ask when requirements are unclear.
- Simplicity first. No speculative abstractions or features.
- Surgical changes. Touch only lines needed for requested behavior.
- Goal-driven execution. Define success criteria and verify with commands.
Hard Rules
- Minimal focused edits only. Touch only files and lines required for requested behavior.
- Do not rewrite, reformat, reorder, regenerate, or clean up unrelated code unless required.
- Never manually edit build_runner generated files, including
*.g.dart,*.freezed.dart,*.config.dart, or files markedGENERATED CODE - DO NOT MODIFY BY HAND. - Avoid primitive obsession. Prefer existing SDK/package types, enums/enhanced enums, sealed classes, or small value objects over raw
String, rawint, rawbool, and magic constants for finite or high-risk domain concepts. Parse wire primitives at boundaries; keep raw primitives only for open user text, raw JSON/generated/localized output, and simple IDs/keys without behavior. - Prefer maintained pub.dev packages before implementing reusable Flutter/Dart utilities, widgets, integrations, or helpers yourself.
- Document any pub.dev package-first exception with reason.
- For Flutter source icons/images, find suitable existing internet assets instead of creating them yourself. Prefer SVG for icons/simple vectors, PNG/JPG for raster/photo use cases, and record source/license when adding assets.
- Keep ephemeral widget-only state local with
StatefulWidget/setState; use injectable feature view models with privateSignaland publicReadonlySignalstate for shared or asynchronous state. - Use
SignalWidgetfor signal-driven screens and focusedSignalBuilderboundaries for surgical rebuilds. UseAsyncState<T>,computed, andbatchwhere their semantics fit. - Keep one-shot UI effects at the widget boundary. Explicitly dispose owned effects, subscriptions, connections, and lifecycle observers. Do not use
.watch(context)orSignalsMixin. - Use
SafeArea; honor text scaling and accessibility-awareMediaQuery. - Use
LayoutBuilderfor parent constraints andMediaQuery.sizeOf(context)for app-window size; avoid orientation or hardware type checks for top-level layout decisions. - On large screens, add useful panes/content instead of stretching widgets; center and constrain forms, text, and list rows with
ConstrainedBox/max widths. - Use lazy builders for long lists/grids. Use
GridView.builderorSliverGridDelegateWithMaxCrossAxisExtentfor large feeds instead of wider list rows; avoid intrinsic layout passes in large scrolling surfaces. - Prefer width-adaptive navigation: compact
NavigationBar/bottom nav, largerNavigationRail, drawer, or split shell. - Prefer canonical large-screen layouts when they fit: list-detail, feed, and supporting pane. Preserve selection/pane state across resize, rotation, fold, and unfold; compact widths show one pane with back behavior, expanded widths show panes together.
- For foldables, do not lock orientation; use
MediaQuery.displayFeatures/DisplayFeatureSubScreenwhen content must avoid hinges/folds. Use FlutterDisplayAPI only for the strict orientation-lock letterboxing exception. - Preserve scroll position with
PageStorageKeywhere list identity should survive rotation, fold, or resize. - Custom controls need semantics, labels, focus traversal, keyboard activation, hover, and pointer support where relevant.
- Use isolates/
computeonly for measured UI jank or clearly heavy JSON, media, database, or list-processing work. - Add
restorationScopeId/restorationIdforMaterialApp.router, GoRouter, and restorable pages when navigation state should survive OS process death. - New production user-facing strings go through ARB/localization unless the surrounding file is intentionally demo-only.
- Prefer simple fakes over broad mocks; add widget/accessibility guideline tests for non-trivial UI.
- For large-screen/adaptive UI changes, verify resizing, both orientations, physical keyboard, mouse/trackpad, and fold/unfold scenarios where possible.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 73 lines · 0 tokens per session scan A 1f523c816fda
flutter is a cursor rule published in the GitHub repository tsnAnh/flutter-agentic-starter (7 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,132 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
blog-guide
Writing guides for the FlutterInit blogs (Guides category).
project-core
Invariantes globais do laboratório Flutter + validation harness.
flutter-app
Convenções do app Flutter (lib/).
change-app-id
Apply when the user asks to change the application ID, bundle identifier, package name, or app ID on Android or iOS.
mobile-cross-platform
Cross-platform mobile: Flutter, React Native, Expo. Load when editing mobile manifests, platform folders, or shared mobile architecture — not for everyday app logic.
conventions
Project-wide coding conventions and rules for FlutterAgentic. Always include for all code generation tasks.