From fc1f1db00562a79cd6c742cfd00f6267295c29a8 Mon Sep 17 00:00:00 2001 From: Ke Wang Date: Fri, 13 Feb 2026 21:43:19 -0800 Subject: [PATCH] fix(skill)!: coloate default skill SI with skilltoolset PiperOrigin-RevId: 870017182 --- contributing/samples/skills_agent/agent.py | 3 +-- src/google/adk/skills/__init__.py | 2 -- src/google/adk/skills/prompt.py | 15 --------------- src/google/adk/tools/skill_toolset.py | 15 +++++++++++++++ 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/contributing/samples/skills_agent/agent.py b/contributing/samples/skills_agent/agent.py index 3e590c5e..39eec53c 100644 --- a/contributing/samples/skills_agent/agent.py +++ b/contributing/samples/skills_agent/agent.py @@ -19,7 +19,6 @@ import pathlib from google.adk import Agent from google.adk.skills import load_skill_from_dir from google.adk.skills import models -from google.adk.skills.prompt import DEFAULT_SKILL_SYSTEM_INSTRUCTION from google.adk.tools import skill_toolset greeting_skill = models.Skill( @@ -53,7 +52,7 @@ root_agent = Agent( model="gemini-2.5-flash", name="skill_user_agent", description="An agent that can use specialized skills.", - instruction=DEFAULT_SKILL_SYSTEM_INSTRUCTION, + instruction=skill_toolset.DEFAULT_SKILL_SYSTEM_INSTRUCTION, tools=[ my_skill_toolset, ], diff --git a/src/google/adk/skills/__init__.py b/src/google/adk/skills/__init__.py index b54535bb..73184b2b 100644 --- a/src/google/adk/skills/__init__.py +++ b/src/google/adk/skills/__init__.py @@ -18,7 +18,6 @@ from .models import Frontmatter from .models import Resources from .models import Script from .models import Skill -from .prompt import DEFAULT_SKILL_SYSTEM_INSTRUCTION from .utils import load_skill_from_dir __all__ = [ @@ -26,6 +25,5 @@ __all__ = [ "Resources", "Script", "Skill", - "DEFAULT_SKILL_SYSTEM_INSTRUCTION", "load_skill_from_dir", ] diff --git a/src/google/adk/skills/prompt.py b/src/google/adk/skills/prompt.py index 5997bb53..e9840ab2 100644 --- a/src/google/adk/skills/prompt.py +++ b/src/google/adk/skills/prompt.py @@ -21,21 +21,6 @@ from typing import List from . import models -DEFAULT_SKILL_SYSTEM_INSTRUCTION = """You can use specialized 'skills' to help you with complex tasks. You MUST use the skill tools to interact with these skills. - -Skills are folders of instructions and resources that extend your capabilities for specialized tasks. Each skill folder contains: -- **SKILL.md** (required): The main instruction file with skill metadata and detailed markdown instructions. -- **references/** (Optional): Additional documentation or examples for skill usage. -- **assets/** (Optional): Templates, scripts or other resources used by the skill. - -This is very important: - -1. Use the `list_skills` tool to discover available skills. -2. If a skill seems relevant to the current user query, you MUST use the `load_skill` tool with `name=""` to read its full instructions before proceeding. -3. Once you have read the instructions, follow them exactly as documented before replying to the user. For example, If the instruction lists multiple steps, please make sure you complete all of them in order. -4. The `load_skill_resource` tool is for viewing files within a skill's directory (e.g., `references/*`, `assets/*`). Do NOT use other tools to access these files. -""" - def format_skills_as_xml(skills: List[models.Frontmatter]) -> str: """Formats available skills into a standard XML string. diff --git a/src/google/adk/tools/skill_toolset.py b/src/google/adk/tools/skill_toolset.py index d83f8657..8d46c3ca 100644 --- a/src/google/adk/tools/skill_toolset.py +++ b/src/google/adk/tools/skill_toolset.py @@ -29,6 +29,21 @@ from .base_tool import BaseTool from .base_toolset import BaseToolset from .tool_context import ToolContext +DEFAULT_SKILL_SYSTEM_INSTRUCTION = """You can use specialized 'skills' to help you with complex tasks. You MUST use the skill tools to interact with these skills. + +Skills are folders of instructions and resources that extend your capabilities for specialized tasks. Each skill folder contains: +- **SKILL.md** (required): The main instruction file with skill metadata and detailed markdown instructions. +- **references/** (Optional): Additional documentation or examples for skill usage. +- **assets/** (Optional): Templates, scripts or other resources used by the skill. + +This is very important: + +1. Use the `list_skills` tool to discover available skills. +2. If a skill seems relevant to the current user query, you MUST use the `load_skill` tool with `name=""` to read its full instructions before proceeding. +3. Once you have read the instructions, follow them exactly as documented before replying to the user. For example, If the instruction lists multiple steps, please make sure you complete all of them in order. +4. The `load_skill_resource` tool is for viewing files within a skill's directory (e.g., `references/*`, `assets/*`). Do NOT use other tools to access these files. +""" + @experimental(FeatureName.SKILL_TOOLSET) class ListSkillsTool(BaseTool):