Skip to main content

Module skills

Module skills 

Source
Expand description

Skills — load AgentSkills-compatible skill directories and inject into system prompts.

Follows the AgentSkills open standard. Skills are directories containing a SKILL.md file with YAML frontmatter.

§Progressive Disclosure

  1. Metadata (~100 tokens/skill) — name + description, always in the system prompt
  2. Instructions (<5k tokens) — SKILL.md body, loaded by the agent when activated
  3. Resources (unlimited) — scripts/, references/, assets/, loaded on demand

The agent decides when to activate a skill based on the description. No trigger engine needed — the LLM is smart enough.

§Example

use phi_core::SkillSet;

let skills = SkillSet::load(&["./skills", "~/.phi-core/skills"]).unwrap();
println!("{}", skills.format_for_prompt());
// Inject into system prompt via Agent::with_skills()

Structs§

Skill
A loaded skill with its metadata.
SkillSet
A collection of loaded skills.

Enums§

SkillError
Errors during skill loading.