Expand description
User-invocable + auto-loadable skill definitions (Claude-Code parity).
PMAT-CODE-SKILLS-001: Claude Code loads .claude/skills/<name>/SKILL.md
(and ~/.claude/skills/ at user scope). Each SKILL.md carries
markdown frontmatter declaring a name, description, optional
when_to_use heuristic, and optional allowed-tools allowlist. The
body is treated as the skill’s instructions — injected into the
model’s system context when the skill is invoked either
(a) explicitly by the user via /<skill-name> in the REPL, or
(b) automatically by matching when_to_use against the pending turn.
apr code mirrors the same pattern at .apr/skills/ with identical
frontmatter schema so Claude-native projects can share skills with
apr code unchanged.
§Example — .apr/skills/rust-test.md
---
name: rust-test
description: Run the Rust test suite and interpret failures
when_to_use: User asks about failing cargo tests
allowed-tools: shell, grep
---
Run `cargo test -p <crate> --lib <pattern>` from the repo root.
When a test fails, read the span around the assertion and report
the minimal reproduction.After discovery, registry.resolve("rust-test") returns the
Skill whose instructions field can be appended to the system
prompt of the active agent turn.
Structs§
- Skill
- A parsed Skill definition.
- Skill
Registry - Registry of discovered skills, keyed by
name(alphabetical iteration).
Enums§
- Skill
Error - Errors that can arise while parsing or loading a skill file.
Constants§
- CLAUDE_
COMPAT_ DIR - Legacy / cross-compat directory — share skills tree with Claude Code.
- DEFAULT_
PROJECT_ DIR - Default project-scope skills directory (relative to cwd).
Functions§
- discover_
skills - Discover skills from the standard locations: user scope
(
~/.config/apr/skills/) then project scope (.apr/skills/or, as fallback,.claude/skills/— cross-compat). Project scope wins on name collision. - load_
skills_ from - Scan a directory for skill
.mdfiles. Both layouts supported: - parse_
skill_ md - Parse a
SKILL.mddocument into aSkill. - register_
discovered_ skills_ into - Register all discovered skills into the given
SkillRegistry. Returns the number of skills added.