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

pi-skill-guard

v0.1.6

Published

Pi extension that guards against common LLM tool call mistakes: missing skill documentation injection, unknown tool bash fallback, and edit/write/read field name normalization

Readme

pi-skill-guard

一个 pi 扩展,用于防止常见的模型错误:错误的工具名称、缺失的 skill、损坏的参数模式以及字段名不匹配。

安装

pi install npm:pi-skill-guard

功能说明

该扩展通过 message_end 事件拦截工具错误,并在 LLM 看到失败之前静默修复。包含三种保护:

1. Skill 文档注入

当模型调用与可用 skill 同名的工具时(例如 brave-search),扩展将"未找到"错误替换为 skill 的 SKILL.md 内容。

修复前: Tool brave-search not found(错误) 修复后: 完整的 SKILL.md 内容作为成功的工具结果注入

2. Bash 命令执行

当模型调用包含 command 参数的未知工具时,扩展通过 pi 内置的 bash 工具执行。支持可选的 timeout(数字或字符串)。

修复前: Tool my-script not found(错误) 修复后: 实际的 bash 执行结果(含截断和临时文件管理)

3. 字段别名规范化(edit / write / read

当工具调用因字段名错误而验证失败时,扩展扫描原始参数、重命名常见别名并重新执行。

| 工具 | 标准字段 | 接受的别名 | |---|---|---| | edit | path | filefilePathfile_pathtargetfilenamefile_name | | edit | edits[].oldText | old_strold_stringoldContentoldoriginalsearch | | edit | edits[].newText | new_strnew_stringnewContentnewreplacementreplace | | write | path | filefilePathfile_pathtargetfilenamefile_name | | write | content | textbodycodedatafileContentcontents | | read | path | filefilePathfile_pathtargetfilenamefile_name | | read | offset | startstartLinestart_linefromline | | read | limit | linesmaxLinesmax_linescountnumLinesnum_lines |

Edit 工具简写支持: 如果未提供 edits 数组,顶层的 oldText/newText(或它们的别名)会被自动包装为单元素 edits 数组。

Read 工具类型转换: offsetlimit 的字符串值(例如 "10" 而不是 10)会在有效时自动转换为数字。


架构

所有拦截均在 message_end 事件中处理,该事件在每条消息完成后触发,并支持原地替换消息。每个工具调用通过 ID 跟踪,防止在替换链中重复处理。

  • session_start:加载 skills,缓存文件路径
  • turn_end:清除已处理的工具调用跟踪
  • message_end:检查错误结果,应用保护机制