AI rules for Flutter and Dart
Learn how to add AI rules to tools that accelerate your development workflow.
This guide covers how you can leverage AI rules to streamline your Flutter and Dart development.
Overview
#AI-powered editors use rules files to provide context and instructions to an underlying LLM. These files help you:
- Customize AI behavior to your team's needs.
- Enforce project best practices for code style and design.
- Provide critical project context to the AI.
Environments that support rules
#Many AI environments support rules files to guide LLM behavior. Here are some common examples and their corresponding rule file or directory names:
| Environment | Rules file or directory | Configuration instructions |
|---|---|---|
| Copilot-powered IDEs | .github/copilot-instructions.md |
Configure instructions for Copilot |
| Claude Code | CLAUDE.md |
Configure rules for Claude Code |
| Cursor | AGENTS.md |
Configure rules in Cursor |
| Firebase Studio | .idx/airules.md |
Configure instructions in Firebase Studio |
| Gemini CLI | GEMINI.md |
Configure context in Gemini CLI |
| Google Antigravity | .agent/rules/<rule-name>.md |
Configure rules for Antigravity Agent |
| JetBrains IDEs | .junie/guidelines.md |
Configure guidelines for Junie |
| VS Code | .instructions.md |
Configure instructions in VS Code |
| Windsurf | .windsurf/rules/<rule-name>.md |
Configure rules in Windsurf |
Create rules for your editor
#You can adapt our Flutter and Dart rules template for your specific environment. To do so, follow these steps:
-
Download the Flutter and Dart rules template:
rules.md -
In an LLM like Gemini, attach the
rules.mdfile that you downloaded in the last step. -
Provide a prompt to reformat the file for your desired editor.
Example prompt:
Convert the attached rules.md file into a guidelines.md file for Gemini CLI. Make sure to use the styles required for a guidelines.md file. -
Review the LLM's output and make any necessary adjustments.
-
Follow your environment's instructions to add the new rules file. This may involve adding to an existing file or creating a new one.
-
Verify that your AI assistant is using the new rules to guide its responses.
Unless stated otherwise, the documentation on this site reflects Flutter 3.38.1. Page last updated on 2025-12-8. View source or report an issue.