-
Notifications
You must be signed in to change notification settings - Fork 388
Expand repo rules to include style guide and UI development guidelines #9754
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
Open
kenzieschmoll
wants to merge
2
commits into
flutter:master
Choose a base branch
from
kenzieschmoll:rules
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # DevTools Repo Guidelines for AI Assistants | ||
|
|
||
| Follow these rules when working in this repository. | ||
|
|
||
| ## Repository Rules | ||
|
|
||
| ### Dependencies | ||
| - **`packages/devtools_shared`**: Never introduce a Flutter dependency or a dependency on web-only Dart libraries. | ||
| - **Imports**: Never import `packages/devtools_app/lib/devtools_app.dart` in code under `packages/devtools_app/lib/src/`. It is acceptable in test code. | ||
|
|
||
| ### Code Style | ||
| - **Style Guide**: Follow the DevTools style guide in [STYLE.md](STYLE.md). | ||
| - **Formatting & Analysis**: Always ensure code is formatted properly and has no analysis errors or warnings before completing a task. | ||
|
|
||
| ## Running Tests | ||
|
|
||
| - **Standard Packages**: Run tests with `flutter test`. | ||
| - **`packages/devtools_shared`**: Run tests with `dart test`. | ||
|
|
||
| ## Tooling Best Practices | ||
|
|
||
| - **MCP Tools**: Prefer using MCP server tools over shell commands whenever possible. | ||
|
|
||
| ## UI Development Guidelines | ||
|
|
||
| ### Constants and Magic Values | ||
| - **Avoid Raw Values**: Avoid using raw strings or numbers in UI code. Use named constants instead. | ||
|
|
||
| ### Themes and Styles | ||
| - **Use Existing Themes**: Use existing theme values and text styles from `packages/devtools_app_shared/lib/src/ui/theme/theme.dart` (e.g., `Theme.of(context).regularTextStyle`). | ||
| - **Reuse Patterns**: Reuse common patterns and styles used in other UI code in the repository. | ||
|
|
||
| ### Code Reuse | ||
| - **Use Shared Components & Utils**: Prefer using reusable components from `shared/ui/` (such as `packages/devtools_app/lib/src/shared/ui/common_widgets.dart`), primitives from `shared/primitives/`, and utilities from `shared/utils/` rather than creating things from scratch. | ||
|
|
||
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 |
|---|---|---|
| @@ -1,24 +1,3 @@ | ||
| # Repository rules | ||
|
|
||
| When making changes to this code base, follow these rules, which are listed | ||
| in no particular order: | ||
| - `packages/devtools_shared` should never introduce a Flutter dependency or a | ||
| dependency on web-only Dart libraries. | ||
| - never import the `packages/devtools_app/lib/devtools_app.dart` file in code | ||
| that lives under `packages/devtools_app/lib/src/`. This file is okay to import | ||
| in code that lives under `packages/devtools_app/test/`. | ||
|
|
||
| # Running tests | ||
|
|
||
| Unit test and widget tests are all contained under a package's `test/` | ||
| directory. These tests should be run with `flutter test` in all packages except | ||
| for `packages/devtools_shared`, whose tests should be run with `dart test`. | ||
|
|
||
| # Gemini Guidelines | ||
|
|
||
| - Prefer to use MCP server tools over shell commands whenever possible. | ||
| - When you are done making code changes, ensure the code does not have analysis | ||
| errors or warnings. Also ensure it is formatted properly. You should have MCP | ||
| server tools available to you to perform these tasks. If not, you can get | ||
| analysis errors and warnings by running the `dart analyze` shell command, and | ||
| you can perform Dart formatting with the `dart format` shell command. | ||
| Refer to the shared [AI Rules](AI_RULES.md) for guidelines when working in this repository. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about integration tests? Those require a different command, right?