-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add a Rules section to our new Create with AI topic #12336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
ff02770
Add rules to Create with AI
antfitch 10b8225
Update TOC
antfitch fe03755
Merge branch 'main' into update-create-with-ai
antfitch 876f129
Update rules section.
antfitch 2eba1e5
Changes to get template to download.
antfitch edb5547
Moved flutter-rules-template.txt back into assets dir.
antfitch 14f4808
Changed category name to AI solutions
antfitch 17ddbe9
Update link for step 1 in create rules...
antfitch 322b395
Update some wording in the Rules section.
antfitch cf63f8e
Merge branch 'main' into update-create-with-ai
parlough 0a63656
Reupdate site-shared
parlough 277956c
Add a passthrough copy of new assets/files directory
parlough 8d52660
Adjust initial download link
parlough b4a707c
Move rules into it's own topic.
antfitch 06a59fc
change to markdown file
johnpryan 7b8495b
Update rules file with best-practices
johnpryan 8fef2d5
Update rules file with complete set of rules
johnpryan dd4fc3b
Update ai-rules.md
antfitch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --- | ||
| title: AI rules for Flutter and Dart | ||
| description: > | ||
| 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. | ||
|
|
||
| <a class="filled-button" style="margin-bottom: 0.5rem;" href="/assets/files/flutter-rules-template.md" download> | ||
| <span aria-hidden="true" class="material-symbols" translate="no">download</span> | ||
| <span>Download the Flutter and Dart rules template</span> | ||
| </a> | ||
|
|
||
| ## Environments that support rules | ||
|
|
||
| Many AI environments support rules files to guide | ||
| LLM behavior. Here are some common examples and their | ||
| corresponding rule file names: | ||
|
|
||
| | Environment | Rules File | Installation Instructions | | ||
| | :--- | :--- | :--- | | ||
| | Copilot powered IDEs | `copilot-instructions.md` | [Configure .github/copilot-instructions.md][] | | ||
| | Cursor | `cursor.md` | [Configure cursorrules.md][] | | ||
| | Firebase Studio | `airules.md` | [Configure airules.md][] | | ||
| | Gemini CLI | `GEMINI.md` | [Configure gemini.md][] | | ||
| | JetBrains IDEs | `guidelines.md` | [Configure guidelines.md][] | | ||
| | VS Code | `.instructions.md` | [Configure .instructions.md][] | | ||
| | Windsurf | `guidelines.md` | [Configure guidelines.md][] | | ||
|
|
||
| [Configure airules.md]: https://firebase.google.com/docs/studio/set-up-gemini#custom-instructions | ||
| [Configure .github/copilot-instructions.md]: https://code.visualstudio.com/docs/copilot/copilot-customization#_custom-instructions | ||
| [Configure cursorrules.md]: https://docs.cursor.com/en/context/rules | ||
| [Configure guidelines.md]: https://www.jetbrains.com/help/junie/customize-guidelines.html | ||
| [Configure .instructions.md]: https://code.visualstudio.com/docs/copilot/copilot-customization#_custom-instructions | ||
| [Configure guidelines.md]: https://docs.windsurf.com/windsurf/cascade/memories#rules | ||
| [Configure GEMINI.md]: https://codelabs.developers.google.com/gemini-cli-hands-on | ||
|
|
||
| ## Create rules for your editor | ||
|
|
||
| You can adapt our Flutter and Dart rules template for your | ||
| specific environment. To do so, follow these steps: | ||
|
|
||
| 1. Download the Flutter and Dart rules template: | ||
| <a href="/assets/files/flutter-rules-template.md" download>flutter-rules-template.md</a> | ||
|
|
||
| 1. In an LLM like [Gemini][], attach the | ||
| `flutter-rules-template.md` file that you downloaded in | ||
| the last step. | ||
|
|
||
| 1. Provide a prompt to reformat the file for your desired | ||
| editor. | ||
|
|
||
| Example prompt: | ||
|
|
||
| ```text | ||
| Convert the attached flutter-rules-template.txt file | ||
| into a guidelines.md file for JetBrains IDE. Make sure | ||
| to use the styles required for a guidelines.md file. | ||
| ``` | ||
|
|
||
| 1. Review the LLM's output and make any necessary | ||
| adjustments. | ||
|
|
||
| 1. Follow your environment's instructions to add the new | ||
| rules file. This may involve adding to an existing file | ||
| or creating a new one. | ||
|
|
||
| 1. Verify that your AI assistant is using the new rules to | ||
| guide its responses. | ||
|
|
||
| [Gemini]: https://gemini.google.com/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.