@2manov/pi-prompt-snippets0.1.0
Choose reusable text instructions to prepend or append to the next Pi message.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
Pi Prompt Snippets
Apply reusable instructions to the next message you send in Pi.
↑ PREPEND - added before your message
> [x] Session Kickoff - Get oriented and report back before starting work
↓ APPEND - added after your message
[x] Ask Questions - Clarify ambiguity before starting
[ ] Concise - Keep the response focused and compact
Snippets can be inserted before or after your draft. Selections are one-shot: they reset after one successful message transformation. The extension changes user message text only and does not modify the system prompt.
Install
Install from npm:
pi install npm:@2manov/pi-prompt-snippets
Or install the current main branch from GitHub:
pi install git:github.com/2manov/pi-prompt-snippets
For local development:
git clone https://github.com/2manov/pi-prompt-snippets.git
cd pi-prompt-snippets
npm install
pi -e ./extensions/index.ts
Use
- Type a draft in Pi.
- Open the picker with
/snippetsorAlt+S. - Move with Up and Down, then press Space to toggle a snippet.
- Press Tab to inspect the complete snippet text.
- Press Enter to apply the selection, or Escape to cancel it.
- Send your draft normally.
Applying a selection does not send or replace the editor draft. A compact widget above the editor shows the snippets waiting for the next message:
prepend · Session Kickoff
append · Ask Questions · Concise
Included snippets
Session Kickoffinspects the relevant project context before work begins.Ask Questionsasks for clarification when the request is ambiguous.Concisekeeps the response focused.Verify Workasks for an appropriate check before completion is reported.
Bundled snippets are examples as well as useful defaults. Override them or add your own with Markdown files.
Write a snippet
Create a .md file with YAML frontmatter and the instruction as its body:
---
name: Ask Questions
description: Clarify ambiguity before starting
placement: append
order: 10
---
Before starting, ask clarifying questions if anything is unclear.
Supported fields:
| Field | Default | Purpose |
|---|---|---|
name |
Filename stem | Label shown in the picker |
description |
Empty | Short explanation shown beside the name |
placement |
append |
Insert before or after the draft: prepend or append |
order |
9999 |
Sort order within the placement group |
disabled |
false |
Hide this snippet and lower-precedence versions with the same filename |
The filename without .md is the stable snippet identifier.
Directories are scanned non-recursively.
Snippet locations
Snippets are loaded in this order:
- Bundled snippets.
<agent-dir>/snippets/*.md, normally~/.pi/agent/snippets/*.md.<cwd>/.pi/snippets/*.mdfor trusted projects.
A later source overrides an earlier source with the same filename stem. Project snippets are never read before Pi marks the project as trusted.
Message behavior
The final message is assembled as:
prepend snippets
original draft
append snippets
Empty sections are omitted. The extension preserves image attachments and the message delivery mode. Slash commands and extension-originated messages do not consume the current selection.
Snippet files are read again immediately before the message is sent. If a selected file was removed or became invalid, the extension blocks the send, restores the draft, and asks you to review the selection instead of silently sending a partial result.
Development
Requirements:
- Node.js 20 or newer
- Pi
0.85.1or newer - Python with
pexpectfor the real-TUI E2E test
Run the full local verification:
npm ci
npm run check
npm run pack:dry-run
npm run pack:smoke
npm run e2e:pi
The E2E test runs Pi in an isolated temporary agent directory against a local mock provider. It does not modify the user's Pi configuration or make paid model requests.