SuperAPI AI 工具集

git-commit-cn

通用与其它

查看项目

更新于 10-15 20:05

技能介绍

用途:为 Git 改动安全地生成并执行中文 Conventional Commits 提交,默认只处理已暂存内容,避免误提交未暂存或未跟踪文件。

主要能力:按 preflight→split plan→classify→compose→commit/draft→verify 顺序执行;先检查 git status --short 与 diff,判断改动归属;对混合改动输出拆分计划而非强行提交;按类型、scope、emoji 与 breaking change 规则分类;用包装脚本生成提交信息,支持 --body-line、--closes、--refs、--footer-line、--breaking-header、--breaking、--no-emoji;默认带 emoji,类型用英文,scope 与正文优先中文。

使用方式:默认 staged-only,仅提交已暂存集合;仅当用户明确说“所有改动”“全部改动”“不管有没有 stage”“包括未跟踪文件”等才进入 all-changes 模式。生成信息时解析脚本路径:Bash/zsh/macOS/Linux 用 COMMIT_COMPOSER="$SKILL_DIR/scripts/compose_commit_message",PowerShell 用 $COMMIT_COMPOSER = "$SKILL_DIR/scripts/compose_commit_message.ps1";执行时 Bash 用 bash "$COMMIT_COMPOSER" ...,PowerShell 用 & "$COMMIT_COMPOSER" ...。提交时把信息写入文件并用 git commit -F <message-file>;all-changes 单次原子提交先 git add -A。若可用 rtk,可用 rtk git status、rtk git diff --staged、rtk git diff、rtk git commit -F <message-file>。

适用场景:需要规范化中文提交信息、拆分混合改动、附加 issue 或 breaking change 说明的 Git 工作流。

限制:默认不推送、不添加 Co-Authored-By 或署名行;staged-only 无暂存改动时停止;all-changes 无任何改动时停止;拆分不明确时只输出计划,不做 hunk 级操作;hook 拒绝时立即停止并报告原始失败,不静默改写信息。参考资料包括 references/commit-types.md、references/message-rules.md、references/split-strategy.md。