Google ADK Cursor Rules
## what it does
What it does
Google’s Agent Development Kit (ADK) ships primitives for LLM agents, workflow agents, tools, sessions, memory, and artifacts. The risk is that models reach for the highest-leverage primitive and end up with one mega-agent that holds every tool, every prompt secret, and every blob in session state.
This rule set keeps each agent focused on a single goal and tool set, validates tool arguments before side effects, separates session state (current conversation) from memory (cross-session recall), routes binary payloads through an artifact service, and requires tests plus observability before deploying.
Sourced from PatrickJS/awesome-cursorrules.
The rules
# Google ADK Rules
## Agent Design
- Keep each agent focused on a clear goal, persona, and tool set.
- Use LLM agents for flexible reasoning and workflow agents for deterministic orchestration.
- Write instructions that define task boundaries, tool-use rules, and escalation behavior.
- Split multi-agent systems by responsibility rather than by implementation convenience.
- Keep model choices configurable.
## Tools
- Give tools narrow, typed inputs and outputs.
- Validate tool arguments before performing side effects.
- Keep secrets, credentials, and privileged APIs out of agent prompts.
- Handle tool errors explicitly and return actionable failure messages.
- Be aware of ADK tool limitations; some built-in tools cannot be combined with other tools on the same agent.
## Sessions, State, and Memory
- Use session state for current-conversation data.
- Use memory for cross-session recall and retrieval.
- Keep state small and serializable.
- Do not store large files or binary payloads in session state.
- Make state keys stable and documented.
## Artifacts
- Use artifacts for generated files, uploaded files, reports, images, audio, and other binary data.
- Configure an artifact service in the runner before relying on artifact operations.
- Version artifact filenames intentionally and avoid overwriting semantically different outputs.
- Store only references or summaries in state when full content belongs in artifacts.
## Evaluation and Deployment
- Add tests for tool behavior, agent routing, prompt regressions, and unsafe tool calls.
- Use trace or event logs to debug agent decisions.
- Keep local development, staging, and production configuration separate.
- Add observability for latency, tool failures, token use, and handoff failures.
## Common Mistakes
- Do not make one agent responsible for every workflow.
- Do not let tools accept arbitrary shell, SQL, or HTTP input without validation.
- Do not rely on prompt text for access control.
- Do not hide important side effects behind generic tool names.
Installation
Create .cursor/rules/google-adk.mdc in your project root:
mkdir -p .cursor/rules
curl -o .cursor/rules/google-adk.mdc \
https://raw.githubusercontent.com/PatrickJS/awesome-cursorrules/main/rules/google-adk.mdc
Or copy the full file from the awesome-cursorrules repo into .cursor/rules/.
Why it helps
Without scoped rules, models will:
- Bundle every tool onto one LLM agent and lose routing clarity
- Accept arbitrary shell or SQL strings in tool arguments
- Stuff binary data into session state and bloat the conversation
- Ship agents without tests for tool behavior or prompt regressions
- Hide side effects behind generic names like
run_commandorquery_data
These rules are the floor for production-grade ADK agents, not the ceiling — they cover what Google ADK’s docs treat as the recurring failure modes.
## embed this badge
