--- name: global-subagents description: Defines the standard global subagents (MemoryLibrarian, PrePushAuditor, BugDiagnostician) that must be dynamically invoked for standard workflow steps. always_on: true --- # Antigravity Subagents Invoke these dynamically using the `invoke_subagent` tool. Use `send_message` to communicate. **CRITICAL:** Before invoking any of these custom subagents for the first time in a conversation, you MUST define them using the `define_subagent` tool with the specific permissions they require. ## 1. MemoryLibrarian * **Role:** The Knowledge Graph Curator * **Permissions:** You MUST define this subagent with `enable_mcp_tools: true` and `enable_write_tools: true` so it can autonomously update the graph without hitting permission boundaries. * **Trigger:** After completing a coding task, refactor, or bug fix. * **Action:** Send a message detailing the work (with exact git hashes and branches). The Librarian will use MCP tools (`log_code_change`, `log_error_fix`, `create_entities`, etc.) in the background to organize the knowledge graph. ## 2. PrePushAuditor * **Role:** Quality Gate Enforcer * **Permissions:** You MUST define this subagent with `enable_write_tools: true` so it can run tests and scripts. * **Trigger:** Before executing `git push`. * **Action:** The Auditor runs pre-commit hooks, formatters, linters, unit tests (`uv`, `cargo`) in a branched workspace, checks for uncommitted changes, and verifies if the Git history requires squashing (using `git reset --soft`). It returns a GO / NO-GO push decision to prevent violating push-safety rules. ## 3. BugDiagnostician * **Role:** Observability & Root Cause Analyst * **Permissions:** You MUST define this subagent with `enable_write_tools: true`. * **Trigger:** When facing complex architectural bugs, race conditions, or eventually consistent state issues that are hard to track down. * **Action:** Instead of guessing or patching blindly, this subagent creates diagnostic scripts, enhances reproducers with detailed logs, and isolates the bug. Once root cause is definitively proven, it hands the diagnostic evidence back to you to implement the fix. ## 4. ScrumMaster * **Role:** Project & Task Orchestrator * **Permissions:** You MUST define this subagent with `enable_mcp_tools: true` and `enable_write_tools: true`. * **Trigger:** When we start a new feature or finish a task. * **Action:** Passively monitors the `memory://tasks/active` and `memory://milestones` MCP resources. Creates tasks, organizes milestones, and updates statuses when criteria are met using `tasks` and `milestones`. ## 5. DevOpsSRE * **Role:** Environment & Handoff Manager * **Permissions:** You MUST define this subagent with `enable_mcp_tools: true` and `enable_write_tools: true`. * **Trigger:** When dependencies change (e.g., you modify `Cargo.toml`, `package.json`, or `.env`) or at the end of a session. * **Action:** Updates environment fingerprints when dependency files change. At the end of a session, it executes the `handoff_routine` MCP prompt to automatically generate standup reports and handoff memos.