skills¶
Source: src/skills.ts
The skills an agent may load, and where they are looked up.
A skill is named in a definition, never inherited from the machine:
skills: is an allowlist exactly like tools:, so what an agent can do
stays readable in its own file. Only the lookup reaches outside, nearest
first: the skill shipped beside the definition, then the repository’s, then
the user’s. Whoever is closest to the work wins the name.
pi does the rest: the system prompt carries a name, a description and a path,
and the model opens SKILL.md itself with read. That is why a declared
skill the model cannot reach is a configuration error rather than a silence
at runtime: a flow’s validation reports it, and spawn throws it.
resolveSkills¶
function
export function resolveSkills(agent: Agent, cwd: string, tools: readonly string[]): Skill[] { /* … */ }
Resolves what an agent’s skills: names, in the order it named them.
Throws rather than dropping one: a missing skill is a typo in a definition, and finding out through prose that quietly lacks a step costs more than failing at spawn. A TypeScript workflow has no validation before it runs, so this is where it finds out; a flow found out before its first spawn.
SkillDir¶
type
export type SkillDir = {
/** Absolute path of the directory. It legitimately may not exist. */
dir: string;
/** Where a skill found here came from: `"agent"`, `"project"` or `"user"`. */
source: string;
};
A directory to search, and the label pi records for what it finds there.