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. 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 new file mode 100644 index 000000000..788b7362f --- /dev/null +++ b/.geminiignore @@ -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/.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/.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 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."