-
Notifications
You must be signed in to change notification settings - Fork 18
[infra] agentic tool-use and token-efficiency guidance #504
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
Draft
pq
wants to merge
3
commits into
flutter:main
Choose a base branch
from
pq:infra_tokenOpts
base: main
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.
Draft
Changes from 2 commits
Commits
Show all changes
3 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,11 @@ | ||
| # Custom Rules for AI Coding Assistants | ||
|
|
||
| To ensure all agentic tasks in this repository are executed as accurately, securely, and token-efficiently as possible, you must strictly follow these rules: | ||
|
|
||
| ## 1. Tool Selection & Efficiency | ||
| * **Prefer Domain-Specific MCP Tools:** Before running generic terminal commands (e.g. `grep`, `find`, or compiler check scripts), always check if a domain-specific MCP tool (such as `lsp`, `analyze_files`, or `rip_grep_packages` from `dart-mcp-server`) is available and use it instead. | ||
| * **Limit Command Output:** Any command-line tool execution (`run_command`) that might print large datasets, build logs, or file listings must have its stdout restricted using filters or limits (e.g. `head -n 50`, `git log -n 5`) to prevent context bloat. | ||
| * **Targeted File Reading:** When reading source files, specify precise line boundaries with `StartLine` and `EndLine` parameters in `view_file` to read only the code you need. Avoid loading entire files over 100 lines. | ||
|
|
||
| ## 2. Task Delegation & Subagents | ||
| * **Isolate Exploratory Research:** For open-ended research, codebase discovery, or scanning third-party docs, delegate the subtask to the `research` subagent. The subagent will run in a separate workspace context and return a concise summary, keeping the main conversation's history clean and token-efficient. |
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 @@ | ||
| .geminiignore | ||
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,8 @@ | ||
| # Exclude baseline output logs and reports from AI scanning | ||
| third_party/tool/baseline/ | ||
| **/build/reports/ | ||
| **/build/test-results/ | ||
|
|
||
| # Exclude large test fixture mock directories | ||
| **/testData/ | ||
| **/sample_tests/ |
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,4 +1,20 @@ | ||
| # Mac Finder settings | ||
| .DS_Store | ||
|
|
||
|
|
||
| # IntelliJ and IDEs | ||
| .idea/ | ||
| **/.idea/ | ||
| *.iml | ||
| third_party/.settings/ | ||
| /.vscode | ||
|
|
||
| # Gradle | ||
| .gradle/ | ||
| **/build/ | ||
| out/ | ||
|
|
||
| # Dart / Flutter | ||
| .dart_tool/ | ||
| .packages | ||
| pubspec.lock |
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.