Skip to content

Commit e7e82d1

Browse files
johnpryansfshaza2
andauthored
Add AI rules limits and compressed files (#12969)
_Description of what this PR is changing or adding, and why:_ This adds the new compressed rules files to our docs page. (flutter/flutter#179817) _Issues fixed by this PR (if any):_ _PRs or commits this PR depends on (if any):_ ## Presubmit checklist - [x] If you are unwilling, or unable, to sign the CLA, even for a _tiny_, one-word PR, please file an issue instead of a PR. - [x] If this PR is not meant to land until a future stable release, mark it as draft with an explanation. - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style)—for example, it doesn't use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first-person pronouns). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. --------- Co-authored-by: Shams Zakhour <[email protected]>
1 parent d568a7f commit e7e82d1

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

src/content/ai/ai-rules.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,37 @@ instructions to an underlying LLM. These files help you:
1919
design.
2020
* Provide critical project context to the AI.
2121

22+
The Flutter project provides several versions of the rules file to accommodate
23+
different tool limits:
24+
25+
* [`rules.md`](https://raw.githubusercontent.com/flutter/flutter/refs/heads/main/docs/rules/rules.md):
26+
The comprehensive master rule set.
27+
* [`rules_10k.md`](https://raw.githubusercontent.com/flutter/flutter/refs/heads/main/docs/rules/rules_10k.md):
28+
A condensed version (<10k chars) for tools with stricter context limits.
29+
* [`rules_4k.md`](https://raw.githubusercontent.com/flutter/flutter/refs/heads/main/docs/rules/rules_4k.md):
30+
A highly concise version (<4k chars) for limited contexts.
31+
* [`rules_1k.md`](https://raw.githubusercontent.com/flutter/flutter/refs/heads/main/docs/rules/rules_1k.md):
32+
An ultra-compact version (<1k chars) for very strict limits.
33+
2234
<a class="filled-button" style="margin-bottom: 0.5rem;" href="https://raw.githubusercontent.com/flutter/flutter/refs/heads/main/docs/rules/rules.md" download>
2335
<Icon id="download" />
2436
<span>Download the Flutter and Dart rules template</span>
2537
</a>
2638

27-
## Environments that support rules
39+
## Device & editor specific limits
2840

29-
Many AI environments support rules files to guide LLM behavior.
30-
Here are some common examples and their corresponding
31-
rule file or directory names:
41+
Different AI coding assistants and tools have varying limits for their "rules"
42+
or "custom instructions" files. *Last updated: 2026-01-05.*
3243

33-
| Environment | Rules file or directory | Configuration instructions |
34-
|:---------------------|:----------------------------------|:------------------------------------------------------|
35-
| Copilot-powered IDEs | `.github/copilot-instructions.md` | [Configure instructions for Copilot][copilot] |
36-
| Claude Code | `CLAUDE.md` | [Configure rules for Claude Code][claude] |
37-
| Cursor | `AGENTS.md` | [Configure rules in Cursor][cursor] |
38-
| Firebase Studio | `.idx/airules.md` | [Configure instructions in Firebase Studio][firebase] |
39-
| Gemini CLI | `GEMINI.md` | [Configure context in Gemini CLI][gemini-cli] |
40-
| Google Antigravity | `.agent/rules/<rule-name>.md` | [Configure rules for Antigravity Agent][antigravity] |
41-
| JetBrains IDEs | `.junie/guidelines.md` | [Configure guidelines for Junie][junie] |
42-
| VS Code | `.instructions.md` | [Configure instructions in VS Code][vs-code] |
43-
| Windsurf | `.windsurf/rules/<rule-name>.md` | [Configure rules in Windsurf][windsurf] |
44+
| Tool / Product | Rules file / Feature | Limit (soft / hard) | Documentation |
45+
|:---|:---|:---|:---|
46+
| Antigravity (Google) | `.agent/rules/<rule-name>.md` | 12,000 chars (Hard) | [Configure rules][antigravity] |
47+
| Claude Code | `CLAUDE.md` | No Hard Limit | [Claude Code Docs](https://code.claude.com/docs/en/memory) |
48+
| Cursor | `AGENTS.md` | No Hard Limit | [Cursor Docs](https://cursor.com/docs/context/rules) |
49+
| Gemini CLI | `GEMINI.md` | 1M+ Tokens (Context) | [Gemini CLI Docs](https://cloud.google.com/vertex-ai/generative-ai/docs/long-context) |
50+
| GitHub Copilot | `.github/copilot-instructions.md` | ~4k chars | [GitHub Copilot Docs](https://docs.github.com/en/copilot/customizing-copilot/adding-custom-instructions-for-github-copilot) |
51+
| JetBrains AI (Junie) | `.junie/guidelines.md` | No Hard Limit | [JetBrains AI Docs](https://www.jetbrains.com/help/junie/get-started-with-junie.html) |
52+
| VS Code | `.instructions.md` | Unknown | [Configure instructions][vs-code] |
4453

4554
{:.table .table-striped}
4655

@@ -55,7 +64,7 @@ the most up-to-date naming conventions and instructions.
5564
[cursor]: https://cursor.com/docs/context/rules
5665
[firebase]: https://firebase.google.com/docs/studio/set-up-gemini#custom-instructions
5766
[gemini-cli]: https://geminicli.com/docs/cli/gemini-md
58-
[antigravity]: https://antigravity.google/docs/rules
67+
[antigravity]: https://antigravity.google/docs/rules-workflows
5968
[junie]: https://www.jetbrains.com/help/junie/customize-guidelines.html
6069
[vs-code]: https://code.visualstudio.com/docs/copilot/customization/custom-instructions#_use-instructionsmd-files
6170
[windsurf]: https://docs.windsurf.com/windsurf/cascade/memories#rules

0 commit comments

Comments
 (0)