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

ocdx

v0.1.5

Published

A simple hello world OpenCode plugin

Readme

OCDX OpenCode Plugin

这是一个可安装的 OpenCode 插件(npm 包名:ocdx),提供一个主要 slash 命令:

  • /pr-review-loop:多模型 PR Review + 自动修复 loop

使用者快速上手(OpenCode 用户)

1) 安装插件

在你的项目 opencode.json 加上插件:OpenCode 会在启动时用 Bun 自动安装 npm 插件。

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["ocdx"]
}

安装后你会获得 slash 命令:

  • /pr-review-loop

OpenCode 插件机制参考:https://opencode.ai/docs/plugins/

1.1) 运行前置条件(/pr-review-loop 必需)

/pr-review-loop 会调用外部 CLI(见 src/pr-review-loop/preflight.ts 的 preflight 检查),因此你需要:

  • 已安装并登录 GitHub CLI:gh auth login
  • 已安装 dx CLI,并且至少包含 dx lintdx build 子命令
  • 在一个 git 仓库内运行
  • 工作区必须干净(git status --porcelain 为空)
  • 必须在一个真实分支上(不能 detached HEAD)

2) 配置 OCDX(必需)

推荐在项目根目录创建 .opencode/ocdx/config.json

  • 这是“项目级配置”,优先级最高
  • 如果没有项目级配置,会回退到全局配置 ~/.config/opencode/ocdx/config.json(或 XDG_CONFIG_HOME
  • 如果两者都不存在,会使用插件内置默认值(见 @asset/config.json
{
  "reviewerModels": ["anthropic/claude-3-7-sonnet-20250219"],
  "commentsAnalyzerModel": "anthropic/claude-3-5-haiku-20241022",
  "prFixModel": "anthropic/claude-3-7-sonnet-20250219"
}

字段说明(最常用):

  • reviewerModels:1-5 个 reviewer 模型(会并行跑)
  • commentsAnalyzerModel:评论线程分析模型(用于判断是否存在未解决的人类 review 阻塞项)
  • prFixModel:自动修复模型
  • prompts.*:覆盖默认 prompt(可选;默认使用插件内置 prompt)

3) 使用命令

/pr-review-loop
/pr-review-loop --pr <PR_NUMBER>

说明:

  • 不传 --pr 时会尝试从当前分支自动检测 PR
  • preflight 不通过时会直接给出可执行的错误提示(例如 gh 未登录、dx 不存在、工作区不干净等)

开发者说明(维护/发布)

本地开发

pnpm install
pnpm run build
pnpm run lint
pnpm run format:check

打包(生成 tgz)

prepack 会自动 clean + build,保证 dist/ 存在:

pnpm pack

发布到 npm

pnpm publish

发布前建议检查包内容:

npm pack --dry-run

插件暴露的工具/子代理(给开发者定位问题用)

  • tools:ocdx_pr_review_loop
  • commands:/pr-review-loop
  • subagents:ocdx-reviewerocdx-comments-analyzerocdx-pr-fix

参考文档

  • docs/pr-review-loop-reference.md
  • OpenCode Plugins: https://opencode.ai/docs/plugins/

License

MIT