Skip to content
FunCoding

git-commit

Star
566
License
MIT
Last commit
Nov 30, 2026

skills/git-commit/SKILL.md

View on GitHub

Git Commit 技能

触发条件

当用户说以下内容时激活:

  • "帮我提交代码"
  • "commit 一下"
  • "保存进度"
  • "check in"

工作流程

1. 检查变更

git status
git diff --staged
git diff

2. 分析变更类型

根据变更内容判断类型:

类型说明示例
feat新功能新增 API 端点
fixBug 修复修复空指针异常
docs文档变更更新 README
style代码格式格式化、去尾部空格
refactor重构提取公共函数
test测试新增单元测试
chore构建/工具更新依赖版本

3. 生成提交信息

格式:<type>(<scope>): <subject>

feat(auth): 添加 OAuth2 登录支持

- 集成 Google 和 GitHub OAuth2 provider
- 添加 token 刷新机制
- 登录成功后重定向到 dashboard

4. 执行提交

git add <相关文件>
git commit -m "<提交信息>"

注意事项

  • 提交信息用中文描述(除非用户指定英文)
  • 一次提交只做一件事,不要混合多个不相关变更
  • 不要提交 .env、密钥等敏感文件
  • 如果 pre-commit hook 失败,先修复问题再提交

Similar Skills

rea-ci-tests-audit

MOmorluto/rea485k9,215 new stars in the last 7 days

rea-changelog-update

MOmorluto/rea485k9,215 new stars in the last 7 days

wizard

MAmattpocock/skills336k5,004 new stars in the last 7 days

pr

MAmattpocock/skills336k5,004 new stars in the last 7 days

triage

MAmattpocock/skills336k5,004 new stars in the last 7 days

Featured

git-guardrails-claude-code

Block dangerous git commands like push and reset --hard before they execute.

MAmattpocock/skills336k5,004 new stars in the last 7 days