SKILL.md files.
What are Agent Skills?
Agent Skills are:- Markdown-based: Written in simple Markdown format with YAML frontmatter
- Modular: Each skill is a self-contained capability
- Reusable: Skills can be shared across agents and projects
- Context-aware: Automatically loaded based on task similarity
- Code-free: No code changes needed to add new capabilities
Skills Directory Structure
SKILL.md Format
Basic Structure
EachSKILL.md file has two parts:
- YAML Frontmatter: Metadata about the skill
- Markdown Content: Instructions and methodology
Example: Financial Analysis Skill
Using Agent Skills
Dynamic Loading (Task-Based, Automatic)
Settingskills_dir on an agent enables dynamic, task-based skill loading automatically. Every call to agent.run(task) loads only the skills whose description is similar enough to the current task (cosine similarity over term-frequency vectors, threshold 0.3 by default) and appends them to the system prompt for that run. There is no separate “load everything” mode triggered by run() — this dynamic path is what fires whenever skills_dir is set.
Static Loading (Load All Skills)
To force-load every skill inskills_dir regardless of task similarity, call handle_skills() directly with no task argument (e.g. right after construction, before run()):
Creating Custom Skills
Step 1: Create Directory
Step 2: Write SKILL.md
Step 3: Use the Skill
Skill Examples
Data Visualization Skill
Dynamic Skills Loader
Best Practices
1. Keep Skills Focused
2. Include Examples
Always provide concrete examples in your skills:3. Use Clear Instructions
4. Provide Guidelines
Sharing Skills
Skills can be easily shared across projects and teams:Next Steps
Structured Outputs
Get structured responses from agents
Creating Agents
Learn how to create agents
Reference
- Skills handling:
swarms/structs/agent.py(handle_skills, a short delegate) plusswarms/agents/skills_manager.py(SkillsManager._static_prompt,SkillsManager._dynamic_prompt) for the tiered static/dynamic loading logic - Dynamic skills loader:
swarms/structs/dynamic_skills_loader.py - Example skills:
examples/single_agent/agent_skill_examples/ - Anthropic Agent Skills: Agent Skills announcement