name: git-commit description: 使用 Conventional Commits 格式暂存并提交变更(仅本地,不 push)。 tags: [Git, Commit, Development, Workflow]
Git Commit
使用 Conventional Commits 格式暂存并提交变更。该 skill 只处理本地 commit,不会 push 到远端。
操作说明
检查 Git 状态
- 运行
git status查看全部变更 - 运行
git diff检查修改内容
- 运行
分析变更
- 审阅已变更文件及其内容
- 判断 commit type 和 scope
- 起草简洁的 commit message
Commit Type 参考
feat - 新功能 fix - Bug 修复 docs - 仅文档 style - 代码风格(格式、分号等) refactor - 代码重构(不含新功能/修复) perf - 性能优化 test - 新增或更新测试 chore - 构建、CI、工具链、依赖Commit Message 格式
<type>(<scope>): <subject> <body> Co-Authored-By: Claude <noreply@anthropic.com>- Subject:祈使句,不加句号,最长 72 字符
- Body:解释做了什么以及为什么做(小改动可省略)
- Scope:受影响模块(data、model、config、trainer、utils、workflow)
暂存并提交
- 用
git add暂存相关文件 - 不要暂存包含 secrets 的文件(
.env、credentials、tokens) - 使用格式化 message 创建 commit
- 用
git log --oneline -1验证
- 用
注意事项
- 该 skill 只做本地 commit。如需 push,请使用
git-pushskill。 - 提交前始终向用户确认 commit message。
- 如果不确定 type 或 scope,先询问用户。
