AgentSkillsCN

conventional-commits

Conventional Commits格式与分支命名参考。适用于撰写提交信息或创建分支时使用。

SKILL.md
--- frontmatter
name: conventional-commits
description: Reference for Conventional Commits format and branch naming. Use this when writing commit messages or creating branches.

Commit Format

code
<type>(<scope>): <short summary>

<optional body: what and why>

<optional footer: breaking changes, issue refs>
  • Summary line ≤72 characters.
  • Body explains what and why, not how.
  • Footer for breaking changes and issue references.

Types

TypeUse for
featNew feature
fixBug fix
docsDocumentation only
styleFormatting, whitespace (no logic change)
refactorCode restructuring (no behavior change)
testAdding or updating tests
choreMaintenance (deps, config, tooling)
ciCI/CD pipeline changes
perfPerformance improvement
buildBuild system changes

Examples

code
feat(auth): add OAuth2 PKCE flow

Implements the PKCE extension for the OAuth2 authorization code flow
to support public clients (SPA, mobile).

Closes #123
code
fix(api): prevent SQL injection in user query

User-supplied sort parameter was concatenated directly into the query.
Now uses parameterized queries.
code
refactor(payments): extract billing calculator

Moves billing logic from the order handler into a dedicated module
to improve testability and reuse.

Breaking Changes

Add ! after the type and a BREAKING CHANGE footer:

code
feat(api)!: change user endpoint response format

BREAKING CHANGE: The /users endpoint now returns a paginated response
instead of an array. Clients must update to handle the new format.

Branch Naming

Format: <type>/<ticket-id>-<short-description>

TypeUse for
feature/New features
fix/Bug fixes
chore/Maintenance
docs/Documentation
refactor/Code restructuring
test/Test additions

Examples:

  • feature/PROJ-123-add-oauth-login
  • fix/PROJ-456-null-pointer-in-parser
  • refactor/PROJ-789-extract-payment-service