{"filename":"google-adk.mdc","content":"---\ndescription: Google Agent Development Kit rules for agents, tools, sessions, memory, artifacts, evaluation, and deployment\nglobs: [\"**/*.py\", \"**/*.ts\", \"**/*.tsx\", \"**/*.go\", \"**/*.java\", \"pyproject.toml\", \"package.json\"]\nalwaysApply: false\n---\n\n# Google ADK Rules\n\n## Agent Design\n\n- Keep each agent focused on a clear goal, persona, and tool set.\n- Use LLM agents for flexible reasoning and workflow agents for deterministic orchestration.\n- Write instructions that define task boundaries, tool-use rules, and escalation behavior.\n- Split multi-agent systems by responsibility rather than by implementation convenience.\n- Keep model choices configurable.\n\n## Tools\n\n- Give tools narrow, typed inputs and outputs.\n- Validate tool arguments before performing side effects.\n- Keep secrets, credentials, and privileged APIs out of agent prompts.\n- Handle tool errors explicitly and return actionable failure messages.\n- Be aware of ADK tool limitations; some built-in tools cannot be combined with other tools on the same agent.\n\n## Sessions, State, and Memory\n\n- Use session state for current-conversation data.\n- Use memory for cross-session recall and retrieval.\n- Keep state small and serializable.\n- Do not store large files or binary payloads in session state.\n- Make state keys stable and documented.\n\n## Artifacts\n\n- Use artifacts for generated files, uploaded files, reports, images, audio, and other binary data.\n- Configure an artifact service in the runner before relying on artifact operations.\n- Version artifact filenames intentionally and avoid overwriting semantically different outputs.\n- Store only references or summaries in state when full content belongs in artifacts.\n\n## Evaluation and Deployment\n\n- Add tests for tool behavior, agent routing, prompt regressions, and unsafe tool calls.\n- Use trace or event logs to debug agent decisions.\n- Keep local development, staging, and production configuration separate.\n- Add observability for latency, tool failures, token use, and handoff failures.\n\n## Common Mistakes\n\n- Do not make one agent responsible for every workflow.\n- Do not let tools accept arbitrary shell, SQL, or HTTP input without validation.\n- Do not rely on prompt text for access control.\n- Do not hide important side effects behind generic tool names.\n"}