Home › Flutter › Flutter AGENTS.md

Flutter AGENTS.md

AGENTS.md for Flutter apps with Riverpod, go_router and clean feature-first structure.

AGENTS.mdFlutter

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

AGENTS.mdDownload  
# AGENTS.md — Flutter

## Commands
- `flutter pub get` · `dart format .` · `flutter analyze` · `flutter test`
- Codegen (freezed/json_serializable/riverpod_generator): `dart run build_runner build -d`

## Structure
- Feature-first: `lib/features/<feature>/{data,domain,presentation}`; shared code in `lib/core`.

## Rules
- State management: Riverpod (with code generation). No `setState` beyond purely local widget state.
- Navigation: go_router with typed routes.
- Immutable models with `freezed`; never mutate state objects in place.
- Prefer `const` constructors; split widgets into small classes rather than helper methods returning widgets.
- Never block the UI thread; heavy work goes to `compute`/isolates.
- Respect platform conventions (back gestures, safe areas, text scaling). All tappables need semantics labels.
- Don't edit generated `*.g.dart` / `*.freezed.dart` files.

## Done
- `flutter analyze` has zero issues and `flutter test` passes.

Related rules

Godot 4 GDScript AGENTS.md

AGENTS.md for Godot 4 projects using typed GDScript, signals and scene composition.

AGENTS.mdGodot

MCP server (TypeScript) AGENTS.md

AGENTS.md for building Model Context Protocol servers in TypeScript with clear tools, zod schemas and safe defaults.

AGENTS.mdMCP servers

Python FastAPI AGENTS.md

Universal AGENTS.md for Codex, Jules, Cursor and other agents working on a FastAPI + uv project.

AGENTS.mdPython / FastAPI

SvelteKit AGENTS.md

AGENTS.md for SvelteKit 2 + Svelte 5 (runes) apps with TypeScript.

AGENTS.mdSvelteKit

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.