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

@suwenguang/pi-rules

v0.1.3

Published

pi-rules 的 AGENTS.md 裁剪版:read/edit/write 时按目录向上回溯注入 AGENTS.md,不加载 .cursor/.claude/.omo/.github 规则与用户级规则;零依赖,直接以 TS 源码运行。

Readme

pi-rules(AGENTS.md 裁剪版)

给 pi coding agent 用的规则注入扩展:读 / 改 / 写文件时,按目录向上回溯把沿途每一层的 AGENTS.md 注入上下文,让子目录约定在需要的那一刻才出现,不占常驻上下文。

本包是 pi-rules 的本地裁剪版,与原版的行为差异:

  • 只收集 AGENTS.md,不再扫描 .cursor/ .claude/ .omo/ .github/ 的规则目录;
  • 不加载用户级规则;
  • 去掉 picomatch 依赖,零依赖,以 TS 源码直接运行。

安装

pi install npm:@suwenguang/pi-rules

也可以从 Git 安装(国内可换 git:gitee.com/suveng/pi-rules):

pi install git:github.com/suveng/pi-rules

用法

装好后不需要额外配置。在 pi 里:

  • /rules —— 查看当前会话已加载 / 命中了哪些 AGENTS.md、各自多少字符;
  • /reload-rules —— 改完 AGENTS.md 后立刻重载,不必重启会话;
  • 环境变量 / 启动参数:
    • PI_RULES_DISABLED=1(或 --pi-rules-disabled)—— 临时关掉整个扩展;
    • PI_RULES_MODE=static|dynamic|both|off(或 --pi-rules-mode)—— 注入时机, static 只在一开始注入,dynamic 随工具调用按路径注入,both 两者都要,off 等于关闭;
    • PI_RULES_MAX_RULE_CHARS / PI_RULES_MAX_RESULT_CHARS —— 单条规则 / 单次结果的字符上限,超出会截断。

与上游的关系

行为参考 oh-my-openagent(omo)的 rules-injector,授权与出处见 NOTICE。本仓是独立维护的裁剪分支,与上游没有同步承诺。

仓库来源(维护者看)

代码的原始位置是本机 monorepo 里的 .pi/pi-rules/,这里是一份镜像仓,用于发布 npm 包。 改完源目录后同步过来:

bash scripts/sync-from-monorepo.sh /Users/kiki/doger/ev/vkk_client_flutter

脚本只同步 src/、LICENSE、NOTICE,不会覆盖本仓的 package.json、README.md、.github/。

发布(维护者)

npm 包名 @suwenguang/pi-rules,由 GitHub Actions 走 OIDC 信任发布,仓库内不放任何 token。

npm version patch --no-git-tag-version
git commit -am "chore(发布): 0.1.2"
git tag v0.1.2
git push origin main v0.1.2      # 触发 Actions

成功征兆:Actions 变绿且日志末尾出现 + @suwenguang/pi-rules@<ver>,并且 npm view @suwenguang/pi-rules version --registry=https://registry.npmjs.org 在 1-2 分钟后返回新版本号(期间 404 是正常的风控延迟)。

Trusted Publisher 配置(改包名 / 改工作流文件名时要同步改): https://www.npmjs.com/package/@suwenguang/pi-rules/access —— Publisher GitHub Actions、Organization suveng、Repository pi-rules、Workflow filename publish.yml、Environment 留空。