flutter_agentify
AGENTS.md0 starsChanged 4 days agoMITView on GitHub
A Flutter app template where an in-app assistant and the UI share the same actions: whatever a person can do with a button, the assistant can do by calling the same code, and every change shows a receipt. The app is in lib/; its packages are in packages/ (flutter_agentify_core, flutter_agentify_ui, flutter_agentify_lints, and flutter_agentify_on_device when the model runs inside the app). Before anything else, name the project and choose a starting point (example keeps the item list, empty starts clean and…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository29 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- actionsSkill
- adding-a-featureSkill
- agent-workflowSkill
- app-contextSkill
- approval-and-safetySkill
- backend-proxySkill
- background-workSkill
- build-an-appSkill
- capture-learningsSkill
- clean-architectureSkill
- customizing-the-assistantSkill
- delegate-to-agentSkill
- edit-boundariesSkill
- i18n-and-rtlSkill
- model-providersSkill
- performanceSkill
- permissions-and-platformSkill
- read-the-docsSkill
- reliable-mutationsSkill
- routingSkill
- secretsSkill
- state-managementSkill
- storing-dataSkill
- testingSkill
- ui-designSkill
- upgrade-the-frameworkSkill
- verifySkill
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 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.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Before anything else, name the project and choose a starting point (example keeps the item list, empty starts clean and keeps the example …
- Very specific: line 12
Add --model both or --model on-device only when asked for a model that runs inside the app.
- Very specific: line 22
UI:: every visible string comes from assets/lang/*.json, every color from the theme, every navigation from GoRouter.
- Very specific: line 23
Database changes: only add tables or nullable or defaulted columns, raise schemaVersion, and come with a schema dump and a …
- Very specific: line 29
Run tool/check.sh. Work is done only when it ends with All checks passed.
- Distinctive: line 35
Check the scope first, then cover four areas:
- Very specific: line 67
All actions, with their inputs and failure codes: .agents/skills/actions/references/action-reference.md (generated).
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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.
Files
Flutter Agentify
A Flutter app template where an in-app assistant and the UI share the same actions: whatever a person can do with a button, the assistant can do by calling the same code, and every change shows a receipt. The app is in lib/; its packages are in packages/ (flutter_agentify_core, flutter_agentify_ui, flutter_agentify_lints, and flutter_agentify_on_device when the model runs inside the app).
<!-- @template:begin -->This template is not set up yet
Before anything else, name the project and choose a starting point (example keeps the item list, empty starts clean and keeps the example as reference in .agents/example/):
dart tool/setup.dart --name <snake_case_name> --org <reverse.domain> --starter emptyAdd --model both or --model on-device only when asked for a model that runs inside the app; the default, server, uses a model server.
Then run the commands it prints under Next: (the commit, flutter pub get, dart run build_runner build, tool/check.sh; never flutter run unless asked) and load the build-an-app skill. If the task is to change Flutter Agentify itself, skip this section.
<!-- @template:end -->Rules
- Layers.
lib/domain/(entities, repository interfaces, actions) imports neitherdata/,presentation/nor Flutter.lib/presentation/imports nothing fromdata/.lib/data/implements the domain interfaces.lib/ai/holds the adapters between the app and the assistant. - Changes go through actions. Screens change data only with
registry.run(action, input)and read through repository members namedwatch…orget…. - Actions live in
lib/domain/actions/, throwActionFailureon failure (never return an error value) and never call a model. - UI: every visible string comes from
assets/lang/*.json, every color from the theme, every navigation from GoRouter. - Database changes only add tables or nullable or defaulted columns, raise
schemaVersion, and come with a schema dump and ato_v<N>_test.dart. - No keys in source, assets, tests or anything sent to the model.
- Never edit generated files (
*.g.dart,*.drift.dart,test/generated_migrations/) orpackages/, unless the task is about the framework itself.
Before you say it is done
Run tool/check.sh. Work is done only when it ends with All checks passed. Report what it printed, and never report a check you did not run. The custom rules show only in dart analyze run from the repo root and in the gate; flutter analyze does not report them.
To opt one line out of a rule, put // ignore: flutter_agentify_lints/<rule> on the line above, with a reason. The doctor counts every // ignore:, ! and dynamic, and those counts may only go down.
Adding a feature
Check the scope first, then cover four areas:
- the screen, reading through
watch…/get…and changing data withregistry.run; - the action in
lib/domain/actions/, registered inAppActions, with its test intest/actions/<action_name>_test.dart; - the regenerated action reference:
dart run tool/action.dart --write-reference(add a row below only for a primary action); - an entry for every new route in
lib/ai/screen_contexts.dart.
test/ai/parity_test.dart fails when an action has no test, the reference is stale, or a route has no screen entry. The adding-a-feature skill has the details.
App context
Each message to the assistant carries a <current-screen> block: {"navigation": {"route", "location", "params", "selectedIds"}, "screen": {...}}. The screen part comes from the table in lib/ai/screen_contexts.dart, keyed by route pattern: a short summary of what the screen shows (counts, the first rows, always with ids), never a key.
Primary actions
<!-- @example:begin -->| Action | What it does |
list_items | Lists the newest items and the total. |
get_item | Returns one item with its full title and description. |
create_item | Adds an item with a title and optional description. |
update_item | Changes an item's title or description. |
delete_item | Deletes an item; the person approves first. |
delete_items | Deletes several items; approval first. |
set_theme_mode | Switches between light, dark and the system theme. |
set_language | Changes the app's language. |
<!-- @example:end --><!-- @empty: | Action | What it does | --><!-- @empty: |---|---| --><!-- @empty: | `set_theme_mode` | Switches between light, dark and the system theme. | --><!-- @empty: | `set_language` | Changes the app's language. | -->All actions, with their inputs and failure codes: .agents/skills/actions/references/action-reference.md (generated).
Try things without the UI
dart run tool/action.dart --list
dart run tool/action.dart set_language '{"locale":"fa"}'
dart run tool/action.dart <action_name> '<json>' --approved
dart run flutter_agentify_core:docs --query "needs approval"The action CLI uses a scratch database under .dart_tool/, never the app's data.
Skills
Skills live in .agents/skills/<name>/SKILL.md; load the one that fits the task.
- Building features:
build-an-app,adding-a-feature,actions,app-context,approval-and-safety,delegate-to-agent - Architecture:
clean-architecture,state-management,storing-data,routing,reliable-mutations - UI:
ui-design,i18n-and-rtl,accessibility - AI layer:
model-providers,secrets,backend-proxy,customizing-the-assistant - Platform:
permissions-and-platform,background-work - Quality:
testing,performance,verify - Agent behavior:
edit-boundaries,agent-workflow,read-the-docs,capture-learnings,upgrade-the-framework
Memory
At the start of a session, read learnings.defaults.md and, if it exists, learnings.md. When the person corrects you or states a preference, append one line to learnings.md (it is not committed).
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
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.

