AgentSkillsCN

commit-lint

依据常规提交格式对提交信息进行校验

SKILL.md
--- frontmatter
name: commit-lint
allowed-tools: Read, Bash, TodoWrite
description: Validate commit messages against conventional commit format

/commit-lint — Commit message validation

Ensure commits follow conventional commit format and pass quality checks.

Commit Format

code
<type>[scope]: <description>

[body]

[footer]

Commit Types

TypePurpose
featNew feature
fixBug fix
docsDocumentation
styleFormatting (no code change)
refactorCode restructuring
testAdding/fixing tests
choreBuild/tooling changes
perfPerformance improvement
ciCI configuration
buildBuild system changes
revertRevert previous commit

Pre-commit Checks

Auto-detected based on lock files (bun/pnpm/yarn/npm):

bash
$PM run format   # Biome formatting
$PM run lint     # Linting checks
$PM run check    # Quality verification

Hook Detection

FileSystem
lefthook.ymllefthook (automatic)
.pre-commit-config.yamlpre-commit (automatic)
NeitherManual validation

Examples

bash
feat: add user authentication
fix(auth): resolve login validation error
docs: update API documentation
feat!: change API interface

BREAKING CHANGE: Method now requires email parameter

Guidelines

  • Keep header under 72 characters
  • Use present tense: "Add" not "Added"
  • Solo-authored commits only (no co-authorship)
  • AI attribution goes in PR description, not commits