Community写作与编辑github.com

Jamie-BitFlight/conventional-commits

编写符合 Conventional Commits v1.0.0 规范的 Git 提交信息,支持结构化提交历史、自动生成变更日志和语义化版本控制。

conventional-commits 是什么?

该技能(Conventional Commits)为 AI 代理(如 Claude Code、Cursor、Codex)提供了一套完整的指南,用于生成和验证符合 Conventional Commits v1.0.0 规范的 Git 提交信息。它支持结构化提交历史、自动生成变更日志以及语义化版本控制。技能详细描述了提交信息的结构(类型、作用域、描述、正文、脚注)、必需和推荐的提交类型(如 feat、fix、docs、refactor 等)及其对语义化版本号的影响(PATCH、MINOR、MAJOR)。此外,它还提供了规范规则、描述最佳实践、破坏性变更的识别方法、与 commitlint 和 semantic-release 等工具的集成方式,以及 Python 验证示例。该技能适用于任何使用 Git 进行版本控制并希望自动化发布流程的软件开发项目,支持 AI 代理在任务完成后正确地编写和审查提交信息。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/conventional-commits/skills/conventional-commits

Installed? Explore more 写作与编辑 skills: steipete/notion, langchain-ai/langchain, bytedance/podcast-generation · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

约定式提交

遵循 Conventional Commits v1.0.0 规范编写提交信息,以实现结构化的提交历史、自动化的变更日志生成和语义化版本控制。

何时使用此技能

在以下场景中使用此技能:

  • 为结构化的项目创建 Git 提交信息
  • 验证提交信息格式是否符合 Conventional Commits 规范
  • 使用 commitlint 设置提交信息验证
  • 从提交历史配置变更日志生成
  • 实现语义化版本自动化
  • 审查提交信息是否符合规范
  • 培训团队掌握提交信息标准
  • 与 semantic-release、commitizen 或 git-cliff 等工具集成

信息结构

<类型>[可选作用域]: <描述>

[可选正文]

[可选脚注]

组成

组成部分必需描述示例
类型(type)是提交类别feat、fix、docs
作用域(scope)否受影响的代码库部分(auth)、(parser)
描述(description)是变更的简短摘要添加用户认证
正文(body)否详细说明多段上下文描述
脚注(footer)否破坏性变更、问题引用BREAKING CHANGE:、Refs: #123

提交类型

必需类型(SemVer 影响)

以下类型是 Conventional Commits 规范所要求的,并直接影响语义化版本:

flowchart LR
    Fix[fix: 用户错误修复] --> PatchVer[补丁版本<br/>0.0.X]
    Feat[feat: 用户新功能] --> MinorVer[次版本<br/>0.X.0]
    Breaking[任何类型含有<br/>BREAKING CHANGE 或 !] --> MajorVer[主版本<br/>X.0.0]

    style PatchVer fill:#e1f5ff
    style MinorVer fill:#fff4e1
    style MajorVer fill:#ffe1e1
类型描述SemVer示例
feat为用户添加新功能次版本 (0.X.0)feat: add user authentication
fix为用户修复错误补丁版本 (0.0.X)fix: prevent crash on empty input

推荐类型(Angular 约定)

以下类型来源于 @commitlint/config-conventional,基于 Angular 提交指南。除非包含 BREAKING CHANGE,否则它们没有隐式的 SemVer 影响。

类型描述示例
build构建系统或外部依赖变更build: update webpack to v5
ciCI 配置变更ci: add Node 18 to test matrix
docs仅文档变更docs: update API reference
perf性能提升perf: reduce bundle size by 20%
refactor代码变更(无错误修复或功能添加)refactor: extract validation logic
style代码样式变更(空白、格式)style: fix indentation
test添加或修正测试test: add unit tests for parser

其他常见类型

类型描述示例
chore不修改 src 或测试文件的变更chore: update .gitignore
revert回滚之前的提交revert: feat: add user auth

注意:团队可以定义除 feat 和 fix 之外的自定义类型,但 Angular 约定类型在工具链中得到广泛支持。

规范规则

