SkillsMiddleware(
self,
*,
backend: BACKEND_TYPES,
sources: list[str]
)| Name | Type | Description |
|---|---|---|
backend* | BACKEND_TYPES | Backend instance for file operations |
sources* | list[str] | List of skill source paths. Source names are derived from the last path component. |
| Name | Type |
|---|---|
| backend | BACKEND_TYPES |
| sources | list[str] |
Middleware for loading and exposing agent skills to the system prompt.
Loads skills from backend sources and injects them into the system prompt using progressive disclosure (metadata first, full content on demand).
Skills are loaded in source order with later sources overriding earlier ones.
Example:
from deepagents.backends.filesystem import FilesystemBackend
backend = FilesystemBackend(root_dir="/path/to/skills")
middleware = SkillsMiddleware(
backend=backend,
sources=[
"/path/to/skills/user/",
"/path/to/skills/project/",
],
)