agentleFS
Spoon94Spoon94/skill-vault/git-commit/SKILL.md

git-commit

Skill5 starsChanged 3 months agoMITView on GitHub

Use when writing Git commit messages, reviewing commits, or setting up commit message linting. Keywords: commit message, git commit, commitlint, semantic versioning, commit format.

174 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use git-pr, github-pr-create and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • klauswgSkill

    git-pr

    Prepare, review, publish, or update a complete GitHub pull request for the current repository, including local commit readiness, safe push strategy, semantic title validation, repository-native PR templates, issue linking, and checks verification. Use when the user asks to draft, create, submit, publish, open, or update a pull request. Always require the user to review and explicitly approve the exact final PR before any push or GitHub write.

    Also in 11 projects that use this

  • mjun0812Skill

    github-pr-create

    Pull Requestを作成するSkill。現在のbranchからpull requestを作成する。言語指定可能。 ユーザーが「PR作って」「pull request作成して」のように依頼したら使うこと。

    Also in 3 projects that use this

  • MicrosoftSkill

    git-branch

    Branch management for implementation. Use when you need to create a branch, switch branches, checkout, or verify branching strategy before implementing code. Do not use for commits (use git-commit), pull requests (use pull-request), or advanced git operations (rebase, merge).

    Also in 4 projects that use this

  • klauswgSkill

    git-issue

    Prepare, review, create, or update evidence-based GitHub issues for the current repository with duplicate detection, repository-native templates, valid labels, and post-publication verification. Use when the user asks to draft, file, submit, publish, edit, or refine a GitHub issue, bug report, feature request, performance issue, or technical proposal. Always require the user to review and explicitly approve the exact final issue before any GitHub write.

    Also in 3 projects that use this

  • gologo13Skill

    git-push

    Push current branch to origin and sync with remote updates; keywords: git, rebase. Use only on explicit request; before execution, review diffs and list impact scope.

    Also in 6 projects that use this

  • GoogleSkill

    github-pr-review

    Review a GitHub pull request and leave inline comments in a natural human reviewing voice, indistinguishable from comments typed by hand on the GitHub web UI. Deliberately bounded to defects a reader can settle by looking at the anchored line, rather than a deep audit, so every comment is cheap for the author to check. Scales to 2-20 comments by PR size, parallelises analysis across sub-agents, drafts for approval, then posts individually with human pacing. Use when the user says "review this PR", "review PR 123", pastes a github.com/.../pull/N link, or asks for comments on a pull request. Don't use for reviewing local uncommitted changes or a diff against a branch (use the `review` skill for that).

    Also in 4 projects that use this

The file

Files
SKILL.md

Conventional Commits

规范 Git 提交信息格式,便于自动化工具生成版本号、变更日志。遵循 Conventional Commits v1.0.0 与 Angular 提交规范。

何时使用

  • 编写 Git 提交信息
  • 创建代码提交
  • 审查提交历史
  • 生成提交信息模板

核心格式

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Type 类型(必须)

Type含义SemVer 影响
feat新功能MINOR
fixBug 修复PATCH
docs文档变更无
style格式调整(不影响逻辑)无
refactor重构(非新功能、非修复)无
perf性能优化PATCH
test测试相关无
build构建流程、依赖变更无
ciCI/CD 配置变更无
chore其他杂项无
revert回退提交(如 revert: feat(api-key))无

其他类型允许,但不影响语义版本(除非含 BREAKING CHANGE)。

Scope 范围(可选)

放在括号内,表示影响的模块。小写,多词用连字符连接:

feat(parser): add array parsing support
fix(api-client): handle timeout errors

Description 描述(必须)

  • 现在时态、祈使句:add 而非 added / adds
  • 首字母小写,结尾不加句号
  • ≤ 72 字符(建议 ≤ 50 更佳)
  • 用动词开头,简短说明做了什么

Body 正文(可选)

  • 空一行后开始
  • 说明"做了什么"和"为什么"(diff 已展示 what,正文补 why)
  • 每行 ≤ 72 字符,可多行,可用列表

Footer 脚注(可选)

  • 空一行后开始
  • 格式:<token>: <value> 或 <token> #<value>
  • 每个脚注独占一行

破坏性变更

两种方式表示(对应 SemVer MAJOR):

方式 1:! 在 type 后

feat!: remove deprecated API endpoints
feat(api)!: change authentication flow

方式 2:BREAKING CHANGE 脚注

feat: add new config format

BREAKING CHANGE: config file format changed from YAML to JSON

关联 Issue

fix: resolve login timeout

Closes #123
Refs #456

GOOD vs BAD 对比

简单提交

✅ feat: add user authentication ❌ added user authentication(过去时、无 type)

带范围

✅ feat(auth): add OAuth2 login support ❌ feat: added OAuth2 to auth(无 scope、过去时)

带正文

✅

feat: add user profile management

Add functionality for users to:
- Update profile information
- Change password
- Upload avatar image

❌ feat: add profile + 一句话流水账

破坏性变更

✅

feat!: remove deprecated API endpoints

BREAKING CHANGE: The following endpoints have been removed:
- /api/v1/users
- /api/v1/posts

Use /api/v2/* endpoints instead.

❌ feat: remove old endpoints(未标记破坏性)

关联 Issue

✅

fix: resolve authentication timeout issue

Closes #123
Refs #456

❌ fix: auth issue + #123(标题模糊、issue 未用 footer)

常见错误

错误正确
feat: Added featurefeat: add feature(现在时态、小写)
fix: fix bug.fix: resolve null pointer exception(具体、无句号)
FEAT: new featurefeat: new feature(type 小写)
feat add featurefeat: add feature(冒号后有空格)
feat(scope)add featurefeat(scope): add feature(冒号后有空格)
feat(UserService): ...feat(user-service): ...(scope 小写、连字符)

最佳实践

  • 一个提交一个逻辑变更——原子性优于体量
  • 标题清晰具体——"add search with debouncing" 胜于 "improve search"
  • 正文说"为什么"而非"做了什么"——diff 已展示 what,正文补 why
  • 关联 Issue——Closes #123 让 PR 自动关闭 issue
  • 不混合格式化与逻辑——style: 和 feat: 分开提交
  • 不提交调试代码或临时文件

快速参考

场景Type示例
新功能featfeat: add user dashboard
修复 Bugfixfix: resolve login error
更新文档docsdocs: update API reference
代码格式stylestyle: format with prettier
重构代码refactorrefactor: simplify validation
性能优化perfperf: cache database queries
添加测试testtest: add integration tests
构建更改buildbuild: upgrade dependencies
CI 配置cici: add GitHub Actions
维护任务chorechore: update license
回退提交revertrevert: feat(api-key)

工具推荐

  • commitlint - 校验 commit 格式
  • commitizen - 交互式 commit 辅助
  • semantic-release - 自动版本发布

参考链接

macOS 复制到剪贴板

在 macOS 系统下生成 commit message 后,使用 pbcopy 将其复制到系统剪贴板,便于直接粘贴到 git GUI 或终端。

检测系统:

[[ "$(uname)" == "Darwin" ]] && echo "macOS"

单行消息:

echo -n "feat(parser): add array parsing support" | pbcopy

多行消息(含 body / footer):

pbcopy <<'EOF'
fix: prevent request race condition

Introduce request ID to track concurrent requests.
Reject duplicate requests with same ID.

Refs: #123
EOF

Agent 工作流建议:

生成 commit message 后,若检测到 uname 输出为 Darwin,自动通过 pbcopy 复制结果,并在回复中提示「已复制到剪贴板」。非 macOS 系统跳过此步骤。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.