pi-skill-retriever

Keyword-based skill retrieval for the Pi coding agent — scores your prompt against all discovered skills each turn and injects the top matches as context. Zero LLM calls, zero config.

Packages

Package details

extensionskill

Install pi-skill-retriever from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-skill-retriever
Package
pi-skill-retriever
Version
0.1.1
Published
Aug 30, 2026
Downloads
319/mo · 16/wk
Author
nadimtuhin
License
MIT
Types
extension, skill
Size
18.7 KB
Dependencies
0 dependencies · 1 peer

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-skill-retriever

npm version License: MIT

Keyword-based skill retrieval for the Pi coding agent.

Scores your prompt against every discovered skill (name + description) each turn and injects the top matches as a hidden context message telling the agent which SKILL.md files to read first.

Zero LLM calls. Zero config. Works with any number of installed skills.

Why

Pi already lists all skills in the system prompt, but with dozens (or hundreds) installed, the model skims past them. pi-skill-retriever surfaces the 3–5 most relevant skills per turn so they actually get loaded.

your prompt ──▶ keyword score vs all skills ──▶ top-5 injected as context
                 (name match ×2, description ×1)

Install

pi install pi-skill-retriever

Or manually add to ~/.pi/agent/settings.json:

{
  "packages": ["npm:pi-skill-retriever"]
}

Commands

Command Action
/sr Show status (on/off, skills indexed)
/sr off / /sr on Toggle injection
/sr <query> Preview what would be injected for a query

How it works

  1. On before_agent_start, reads the full skill list from systemPromptOptions.skills
  2. Tokenizes the prompt (stopwords dropped)
  3. Scores each skill: token found in name = 2, in description = 1
  4. Injects top 5 (score ≥ 2) as a hidden message with skill paths and descriptions

Skills with disable-model-invocation: true are excluded.

Tuning

Constants at the top of src/index.ts:

  • MAX_INJECT — max skills per turn (default 5)
  • MIN_SCORE — injection threshold (default 2)

Credits

  • Hermes Agent skill-retriever plugin (Donald Thompson & contributors, MIT) — the flat-index keyword pre-filter approach this extension adapts from.
  • Pi coding agent (Earendil Works / Mario Zechner) — the extension API this builds on.

License

MIT © Nadim Tuhin