strands.vended_plugins.skills.agent_skills
AgentSkills plugin for integrating Agent Skills into Strands agents.
This module provides the AgentSkills class that extends the Plugin base class to add Agent Skills support. The plugin registers a tool for activating skills, and injects skill metadata into the system prompt.
SkillSource
Section titled “SkillSource”A single skill source: path string, Path object, or Skill instance.
SkillSources
Section titled “SkillSources”One or more skill sources.
AgentSkills
Section titled “AgentSkills”class AgentSkills(Plugin)Defined in: src/strands/vended_plugins/skills/agent_skills.py:44
Plugin that integrates Agent Skills into a Strands agent.
The AgentSkills plugin extends the Plugin base class and provides:
- A
skillstool that allows the agent to activate skills on demand - System prompt injection of available skill metadata before each invocation
- Session persistence of active skill state via
agent.state
Skills can be provided as filesystem paths (to individual skill directories or
parent directories containing multiple skills) or as pre-built Skill instances.
Example:
from strands import Agentfrom strands.vended_plugins.skills import Skill, AgentSkills
# Load from filesystemplugin = AgentSkills(skills=["./skills/pdf-processing", "./skills/"])
# Or provide Skill instances directlyskill = Skill(name="my-skill", description="A custom skill", instructions="Do the thing")plugin = AgentSkills(skills=[skill])
agent = Agent(plugins=[plugin])__init__
Section titled “__init__”def __init__(skills: SkillSources, state_key: str = _DEFAULT_STATE_KEY, max_resource_files: int = _DEFAULT_MAX_RESOURCE_FILES, strict: bool = False) -> NoneDefined in: src/strands/vended_plugins/skills/agent_skills.py:74
Initialize the AgentSkills plugin.
Arguments:
-
skills- One or more skill sources. Can be a single value or a list. Each element can be:- A
strorPathto a skill directory (containing SKILL.md) - A
strorPathto a parent directory (containing skill subdirectories) - A
Skilldataclass instance
- A
-
state_key- Key used to store plugin state inagent.state. -
max_resource_files- Maximum number of resource files to list in skill responses. -
strict- If True, raise on skill validation issues. If False (default), warn and load anyway.
init_agent
Section titled “init_agent”def init_agent(agent: Agent) -> NoneDefined in: src/strands/vended_plugins/skills/agent_skills.py:99
Initialize the plugin with an agent instance.
Decorated hooks and tools are auto-registered by the plugin registry.
Arguments:
agent- The agent instance to extend with skills support.
skills
Section titled “skills”@tool(context=True)def skills(skill_name: str, tool_context: ToolContext) -> strDefined in: src/strands/vended_plugins/skills/agent_skills.py:112
Activate a skill to load its full instructions.
Use this tool to load the complete instructions for a skill listed in the available_skills section of your system prompt.
Arguments:
skill_name- Name of the skill to activate.
get_available_skills
Section titled “get_available_skills”def get_available_skills() -> list[Skill]Defined in: src/strands/vended_plugins/skills/agent_skills.py:167
Get the list of available skills.
Returns:
A copy of the current skills list.
set_available_skills
Section titled “set_available_skills”def set_available_skills(skills: SkillSources) -> NoneDefined in: src/strands/vended_plugins/skills/agent_skills.py:175
Set the available skills, replacing any existing ones.
Each element can be a Skill instance, a str or Path to a
skill directory (containing SKILL.md), or a str or Path to a
parent directory containing skill subdirectories.
Note: this does not persist state or deactivate skills on any agent. Active skill state is managed per-agent and will be reconciled on the next tool call or invocation.
Arguments:
skills- One or more skill sources to resolve and set.
get_activated_skills
Section titled “get_activated_skills”def get_activated_skills(agent: Agent) -> list[str]Defined in: src/strands/vended_plugins/skills/agent_skills.py:378
Get the list of skills activated by this agent.
Returns skill names in activation order (most recent last).
Arguments:
agent- The agent to query.
Returns:
List of activated skill names.