git-commit
它能做什么
这项技能指导 AI 以整洁的方式保存 git 项目中的改动。适合希望提交信息清晰、拉取请求描述完整的开发人员。
适用场景
- ✓当你即将把改动提交到 git 项目时。
- ✓当你的改动混杂了多个不相关的主题,需要拆分为独立的提交时。
- ✓当你希望以清晰的标题和描述提交拉取请求的时候。
技能链接
https://github.com/spinabot/brigade/blob/main/skills/git-commit/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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 statusandgit diff --stagedto see exactly what's going in. Nevergit add -Ablindly — 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
.gitignorecovers 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>thengh 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
评论
- …