← Catalog

pi-toggle-skills

Toggle skill visibility in pi's system prompt — flip disable-model-invocation on skills via an interactive TUI

ExtensionSkill

Install

Install with PiG

pig install npm:pi-toggle-skills

Install with Pi

pi install npm:pi-toggle-skills
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./toggle-skills.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.25 (README.md). PiG does not review it.

🔘 pi-toggle-skills

Toggle skill visibility in pi's system prompt

Flip disable-model-invocation on skills so the model only sees the ones you want.

pi extension license


The Problem

Pi loads skills from multiple directories and includes their names and descriptions in the system prompt. If you have many skills installed, the prompt gets noisy — the model sees every skill and may inappropriately trigger ones you rarely use.

Pi supports disable-model-invocation: true in SKILL.md frontmatter to hide a skill from the system prompt, but toggling it requires manually editing each YAML file. There's no interactive way to manage skill visibility.

The Solution

pi-toggle-skills gives you an interactive TUI to toggle which skills are visible to the model:

  • Discover all skills from the standard directories (~/.pi/agent/skills/, .pi/skills/, etc.)
  • Interactive /toggle-skills command — search, toggle, done
  • Flips disable-model-invocation directly in each SKILL.md's YAML frontmatter
  • Auto-reloads pi after saving so changes take effect immediately
  • Subcommands for quick CLI-style enable/disable

When a skill has disable-model-invocation: true, pi excludes it from the system prompt entirely. The skill is still available via explicit /skill:name commands — it just won't be suggested to the model automatically.

Usage

Interactive Commands

CommandWhat it does
/toggle-skillsOpen interactive TUI to toggle skill visibility
/toggle-skills statusShow current skills and their visibility status
/toggle-skills disable <name>Hide a skill from the system prompt
/toggle-skills enable <name>Show a skill in the system prompt
/toggle-skills listSame as /toggle-skills status
/toggle-skills helpShow usage reference

Interactive TUI Keybindings

KeyAction
EnterToggle selected skill
Ctrl+ADisable all (filtered if search active)
Ctrl+DEnable all (filtered if search active)
Ctrl+SSave changes (run /reload to apply)
EscCancel (discard changes)
Ctrl+CClear search, or cancel if empty
↑/↓Navigate the list

CLI Examples

/toggle-skills disable brave-search
→ Disabled: "brave-search" — hidden from system prompt. Run /reload to apply.

/toggle-skills enable brave-search
→ Enabled: "brave-search" — visible in system prompt. Run /reload to apply.

Installation

With pi install (recommended):

pi install npm:pi-toggle-skills

Or install from GitHub:

pi install https://github.com/monotykamary/pi-toggle-skills

With npm:

npm install pi-toggle-skills

Or in ~/.pi/agent/settings.json:

{
  "packages": ["https://github.com/monotykamary/pi-toggle-skills"]
}

Then /reload or restart pi.

For quick one-off tests:

pi -e ./toggle-skills.ts

How It Works

Session starts
  → Extension discovers skills from standard directories
  → Parses SKILL.md YAML frontmatter to check disable-model-invocation
  → Notifies how many visible/hidden skills

/toggle-skills (interactive):
  → Opens TUI selector listing all skills
  → Changes collected in-memory (no disk writes until Ctrl+S)
  → Ctrl+S: writes changed SKILL.md files, notifies user to /reload
  → Esc: discards changes, no files modified

/toggle-skills disable/enable:
  → Toggles disable-model-invocation in SKILL.md frontmatter
  → Adds the key when disabling, removes it when enabling (false is the default)
  → Validates with gray-matter and publishes the flag change atomically
  → User must /reload for changes to take effect

The extension does NOT monkey-patch any pi internals. It modifies SKILL.md files on disk and relies on pi's skill re-scanning on /reload to apply changes.

Frontmatter Changes

When disabling a skill, the extension adds disable-model-invocation: true to the SKILL.md frontmatter:

---
name: my-skill
description: Does things
disable-model-invocation: true # ← added
---

When enabling, the key is removed entirely (since false/absent are equivalent):

---
name: my-skill
description: Things done
---

The toggle preserves the body and the rest of the frontmatter. It skips a busy file, a visibility state changed since the picker opened, or YAML it cannot edit without reformatting. If a crash leaves an empty SKILL.md.lock directory, remove it only after confirming no process is editing that skill through this extension.

Skill Directories Scanned

The extension scans the same directories pi uses:

DirectoryScope
~/.pi/agent/skills/Global (pi-specific)
~/.agents/skills/Global (agent-standard)
.pi/skills/Project (pi-specific)
.agents/skills/Project (agent-standard)

Package skills, settings skills, and --skill paths are not currently scanned (they require reading settings.json and CLI args).

Comparison with Alternatives

ApproachProsCons
pi-toggle-skills (this)Interactive TUI; directly modifies SKILL.md; no intermediate config; auto-reload; batch changes with undoChanges require /reload; doesn't scan package/settings/CLI skills
Manual SKILL.md editingNo extension neededTedious; error-prone YAML editing; must remember frontmatter syntax
Deleting SKILL.md filesEffectiveDestructive; must restore to re-enable; can't toggle back easily

Development

npm install
npm test          # Vitest unit tests
npm run typecheck # TypeScript validation (pi-tui import error is expected — types resolve at runtime)
npm run lint:dead # Dead code detection (knip)

Structure

.
├── toggle-skills.ts        # Main extension
├── src/
│   ├── index.ts             # Constants, types, and utilities
│   ├── skill-discovery.ts   # Skill directory scanning, frontmatter parsing/writing
│   └── skill-selector.ts    # Interactive TUI component
├── __tests__/
│   └── unit/
│       ├── toggle-skills.test.ts
│       └── skill-discovery.test.ts
├── package.json
├── tsconfig.json
├── vitest.config.ts
└── knip.json

License

MIT

Pi 1.0 compatibility (0.1.20)

Tested against Pi 1.3.0 with exact SDK development pins and wildcard host peers. Real-host command registration and skill frontmatter toggling are verified, alongside selector IME/width tests.

Run bun run test:host for the offline real-host regression. Set PI1_HOST_PACKAGE to an installed Pi package directory and PI1_HOST_ENTRY=bundle to test its bundled CLI runtime.

Pi 0.99 compatibility (0.1.19)

Verified native 0.99 extension loading and skill-selector rendering. Custom-screen wrappers now forward focus to their Input, preserving IME cursor positioning across resize and invalidation.

Tested with Pi 0.99.0. Host-provided Pi packages are wildcard peers, not bundled dependencies; development uses exact 0.99.0 versions.