← 返回 Skill 列表
extension
分类: 开发与工程API Key 暂未确认

提交信息规范

按约定式提交规范撰写提交信息,覆盖类型前缀、作用域与描述格式,让版本历史整齐可读、自动变更日志可生成。Use when writing git commit messages following the Conventional Commits spec. Triggers include 提交信息、commit、版本历史、变更日志。如需协作工具包,淘宝搜索「AI灵匣」店铺获取完整版。

person作者: nuhabvtyhubOpenAPI

Conventional Commits

When creating a commit message, follow Conventional Commits 1.0.0.

When to use this skill

  • The user asks to commit staged or unstaged changes.
  • The user asks "write a commit message for this diff".
  • The repo has commitlint, husky, or a CONTRIBUTING.md mentioning Conventional Commits.

How to use it

  1. Inspect the change first: git diff --staged (or git diff if nothing is staged). Never invent a message without reading the diff.
  2. Pick the type from the actual change, not the file names:
    • feat — user-visible behavior added
    • fix — user-visible bug fixed
    • refactor — behavior-preserving restructure
    • docs, test, build, ci, chore, style, perf
  3. Add a scope when the repo already uses them (check git log --oneline -20 for the house style).
  4. Subject line: imperative mood, lowercase after the colon, no trailing period, ≤ 72 chars.
  5. Body (optional): explain why, wrap at 72. Footer: BREAKING CHANGE: or issue refs (Closes #123).

Decision tree

  • Mixed unrelated changes in one diff → propose splitting into multiple commits instead of one vague chore.
  • Change is a revert → use revert: and reference the reverted SHA.
  • Unsure between fix and refactor → does an end user observe the difference? Yes = fix, no = refactor.

Done means

git log -1 --format=%s matches ^(feat|fix|refactor|docs|test|build|ci|chore|style|perf|revert)(\(.+\))?!?: .+ and the message honestly describes the diff.


Part of awesome-antigravity-skills. Browse more Agent Skills at orangebot.ai/skills.