mcp_flutter / rules
Cursor rule385 starsChanged 5 months agoMITView on GitHub
This document provides a condensed, unified overview of the application's architecture. It is designed to be a primary reference for understanding the core concepts, structure, and development patterns. The application follows a standard layered architecture, separating concerns into distinct layers and directories. A Workspace is composed of several key file types, each serving a distinct purpose. All file contents are parsed into immutable extension type models located in lib/data_models/. See dart_extension_type_const_models.guide.mdc for more details. Services in lib/services/ contain isolated, high-level…
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 1,533 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 repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .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/command_resource.pattern.mdCursor 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
- 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 app_architecture.guide.mdc into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 51
Should contain isolated game logic.
- Very specific: line 73
Use useLocale() and AppStrings.{key}.getValue(locale) to get the current locale and strings.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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
---
description:
globs:
alwaysApply: true
---
# Application Architecture Overview
This document provides a condensed, unified overview of the application's architecture. It is designed to be a primary reference for understanding the core concepts, structure, and development patterns.
## 1. High-Level Architecture & Directory Structure
The application follows a standard layered architecture, separating concerns into distinct layers and directories.
```
lib/
├── core/ # Core abstractions & shared utilities
├── components/ # Shared UI components in atom design style. See
├── data_models/ # Immutable data models based on extension types. See `[dart_extension_type_const_models.mdc](mdc:.cursor/rules/dart_extension_type_const_models.mdc)` for more details.
├── data_resources/ # UI state holders (Resources) See `[command_resource_pattern.guide.mdc](mdc:.cursor/rules/command_resource_pattern.guide.mdc)` for more details.
├── data_commands/ # Logic to update Resources (Commands) See `[command_resource_pattern.guide.mdc](mdc:.cursor/rules/command_resource_pattern.guide.mdc)` for more details.
├── data_api/ # Data access layer (file I/O, parsing)
├── data_services/ # Data services (file I/O, parsing)
├── mechanics/ # Mechanics (game mechanics)
├── di/ # Dependency injection setup See `[di_usage.guide.mdc](mdc:.cursor/rules/di_usage.guide.mdc)` for more details.
├── services/ # Isolated Application-level business logic
├── {ui_domain}/ # Domain or Feature-specific screens and widgets, like ui_vitamin_selection, ui_info etc..
├── theme/ # Context based Theme
└── main.dart # Application entry point
```
- **Data Layer:** `data_models/` & `data_api/` handle the representation of and interaction with the data.
- **State & Service Layer:** `data_resources/` & `data_commands/` & `data_services/` manage application state and orchestrate business logic.
- **UI Layer:** `{ui_domain}/` contains all Flutter widgets, organized by domain and then by feature.
## 2. The Data Layer: Workspace File Structure
A Workspace is composed of several key file types, each serving a distinct purpose. All file contents are parsed into immutable **`extension type`** models located in `lib/data_models/`.
See `[dart_extension_type_const_models.guide.mdc](mdc:.cursor/rules/dart_extension_type_const_models.guide.mdc)` for more details.
## 3. Data Service Layer
Services in `lib/services/` contain isolated, high-level data related business logic that orchestrates data flow and complex operations. They provide reusable **capabilities** (e.g., file writing, data parsing) and are consumed by Commands to perform actions.
They can be used by commands, mechanics.
## 4. Mechanics Layer: Game Mechanics
Mechanics in `lib/mechanics/` contain the game mechanics, they can be consumed by commands, and may modify resources.
Should contain isolated game logic.
## 5. UI & State Management: The Command-Resource Pattern
The application uses the **Command-Resource pattern** for a clear separation between UI state and business logic. Commands are triggered by the UI to execute atomic **transactions** (e.g., "save this character"), using Services to perform the work and updating Resources with the result.
See `[command_resource_pattern.guide.mdc](mdc:.cursor/rules/command_resource_pattern.guide.mdc)` for more details.
## 6. Dependency Injection (DI)
The application uses the `get_it` package for service location. The setup is centralized in `lib/di/dependency_injector.dart`. See `[di_usage.guide.mdc](mdc:.cursor/rules/di_usage.guide.mdc)` for more details.
See `[di_creation.guide.mdc](mdc:.cursor/rules/di_creation.guide.mdc)` for more details.
For how to use DI, see more in `[di_usage.guide.mdc](mdc:.cursor/rules/di_usage.guide.mdc)`
For how to create DI, see more in `[di_creation.guide.mdc](mdc:.cursor/rules/di_creation.guide.mdc)`
## 7. Localization
The application supports dynamic, user-switchable localization for multiple languages. This is achieved by centralizing all user-facing strings and using a reactive architecture to update the UI when the language changes.
Use `useLocale()` and `AppStrings.{key}.getValue(locale)` to get the current locale and strings.
For how to use localization, see more in `[locale_usage.guide.mdc](mdc:.cursor/rules/locale_usage.guide.mdc)`
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.

