From 4e43b660efa4db130e3b29c898c8e9c60e1e5ddb Mon Sep 17 00:00:00 2001 From: pq Date: Mon, 29 Jun 2026 16:33:06 -0700 Subject: [PATCH 1/3] [infra] agentic tool-use and token-efficiency guidance --- .agents/AGENTS.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .agents/AGENTS.md diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md new file mode 100644 index 000000000..a7cc72d92 --- /dev/null +++ b/.agents/AGENTS.md @@ -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. From 552113c073a26ae070d3b070777a4bcb0683785c Mon Sep 17 00:00:00 2001 From: pq Date: Mon, 29 Jun 2026 16:38:51 -0700 Subject: [PATCH 2/3] + ignores --- .claudeignore | 1 + .geminiignore | 8 ++++++++ .gitignore | 16 ++++++++++++++++ 3 files changed, 25 insertions(+) create mode 120000 .claudeignore create mode 100644 .geminiignore diff --git a/.claudeignore b/.claudeignore new file mode 120000 index 000000000..1b6833c08 --- /dev/null +++ b/.claudeignore @@ -0,0 +1 @@ +.geminiignore \ No newline at end of file diff --git a/.geminiignore b/.geminiignore new file mode 100644 index 000000000..f168d64c3 --- /dev/null +++ b/.geminiignore @@ -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/ diff --git a/.gitignore b/.gitignore index c8fc18583..13e4b843b 100644 --- a/.gitignore +++ b/.gitignore @@ -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 From c5838c797d69b380022aad7f2f07abd3921918c3 Mon Sep 17 00:00:00 2001 From: pq Date: Mon, 29 Jun 2026 16:50:51 -0700 Subject: [PATCH 3/3] + fix ignores and add validation --- .claudeignore | 10 +++++++++- .geminiignore | 1 + .github/workflows/presubmit.yaml | 8 ++++---- ...gent_skills.sh => validate_agent_configs.sh} | 17 +++++++++++++++++ 4 files changed, 31 insertions(+), 5 deletions(-) mode change 120000 => 100644 .claudeignore rename tool/{check_agent_skills.sh => validate_agent_configs.sh} (68%) diff --git a/.claudeignore b/.claudeignore deleted file mode 120000 index 1b6833c08..000000000 --- a/.claudeignore +++ /dev/null @@ -1 +0,0 @@ -.geminiignore \ No newline at end of file diff --git a/.claudeignore b/.claudeignore new file mode 100644 index 000000000..788b7362f --- /dev/null +++ b/.claudeignore @@ -0,0 +1,9 @@ +# 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/ + diff --git a/.geminiignore b/.geminiignore index f168d64c3..788b7362f 100644 --- a/.geminiignore +++ b/.geminiignore @@ -6,3 +6,4 @@ third_party/tool/baseline/ # Exclude large test fixture mock directories **/testData/ **/sample_tests/ + diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 025053edf..1d9033560 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -12,15 +12,15 @@ permissions: contents: read jobs: - # Job 0: Check Agent Skills Documentation - check-skills-docs: + # Job 0: Validate Agent Configurations + validate-agent-configs: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v6 - - name: Run documentation check - run: ./tool/check_agent_skills.sh + - name: Run configurations check + run: ./tool/validate_agent_configs.sh # Job 1: Build Plugin build-plugin: diff --git a/tool/check_agent_skills.sh b/tool/validate_agent_configs.sh similarity index 68% rename from tool/check_agent_skills.sh rename to tool/validate_agent_configs.sh index 3e2bcd780..0b30f56d0 100755 --- a/tool/check_agent_skills.sh +++ b/tool/validate_agent_configs.sh @@ -41,6 +41,23 @@ for link in $(grep -o '\.agents/skills/[a-zA-Z0-9_-]*/SKILL.md' "$README_FILE" | exit_code=1 fi done +# 3. Check that ignore files (.geminiignore and .claudeignore) are identical and in sync +GEMINI_IGNORE=".geminiignore" +CLAUDE_IGNORE=".claudeignore" + +if [[ -f "$GEMINI_IGNORE" || -f "$CLAUDE_IGNORE" ]]; then + if [[ ! -f "$GEMINI_IGNORE" ]]; then + echo "Error: $CLAUDE_IGNORE exists but $GEMINI_IGNORE is missing." >&2 + exit_code=1 + elif [[ ! -f "$CLAUDE_IGNORE" ]]; then + echo "Error: $GEMINI_IGNORE exists but $CLAUDE_IGNORE is missing." >&2 + exit_code=1 + elif ! cmp -s "$GEMINI_IGNORE" "$CLAUDE_IGNORE"; then + echo "Error: $GEMINI_IGNORE and $CLAUDE_IGNORE are out of sync." >&2 + echo "Please ensure both files contain the exact same ignore patterns." >&2 + exit_code=1 + fi +fi if [[ $exit_code -eq 0 ]]; then echo "Success: All AI Agent Skills are correctly documented in $README_FILE."