How this skill is triggered — by the user, by Claude, or both
Slash command
/bh:commit-cnThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
生成遵循 [Conventional Commits](https://www.conventionalcommits.org/) 规范的中文 commit message。
生成遵循 Conventional Commits 规范的中文 commit message。
仓库: !git rev-parse --is-inside-work-tree 2>/dev/null || echo "NOT_A_GIT_REPO"
分支: !git branch --show-current 2>/dev/null
状态:
!git status --short 2>/dev/null
Staged 文件概览:
!git diff --staged --stat 2>/dev/null
最近提交(风格参考):
!git log --oneline -5 2>/dev/null
Staged diff:
!git diff --staged 2>/dev/null | head -500
<type>(<scope>): <描述> 这一行git add — 只提示用户手动运行NOT_A_GIT_REPO → 告知用户"不是 git 仓库",停止git add 暂存文件",停止利用上方注入的上下文:
| Type | 使用场景 |
|---|---|
feat | 新增用户可见的功能 |
fix | 修复错误行为 |
docs | 仅修改文档/注释 |
style | 仅修改格式,无逻辑变更 |
refactor | 重构代码,不改变行为 |
perf | 可量化的性能提升 |
test | 新增或修改测试 |
build | 构建系统或依赖变更 |
ci | CI 配置变更 |
chore | 杂项维护任务 |
revert | 回滚之前的提交(body 中需注明被回滚的提交 SHA 或原始标题) |
按优先顺序:
feature/auth-login → authsrc/auth/ → authButton.tsx → buttonauth,api(非标准扩展,部分 CI 工具可能不支持)参考最近提交中的 scope 命名风格,与项目保持一致。
type(scope): 后接英文描述(冒号后有空格)Body 始终生成,使用散文句子解释为什么做这个改动:
必须严格按以下顺序执行,不能省略或调换:
AskUserQuestion 工具询问输出模板如下:
```text
<complete commit message>
```
禁止行为:
AskUserQuestion如果因为上下文或工具调用导致这条回复里没有成功展示代码块,必须先重新输出完整 commit message,再进入确认步骤。
然后询问:
"请确认上方的 commit message,是否执行提交?(是 / 否 / 修改)"
必须等待用户明确回复,在收到回复前绝对不能调用 git commit。
仅在步骤 6 用户明确确认后执行:
git commit -s -m "$(cat <<'EOF'
<commit message>
EOF
)"
| 部分 | 语言 |
|---|---|
| Type / Scope / Footer 关键词 | 始终英文 |
| 标题描述 | 始终英文 |
| Body | 中文 |
feat(auth): add user login
实现了基于 JWT 的用户认证流程。选择 httpOnly cookie 存储
refresh token 以避免 XSS 攻击风险。
fix(api): fix null pointer exception in user query
之前代码假设 user 对象始终存在,但在未登录状态下会导致
崩溃。通过提前判空并返回统一错误格式修复此问题。
refactor(db): extract query builder into standalone module
查询构建代码分散在 4 个 repository 文件中导致重复维护。
集中管理后更易于后续添加查询缓存机制。
npx claudepluginhub blackhole1/bh-skills --plugin bhGenerates commit messages following Conventional Commits standard. Use /commit to auto-analyze staged changes and produce structured messages with type, scope, subject, body, and footer.
Provides Chinese-language conventions for commit messages (Conventional Commits adaptation), changelog generation, and commitizen/commitlint/husky configuration. Helps Chinese-speaking teams write structured commit messages and generate changelogs automatically.
Generates Conventional Commits messages for staged git changes and commits them. Follows v1.0.0 spec with types like feat, fix, refactor. Use for standardized commits or /commit invocation.