跳到正文
Skillpedia
部署与云(DevOps)11k · #11720

git-commit

它能做什么

这项技能指导 AI 以整洁的方式保存 git 项目中的改动。适合希望提交信息清晰、拉取请求描述完整的开发人员。

适用场景

  • ✓当你即将把改动提交到 git 项目时。
  • ✓当你的改动混杂了多个不相关的主题,需要拆分为独立的提交时。
  • ✓当你希望以清晰的标题和描述提交拉取请求的时候。

技能链接

https://github.com/spinabot/brigade/blob/main/skills/git-commit/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/spinabot/brigade/blob/main/skills/git-commit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请用清晰的提交信息提交我在这个项目中的改动,并向主分支提交一个拉取请求。”

每周 5 个新技能,1 分钟读完。

工作原理

AI 会精确检查哪些文件已暂存,用标准风格撰写简短的提交信息,并将不相关的工作拆分为独立的提交。对于拉取请求,它会推送分支,并使用 GitHub 命令行工具创建请求。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Git commits & PRs

Use this when committing changes or opening a pull request.

Before committing

  • Run git status and git diff --staged to see exactly what's going in. Never git add -A blindly — stage the files that belong to this change.
  • Keep one logical change per commit. If the diff does two unrelated things, make two commits.
  • Don't commit secrets, large binaries, or generated artifacts. Check .gitignore covers them.

Message format

Conventional Commits:

<type>(<optional scope>): <short imperative summary>

<optional body — what changed and WHY, wrapped at ~72 cols>

Types: feat, fix, docs, refactor, test, chore, perf, build, ci.

  • Summary in the imperative mood ("add", not "added"), ≤72 chars, no trailing period.
  • The body explains the reasoning a future reader needs — not a restatement of the diff.

Pull requests (gh CLI)

  • git push -u origin <branch> then gh pr create --fill (or --title/--body).
  • PR body: what changed, why, and how it was verified (tests run, manual checks).
  • Confirm the base branch is correct before creating.

Conventions to honor

Match the repository's existing style — read recent git log --oneline first and follow whatever format the project already uses if it differs from the above.

常见问题

它使用哪种提交信息风格?

它使用 Conventional Commits,这是一种标准格式,包含 fix 或 feat 等类型和一句简短摘要。

它会一次性添加所有文件吗?

不会。它只暂存属于该改动的文件,而不是把所有内容都加进去。

它会遵循项目自身的风格吗?

会。它会先阅读最近的提交历史,并遵循项目已有的风格。

详情

作者的原始描述

Stage, write, and structure git commits and pull requests cleanly. Read this before committing — for conventional-commit message format, when to split commits, and how to open a PR with the gh CLI.

repo: spinabot/brigade

热度

GitHub 星标
11k
排名
#11720
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能