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

prompt-polish-pi

v0.0.3

Published

Expand short Pi prompts into complete, previewable instructions

Readme

Prompt Polish for Pi

把 Pi 输入框里的短需求扩成一段可预览、可执行的提示词。 会带上当前项目里真正相关的路径和约定,但不会把仓库说明书整段贴进结果。

怎么用

把扩展文件放到 Pi 的扩展目录:

~/.pi/agent/extensions/prompt-polish.ts

重启 Pi 或执行 /reload 后,在输入框写下原始需求,按 Ctrl+R 即可强化。 也可以使用命令:

/polish

强化结果会先进入预览:

  • Enter:采用结果并写回输入框
  • Esc:取消
  • Up / Down:逐行滚动
  • PageUp / PageDown:快速滚动

特性

  • 复用 Pi 当前会话的模型和认证
  • 短句扩成一段完整需求,不用标题模板
  • 只读取项目名片级上下文,避免全量扫盘
  • 对项目上下文设置安全文件过滤,不读取 .env、密钥和凭据文件
  • /polish-setting 可开关 Magic Context、context-mode 是否织进强化结果
  • 用户在模型请求期间修改输入时,不覆盖新输入

配置快捷键

默认快捷键是 ctrl+r,可以在启动 Pi 时修改:

pi --extension /path/to/prompt-polish.ts --polish-key ctrl+shift+p

扩展始终跟随当前 Pi 会话的模型,不单独配置模型或 API Key。

插件开关

/polish-setting
  • 只列出本机已安装的插件
  • Enter 切换,Esc 关闭
  • 配置写在 ~/.pi/agent/prompt-polish.json
  • 开关的是「强化时是否引用」,不是装卸插件本身

直接加载

不复制文件也可以通过开发参数加载:

pi --extension /path/to/prompt-polish.ts

在本仓库中运行:

npm install
npm run self-check
npm run typecheck

从 npm 安装

npm install prompt-polish-pi

安装后,将包中的 prompt-polish.ts 注册为 Pi 扩展,或直接使用本地路径加载:

pi --extension node_modules/prompt-polish-pi/prompt-polish.ts

工作方式

  1. 记录当前输入,避免异步请求期间的输入变化造成误覆盖。
  2. 读取 README、AGENTS.md、package.json 等摘要作为项目事实。
  3. 使用 Pi 当前模型把短句扩成一段可执行需求。
  4. 展示原文与强化结果,只有用户按 Enter 才写回输入框。

项目上下文仅作为事实参考,不会被当作需要执行的指令。

目录结构

prompt-polish-pi/
├── prompt-polish.ts  # Pi 扩展入口
├── self-check.ts     # 最小行为自检
├── package.json      # npm 包配置
└── tsconfig.json     # TypeScript 配置

许可证

暂未指定许可证。发布包仅包含本项目源码和使用说明。