mcp_flutter / rules
Cursor rule401 starsChanged 5 days agoMITView on GitHub
When writing commands or resources
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,263 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 repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/app_architecture.guide.mdcCursor rule
- .cursor/rules/ask_file_by_file_actions.mdcCursor rule
- .cursor/rules/ask_follow_up.mdcCursor rule
- .cursor/rules/ask_step_by_step_plan.mdcCursor rule
- .cursor/rules/create_test_rule.mdcCursor rule
- .cursor/rules/dart_dev.mdcCursor rule
- .cursor/rules/dart_doc.mdcCursor rule
- .cursor/rules/dart_extension_type_const_models.mdcCursor rule
- .cursor/rules/faq_usage.mdcCursor rule
- .cursor/rules/flutter_ui_dev.mdcCursor rule
- .cursor/rules/key_design_decisions.mdcCursor rule
- .cursor/rules/mermaid_rule.mdcCursor rule
- .cursor/rules/steward.mdcCursor rule
- .cursor/rules/test_guide.mdcCursor rule
- .cursor/rules/test_use_tdd.mdcCursor rule
- .cursor/rules/think_hard.mdcCursor rule
- .cursor/rules/training.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
- .cursor/rules/writing_code_protocol.mdcCursor rule
- docs/llms.txtllms.txt
- llms.txtllms.txt
- flutter-mcp-automation-chainSkill
- flutter-mcp-e2e-harnessSkill
- flutter-mcp-toolkit-guideSkill
- harness-engineering-lifecycleSkill
- mcp-harness-repo-maintainerSkill
- mixture-of-expertsSkill
- multi-agent-handoffSkill
- plugin-marketplace-setupSkill
- release-changelog-harnessSkill
- repository-governance-lifecycleSkill
- skill-authoring-lifecycleSkill
- skill-eval-improveSkill
- skill-source-citationsSkill
The file
We split this command_resource.pattern.md into the rules it gives an agent
12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Do not rely on strings, use enums.
- Distinctive: line 13
Use context.read/context.select to subscribe to observable state in build methods.
- Distinctive: line 32
Call one or more Services to perform the necessary work.
- Distinctive: line 33
Update one or more Resources with the result of the operation.
- Distinctive: line 60
Place ResourceData (BLoC models, see below) and support types to {snake_case}.src.data.dart
- Distinctive: line 63
Use for all Flutter UI Widget related data.
- Very specific: line 64
Use BLoC Style, see explanation below.
- Very specific: line 67
If the domain scope is similar: KeyboardSetting, MusicSettings, GridSettings etc..
- Very specific: line 68
If it is related to one model, like Apple has properties: color, shape etc..
- Very specific: line 69
If that's the case, always create ResourceData.
- Distinctive: line 75
Use for scenarios demanding ultra-fast, in-place updates: e.g., animation buffers, real-time game state, or any data structure where …
- Very specific: line 78
Create separate 'Data', if no models exists.
≈ “Common” is an estimate: at least 1 in 5 of the 7,111 Cursor rule 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
Writing Code Protocol
- Export files from its folders using barrel file (resources/resources.dart, commands/commands.dart etc.).
- Do not rely on strings, use enums.
- Use context.read/context.select to subscribe to observable state in build methods.
Intent and Implementation Consistency
Command-Resource Pattern
The relationship between Commands, Resources, and Services is the backbone of the application's architecture, ensuring a clean separation of concerns.
- Commands: Execute atomic transactions.
- Services: Provide reusable capabilities.
- Resources: Hold and expose UI state.
A typical data flow is: UI -> Command -> Service -> Resource -> UI.
- Commands: Pure business logic containers
- Role: To execute a single, discrete business transaction (e.g., "Save Character") in response to a UI event. Commands are the only part of the application allowed to orchestrate state changes.
- Responsibilities:
- Translate a UI event into a state change.
- Validate input for a specific action.
- Call one or more Services to perform the necessary work.
- Update one or more Resources with the result of the operation.
- Characteristics:
- Short-lived & Stateless: A Command is created, executed, and discarded for a single action. It holds no state itself.
- Triggered by UI: They are the bridge between user intent (a button click, a debounced text change) and the system's reaction.
- Expose logic via
execute()method. Create private methods if needed for clarity - Named as
{Action}{Resource}Command - File named as {snake_case}.cmd.dart
- The Dart class name within a command file must be the
PascalCaseversion of the file name. For example,load_nutrients.cmd.dartmust containclass LoadNutrientsCommand. - Can read/update multiple resources
- Contain all transformative logic
- Commands are executed based on user or other actions
- Services: High-level capability providers
- Role: To encapsulate a major area of application functionality and provide a stable, reusable API for a core domain concern (e.g.,
WorkspaceService). - Responsibilities:
- Interacting with the Data API (file system I/O, parsing).
- Managing long-running processes (e.g., watching a directory).
- Encapsulating complex, multi-step business workflows.
- Characteristics:
- Long-lived: Often instantiated once and used throughout the application's lifecycle.
- Called by Commands: Services should never be called directly from the UI.
- Dependencies: Depend on the Data API and other low-level utilities. They do not depend on Commands or UI.
- Role: To encapsulate a major area of application functionality and provide a stable, reusable API for a core domain concern (e.g.,
- Resources: Pure data containers
- Role: To hold, manage, and expose UI state. They notify listeners when their data changes, enabling the UI to be reactive.
- Named as
{Domain}Resource - File named as {snake_case}.src.dart
- Place ResourceData (BLoC models, see below) and support types to {snake_case}.src.data.dart
- Minimal business logic related to state management. Focus on holding and managing state, not complex domain logic.
- Immutable Resources
- Use for all Flutter UI Widget related data.
- Use
BLoC Style, see explanation below. - For resources representing collections (lists, maps), always extend
OrderedMapNotifier/OrderedListNotifierfromxsoulspace_state_utils. - Protocol defining
ResourceDataclass:- If the domain scope is similar:
KeyboardSetting,MusicSettings,GridSettingsetc.. - If it is related to one model, like
Applehas properties: color, shape etc.. - If that's the case, always create
ResourceData. - Otherwise create for every primitive different Resource, like
GameStatusResource extends ValueNotifieretc. - In the context of
Immutable Resources,BLoC stylerefers to the practice of separating the immutable data structure (the "State" in BLoC terminology) into its own Data class (Model). This Data class is then held and managed by the Resource class (which acts as a simplified "BLoC"), usingValueNotifier,OrderedMapNotifier, orOrderedListNotifierto notify listeners of state changes. This promotes a clear separation of concerns and improves the manageability of immutable state.
- If the domain scope is similar:
- Mutable Resources
- Pure classes with mutable structures.
- Use for scenarios demanding ultra-fast, in-place updates: e.g., animation buffers, real-time game state, or any data structure where mutation speed is critical.
- Optimized for high-frequency, low-latency changes—ideal for render loops, simulations, or transient, performance-sensitive state.
- For resources representing collections (lists, maps), always extend
OrderedMap/OrderedListfromxsoulspace_state_utils. - Create separate 'Data', if no models exists. Bloc style files for complex data structures. When using in Mutable Resource, Data should have prefix
Mutand be mutable. - Data can be changed in place; updates mutate the existing instance.
- Resources should provide a clear way to define their initial state. Use factory constructors like
initial()within the state class for this purpose. - Cannot have any dependencies!
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.

