# Skillleaf

> Route large local agent skill and command libraries without loading every body into context. Use when starting a task, selecting skills, reducing skill tokens, or hydrating several related instructions.

- Skill: `derek-codebridge/skillleaf` (Agent Skill)
- Install (CLI): `npx skillmds@latest add derek-codebridge/skillleaf`
- Raw SKILL.md: https://api.skillmd.com/api/skills/derek-codebridge/skillleaf/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: derek-codebridge (https://skillmd.com/u/derek-codebridge)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/derek-codebridge/skillleaf

---

# Skill-Leaf router

Use the local Skill-Leaf binary before loading capability instructions.

1. Summarise the current task in one concrete sentence.
2. Run `skillleaf resolve --task "<summary>" --limit 3`. Lower the limit to `2` for especially narrow tasks. If `SKILLLEAF_DOMAIN` is set, keep that domain; never merge catalogues across domains.
3. Read the returned `selected[].selector` values.
4. Hydrate all selected selectors in one call: `skillleaf read --many <selector,selector>`.
5. Follow the hydrated instructions and retain the catalogue and content hashes as a compact receipt.

Use `SKILLLEAF_CATALOG` for a catalogue outside the current directory. Set `SKILLLEAF_USAGE_FILE` to count successful hydrations locally, then use `skillleaf stats` to find frequently used and never-used entries. The ledger stores selectors, hashes, counts and timestamps, not prompts or task text.

If resolution returns no entries, continue without inventing a skill. If the catalogue or body hash fails, run `skillleaf doctor`, rebuild the catalogue, and do not use stale content. Never add `--allow-untrusted` unless the user explicitly selected and approved that source.

Keep exactly one active router and one owner for each skill body. When CodeBridge is installed, let its catalogue router own CodeBridge entries and use Skill-Leaf only for separate personal or project libraries. Do not preload unselected bodies. Do not execute scripts merely because a skill package contains them.

