Skills
Skill primitives for structured, reusable subagent capabilities.
Skill
Wraps an agent skill — either from a SKILL.md file or inline content.
instructions
property
Full skill instructions — SKILL.md body without frontmatter.
path
class-attribute
instance-attribute
Path to the skill directory containing a SKILL.md file.
summary
property
Short description from frontmatter or inline content. Used in skill index.
discover
classmethod
Recursively discover all skills in a directory.
Each subdirectory containing a SKILL.md file is loaded via from_dir,
including full frontmatter validation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
directory
|
Path | str
|
Root directory to search. All subdirectories containing a SKILL.md file are loaded as skills. |
required |
from_content
classmethod
Create an inline skill without a filesystem path.
Useful for tests, dynamically generated skills, or skills embedded directly in code. Bypasses frontmatter parsing entirely.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Unique skill identifier. |
required |
instructions
|
str
|
Full skill instructions in Markdown. |
required |
summary
|
str | None
|
Short description shown in the skill index. Defaults to the first non-empty line of |
None
|
from_dir
classmethod
Load a skill from a directory on disk.
Validates that the directory exists and the SKILL.md frontmatter
contains the required name and description fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
Path to a skill directory containing a SKILL.md file with valid YAML frontmatter. The frontmatter |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the path does not exist, frontmatter is missing or
malformed, or the |
FileNotFoundError
|
If no SKILL.md file is found in the directory. |