用途:按 Conventional Commits 规范创建 git 提交,帮助生成结构化的提交信息。
主要能力:支持 type/scope/subject 格式;scope 为必填且使用 kebab-case(如 validation、auth、cookie-service、api);在标准 CC 类型之外额外支持 security 类型,用于漏洞修复或安全加固;支持通过 HEREDOC 创建多行提交信息。
使用方式:先暂存更改,再创建提交。
git add <files> git commit -m "type(scope): subject"
多行提交示例:
git commit -m "$(cat <<'EOF' feat(validation): add URLValidator with domain whitelist
Implement URLValidator class supporting:
- Domain whitelist enforcement
- Dangerous scheme blocking
Addresses Requirement 31 Part of Task 5.1 EOF )"
规则:始终先检查 CLAUDE.md 约定,若项目格式不同则使用项目格式;始终在括号中包含 scope;subject 使用现在时祈使动词;subject 不以句号结尾;subject 不超过 50 字符;不使用泛化信息(如 update code、fix bug、changes);将相关更改合并为一个聚焦的提交。
参考资料:references/commit_examples.md 提供按类型划分的扩展示例及好坏对比。
限制:资料未提供安装命令、平台支持、收费或价格信息。