Conversation
Implements Agent Skills support following the AgentSkills.io specification. Features: - Single tool with action-based interface (discover, list, activate, deactivate, get_resource, list_resources, status) - Progressive disclosure: metadata-only discovery, full instructions on activation - Resource loading for scripts, references, and assets - Path traversal protection and file size limits - Thread-safe registry for multi-connection scenarios Actions: - discover: Scan directory for available skills - list: Show all discovered skills with activation status - activate: Load skill instructions into context - deactivate: Remove skill from active context - get_resource: Load specific resource file from skill - list_resources: List available resources in a skill - status: Show current skills directory and activation status Follows the pattern established by mcp_client tool with action parameter. Refs: strands-agents/sdk-python#1181
- Add auto-discovery on first use (controlled by STRANDS_SKILLS_AUTO_DISCOVER env var) - Rename parameter to STRANDS_SKILLS_DIR to follow strands env var naming convention - Centralize auto-discovery logic in _get_or_create_registry - Add tests for auto-discovery feature Environment Variables: - STRANDS_SKILLS_DIR: Directory containing skills (default: ./skills) - STRANDS_SKILLS_AUTO_DISCOVER: Enable auto-discovery on first use (default: true) Usage: # Just use the tool - skills are auto-discovered from STRANDS_SKILLS_DIR agent.tool.skills(action='list') agent.tool.skills(action='activate', skill_name='code-reviewer') # Or override the directory agent.tool.skills(action='list', STRANDS_SKILLS_DIR='/custom/path')
Simplify the skills tool to match how other implementations work: - Remove 'activate' action, rename to 'use' (just loads instructions) - Remove 'deactivate' action (not a real concept in skills) - Remove 'discover' action (auto-discovery handles this) - Remove 'status' action (no state to track) - Remove registry tracking (unnecessary complexity) The tool now simply: 1. Auto-discovers skills from STRANDS_SKILLS_DIR 2. Lists available skills with 'list' action 3. Returns skill instructions with 'use' action 4. Loads resources with 'get_resource' action This matches the pattern used by: - Anthropic's skills implementation - AWS sample-strands-agents-agentskills Actions: - list: Show available skills - use: Load skill instructions (returned as tool result) - get_resource: Load a script/reference file - list_resources: List files in a skill
- Add skills tool to tools overview table - Add Agent Skills usage example section - Add STRANDS_SKILLS_DIR environment variable documentation - Fix ruff linting issues (unused f-string prefix)
Windows uses backslashes for paths, but the test and categorization logic expects forward slashes. Using Path.as_posix() ensures consistent forward slashes on all platforms.
- Added get_skills_prompt() function that generates XML-formatted skills list - Uses same cache as skills tool (no duplicate discovery) - Returns empty string if no skills found - Follows AgentSkills.io recommended format for system prompts - Improved list_resources with Path.parts for cross-platform support - Updated tests for simplified API (list/use vs activate/deactivate)
vivekghatala
left a comment
There was a problem hiding this comment.
Thank you for working on this. I was thinking to pick this up as one of the consumer.
The skills tool uses yaml.safe_load() to parse YAML frontmatter from SKILL.md files (AgentSkills.io specification), but PyYAML was not listed as a dependency, causing ModuleNotFoundError on import.
afarntrog
left a comment
There was a problem hiding this comment.
This is great! Wondering if it should be vended as part of the core SDK instead of the tools repo.
|
@afarntrog strands-agents/docs#528 what do you think? |
|
This tool feels really great. I’ve been waiting for it for a long time and I’m wondering when it will be released. |
|
Hi @mkmeral, nice work on this PR! Just curious — since Level 1 metadata in the system prompt is essentially a prerequisite for the agent to discover and use skills at all, would it be worth having the SDK handle this automatically when skills is registered as a tool (e.g., via |

Description
This PR adds a new
skillstool that implements support for Agent Skills - modular packages of specialized instructions that help AI agents perform specific tasks effectively.What are Agent Skills?
Agent Skills are folders containing
SKILL.mdfiles with structured instructions. They follow the AgentSkills.io specification and enable:Tool Design
The tool follows the action-based pattern used by other tools (like
mcp_client,memory,slack):Actions
listuseget_resourcelist_resourcesHelper Function
The tool also provides a
get_skills_prompt()helper for users who want proactive skill awareness in their agent's system prompt:Design Decisions
Simple stateless design: Skills are loaded on demand and returned as tool results. No state tracking or system prompt modification - this matches how Anthropic's skills and AWS sample implementation work.
No activate/deactivate: These concepts don't exist in the AgentSkills.io spec. Skills are simply loaded when needed via conversation history.
Auto-discovery: Skills are automatically discovered from
STRANDS_SKILLS_DIR(default:./skills) on first use.SKILL.md format: Follows AgentSkills.io spec with YAML frontmatter for metadata and markdown body for instructions.
SKILL.md Frontmatter Fields
The tool parses YAML frontmatter from SKILL.md files. Supported fields:
nameskill_nameparameterdescriptionlistaction outputlicenseallowed-toolslistaction output (informational only)Example SKILL.md:
Note: The
allowed-toolsfield is informational only - the tool doesn't enforce or validate tool availability. It's displayed to help users understand what tools a skill expects to use.Skill Directory Structure
Environment Variables
STRANDS_SKILLS_DIR./skillsRelated Issues
Documentation PR
N/A - Documentation is included in README.md updates in this PR.
Type of Change
New Tool
Testing
python -m pytest tests/test_skills.py -v)ruff check src/strands_tools/skills.py tests/test_skills.py)Test coverage includes:
get_skills_prompt()helper function (XML output, empty directory, env var usage, cache sharing)Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.