Understanding Skills
Skills
Skills are modular, reusable capabilities that add functions, prompts, and integrations to your agents without custom code.
What You’ll Learn
This chapter covers the skills system:
- Understanding Skills - What skills are and how they work
- Built-in Skills - Pre-built skills available in the SDK
- Adding Skills - How to add skills to your agents
- Custom Skills - Creating your own skills
- Skill Configuration - Parameters and advanced options
What Are Skills?
Skills are pre-packaged capabilities that add:
- Functions - SWAIG tools the AI can call
- Prompts - Instructions for how to use the skill
- Hints - Speech recognition keywords
- Global Data - Variables available throughout the call
Quick Start
Add a skill in one line:
Available Built-in Skills
Chapter Contents
Skills vs Functions
When to Use Skills
Use Built-in Skills When:
- Standard capability needed (datetime, search, etc.)
- Want quick setup without custom code
- Need tested, maintained functionality
Create Custom Skills When:
- Reusing capability across multiple agents
- Want to share functionality with team/community
- Packaging complex integrations
Use SWAIG Functions When:
- One-off custom logic
- Agent-specific business rules
- Need full control over implementation
Complete Example
Let’s start by understanding how skills work internally.
Skill Architecture
SkillBase (Abstract Base Class)
Required Methods:
setup()- Initialize the skillregister_tools()- Register SWAIG functions
Optional Methods:
get_hints()- Speech recognition hintsget_global_data()- Session dataget_prompt_sections()- Prompt additionscleanup()- Resource cleanup
SkillRegistry (Discovery & Loading)
- Discovers skills from directories
- Loads skills on-demand (lazy loading)
- Validates requirements (packages, env vars)
- Supports external skill paths
How Skills Work
Skills are a convenience layer built on top of SWAIG functions. When you add a skill, it registers one or more SWAIG functions with the agent, adds relevant prompts, and configures hints—all from a single add_skill() call.
Understanding this helps when debugging: a skill’s function behaves exactly like a SWAIG function you’d define yourself. The only difference is that the skill packages everything together.
When you call add_skill():

Skill Directory Structure
Built-in skills live in the SDK:
Each skill directory contains:
SkillBase Class
All skills inherit from SkillBase:
Skill Lifecycle
Skill Contributions
Skills can contribute to the agent in multiple ways:
1. Tools (Functions)
2. Prompt Sections
3. Speech Hints
4. Global Data
Skill Discovery Paths
Skills are discovered from multiple locations in priority order:
Lazy Loading
Skills are loaded on-demand to minimize startup time:
Multi-Instance Skills
Some skills support multiple instances with different configurations:
Usage:
Parameter Passing
Parameters flow through skills in a structured way:
At add_skill() time:
The skill receives these in self.params during setup:
At function call time: The AI calls the function with arguments:
Result Handling
Skill handlers return SwaigFunctionResult just like regular SWAIG functions:
The result goes back to the AI, which uses it to formulate a response to the user.
Error Handling and Propagation
Skills should handle errors gracefully and return meaningful messages:
Error handling principles:
- Always return a
SwaigFunctionResult, even on errors - Make error messages user-friendly (the AI will relay them)
- Log technical details for debugging
- Don’t expose internal errors to users
Debugging Skills
When skills don’t work as expected:
1. Check if the skill loaded:
2. Verify functions are registered:
3. Test the function directly:
4. Check for missing requirements: Skills log warnings if required packages or environment variables are missing. Check your logs during agent startup.
5. Look at skill source: Built-in skills are in the SDK source. Examine them to understand how they work: