Skills module for Deep Agents Code.
Public API:
All other components are internal implementation details.
Shared skill-merge helper with override (name-collision) debug logging.
Both skill discovery paths — the CLI skills list loader
(deepagents_code.skills.load) and the runtime agent loader
(deepagents_code.plugins.adapters.skills_middleware.PluginSkillsMiddleware) —
merge skills from multiple sources by precedence, last-one-wins, keyed on skill
name. A higher-precedence skill replaces a lower-precedence skill with the same
name. That override behavior is intentional; this helper leaves it unchanged and
makes each replacement observable in debug logs.
Trust store for skill directories that resolve outside trusted roots.
load_skill_content refuses to read a SKILL.md whose resolved path falls
outside every trusted skill root — this stops a symlink inside a skill
directory from reading arbitrary files. The static escape hatch is the
DEEPAGENTS_CODE_EXTRA_SKILLS_DIRS env var / [skills].extra_allowed_dirs
config allowlist.
This module adds an in-the-moment, persistent approval path: when a skill resolves outside the trusted roots, the user is asked once to allow the resolved target directory, and the decision is remembered. Trust is keyed by the approved target directory — the canonical path resolved and shown to the user at approval time, stored as-is and never re-resolved.
Two distinct post-approval swaps are caught by two distinct layers, so neither grants access the user never approved:
SKILL.md path) at a new target is
caught by containment enforcement in load_skill_content: the new target is
not on the allowlist, so the read is refused and the user is re-prompted.
The stored trust entry — the original resolved target — is untouched.resolve()-to-self re-verification in
load_trusted_skill_dirs, which drops the stale entry rather than following
the injected symlink to a directory the user never approved.Trust entries are app-managed bookkeeping (a set of approved directories), not
user-facing configuration, so they live alongside the other state files under
~/.deepagents/.state/skill_trust.json rather than in the hand-editable
config.toml.
CLI commands for skill management.
Skill loader for CLI commands.
This module provides filesystem-based skill discovery for CLI operations (list, create, info, delete). It wraps the prebuilt middleware functionality from deepagents.middleware.skills and adapts it for direct filesystem access needed by CLI commands.
For middleware usage within agents, use deepagents.middleware.skills.SkillsMiddleware directly.
Helpers for loading and formatting skill invocations.