npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jmcombs/pi-prompt-enhancer

v4.0.0

Published

Codebase-aware prompt enhancer for the Pi coding agent — rewrites rough prompts into precise ones, with project tree, git context, and referenced file contents, before they reach the model.

Readme

@jmcombs/pi-prompt-enhancer

Codebase-aware prompt rewriting for the Pi coding agent. It turns a rough request into a precise one, then puts that rewrite back in the editor for you to review. Nothing is submitted until you say so.

The enhancer looks at your project tree, git status, any files the draft names, and the last few turns of the conversation, then rewrites the request instead of answering it. The original stays one keystroke away.

That last part is what makes a follow-up work: "help me with this skill" can be rewritten because the enhancer can see what "this" was. Only a small, capped slice of the conversation is sent, and it is sent to the enhancer model — the one shown on the status bar, which may not be the model running your session.

Install

pi install npm:@jmcombs/pi-prompt-enhancer

See the Pi packages documentation for git, local path, project-scoped install, and filtering options.

No extra API keys. It uses the model already active in your session, or one you pick with /prompt_enhance_model.

Quick start

  1. Type a rough request.
  2. Press Ctrl+Shift+E.
  3. Read the rewrite. Nothing has been sent.
  4. Press Enter to send, or Ctrl+Shift+Z for the original.

Commands

| Command | What it does | | --- | --- | | /prompt_enhance [text] | Rewrite the text you pass, or whatever is already in the editor. | | /prompt_enhance_model | Pick the enhancer model for the current session. Resets when Pi restarts. | | /prompt_enhance_revert | Put back the last prompt you wrote and enhanced. Once only; also clears when you send a prompt. | | /prompt_enhance_auto | Turn auto-enhance on or off for the current session. Off until you do. |

Shortcuts (also listed in /hotkeys):

  • Ctrl+Shift+E: enhance what is in the editor. Always works, even when auto-enhance would skip.
  • Ctrl+Shift+Z: revert the last enhance.

After an enhance, the footer reminds you how to revert. With auto-enhance on it also says Enter to send. Press Esc to cancel an enhance that is still running.

Press Ctrl+Shift+E again on a rewrite you have not touched and you get another rewrite of your original prompt, not a rewrite of the rewrite — press it a few times to see different approaches to the same request. The footer says Re-enhanced your original prompt when that is what happened, since a second rewrite can read much like the first. Edit the rewrite first and enhancing takes your edited text instead: an edit is you saying something, so it is what gets rewritten — and from then on it is what "again" means. Every further press re-rolls your edit, not the draft you started from, until you edit again.

So Ctrl+Shift+Z hands back the last thing you wrote and enhanced: your typed draft if you never edited a rewrite, otherwise your most recent edit. Getting back to the draft behind an edit is the editor's own undo, not this. Revert is once per chain, and a chain ends when you send something.

If you edit a rewrite and press Ctrl+Shift+Z without enhancing first, that edit is overwritten — the status line says later edits lost rather than claiming it gave you your own words back.

When an enhance does not work

A slow or unreachable model is retried a few times first, and the loader names the reason so you can decide to wait or press Esc:

Retrying (1/3) in 2s… · Connection error

Esc cancels and changes nothing else. If the retries run out, three things happen and nothing else:

  • your prompt goes back in the editor, exactly as you typed it;
  • auto-enhance turns itself off for the rest of the session, so the next Enter sends — turn it back on with /prompt_enhance_auto;
  • one message says so on the status bar, names the reason, and clears itself after a few seconds:
prompt enhancement failed (Connection error); your prompt is unchanged

Configuration problems are the exception. No active model, credentials that will not resolve, no API key for the model — those stay on screen as notifications, because pressing the key again cannot help until you have changed something.

The status bar

Prompt Enhancer displays in the Pi status bar with the enhancer model, when auto-enhance is enabled, and a short status after an action is taken. Here are the elements of the status bar:

  • Ready: a model is resolved. Enhance with Ctrl+Shift+E.
  • Auto on: /prompt_enhance_auto is armed. Enter rewrites; Enter again sends.
  • No model: pick one with /model or /prompt_enhance_model.
  • Enhancing: the call is out. Input is blocked until it lands; Esc cancels.
  • Review: a rewrite is in the editor and has not been sent. Ctrl+Shift+Z restores the original.

A Nerd Font is required for the mark and separators to render.

Auto-enhance on Enter

Off by default. Run /prompt_enhance_auto to turn it on for the current session. A green auto block on the status bar means it is on.

flowchart TD
    A[Type a request] --> B[Enter]
    B --> C[Rewrite appears in the editor]
    C --> D{Keep it?}
    D -->|Enter| E[Send to the model]
    D -->|Ctrl+Shift+Z| F[Original comes back]

Short replies like ok, yes, approved, or a brief answer to a question are skipped: on those turns you did not ask for a rewrite, so auto-enhance stands aside without a word. Naming a file is enough to count as a task, so fix foo.ts is not skipped.

Ctrl+Shift+E and /prompt_enhance enhance a skipped reply anyway. Pressing the key is asking for the call, and it is always made — whatever the draft says and however short it is. The one thing that stops it is an empty editor, which has nothing to send:

Nothing to enhance (editor is empty).

Requirements

| | | | --- | --- | | Node | ≥ 22.19.0 | | Pi | any recent version | | A Nerd Font | for the status bar mark and separators | | A configured model | at least one Pi model with an API key |

Development

This package lives in the pi-extensions monorepo. See CONTRIBUTING.md at the repo root for project conventions.

# From the repo root
npm ci
npm run check
npm run test -- packages/prompt-enhancer

# Try local changes (skip globally installed extensions so they do not collide)
pi --no-extensions -e ./packages/prompt-enhancer

License

MIT © Jeremy Combs