AgentSkillsCN

conventional-commits

提供Conventional Commits规范的撰写指南,适用于提交信息的编写、变更日志的生成,以及语义化版本控制的自动化流程。完全遵循Conventional Commits规范要求。

SKILL.md
--- frontmatter
name: conventional-commits
description: "Guide for writing Conventional Commits. Use when writing commit messages, creating changelogs, or automating semantic versioning. Follows the Conventional Commits specification."
metadata:
  {
    "openclaw":
      {
        "emoji": "📝",
        "requires": {},
        "install": [],
      },
  }

Conventional Commits Skill

Guide for writing Conventional Commits to create clear, structured commit messages that enable automatic changelog generation and semantic versioning.

When to Use

  • Writing commit messages
  • Creating changelogs
  • Automating semantic versioning
  • Maintaining clear git history
  • Enforcing commit standards

Commit Format

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

[optional body]

[optional footer(s)]

Types

TypeDescriptionSemVer
featNew featureMINOR
fixBug fixPATCH
docsDocumentation onlyPATCH
styleCode style (formatting)PATCH
refactorCode refactoringPATCH
perfPerformance improvementPATCH
testAdding/updating testsPATCH
choreMaintenance tasksPATCH
ciCI/CD changesPATCH
buildBuild system changesPATCH
revertRevert previous commitPATCH

Examples

Feature Commit

code
feat(auth): add OAuth2 login support

- Implement Google OAuth2 provider
- Add token refresh logic
- Update user model for OAuth fields

Closes #123

Bug Fix Commit

code
fix(api): resolve null pointer in user validation

The validation was failing when user object was undefined.
Added null checks and proper error handling.

Fixes #456

Breaking Change

code
feat(api): redesign authentication endpoints

BREAKING CHANGE: `/api/v1/login` is now `/api/v2/auth/login`
Old endpoints will be removed in v3.0.0

Documentation Update

code
docs(readme): update installation instructions

- Add Docker setup guide
- Update Node.js version requirements
- Fix broken links

Scopes

Common scopes for different projects:

Web Projects:

  • api - Backend API changes
  • ui - User interface changes
  • auth - Authentication related
  • db - Database changes

AI/ML Projects:

  • model - ML model changes
  • data - Data pipeline changes
  • train - Training logic
  • infer - Inference/prediction

Tools

Commitlint

Validate commits:

bash
npx commitlint --from HEAD~1 --to HEAD --verbose

Standard Version

Auto-generate changelog:

bash
npx standard-version

Semantic Release

Automated versioning:

bash
npx semantic-release

Best Practices

  1. Use present tense ("add feature" not "added feature")
  2. Use imperative mood ("move cursor" not "moves cursor")
  3. Don't capitalize first letter
  4. No period at the end
  5. Keep first line under 72 characters
  6. Use body to explain what and why, not how

Common Patterns

bash
# Feature with scope
feat(user): add profile page

# Fix with issue reference
fix(api): handle timeout error

Fixes #789

# Breaking change
feat(db): migrate to PostgreSQL

BREAKING CHANGE: MySQL no longer supported

# Multiple changes
docs: update README and CONTRIBUTING