Overview
Skills provide:- Structured prompts - Markdown-based skill definitions
- Auto-discovery - Load skills from multiple directories
- Eligibility filtering - OS, binary, and environment-based filtering
- Command integration - Expose skills as slash commands
- Precedence rules - Workspace > project > personal > managed > bundled
Architecture
Skills are discovered and loaded from multiple sources (src/agents/skills/workspace.ts:220):Skill Definition Format
A skill is a Markdown file with frontmatter and instructions:OS Filtering
macos, linux, windows, darwin, win32
Binary Requirements
which or PATH lookup.
Environment Variables
Installation Specs
brew, node, go, uv, download
Skill Discovery
Default Locations
Custom Directories
Plugin Skills
Plugins can contribute skills via package.json:src/agents/skills/plugin-skills.ts
Skill Filtering
Agent-Level Filter
Restrict skills per agent:Invocation Policy
src/agents/skills/types.ts:35:
Skill Commands
Skills can expose slash commands (src/agents/skills/workspace.ts:654):github-cli→/github_cliDocker Tools→/docker_tools
Command Specs
Skill Limits
Prompt and loading limits (src/agents/skills/workspace.ts:95):Skill Snapshots
Skills are compiled into snapshots for agent runs (src/agents/skills/types.ts:82):CLI Operations
Programmatic API
Load Skills
Build Prompt
Create Snapshot
Filter Skills
Skill Sync
Sync skills to isolated workspace (src/agents/skills/workspace.ts:589):Advanced Features
Path Compaction
Skill paths are compacted to save prompt tokens (src/agents/skills/workspace.ts:45):Nested Skill Roots
Auto-detects nestedskills/ directories:
Skill Entry Deduplication
When same skill exists in multiple locations, higher priority wins:Bundled Skills
SimpleClaw includes built-in skills:src/agents/skills/bundled-dir.ts
Custom Skill Example
Create~/project/skills/postgres/SKILL.md:
Environment
SetDATABASE_URL:
API Reference
Key files insrc/agents/skills/:
workspace.ts- Main skill loading logic (src/agents/skills/workspace.ts:220)types.ts- Skill type definitions (src/agents/skills/types.ts:1)config.ts- Eligibility and config resolutionfilter.ts- Skill filter normalizationfrontmatter.ts- Frontmatter parsingplugin-skills.ts- Plugin skill discoverybundled-dir.ts- Bundled skills location