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

dsh-tool-code-review

v0.1.0

Published

DSH plugin: structured code review tool — Agent reads git diff, reviews for bugs/security/style, outputs actionable findings.

Downloads

48

Readme

dsh-tool-code-review

DSH 插件:结构化代码审查 — Agent 读取 git diff,按 checklist 逐项审查,输出可操作的发现。

工具

| 工具 | 功能 | |------|------| | review_diff | 获取并解析 git diff,返回结构化文件变更摘要 | | review_file | 读取文件指定行范围(带行号,方便定位问题) | | review_checklist | 生成审查 checklist(bugs/security/style/performance/tests/docs) |

使用示例

User: 帮我 review 一下当前的改动

Agent:
→ review_diff({ target: "main" })
  // 获取与 main 分支的 diff,了解改了什么
→ review_checklist({ checks: ["bugs", "security"] })
  // 生成要检查的点
→ review_file({ path: "src/auth.ts", startLine: 45, endLine: 80 })
  // 深入看可疑的代码段

审查结果:
1. [Security] src/auth.ts:52 — 用户输入直接拼接到 SQL,存在注入风险
2. [Bug] src/handler.ts:28 — async 函数缺少 try/catch,错误会被吞掉
3. [Style] src/utils.ts:15 — 未使用的 import

配置

- insert:
    - id: code-review
      name: dsh-tool-code-review
      config:
        maxDiffLines: 500
        defaultChecks: [bugs, security, style, performance]

审查维度

| 维度 | 检查项 | |------|--------| | bugs | 越界、空指针、async 错误处理、竞态、资源泄漏 | | security | SQL 注入、XSS、命令注入、硬编码密钥、路径遍历 | | style | 命名不一致、死代码、过度复杂、缺少错误消息 | | performance | N+1 查询、热路径大分配、缺分页、同步 I/O 阻塞 | | tests | 新代码无测试、边界未覆盖、flaky 模式 | | docs | API 变更无文档、配置变更未说明、Breaking change 无迁移指南 |

与 dsh-agent-eval 配合

可以定义 eval 任务验证审查质量:

{
  "id": "catch-sql-injection",
  "prompt": "Review this diff and find the security issue",
  "expectedOutcome": { "type": "output_contains", "substring": "SQL injection" }
}

License

MIT