What problem does it solve? Optimizing agent contract files (*.agent.md) requires coordinating research, dataset synthesis, optimization, validation, and safe write-back, and mistakes in tool routing, persona scope, or handoff behavior are hard to catch without a structured loop. ## Core Features & Use Cases - Three-concern optimization: Separates tool routing, persona/scope, and handoff behavior so each failure mode is addressed independently. - MCP routing audit: Compares agent routing instructions against each MCP skill's description field before optimization and records mismatches as steering context. - Write-back gating: Blocks write-back unless routing audits pass, handoffs are bounded to named agents, validation succeeds, and a decision summary exists. - Use Case: An agent keeps using web search instead of its dedicated research MCP skill. The loop initializes a workspace, audits the routing mismatch, optimizes the contract with llm_judge scoring, and writes back only after validation passes. ## Quick Start Run the trainer loop on .github/agents/researcher.agent.md to audit its MCP skill routing and optimize the contract.