以下规则构成官方 Conventional Commits 1.0.0 规范,依据 RFC 2119。

类型和作用域

  1. 提交必须以类型为前缀,该类型由一个名词(feat、fix 等)组成,后跟可选的作用域、可选的 !,以及必需的冒号和空格。

  2. 当提交添加新功能时,必须使用类型 feat。

  3. 当提交表示错误修复时,必须使用类型 fix。

  4. 类型后可以提供作用域。作用域必须由一个描述代码库部分的名词组成,并放在括号内,例如:fix(parser):

  5. 在类型/作用域前缀之后的冒号和空格之后,必须紧跟描述。描述是代码变更的简短摘要,例如:fix: array parsing issue when multiple spaces were contained in string

正文

  1. 在简短描述之后可以提供更长的提交正文,以提供额外的上下文信息。正文必须在描述之后空一行开始。

  2. 提交正文是自由格式的,可以由任意数量的换行分隔的段落组成。

脚注

  1. 在正文之后空一行可以提供一个或多个脚注。每个脚注必须由一个单词标记组成,后跟 :<space> 或 <space># 分隔符,再跟一个字符串值(灵感来自 git trailer 约定)。

  2. 脚注的标记必须使用 - 代替空白字符,例如:Acked-by(这有助于将脚注部分与多段落正文区分开)。例外:BREAKING CHANGE也可以用作标记。

  3. 脚注的值可以包含空格和换行。解析必须在观察到下一个有效的脚注标记/分隔符对时终止。

破坏性变更

  1. 破坏性变更必须在提交的类型/作用域前缀中指示,或者在脚注中作为条目指示。

  2. 如果作为脚注包含,破坏性变更必须由大写文本 BREAKING CHANGE 组成,后跟冒号、空格和描述,例如:BREAKING CHANGE: environment variables now take precedence over config files

  3. 如果在类型/作用域前缀中包含,破坏性变更必须通过在 : 之前添加 ! 来指示。如果使用了 !,则可以从脚注中省略 BREAKING CHANGE:,并且提交描述应用于描述破坏性变更。

附加规则

  1. 除了 feat 和 fix 之外的类型可以在提交信息中使用,例如:docs: update ref docs

  2. 构成 Conventional Commits 的信息单元不得被实现者视为大小写敏感的,但 BREAKING CHANGE必须大写。

  3. 当 BREAKING-CHANGE 用作脚注中的标记时,必须与 BREAKING CHANGE 同义。

描述最佳实践

基于 Angular 提交信息指南:

摘要/描述指南

  • 使用祈使句、现在时:

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Jamie-BitFlight/agentskill-kaizen-meta-docs

Agentskill kaizen plugin documentation index. Load when needing to read about cross-platform notes, improvement plans, or DuckDB integration.

Jamie-BitFlight/bash-51-features

Bash 5.1 release features and improvements with practical examples. Use when working with Bash 5.1 features, epoch time variables, redirection enhancements, or when user asks about Bash 5.1 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-52-features

Bash 5.2 release features and improvements with practical examples. Use when working with Bash 5.2 features, variable handling enhancements, readline improvements, or when user asks about Bash 5.2 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-53-features

Bash 5.3 release features and improvements with practical examples. Use when working with Bash 5.3 features, new command substitution, GLOBSORT, loadable builtins, or when user asks about Bash 5.3 changes, new features, or version-specific capabilities.

Jamie-BitFlight/bash-development

This skill should be used when the user asks to "write a bash script", "create a shell script", "implement bash function", "parse arguments in bash", "handle errors in bash", or mentions bash development, shell scripting, script templates, or modern bash patterns.

Jamie-BitFlight/bash-lint

This skill should be used when the user asks to "lint bash script", "run shellcheck", "format shell script", "use shfmt", "fix shellcheck errors", or mentions shell script linting, formatting, code quality, or pre-commit hooks for bash.

Jamie-BitFlight/bash-logging

This skill should be used when the user asks to "add logging to bash script", "colorize output", "implement log levels", "CI/CD sections", "terminal colors in bash", or mentions logging functions, emoji output, collapsible CI sections, or shlocksmith.

