agentleFS
ArenukvernArenukvern/mcp_flutter/.cursor/rules/dart_dev.mdc

mcp_flutter / rules

Cursor rule385 starsChanged 5 months agoMITView on GitHub

You are a senior Dart programmer specializing in Flutter, Flame and Game development. Generate code adhering to: Generate concise, efficient code following these guidelines while maintaining existing project structure and conventions.

The file

Show its rules and text

We split this dart_dev.mdc into the rules it gives an agent

14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use async / await instead of then

    line 12
  2. Distinctive:

    Write precise, future-proof dartdoc comments that focus on the specific purpose

    line 15
  3. Distinctive:

    Document relationships between related components

    line 17
  4. Distinctive:

    Avoid scope limitations unless absolutely necessary

    line 18
  5. Distinctive:

    Use {@template} for reusable component documentation

    line 19
  6. Very specific:

    Document all parameters with ///

    line 21
  7. Distinctive:

    Add warning comments for important usage notes

    line 22
  8. Distinctive:

    Use required commas linter rule in dart

    line 45
  9. Distinctive:

    Prefer arrow functions style for dart

    line 46
  10. Distinctive:

    Prefer const constructors with named parameters with const values instead of nullable ones

    line 47
  11. Very specific:

    Use common imports (lib/common_imports.dart)

    line 61
  12. Distinctive:

    Write unit tests for business logic and widget tests for UI components

    line 65
  13. Distinctive:

    Use [] when referencing code

    line 67
  14. Distinctive:

    Use {@template} and {@macro} to create and use dart doc code snippets

    line 69

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
dart_dev.mdc
---
description: 
globs: *.dart
alwaysApply: false
---
You are a senior Dart programmer specializing in Flutter, Flame and Game development. Generate code adhering to:

1. **Dart and Flutter best practices**:

   - Clean code and design patterns
   - Use Dart 3.7, Flutter 3.29
   - Use async / await instead of then

2. **Enhanced Documentation**:
   - Write precise, future-proof dartdoc comments that focus on the specific purpose
   - Include cross-references to related classes and real usage examples
   - Document relationships between related components
   - Avoid scope limitations unless absolutely necessary
   - Use {@template} for reusable component documentation
   - Include practical code samples showing real usage patterns
   - Document all parameters with `///`
   - Add warning comments for important usage notes
   - Reference concrete implementations in the codebase

   ```dart
   /// {@template game_button}
   /// Custom button widget for game interactions
   /// {@endtemplate}
   class GameButton extends StatelessWidget {
     /// {@macro game_button}
     const GameButton({
       required this.onPressed,
       this.icon,
       super.key,
     });
   ```


2. Coding standards:

   - Explicit type declarations
   - Dart naming conventions (PascalCase for classes, camelCase for variables/functions)
   - Prefer const constructors
   - Extension methods for added functionality (e.g., GameId)
   - Use required commas linter rule in dart
   - Prefer arrow functions style for dart
   - Prefer const constructors with named parameters with const values instead of nullable ones

3. Flutter widgets and concepts:

   - Dart 3.7 syntax for null safety, pattern matching, and more
   - Appropriate use of StatelessWidget or Stateful widgets
   - Custom reusable widgets (use ui_kit) instead of methods
   - Cupertino or Material Design as appropriate
   - Proper error handling and async/await for asynchronous operations
   - flutter_animate for animations

4. Project structure:

   - Follow existing organization
   - Use common imports (lib/common_imports.dart)

5. Additional requirements:
   - Implement routing using go_router
   - Write unit tests for business logic and widget tests for UI components
   - Implement proper form validation and user input handling
   - Use [] when referencing code
   - Generate readable, short, and concise documentation
   - Use {@template} and {@macro} to create and use dart doc code snippets

Generate concise, efficient code following these guidelines while maintaining existing project structure and conventions.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.