ADK Progressive Skills
Automate skill discovery and dynamically inject them into your ADK (Agent Development Kit) agents without manual loading or codebase bloat.
Why This Library Is Important
When building agentic applications using Google’s Agent Development Kit, agents often require specialized knowledge and workflows (skills). Traditionally, skills have to be explicitly loaded and mounted on the agent’s tool list, leading to several drawbacks:
- Code Coupling: Agent scripts become coupled to specific skill files, forcing you to modify code whenever you add or modify a skill.
- Context Bloat: Hardcoding all skills into a single agent’s tools list wastes context window tokens and model attention.
- Manual Overhead: Developers must write verbose boilerplates to manually import, instantiate, and pass skills as tools during agent initialization.
adk-progressive-skills solves this by introducing Progressive Skill Discovery. By simply importing this library at the top of your agent script, skills are automatically scanned, prioritized by precedence, and seamlessly injected into your agent’s tools on instantiation.
How Progressive Discovery Works
This library automatically hooks (monkeypatches) the ADK agent constructors (google.adk.agents.llm_agent.LlmAgent and google.adk.agents.Agent). When an agent is initialized:
- Precedence-Aware Scanning: It scans paths in increasing order of precedence (lowest first, meaning higher precedence paths override duplicate skills from lower ones):
~/.gemini/config/skills(Global User configuration skills)~/.agents/skills(User home directory skills).agents/skills(Local workspace directory skills - highest precedence)
- Conflict Resolution: If a skill with the same name exists in multiple search folders, the library keeps only the one from the higher-precedence folder.
- Graceful Loading: If any individual skill folder fails validation or contains errors, the library reports a warning using
warnings.warninstead of crashing your agent. - Dynamic Toolset Injection: It packages the discovered skills inside a
SkillToolsetand appends it to the agent’stoolsparameter, preventing duplicate toolset additions.
Architecture & Workflows
Architecture/Design
graph TD
A[import adk_progressive_skills] --> B(apply_patch)
B --> C[Monkeypatch LlmAgent.__init__]
C --> D[LlmAgent Instantiated]
D --> E[discover_skills]
E --> F[Scan paths in precedence order]
F --> H[~/.gemini/config/skills]
F --> I[~/.agents/skills]
F --> J[.agents/skills]
H --> K(skills_by_name)
I --> K
J --> K
K --> L[Filter Duplicate Names]
L --> M[Create SkillToolset]
M --> N["Safe Inject into kwargs['tools']"]
N --> O[Call Original LlmAgent.__init__]
User Workflow
sequenceDiagram
actor Developer
participant FS as Local Filesystem
participant Agent as ADK Agent
Developer->>FS: Create skill in .agents/skills/my-skill/SKILL.md
Developer->>Agent: Write agent script importing adk_progressive_skills
Developer->>Agent: Run agent script
Agent->>FS: Automatically scans paths
FS-->>Agent: Discovers my-skill
Agent->>Agent: Injects SkillToolset containing my-skill
Agent-->>Developer: Agent starts with skill dynamically loaded!
Usage Instructions
ADK 1.x Usage
For ADK 1.x style agents, import the progressive skills library at the very top of your entrypoint file:
# 1. Import library first to apply the patches
import adk_progressive_skills
# 2. Import ADK agent classes
from google.adk.agents import Agent
# 3. Instantiate your Agent (skills in .agents/skills/ are automatically loaded)
agent = Agent(
name="my_helper_agent",
instruction="Help user with tasks.",
model="gemini-3.5-flash",
tools=[], # Injected automatically with SkillToolset
)
print(agent.tools)
ADK 2.0 Usage
For ADK 2.0 style agents, import the library first and use LlmAgent:
# 1. Import library first to apply the patches
import adk_progressive_skills
# 2. Import ADK 2.0 agent classes
from google.adk.agents.llm_agent import LlmAgent
# 3. Instantiate your LlmAgent
agent = LlmAgent(
name="my_helper_agent_v2",
instruction="Help user with tasks.",
model="gemini-3.5-flash",
tools=[], # Injected automatically with SkillToolset
)
print(agent.tools)
Context Preservation & Prevention of Context Bloat
To prevent context window bloat and reduce token overhead, the library leverages ADK's native execution-time lazy-loading mechanisms:
- Minimal Initial Overhead: On initialization, the full markdown instructions (
SKILL.mdbody) of discovered skills are withheld from the initial system instructions. Only the skill names and descriptions are exposed to the model (either summarized in the system prompt or made queryable via a corelist_skillstool). - On-Demand Activation: The model must call
load_skill(skill_name="...")to fetch the full markdown body of a skill and append it to the conversation history dynamically. - Lazy Tool Mounting: Any supplementary tools defined in the skill's metadata (
adk_additional_toolsin the YAML frontmatter) are only registered and exposed to the model after the skill has been dynamically activated in that session. - On-Demand Resource Access: Scripts and assets under
scripts/,references/, andresources/are accessed progressively usingload_skill_resource()andrun_skill_script()only when invoked.
Metadata
Release files for adk-progressive-skills 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| adk_progressive_skills-0.1.1.tar.gz | 53.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| adk_progressive_skills-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.3 kB
Release files / adk_progressive_skills-0.1.1.tar.gz
| Download URL | adk_progressive_skills-0.1.1.tar.gz |
|---|---|
| Size | 53.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd2a53b7d50abd724572f640982d6253c7f6e88fca8f390b1758315da1005c64
|
|
BLAKE2b-256 checksum How to use checksums |
fd16c8b4bab61662a3c490b7f316ba1d2cf526f0b0998b0786fd1e3a87fd3690
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux rodete","version":null,"id":"rodete","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / adk_progressive_skills-0.1.1-py3-none-any.whl
| Download URL | adk_progressive_skills-0.1.1-py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
888c45c1c6291f6fca1c5fd55eaf13dcf439a8811ac4f1414d7df7b405828a93
|
|
BLAKE2b-256 checksum How to use checksums |
8204e1bbff5e3617523bb9a18e96279b8a99a77eaef23d9219c0ab694b92c30e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux rodete","version":null,"id":"rodete","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|