AgentSkillsCN

commit-classification

按照常规提交规范对提交进行分类,并映射到更新日志类别。

SKILL.md
--- frontmatter
name: commit-classification
description: Classifies commits according to conventional commits specification and maps them to changelog categories
triggers: [commit, classify, conventional]
dependencies: [git, schangelog]

Commit Classification

Classifies commits according to conventional commits specification and maps them to changelog categories

Instructions

Guidelines for classifying commits using Conventional Commits specification.

Commit Types

TypeDescriptionChangelog Category
featNew featureAdded
fixBug fixFixed
docsDocumentation onlyDocumentation
styleFormatting, no code change-
refactorCode change, no feature/fixChanged
perfPerformance improvementPerformance
testAdding/fixing tests-
buildBuild system changes-
ciCI configuration-
choreMaintenance tasks-

Changelog Categories

Map commit types to Keep a Changelog categories:

Changelog CategoryCommit Types
Addedfeat
Changedrefactor, perf
DeprecatedManual marking
RemovedManual marking
Fixedfix
Securityfix with security scope

Scope Guidelines

Scopes provide context:

code
feat(auth): add OAuth2 support
fix(api): handle timeout errors
docs(readme): update installation steps

Common scopes:

  • api - API changes
  • cli - Command-line interface
  • auth - Authentication
  • db - Database
  • ui - User interface
  • core - Core functionality

Breaking Changes

Mark breaking changes with:

  1. ! after type: feat!: new API
  2. Footer: BREAKING CHANGE: description

Both trigger MAJOR version bump.

Commit Message Format

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

[optional body]

[optional footer(s)]

Examples:

code
feat(auth): add OAuth2 login support

Implements OAuth2 flow with support for Google and GitHub providers.

Closes #123
code
fix!: change error response format

BREAKING CHANGE: Error responses now use RFC 7807 format.
Migration guide: https://example.com/migrate

Classification Tools

Use schangelog for automatic classification:

bash
schangelog parse-commits --since=v1.0.0

Output provides:

  • Parsed type and scope
  • Suggested changelog category
  • Breaking change detection