Skills¶
AgentSkills.io-compatible packaged instruction bundles (SKILL.md
files) that agents load on demand via progressive disclosure:
- L1: the skill catalog (names + descriptions) appears in the system prompt.
- L2: the agent activates a skill — full instructions are loaded.
- L3: the agent reads supporting resource files (
scripts/,references/,assets/).
Attach via AgentConfig.skills=[skill_or_path, ...].
Skill
dataclass
¶
Skill(name: str, description: str, instructions: str = '', path: Path | None = None, allowed_tools: list[str] | None = None, required_probes: list[RequiredProbe] = list(), min_tool_calls: int | None = None, max_tool_calls: int | None = None, metadata: dict[str, Any] = dict(), license: str | None = None, compatibility: str | None = None)
A skill — packaged instructions for an agent.
Skills follow the AgentSkills.io specification.
Example
skill = Skill( ... name="code-review", ... description="Review code for quality and security issues.", ... instructions="# Code Review\n1. Check error handling...", ... )
Load from filesystem¶
skill = Skill.from_file(Path("./skills/code-review"))
from_file
classmethod
¶
Load a skill from a directory containing SKILL.md.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Path to skill directory or SKILL.md file. |
required |
Returns:
| Type | Description |
|---|---|
Skill
|
Loaded Skill instance. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If SKILL.md not found. |
ValueError
|
If required fields missing. |
Source code in .sdk/src/tulip/skills/models.py
from_content
classmethod
¶
Parse a skill from raw SKILL.md content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
str
|
Raw SKILL.md file content. |
required |
path
|
Path | None
|
Optional filesystem path for resource resolution. |
None
|
Returns:
| Type | Description |
|---|---|
Skill
|
Parsed Skill instance. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If required fields (name, description) missing. |
Source code in .sdk/src/tulip/skills/models.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
from_directory
classmethod
¶
Load all skills from a parent directory.
Scans subdirectories for SKILL.md files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Parent directory containing skill subdirectories. |
required |
Returns:
| Type | Description |
|---|---|
list[Skill]
|
List of loaded skills. |
Source code in .sdk/src/tulip/skills/models.py
list_resources ¶
List resource files from scripts/, references/, assets/ directories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_files
|
int
|
Maximum number of files to list. |
20
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of relative file paths. |
Source code in .sdk/src/tulip/skills/models.py
SkillsPlugin ¶
Bases: Plugin
Plugin that provides AgentSkills.io skill discovery and activation.
Injects a compact XML catalog of available skills into the system prompt.
Registers a skills tool that the agent calls to load full instructions.
Example
from tulip.skills import Skill, SkillsPlugin
plugin = SkillsPlugin( ... skills=[ ... Skill.from_file("./skills/code-review"), ... Skill( ... name="summarize", description="Summarize text", instructions="..." ... ), ... ] ... )
agent = Agent( ... config=AgentConfig( ... model=model, ... plugins=[plugin], ... ) ... )
Initialize with skill sources.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skills
|
list[Skill | str | Path]
|
List of Skill instances, paths to skill directories, or paths to parent directories containing skills. |
required |
max_resource_files
|
int
|
Max resource files to list per skill. |
20
|
Source code in .sdk/src/tulip/skills/plugin.py
activated_skills
property
¶
Get list of activated skill names (most recent last).
on_before_model_call
async
¶
Inject skills catalog XML into messages before model call.
Source code in .sdk/src/tulip/skills/plugin.py
get_activation_tool ¶
Create the skills activation tool.
Returns a Tool that the agent calls to load skill instructions.
Source code in .sdk/src/tulip/skills/plugin.py
get_hooks ¶
Discover all @hook decorated methods.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict mapping hook method names to bound methods. |
Source code in .sdk/src/tulip/hooks/plugin.py
get_tools ¶
Discover all @tool decorated methods.
Returns:
| Type | Description |
|---|---|
list[Any]
|
List of Tool instances found on the plugin. |
Source code in .sdk/src/tulip/hooks/plugin.py
init_agent ¶
Called when plugin is attached to an agent.
Override to perform setup that requires the agent instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
Any
|
The agent this plugin is being attached to. |
required |