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

git-commit-review-tool

v1.0.2

Published

Automated code review tool for Git commits using multi-agent analysis

Readme

Git Commit Review Tool

一个基于多代理系统的 Git 提交审查工具,能够自动分析代码变更并识别潜在问题。

功能特性

  • 🔍 多代理审查系统: 使用多个专门的代理并行分析代码
  • 📊 置信度评分: 每个问题都有 0-100 的置信度评分
  • 🎯 智能过滤: 自动过滤低置信度问题,减少误报
  • 📋 CLAUDE.md 支持: 自动查找并应用项目特定的代码规范
  • 🚀 高性能: 支持并行执行,快速完成审查
  • 📄 多种输出格式: 支持控制台、JSON、Markdown 格式输出

安装

npm install
npm run build

使用方法

基本用法

# 审查指定的提交
node dist/cli.js <commit-hash>

# 示例
node dist/cli.js abc1234

高级选项

# 指定仓库路径
node dist/cli.js abc1234 -r /path/to/repo

# 输出为 JSON 格式
node dist/cli.js abc1234 -f json

# 保存报告到文件
node dist/cli.js abc1234 -o report.md

# 设置置信度阈值
node dist/cli.js abc1234 --confidence 90

# 禁用并行执行
node dist/cli.js abc1234 --no-parallel

# 详细输出
node dist/cli.js abc1234 -v

配置管理

# 创建默认配置文件
node dist/cli.js config --init

# 查看当前配置
node dist/cli.js config --show

查看可用代理

node dist/cli.js agents

代理系统

工具包含以下内置代理:

1. 合规性代理 (Compliance Agent)

  • 命名规范检查: 验证文件名和变量名是否符合约定
  • 代码结构检查: 检查函数长度、导入顺序等
  • CLAUDE.md 规则: 应用项目特定的代码规范

2. 错误扫描代理 (Bug Scanner Agent)

  • 空指针检查: 识别潜在的空指针引用
  • 边界检查: 检测数组越界等问题
  • 异步错误: 发现 async/await 使用问题
  • 资源泄漏: 检测未清理的事件监听器等

3. 历史分析代理 (History Analyzer Agent)

  • 热点分析: 识别频繁修改的代码区域
  • 回滚模式: 检测可能的问题代码模式
  • 作者模式: 分析代码修改模式

配置文件

工具支持通过 git-review.config.json 文件进行配置:

{
  "confidenceThreshold": 80,
  "parallelExecution": true,
  "defaultTimeout": 30000,
  "excludePatterns": [
    "node_modules/**",
    "dist/**",
    "*.min.js"
  ],
  "codeExtensions": [
    ".js", ".ts", ".jsx", ".tsx",
    ".py", ".java", ".cpp", ".go"
  ],
  "agents": [
    {
      "id": "compliance-naming",
      "name": "Compliance Agent (Naming)",
      "enabled": true,
      "timeout": 30000,
      "confidenceThreshold": 80
    }
  ]
}

输出格式

控制台输出

默认的彩色控制台输出,包含问题摘要和详细信息。

JSON 输出

结构化的 JSON 格式,适合程序化处理:

{
  "commitHash": "abc1234",
  "timestamp": "2024-01-01T00:00:00.000Z",
  "summary": {
    "totalIssues": 3,
    "highConfidenceIssues": 2,
    "issuesByType": {
      "bug": 1,
      "compliance": 2
    },
    "issuesBySeverity": {
      "high": 1,
      "medium": 2
    }
  },
  "issues": [...],
  "agentResults": [...]
}

Markdown 输出

适合文档和报告的 Markdown 格式。

退出码

  • 0: 无问题或仅有低严重性问题
  • 1: 发现高严重性问题
  • 2: 发现严重问题
  • 3: 工具执行错误

CLAUDE.md 支持

工具会自动查找项目中的 CLAUDE.md 文件并应用其中定义的规则。支持:

  • 命名约定规则
  • 代码结构要求
  • 安全性检查
  • 性能要求

开发

项目结构

src/
├── agents/          # 代理实现
├── core/           # 核心功能
├── types/          # 类型定义
├── utils/          # 工具函数
├── cli.ts          # 命令行接口
└── index.ts        # 主入口

添加新代理

  1. 继承 BaseAgent
  2. 实现 reviewFile 方法
  3. AgentFactory 中注册

构建和测试

# 构建
npm run build

# 开发模式
npm run dev

# 代码检查
npm run lint

# 格式化代码
npm run format

许可证

MIT License