AgentSkillsCN

conventional-commit

Git 提交信息的 Conventional Commits v1.0.0 标准。适用于以下场景:(1) 创建 Git 提交;(2) 编写或草拟提交信息;(3) 审核提交信息格式;(4) 解释提交规范;(5) 验证提交信息的合规性。

SKILL.md
--- frontmatter
name: conventional-commit
description: Conventional Commits v1.0.0 standards for git messages. Use when (1) creating git commits, (2) writing or drafting commit messages, (3) reviewing commit message format, (4) explaining commit conventions, or (5) validating commit message compliance.

Commit Authoring

Write commit messages following Conventional Commits v1.0.0.

Message Structure

code
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Rules

  1. Prefix with type, optional scope in parentheses, optional ! for breaking changes, colon, space
  2. feat for new features (MINOR in SemVer)
  3. fix for bug fixes (PATCH in SemVer)
  4. Description immediately follows the colon and space
  5. Body separated by one blank line, free-form
  6. Footers one blank line after body, token-separator-value format
  7. Footer tokens use - instead of spaces (except BREAKING CHANGE)
  8. ! before : indicates breaking change; BREAKING CHANGE: footer may be omitted if ! is used
  9. Breaking changes correlate with MAJOR in SemVer

Types

TypePurposeSemVer
featNew featureMINOR
fixBug fixPATCH
docsDocumentation only-
styleFormatting, whitespace-
refactorNeither fix nor feature-
perfPerformance improvement-
testAdding or updating tests-
buildBuild system or dependencies-
ciCI configuration-
choreMaintenance tasks-

Description

Use imperative mood: "add feature" not "added feature". Keep under 50 characters. No period. Lowercase after type prefix.

Body

Wrap at 72 characters. Explain what and why, not how.

Prohibited

Do not include "Generated with Claude Code", AI attribution, Co-authored-by lines for AI, emoji, time estimates, dates, or TODO items.

Examples

Simple:

code
docs: correct spelling of CHANGELOG

With scope:

code
feat(lang): add Polish language

Breaking change:

code
feat!: send email to customer when product ships

BREAKING CHANGE: customers now receive emails by default.

With body:

code
fix: prevent duplicate form submissions

Disables submit button after first click and adds
debounce to the handler.

With footer:

code
fix: resolve race condition in auth flow

Refs: #123
Reviewed-by: Alice