Jamie-BitFlight/bash-portability

This skill should be used when the user asks about "POSIX compatibility", "portable shell scripts", "cross-shell compatibility", "bashisms", "shebang selection", or mentions writing scripts that work on different shells (bash, sh, dash, zsh) or different systems.

Jamie-BitFlight/bash-testing

This skill should be used when the user asks to "test bash script", "write shell tests", "use shunit2", "use shellspec", "create test suite for bash", or mentions unit testing, test frameworks, mocking, or test-driven development for shell scripts.

Jamie-BitFlight/brainstorming-skill

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or when users request help with ideation, marketing, and strategic planning. Explores user intent, requirements, and design before implementation using research-validated prompt patterns.

Jamie-BitFlight/clang-format

Configure clang-format code formatting. Use when: user mentions clang-format or .clang-format, analyzing code style/patterns, creating/modifying formatting config, troubleshooting formatting, brace styles/indentation/spacing/alignment/pointer alignment, or codifying conventions.

Jamie-BitFlight/commitlint

When setting up commit message validation for a project. When project has commitlint.config.js or .commitlintrc files. When configuring CI/CD to enforce commit format. When extracting commit rules for LLM prompt generation. When debugging commit message rejection errors.

Jamie-BitFlight/dasel-reference

Use when querying, modifying, or converting JSON, YAML, TOML, XML, CSV, HCL, or INI with dasel v3. Complete reference for selectors, functions, conditionals, variables, spread operator, type casting, and format-specific patterns.

Jamie-BitFlight/data-exploration

Use when exploring unknown structured data files with dasel v3 — discover schema, list keys, find nested values, sample arrays, identify data types across JSON, YAML, TOML, XML, CSV, HCL, INI formats

Jamie-BitFlight/data-transformation

Use when modifying, converting, or transforming structured data with dasel v3 — in-place mutations, format conversion, batch operations, array manipulation, object construction, and merge patterns across JSON, YAML, TOML, XML, CSV, HCL, INI

Jamie-BitFlight/delegate

Decompose substantive work into phases, dispatch each phase to a sub-agent, and adjudicate what comes back. Use whenever a request asks for implementation, investigation, a fix, a review, or any change to files — including small ones — and whenever you are about to read source or run a diagnostic yourself instead of handing it off. Also use when a report from a sub-agent needs judging, when a phase needs re-dispatching, or when a user names one instance of a pattern. Does not apply when your own prompt begins "Your ROLE_TYPE is sub-agent." — then follow references/sub-agent-contract.md instead.

Jamie-BitFlight/enterprise-hibernate-hbm

Dasel v3 query patterns for Hibernate .hbm.xml mapping files — entity-table binding, Java property-to-column extraction, one-to-many set/list/bag relationship tracing, many-to-one foreign key discovery, batch scanning across 60+ HBM files. Use when querying Hibernate ORM class mappings, extracting schema metadata from Java persistence layer, or auditing entity-column relationships in enterprise legacy codebases.

Jamie-BitFlight/enterprise-installanywhere

Dasel v3 query patterns for InstallAnywhere .iap_xml installer definitions — use when querying action sequences, discovering variables, resolving platform conditions, navigating panels, or comparing installer variants. Files are 2.5+ MB, 65,000+ lines — too large for context reads, requires structural dasel queries.

Jamie-BitFlight/enterprise-maven-pom

Dasel v3 selector patterns for Maven POM XML files — use when querying dependency versions, filtering by groupId or scope, extracting module hierarchy from parent POMs, or detecting version conflicts across enterprise multi-module Java projects. Load this skill when working with pom.xml files using dasel.

Jamie-BitFlight/enterprise-spring-xml

Dasel v3 selectors for Spring bean factory XML — use when querying any Spring ApplicationContext XML for bean discovery, dependency wiring, JMS destination mapping, property injection extraction, or cross-bean reference tracing. Load this skill before writing dasel selectors against Spring bean XML files (applicationContext.xml, *_beans.xml, spring-*.xml).

相关技能