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

madoka-opencode-git-check

v0.1.3

Published

OpenCode 插件 — 一键扫描、分类、审查并提交代码

Readme

madoka-opencode-git-check

OpenCode 插件 — 一键扫描、分类、审查并提交代码

为 OpenCode 提供完整的 Git 工作流能力:扫描工作目录、智能分类、预提交质量检查、暂存/提交、以及 .gitignore 智能生成。

功能

  • 智能分类:按 8 类自动归类变更文件(源码、配置、文档、测试、样式、资源、构建产物、其他),标注状态与增删行统计
  • 预提交检查:检测冲突标记、调试语句、敏感信息、大文件、TODO 标记,并自动运行项目 lint
  • 安全落盘:gitignore_write 使用 fs.writeFile 直接写入,避免 shell 转义问题
  • 跨平台:基于 node:fs 与 git -C 实现,不依赖 bash,Windows / macOS / Linux 通用
  • UTF-8:全量 UTF-8 编码,中文提交信息无乱码

工具

| 工具 | 说明 | |------|------| | git_scan | 扫描工作目录所有变更并按 8 类自动分类 | | git_stage | git add 全部或指定文件 | | pre_commit_check | 检查暂存区(冲突/调试/敏感信息/TODO/大文件/lint)+ 返回 diff | | git_commit | git commit -m 仅本地提交,不推送 | | gitignore_scan | 扫描项目结构,给出 .gitignore 建议 | | gitignore_write | 写入 .gitignore |

命令

| 命令 | 说明 | |------|------| | /commit | 中文提交流程(扫描 → 分类 → 暂存 → 检查 → 审查 → 提交) | | /commit:en | 英文提交流程 | | /gitignore | 生成 .gitignore 流程 |

安装

发布后

在你的 opencode.json 中添加:

{ "plugin": ["madoka-opencode-git-check"] }

本地开发 / 调试

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

本地开发

npm install
npm run build      # 输出 dist/
npm run dev        # watch
npm run typecheck  # 类型检查

项目结构

src/
  index.ts          # 插件入口:注册 config + 6 tools + 3 commands
  lib/
    scanner.ts      # git_scan 逻辑 + 分类/格式化
    checks.ts       # pre_commit_check 逻辑
    stage.ts        # git_stage
    commit.ts       # git_commit
    ignore.ts       # gitignore_scan/write

协议

MIT