omp packages

@2manov/pi-prompt-snippets0.1.0

Choose reusable text instructions to prepend or append to the next Pi message.

2manov Published 1 month ago MIT ~152 downloads/mo

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.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

Pi Prompt Snippets

CI

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

  1. Type a draft in Pi.
  2. Open the picker with /snippets or Alt+S.
  3. Move with Up and Down, then press Space to toggle a snippet.
  4. Press Tab to inspect the complete snippet text.
  5. Press Enter to apply the selection, or Escape to cancel it.
  6. 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 Kickoff inspects the relevant project context before work begins.
  • Ask Questions asks for clarification when the request is ambiguous.
  • Concise keeps the response focused.
  • Verify Work asks 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:

  1. Bundled snippets.
  2. <agent-dir>/snippets/*.md, normally ~/.pi/agent/snippets/*.md.
  3. <cwd>/.pi/snippets/*.md for 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.1 or newer
  • Python with pexpect for 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.

License

MIT