← Pi Agents

Skills

Pi advertises each skill by name and description and loads its full instructions on demand; here is how to write the description that makes routing work.

/review from chapter 12 only runs when you type it. The problem it solves has a sibling: work that should begin the moment Pi recognises the kind of task, without you naming the command first.

That is a skill, and the entire mechanism turns on one field you are tempted to rush.

What a skill actually is

skills.md opens with the definition: skills give Pi specialized instructions and supporting files for a particular kind of work. Pi advertises each available skill by name and description, then loads its full instructions only when the task calls for them.

The load side says the same thing: at startup, Pi scans configured skill locations and adds each skill’s name, description, and path to the system prompt. It does not add the full instructions.

    flowchart TD
  A["startup"] --> B["system prompt carries name, description, path"]
  B --> C{"does the task match"}
  C -->|no| D["nothing else loads"]
  C -->|yes| E["the model reads SKILL.md"]
  F["you type /skill:name"] --> E
  E --> G["body instructions enter the context"]
  G --> H["bundled files, if the body says so"]
  

Two properties follow. The description is always present in the request; the body is not. That is why a skill costs almost nothing while it is irrelevant, and why the description is the entire routing surface.

Wrong: "Pi runs a skill when the task calls for it."
Correct: "Pi advertises the description. The model matches it against the task, and only then reads the body."

The directory

review-guard/
├── SKILL.md
├── scripts/
│   └── run-checks.sh
├── references/
│   └── checklist.md
└── assets/
    └── review-template.md

A skill is a directory containing SKILL.md. Pi implements the Agent Skills specification, and most invalid fields produce warnings rather than stopping startup.

SKILL.md

---
name: review-guard
description: Reviews changed code against this repository's conventions and runs its own checks. Use when reviewing a diff, a pull request, or uncommitted changes.
---

# Review guard

1. Run `scripts/run-checks.sh` and read the output before reviewing anything.
2. Read `references/checklist.md` and apply it to the diff.
3. Report findings ordered by severity, each with a file path.

Do not summarise the diff back to the user; report only findings.

The frontmatter is followed by direct instructions. That is the whole file format.

The description is the routing mechanism

skills.md is unusually explicit:

The description determines when the model considers loading the skill. State both what the skill does and when it applies. Avoid descriptions such as “Helps with PDFs,” which do not provide enough routing information.

Compare three descriptions of the same skill:

description: Helps with reviews.          # what: vaguely; when: never
description: Reviews code.                # what: yes; when: never
description: Reviews changed code against this repository's conventions. Use when reviewing a diff, a pull request, or uncommitted changes.   # both

Only the third gives the model something to match a task against. “Reviews code” could plausibly match an implementation task; “reviews changed code … when reviewing a diff, a pull request, or uncommitted changes” does not.

This is also why chapter 11’s procedure puts the skill above the template. Routing is a capability text cannot have.

The description will sometimes miss

skills.md says a model might fail to load a relevant skill, and gives the override:

/skill:review-guard

Arguments after /skill:name are appended to the loaded instructions as a user request:

/skill:review-guard src/auth only

So both paths arrive at the same box in the diagram above: the skill’s body, loaded and followed. If you are typing /skill:name routinely, the description needs work — or the skill is really a template.

Opting out of automatic selection

Set disable-model-invocation: true in frontmatter when a skill should be available only through its explicit command. The enableSkillCommands setting, default true, controls whether skill commands appear in interactive command discovery; manually entered /skill:name commands still work.

That gives you three states worth choosing deliberately:

State Frontmatter / setting Reaches the model?
Routed and listed default yes, by description match
Routed but hidden from the menu enableSkillCommands: false yes
Explicit only disable-model-invocation: true no

Portable frontmatter

The specification defines these fields:

Field Purpose
name Command and display name
description Routing description shown to the model
license License name or bundled license file
compatibility Environment requirements
metadata Additional key-value metadata
allowed-tools Experimental pre-approved tool list
disable-model-invocation Hide the skill from automatic model selection

Names use lowercase letters, numbers, and hyphens, with no leading, trailing, or consecutive hyphens, at most 64 characters; descriptions at most 1024.

Two documented behaviours to know. Pi neither requires nor warns when the declared name differs from the parent directory, but other Agent Skills implementations may enforce that, so matching names remain the portable choice. And malformed SKILL.md files, plus declared skills without descriptions, are not loaded at all — a missing description is a silent disappearance, not an error.

Name collisions keep the first discovered skill and produce a warning. If two skills both claim “review”, the discovery order decides which one you get.

Where skills load from

Place the skill in your user or project skills directory. Directories containing SKILL.md are discovered recursively, so nesting is fine here — unlike prompt templates, which load direct .md children only.

Pi also supports the Agent Skills locations ~/.agents/skills/ and .agents/skills/. Project .agents/skills/ directories are discovered from the working directory through its ancestors, stopping at the repository root when one exists.

Pi accepts some standalone Markdown skills, but a directory containing SKILL.md is the portable form and should be preferred.

Iterate on it

Run Pi from a location where the skill is discoverable, then inspect the startup diagnostics and the /skill:name command. Run /reload after editing a skill during an active session.

The startup header lists the instructions and resources Pi loaded, which is where you confirm the description made it in.

The running example: /review grows a skill

Chapter 11 said the release checklist was the case that outgrew a template. Here is the smaller version, the review guard, at skill scope:

---
name: review-guard
description: Reviews changed code against this repository's conventions and runs its own checks. Use when reviewing a diff, a pull request, or uncommitted changes.
---

# Review guard

1. Run `scripts/run-checks.sh` and read the output before reviewing.
2. Read `references/checklist.md`.
3. Report findings ordered by severity, each with a file path.

Same job as the template, and every difference comes from being a skill: it fires without being typed, and its instructions load only when they are relevant.

The second one is a constraint rather than a bonus. The body loads whole, every time the skill fires, so the moment a checklist stops fitting in a screen it cannot live there. Chapter 14 moves it into the directory beside the body.