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: activation also appends a listing of the skill's resource
files (
scripts/,references/,assets/) — the first 20 by default (themax_resource_filesargument ofSkillsPlugin;AgentConfig.skillsuses the default). A skill with no folder (path=None) has none. The listing gives paths, not contents, and the skills plugin registers no file reader. To open those files the agent needs a tool that can read them, such as a file or MCP read tool you register, or code execution (code_mode).
Attach via AgentConfig.skills=[skill_or_path, ...].
For the concepts, start with Skills.
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 ¶
SkillsPlugin(skills: list[Skill | str | Path], max_resource_files: int = 20, *, active: Iterable[str] = (), catalog: bool | None = None, enforce_allowed_tools: bool = False, show_paths: bool = True, router: SkillRouter | None = None, active_preamble: str = DEFAULT_ACTIVE_PREAMBLE, catalog_preamble: str = DEFAULT_CATALOG_PREAMBLE, render_skill: Callable[[Skill], str] | None = None, skill_footer: bool = True)
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
|
active
|
Iterable[str]
|
Names of skills the host activates for the run up front.
Their full instructions are sent with every model call (as a
system message after the system prompt, never written to the
conversation state). Unknown names raise |
()
|
catalog
|
bool | None
|
Whether the model sees the L1 catalog and gets the
|
None
|
enforce_allowed_tools
|
bool
|
Make the active skills' |
False
|
show_paths
|
bool
|
Include each skill's filesystem location in the catalog and in activation responses. Set False for a server, where paths reveal the deployment layout and help nobody. |
True
|
router
|
SkillRouter | None
|
|
None
|
active_preamble
|
str
|
The text before the active skills' instructions. |
DEFAULT_ACTIVE_PREAMBLE
|
catalog_preamble
|
str
|
The text before the catalog. |
DEFAULT_CATALOG_PREAMBLE
|
render_skill
|
Callable[[Skill], str] | None
|
|
None
|
skill_footer
|
bool
|
Whether the default rendering of an active skill ends
with its |
True
|
Source code in .sdk/src/tulip/skills/plugin.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 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 | |
activated_skills
property
¶
Skills active in the most recent run (most recent activation last).
On a shared Agent serving runs at once this is whichever run touched
its skills last; use :meth:allowed_tools with a run id, or a hook
reading event.run, for one run's own view.
on_before_model_call
async
¶
Inject the active skills and/or the catalog before each model call.
Only the messages sent to the model change; the run's state (and so every checkpoint) never holds them.
Source code in .sdk/src/tulip/skills/plugin.py
allowed_tools ¶
The tools a run's active skills allow, or None when nothing limits them.
The union of the allowed-tools lists the run's active skills
declare (routed, or active); None when no active skill declares
one (or none is active). Also whatever the model activated itself
through the skills tool in that run. run_id=None is the state
outside any run, which starts from active.
Source code in .sdk/src/tulip/skills/plugin.py
on_before_tool_call
async
¶
With enforce_allowed_tools, cancel calls the skills do not allow.
Source code in .sdk/src/tulip/skills/plugin.py
get_tools ¶
The skills activation tool when the catalog is on, else none.
(AgentConfig.skills registers it itself; this is what lets a
configured plugin in AgentConfig.plugins work the same way.)
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
on_after_invocation
async
¶
Forget the run's skills once it ends (activated_skills keeps them).
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
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 |