Skills
Skills are self-contained capability packages that extend Pi with domain-specific knowledge and instructions. Unlike extensions (which run code), skills are declarative Markdown files that provide context and instructions to the LLM.
Overview
A skill teaches Pi how to perform a specific task or work with a specific technology. Skills are loaded on-demand -- their descriptions are always visible to the model, but full instructions are only injected when the skill is activated. This progressive disclosure keeps the context window efficient.
Key Locations
Skills are discovered from multiple locations:
Progressive Disclosure
Skills use a two-tier loading strategy to conserve context:
-
Description (always loaded): A short summary from the SKILL.md frontmatter. This is included in every request so the model knows what skills are available.
-
Full instructions (loaded on demand): The complete Markdown body is injected only when the skill is activated. This keeps the base context small while making detailed instructions available when needed.
SKILL.md Structure
Each skill is defined by a SKILL.md file with YAML frontmatter and a Markdown body:
Frontmatter Requirements
The name field must be unique across all loaded skills. The description is always present in the model's context as part of the available skills list.
Access Methods
Slash Command
Invoke a skill explicitly:
Auto-Selection
The model can select skills automatically based on the conversation context. When the user's request matches a skill's description, the model activates it and loads the full instructions.
CLI Flag
Load a skill for the entire session:
Settings
Pre-load skills via settings:
Validation Standards
Skills should follow these guidelines:
- Frontmatter is required: Both
nameanddescriptionmust be present - Description should be actionable: Describe what the skill enables, not just what it is
- Instructions should be specific: Include concrete commands, patterns, and examples
- Keep skills focused: One skill per domain or technology. Split broad topics into multiple skills
- Test instructions: Verify that the instructions produce correct results when followed
Security Note
Skills inject content into the LLM context. While skills cannot execute code directly, they influence the model's behavior. Only use skills from trusted sources, as a malicious skill could instruct the model to perform unwanted actions.
Discovery Behavior
Pi discovers skills differently depending on directory structure:
-
Non-recursive for
.mdfiles: Pi scans skill directories for.mdfiles at the top level only. A file like~/.pi/agent/skills/docker.mdis discovered, but~/.pi/agent/skills/docker/tips.mdis not (unless it is aSKILL.md). -
Recursive for
SKILL.mddirectories: Pi recursively scans directories for files namedSKILL.md. A skill at~/.pi/agent/skills/docker/SKILL.mdis discovered, as is~/.pi/agent/skills/web/react/SKILL.md.
This means you can organize skills in two ways:
Both structures work. The directory structure is useful when a skill needs supporting files (examples, templates) alongside its SKILL.md definition. Supporting files are not automatically loaded but can be referenced in the skill's instructions.