Skills System
Skills are specialized prompt injections that give the agent expert knowledge and behavior patterns for specific tasks.
Overview
Skills provide:
- Expert personas - Code reviewer, debugger, technical writer
- Domain knowledge - Best practices, patterns, methodologies
- Consistent behavior - Reliable, repeatable approaches
Using Skills
Activate Skills via Options
from isa_agent_sdk import query, ISAAgentOptions
options = ISAAgentOptions(
skills=["code-review", "debug"]
)
async for msg in query("Review this function for issues", options=options):
print(msg.content, end="" if msg.is_text else "\n")Programmatic Skill Loading
from isa_agent_sdk import load_skill, activate_skills, list_builtin_skills
# List available skills
skills = list_builtin_skills()
print(skills)
# Output: ['code-review', 'debug', 'refactor', 'test-writer', 'documentation', 'security-audit']
# Load a single skill (async)
skill = await load_skill("code-review")
print(f"Skill: {skill.name}")
print(f"Description: {skill.description}")
print(f"Triggers: {skill.triggers}")
# Output:
# Skill: code-review
# Description: Expert code reviewer focusing on quality, security, and best practices
# Triggers: ['review', 'code review', 'check this code', 'review my code']
# Activate multiple skills (note: uses *args, not list)
injection = activate_skills("code-review", "debug", "refactor")
print(f"Injection length: {len(injection)} chars")Built-in Skills
code-review
Expert code reviewer focusing on:
- Code quality and readability
- Best practices adherence
- Security vulnerabilities
- Performance issues
options = ISAAgentOptions(skills=["code-review"])
async for msg in query("""
Review this code:
def process(data):
result = []
for i in range(len(data)):
if data[i] != None:
result.append(data[i] * 2)
return result
""", options=options):
print(msg.content, end="" if msg.is_text else "\n")debug
Systematic debugger that:
- Analyzes error messages
- Traces execution flow
- Identifies root causes
- Suggests fixes
options = ISAAgentOptions(skills=["debug"])
async for msg in query("""
Debug this error:
TypeError: cannot unpack non-iterable NoneType object
File "app.py", line 42, in process_user
name, email = get_user_info(user_id)
""", options=options):
print(msg.content, end="" if msg.is_text else "\n")refactor
Refactoring specialist that:
- Improves code structure
- Reduces complexity
- Applies design patterns
- Maintains functionality
options = ISAAgentOptions(skills=["refactor"])
async for msg in query("Refactor this 200-line function into smaller pieces", options=options):
print(msg.content, end="" if msg.is_text else "\n")test-writer
Test coverage specialist that:
- Writes comprehensive tests
- Covers edge cases
- Uses appropriate frameworks
- Follows testing best practices
options = ISAAgentOptions(skills=["test-writer"])
async for msg in query("Write tests for the UserService class", options=options):
print(msg.content, end="" if msg.is_text else "\n")documentation
Technical documentation writer that:
- Creates clear API docs
- Writes helpful README files
- Documents complex systems
- Maintains consistency
options = ISAAgentOptions(skills=["documentation"])
async for msg in query("Document the authentication module", options=options):
print(msg.content, end="" if msg.is_text else "\n")Combining Skills
Skills can be combined for complex tasks:
# Code review + security focus
options = ISAAgentOptions(skills=["code-review", "debug"])
# Full development workflow
options = ISAAgentOptions(skills=["code-review", "refactor", "test-writer"])
# Documentation + code quality
options = ISAAgentOptions(skills=["documentation", "code-review"])Skill Manager
Advanced Skill Management
from isa_agent_sdk import get_skill_manager
manager = get_skill_manager()
# Load skills
await manager.load("code-review")
await manager.load("debug")
# Get current injection
injection = manager.get_injection()
# List loaded skills
loaded = manager.list_loaded()
print(f"Active skills: {loaded}")List Available Skills
from isa_agent_sdk import list_builtin_skills
skills = list_builtin_skills()
for skill_name in skills:
print(f"- {skill_name}")Skill Structure
Skill Properties
from isa_agent_sdk import Skill
# Skill data structure
skill = Skill(
name="code-review", # Unique identifier
description="Expert code reviewer", # What it does
prompt="You are an expert...", # Prompt injection
triggers=["review", "check"], # Keywords that trigger
category="coding", # Category
source="builtin", # Where loaded from
metadata={"version": "1.0"} # Additional data
)Access Skill Details
from isa_agent_sdk import load_skill
skill = load_skill("debug")
print(f"Name: {skill.name}")
print(f"Description: {skill.description}")
print(f"Category: {skill.category}")
print(f"Triggers: {skill.triggers}")
print(f"Prompt preview: {skill.prompt[:200]}...")Custom Skills
Define Custom Skills
from isa_agent_sdk import Skill, get_skill_manager
# Create custom skill
security_skill = Skill(
name="security-audit",
description="Security vulnerability scanner",
prompt="""You are a security expert specializing in:
- OWASP Top 10 vulnerabilities
- SQL injection detection
- XSS prevention
- Authentication flaws
- Authorization issues
When reviewing code:
1. Check all user inputs
2. Verify authentication flows
3. Review authorization logic
4. Look for injection points
5. Check for sensitive data exposure
""",
triggers=["security", "vulnerability", "audit"],
category="security",
source="custom",
metadata={"author": "security-team"}
)
# Register with manager
manager = get_skill_manager()
manager.register_skill(security_skill)
# Use in query
options = ISAAgentOptions(skills=["security-audit"])Load Skills from Files
# skills/api-design.yaml
name: api-design
description: REST API design expert
category: architecture
triggers:
- api
- rest
- endpoint
prompt: |
You are an API design expert following:
- RESTful principles
- OpenAPI specification
- Versioning best practices
- Error handling standards
- Rate limiting patternsimport yaml
from isa_agent_sdk import Skill, get_skill_manager
with open("skills/api-design.yaml") as f:
data = yaml.safe_load(f)
skill = Skill(**data, source="file")
manager = get_skill_manager()
manager.register_skill(skill)Skill Triggers
Skills can be auto-activated based on query content:
from isa_agent_sdk import get_skill_manager
manager = get_skill_manager()
# Check if query triggers any skills
query = "Can you review this code for bugs?"
triggered = manager.get_triggered_skills(query)
print(f"Auto-triggered: {triggered}") # ['code-review', 'debug']Best Practices
- Combine complementary skills - code-review + debug for thorough analysis
- Use specific skills - Don’t load all skills, pick relevant ones
- Create domain skills - Build skills for your specific needs
- Keep prompts focused - Each skill should have a clear purpose
- Test skill combinations - Ensure skills work well together
Skill Categories
| Category | Skills | Use Case |
|---|---|---|
coding | code-review, debug, refactor | Code quality |
testing | test-writer | Test coverage |
documentation | documentation | Technical writing |
security | (custom) | Security audits |
architecture | (custom) | System design |
Next Steps
- Options - Configure skill activation
- Tools - Combine skills with tools
- Human-in-the-Loop - Review skill outputs