pi-load-skill
v1.2.4
Published
Pi extension for loading skills on demand from any location
Maintainers
Readme
pi-load-skill
Load your skills on demand from any location. Keep your pi agent lean — don't load all your skills when you don't need them, add only the ones you need for that session.
Features
- Load skills on-demand: Load individual skills or entire skill directories from any path
- Session-scoped: Skills persist in the session file and are restored automatically on
/reload,/resume,/fork, and pi restart - Native injection: Loaded skills appear in the system prompt with name, description, and location — the agent can read the full skill content on demand
- Unload skills: Remove loaded skills when no longer needed
Installation
Option 1: From npm
pi install npm:pi-load-skillOption 2: Local development
pi -e ./extensions/load-skills.tsUsage
Load Skills
Load all skills from a directory:
/load-skills ./path/to/skills-folderLoad a single skill:
/load-skills ./path/to/skill-folderThe extension will:
- Find all skills in the directory (or validate a single skill)
- Add them to pi's skill discovery system via
resources_discover - They appear in the
<available_skills>section of the system prompt with their file location - The agent can read the full skill content on demand using the
readtool
List Loaded Skills
/list-loaded-skillsUnload Skills
Unload a specific skill:
/unload-skills skill-nameUnload all loaded skills:
/unload-skillsExample
# Start pi
pi
# In the pi session:
/load-skills ./my-skills
# Skills now appear in the system prompt — the agent can use them
What skills do you have available?
# Unload when done
/unload-skillsHow It Works
- On
/load-skills: Skills are validated, added to the in-memory map, a snapshot is appended to the session file viapi.appendEntry(), and pi reloads - On any session transition (
/reload,/resume,/fork, pi restart):session_startfires, the extension replays the current branch viactx.sessionManager.getBranch(), finds the lastpi-load-skillsnapshot entry, and restores the map from it - On
/new: A fresh session has no prior entries — the map starts empty
Persistence Model
| Event | Skills in session |
|------------------------|---------------------------------------------|
| /load-skills | snapshot appended to session + reload triggered |
| /unload-skills | snapshot appended to session + reload triggered |
| /reload | branch replayed → skills restored ✓ |
| /new | fresh session, no entries → map empty ✓ |
| /resume | branch replayed → skills restored ✓ |
| /fork | branch up to fork point replayed ✓ |
| pi restart + resume | branch replayed → skills restored ✓ |
| pi restart (no resume) | fresh session → map empty ✓ |
Skill Format
Skills must follow the Agent Skills standard:
---
name: my-skill
description: What this skill does and when to use it.
---
# My Skill
## Usage
Instructions for using the skill...Requirements
- pi >= 0.65.0
- Node.js >= 18
License
MIT
Made with reespec and ❤️ in EU
