You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f3efcc4
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/content/docs/framework/agent/skills.en.mdx
+63-28Lines changed: 63 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,60 +2,94 @@
2
2
title: "Skills"
3
3
---
4
4
5
-
Skills are reusable "prompt packages" that inject specific domain knowledge, operating procedures, and scripts into an Agent. Instead of stuffing all prompts into `instruction` at once, skills use **progressive prompt loading**: the Agent loads a skill's full content only when needed, which keeps the context length under control and improves execution accuracy.
5
+
Skills are reusable "prompt packages" that inject specific domain knowledge, operating procedures, and scripts into an Agent. For local skill loading and execution, the recommended integration is Google ADK's official `load_skill_from_dir` / `SkillToolset` path. VeADK's legacy `Agent(skills=..., skills_mode="local")` local entry point remains compatible, but is deprecated. The `skills_sandbox`and `aio_sandbox` modes keep their existing behavior.
6
6
7
-
VeADK provides three skill execution modes:
7
+
## Recommended: ADK SkillToolset
8
8
9
-
| Mode | Description |
10
-
| :- | :- |
11
-
|`local`| Skills live in a local directory and are loaded and executed locally by the Agent. |
12
-
|`skills_sandbox`| Skills are hosted in a cloud Skill Space and executed in a sandbox through the `execute_skills` tool. |
13
-
|`aio_sandbox`| All-in-one sandbox mode, suitable for the AgentKit-hosted tool runtime. |
9
+
Local skills can be loaded directly by Google ADK and passed to a VeADK Agent as a standard toolset:
14
10
15
-
When `skills_mode` is not set explicitly, VeADK infers it from the runtime environment: local runs default to `local`; in the AgentKit tool runtime, it automatically selects `skills_sandbox` or `aio_sandbox` based on the tool type.
11
+
```python
12
+
from google.adk.skills import load_skill_from_dir
13
+
from google.adk.tools.skill_toolset import SkillToolset
On this path, skill loading, prompt injection, and tool exposure are handled by ADK. The model sees ADK's official skill tools: `list_skills`, `load_skill`, `load_skill_resource`, and `run_skill_script`. If a skill depends on `scripts/`, configure an appropriate `code_executor` explicitly on the `SkillToolset` or Agent; VeADK does not create a local code executor by default.
23
+
24
+
Cloud SkillHub / SkillSpace skills should be exposed through VeADK's ADK registry. `search_skills` fetches the remote list live, and `get_skill` downloads and loads a concrete skill only when requested:
25
+
26
+
```python
27
+
from google.adk.tools.skill_toolset import SkillToolset
This path does not download every skill at initialization time. The cache only stores concrete downloaded skill versions; remote metadata is fetched again on every search / get, so remote version changes are picked up before loading.
16
38
17
39
## Skill Directory Structure
18
40
19
-
A local skill consists of its own directory containing a single `SKILL.md` file:
41
+
An ADK local skill consists of its own directory containing a `SKILL.md` file. The frontmatter must include `name` and `description`, and the directory name must match `name`:
20
42
21
43
<Files>
22
44
<Foldername="skills"defaultOpen>
23
-
<Foldername="kb_skill"defaultOpen>
45
+
<Foldername="kb-skill"defaultOpen>
24
46
<Filename="SKILL.md" />
47
+
<Foldername="references" />
48
+
<Foldername="assets" />
49
+
<Foldername="scripts" />
25
50
</Folder>
26
51
</Folder>
27
52
</Files>
28
53
29
-
`SKILL.md` declares `name` and `description` in frontmatter, followed by the skill body:
30
-
31
-
```markdown title="skills/kb_skill/SKILL.md"
54
+
```markdown title="skills/kb-skill/SKILL.md"
32
55
---
33
-
name: kb_skill
56
+
name: kb-skill
57
+
description: Query the knowledge base and compose an answer.
The `name` in `SKILL.md` must match the directory name.
41
-
</Callout>
63
+
## Deprecated: VeADK Legacy Local Entry
64
+
65
+
`Agent(skills=..., skills_mode="local")` keeps its legacy behavior, but this local entry point is deprecated. Whether `skills` contains local directories or remote skill sources, once the final mode is `local`, VeADK uses the legacy local loading path: it loads skill metadata, writes the skill list into `instruction`, and mounts the legacy `SkillsToolset`.
66
+
67
+
The `skills` parameter still supports three skill execution modes. Only the legacy `local` loading and execution path is deprecated:
68
+
69
+
| Mode | Description |
70
+
| :- | :- |
71
+
|`local`| Deprecated. Skills are loaded by VeADK's legacy `skills_tool` plus file/Shell helper tools; migrate to ADK `SkillToolset` for local execution. |
72
+
|`skills_sandbox`| Skills are hosted in a cloud Skill Space and executed in a sandbox through the `execute_skills` tool. |
73
+
|`aio_sandbox`| All-in-one sandbox mode, suitable for the AgentKit-hosted tool runtime. |
74
+
75
+
When `skills_mode` is not set explicitly, VeADK infers it from the runtime environment: local runs default to `local`; in the AgentKit tool runtime, it automatically selects `skills_sandbox` or `aio_sandbox` based on the tool type.
42
76
43
-
## Local Mode
77
+
###Local Mode
44
78
45
-
In `local` mode, pass the skill directory path to `skills` and set `skills_mode` to `local`:
79
+
In `local` mode, pass the skills root directory path to `skills` and set `skills_mode` to `local`:
46
80
47
81
```python
48
82
from veadk import Agent
49
83
50
84
agent = Agent(
51
-
skills=["/abs/path/to/skills/kb_skill"],
85
+
skills=["/abs/path/to/skills"],
52
86
skills_mode="local",
53
87
)
54
88
```
55
89
56
90
During initialization, the Agent loads each skill's metadata (`name` and `description`) and injects it into the system prompt, guiding the model to invoke the corresponding skill at the right time. In local mode, VeADK also automatically mounts a set of supporting tools (read/write files, edit files, run shell commands, register skills, etc.) for the Agent to use when executing a skill.
57
91
58
-
## Sandbox Mode
92
+
###Sandbox Mode
59
93
60
94
In `skills_sandbox` mode, skills are hosted in a cloud Skill Space. Pass the cloud skill space identifier to `skills` and add the `execute_skills` tool; the Agent invokes that tool to execute the chosen skill in the sandbox when needed:
61
95
@@ -65,27 +99,28 @@ from veadk.tools.builtin_tools.execute_skills import execute_skills
65
99
66
100
agent = Agent(
67
101
skills=[skill_space_id],
102
+
skills_mode="skills_sandbox",
68
103
tools=[execute_skills],
69
104
)
70
105
```
71
106
72
-
## Skill Checklist
107
+
###Skill Checklist
73
108
74
109
A skill can carry a checklist in its definition to constrain the Agent to complete the task step by step. When enabled, the Agent must complete each checklist item while executing the skill, and mark each item as done through the `update_check_list` tool:
75
110
76
111
```python
77
112
from veadk import Agent
78
113
79
114
agent = Agent(
80
-
skills=["/abs/path/to/skills/kb_skill"],
115
+
skills=["/abs/path/to/skills"],
81
116
skills_mode="local",
82
117
enable_skills_checklist=True,
83
118
)
84
119
```
85
120
86
121
When a skill defines a checklist, VeADK automatically initializes the state of all checklist items when the skill is invoked, and prompts the model in the system prompt to complete them one by one.
87
122
88
-
## Dynamically Loading Skills
123
+
###Dynamically Loading Skills
89
124
90
125
With `enable_dynamic_load_skills=True`, new skills can be discovered and loaded at runtime, without declaring all skills up front at Agent initialization:
91
126
@@ -102,7 +137,7 @@ agent = Agent(
102
137
103
138
| Parameter | Type | Description |
104
139
| :- | :- | :- |
105
-
|`skills`|`list[str]`|The skill list; each element is a local skill directory path or a cloud skillspace identifier. |
|`enable_skills_checklist`|`bool`| Whether to enable the skill checklist; defaults to `False`. |
108
-
|`enable_dynamic_load_skills`|`bool`| Whether to enable dynamic loading of skills; defaults to `False`. |
140
+
|`skills`|`list[str]`|Skill list; each item is a local skills root path or a cloud skill-space identifier. The legacy local loading path is deprecated when `skills_mode="local"`. |
141
+
|`skills_mode`|`"local" \| "skills_sandbox" \| "aio_sandbox"`| Skill execution mode; inferred automatically when omitted. The legacy `local` path is deprecated, while `skills_sandbox` / `aio_sandbox` keep their existing behavior. |
142
+
|`enable_skills_checklist`|`bool`| Whether to enable the legacy skill checklist; defaults to `False`. |
143
+
|`enable_dynamic_load_skills`|`bool`| Whether to enable dynamic loading for legacy skills; defaults to `False`. |
0 commit comments