💡 摘要
一个在 Claude Code 会话后自动运行代码质量验证(代码检查、格式化、类型检查、测试)的 CLI 工具。
🎯 适合人群
🤖 AI 吐槽: “它就像你 AI 生成代码的直升机父母,在代码能出去玩耍之前不断检查它的作业。”
安装方法(`curl | bash`)和插件自动安装带来了供应链风险,会执行不受信任的代码。该工具还通过验证插件拥有广泛的文件系统和网络访问权限。缓解措施:审计并固定特定的插件版本,在沙盒环境中运行。
Han
Automatic quality gates for Claude Code. Every conversation ends with validation—linting, formatting, type-checking, and tests run automatically, catching issues before they ship.
Getting Started
Two commands. That's it.
# 1. Install the CLI curl -fsSL https://han.guru/install.sh | bash # 2. Auto-detect and install plugins for your project han plugin install --auto
Next time you use Claude Code, validation hooks run automatically when you finish a conversation.
Alternative Installation
# Homebrew (macOS/Linux) brew install thebushidocollective/tap/han
How It Works
- Install - One command installs the CLI and auto-detects plugins for your stack
- Code - Claude writes code as usual. No workflow changes needed
- Validate - Stop hooks run automatically. Linters, formatters, type checkers, and tests are all verified
- Learn - Local metrics track success rates and calibrate confidence. Nothing leaves your machine
Plugin Categories
139 plugins across four categories:
| Category | Description | Examples | |----------|-------------|----------| | Core | Essential infrastructure. Auto-installs han binary, provides metrics and MCP servers | Always required | | Jutsu (Tools) | Validation plugins for your stack | TypeScript, Biome, Pytest, RSpec, ShellCheck | | Dō (Agents) | Specialized AI agents | Code review, debugging, architecture, security | | Hashi (Integrations) | MCP servers for external tools | GitHub, Playwright, Blueprints |
Browse all plugins at han.guru/plugins
Why It Works
- Smart Caching - Only runs validation when relevant files change. Native Rust hashing keeps it fast
- Local Metrics - Tracks task success and confidence calibration. All data stays on your machine
- Zero Config - Binary auto-installs on first session.
--autoflag detects your stack automatically - Any Stack - TypeScript, Python, Rust, Go, Ruby, Elixir. If there's a linter, there's a plugin
CLI Commands
# Install plugins han plugin install # Interactive mode han plugin install --auto # Auto-detect your stack han plugin install <name> # Install specific plugin # Manage plugins han plugin search <query> # Search marketplace han plugin uninstall <name> # Remove plugin # Run hooks manually han hook run <plugin> <hook> # Run a specific hook han hook explain # Show configured hooks # MCP server han mcp # Start MCP server for natural language hook execution
Documentation
Full documentation at han.guru/docs
Contributing
See CONTRIBUTING.md for how to create new plugins.
License
MIT License - see LICENSE
Built by The Bushido Collective
优点
- 项目技术栈的零配置自动检测
- 仅对更改的文件运行验证以提高速度
- 本地指标确保隐私
- 适用于多种工具的可扩展插件生态系统
缺点
- 与 Claude Code 生态系统紧密耦合
- 插件质量可能参差不齐
- 为每次编码会话增加开销
- 需要信任自动安装的脚本
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 TheBushidoCollective.
