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

REST API design AGENTS.md

AGENTS.md for designing consistent HTTP/JSON APIs: resource naming, status codes, errors, pagination, and versioning.

AGENTS.mdAPI design

Bevy game engine AGENTS.md

AGENTS.md for Bevy (0.16+) games in Rust: ECS systems, plugins, required components, and fast dev builds.

AGENTS.mdBevy (Rust)

Git commits & PRs AGENTS.md

AGENTS.md rules for how agents commit: Conventional Commits, atomic changes, safe git commands, and PR descriptions.

AGENTS.mdAgent workflows

CrewAI multi-agent AGENTS.md

AGENTS.md for CrewAI 1.x projects: YAML agents and tasks, crews and flows, tools, and cost-aware runs.

AGENTS.mdLLM apps & agents

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.