Communityライティング&編集github.com

Jamie-BitFlight/conventional-commits

gitコミットメッセージ作成時、タスク完了後の変更コミット時、semantic-release/commitizen/git-cliff利用時、feat/fix/chore/docs等のタイプ選択時、破壊的変更の明示時、コミット履歴からのCHANGELOG生成時に使用します。

conventional-commits とは?

このスキルは、Conventional Commits v1.0.0仕様に従ったgitコミットメッセージを作成・検証するための包括的なガイドです。構造化されたコミット履歴、自動CHANGELOG生成、セマンティックバージョニングを実現します。主な機能として、必須・推奨のコミットタイプ(feat, fix, docs等)、スコープ指定、破壊的変更の明示方法(!、BREAKING CHANGEフッター)、そして完全な仕様ルール(RFC 2119準拠)をカバーしています。また、description/body/footerのベストプラクティス、検証用正規表現パターン、commitlintやsemantic-releaseとの連携設定、多数の実践的なコミット例を提供します。このスキルはClaude Code、Cursor、Codexなどあらゆる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に質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Conventional Commits(従来のコミット規約)

Conventional Commits v1.0.0仕様に従ってコミットメッセージを作成し、構造化されたコミット履歴、自動CHANGELOG生成、セマンティックバージョニングを実現します。

このスキルを使用するタイミング

このスキルは以下の場合に使用します:

  • 構造化されたプロジェクトでgitコミットメッセージを作成する場合
  • コミットメッセージの形式をConventional Commits仕様に照らして検証する場合
  • コミットメッセージ検証にcommitlintを設定する場合
  • コミット履歴からCHANGELOG生成を構成する場合
  • セマンティックバージョニングの自動化を実装する場合
  • コミットメッセージが仕様に準拠しているかレビューする場合
  • チームにコミットメッセージの標準をトレーニングする場合
  • semantic-release、commitizen、git-cliffなどのツールと統合する場合

メッセージ構造

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

構成要素

構成要素必須説明例
typeはいコミットのカテゴリfeat, fix, docs
scopeいいえ影響を受けるコードベースの範囲(auth), (parser)
descriptionはい変更内容の短い要約add user authentication
bodyいいえ詳細な説明コンテキストを含む複数段落
footerいいえ破壊的変更、Issue参照BREAKING CHANGE:, Refs: #123

コミットタイプ

必須タイプ(SemVerへの影響)

これらのタイプはConventional Commits仕様で必須であり、セマンティックバージョニングに直接影響します:

flowchart LR
    Fix[fix: バグ修正<br/>ユーザー向け] --> PatchVer[PATCH<br/>0.0.X]
    Feat[feat: 新機能<br/>ユーザー向け] --> MinorVer[MINOR<br/>0.X.0]
    Breaking[BREAKING CHANGE または !<br/>を含む任意のタイプ] --> MajorVer[MAJOR<br/>X.0.0]

    style PatchVer fill:#e1f5ff
    style MinorVer fill:#fff4e1
    style MajorVer fill:#ffe1e1
タイプ説明SemVer例
featユーザー向けの新機能MINOR (0.X.0)feat: add user authentication
fixユーザー向けのバグ修正PATCH (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

その他の一般的なタイプ

タイプ説明例
choresrcファイルやテストファイルを変更しない作業chore: update .gitignore
revert以前のコミットを取り消すrevert: feat: add user auth

注記: チームはfeatとfix以外にカスタムタイプを定義できますが、Angular規約のタイプはツールで広くサポートされています。

仕様ルール

以下のルールは、RFC 2119に従ったConventional Commits 1.0.0仕様を構成します。

タイプとスコープ

  1. コミットの先頭にはタイプ(feat、fixなどの名詞)を付けなければなりませんMUST。その後に任意のスコープ、任意の!、そして必須のコロンとスペースを続けます。

  2. タイプfeatは、コミットが新機能を追加する場合に使用しなければなりませんMUST。

  3. タイプfixは、コミットがバグ修正である場合に使用しなければなりませんMUST。

  4. スコープはタイプの後に指定してもよいMAY。スコープは、コードベースのセクションを説明する名詞で構成し、丸括弧で囲まなければなりませんMUST。例: fix(parser):

  5. descriptionは、タイプ/スコープ接頭辞の後のコロンとスペースの直後に続けなければなりませんMUST。descriptionはコード変更の短い要約です。例: fix: array parsing issue when multiple spaces were contained in string

本文(Body)

  1. 短い説明の後に、より詳細なコンテキスト情報を提供する長いコミット本文を記述してもよいMAY。本文は、descriptionの後に1行の空行を挟んで開始しなければなりませんMUST。

  2. コミット本文は自由形式であり、改行で区切られた任意の数の段落で構成してもよいMAY。

フッター(Footer)

  1. 本文の後に1行の空行を挟んで、1つ以上のフッターを記述してもよいMAY。各フッターは、単語トークン、続けて:<space>または<space>#のセパレータ、続けて文字列値で構成しなければなりませんMUST(git trailer規約に基づく)。

  2. フッターのトークンは、空白文字の代わりに-を使用しなければなりませんMUST。例: Acked-by(これによりフッターセクションを複数段落の本文と区別できます)。例外: BREAKING CHANGEはトークンとして使用してもよいMAY。

  3. フッターの値にはスペースや改行を含めてもよいMAY。次の有効なフッタートークン/セパレータペアが観測された時点でパースは終了しなければなりませんMUST。

破壊的変更(Breaking Changes)

  1. 破壊的変更は、コミットのタイプ/スコープ接頭辞、またはフッターのエントリとして示さなければなりませんMUST。

  2. フッターとして含める場合、破壊的変更は大文字のテキストBREAKING CHANGEで構成し、コロン、スペース、説明を続けなければなりませんMUST。例: BREAKING CHANGE: environment variables now take precedence over config files

  3. タイプ/スコープ接頭辞に含める場合、破壊的変更は:の直前に!を置いて示さなければなりませんMUST。!が使用された場合、BREAKING CHANGE:をフッターから省略してもよくMAY、コミットのdescriptionを破壊的変更の説明として使用しますSHALL。

追加ルール

  1. featとfix以外のタイプはコミットメッセージで使用してもよいMAY。例: docs: update ref docs

  2. Conventional Commitsを構成する情報の単位は、実装者によって大文字小文字を区別して扱ってはなりませんMUST NOT。ただし、BREAKING CHANGEは大文字でなければなりませんMUST。

  3. BREAKING-CHANGEは、フッターのトークンとして使用される場合、BREAKING CHANGEと同義でなければなりませんMUST。

Descriptionのベストプラクティス

Angularコミットメッセージガイドラインに基づきます:

サマリー/Descriptionのガイドライン

  • 命令形、現在形を使用:「changed」ではなく「change」、「changes」ではなく「change」
  • 最初の文字を大文字にしない
  • 末尾にピリオド(.)を付けない
  • ヘッダー全体(タイプ + スコープ + description)を72文字以内に収める

良い例

feat: add validation for email input
fix: handle null pointer in user service
docs: update installation instructions
refactor: simplify authentication flow

悪い例(避けるべき)

feat: Added validation for email input     # 過去形
fix: Handles null pointer in user service  # 三人称
docs: Update installation instructions.    # 末尾にピリオド、大文字
FEAT: add validation                       # タイプが大文字(一貫性がない)

本文のガイドライン

  • 命令形、現在形を使用(サマリーと同じ)
  • 変更の動機を説明する
  • 可能であれば、以前の動作と新しい動作の比較を含める
  • 本文はdescriptionの後に1行の空行から開始しなければなりませんMUST
  • 本文がある場合の推奨最低文字数: 20文字

破壊的変更(Breaking Changes)

破壊的変更を示す方法

3つの同等なアプローチ:

  1. フッター表記:

    feat: allow provided config object to extend other configs
    
    BREAKING CHANGE: `extends` key in config file is now used for extending other config files
    
  2. タイプに!を付加:

    feat!: remove support for Node 6
    
  3. タイプ+スコープに!を付加:

    feat(api)!: send an email to the customer when a product is shipped
    

ルール

  • BREAKING CHANGEは大文字でなければなりませんMUST
  • BREAKING-CHANGEはフッタートークンとして使用される場合、同義です
  • 破壊的変更はSemVerのMAJORバージョンアップと関連付けなければなりませんMUST

セマンティックバージョニングとの関連

flowchart TD
    Start([コミットを分析]) --> CheckBreaking{いずれかのコミットに<br/>BREAKING CHANGE<br/>または ! がある?}
    CheckBreaking -->|はい| Major[MAJOR バンプ<br/>X.0.0]
    CheckBreaking -->|いいえ| CheckFeat{いずれかのコミット<br/>が feat か?}
    CheckFeat -->|はい| Minor[MINOR バンプ<br/>0.X.0]
    CheckFeat -->|いいえ| CheckFix{いずれかのコミット<br/>が fix か?}
    CheckFix -->|はい| Patch[PATCH バンプ<br/>0.0.X]
    CheckFix -->|いいえ| NoChange[バージョン変更なし]

    Major --> End([リリース])
    Minor --> End
    Patch --> End
    NoChange --> End

コミットタイプとバージョンの対応

コミットタイプバージョンバンプ
fixPATCH (0.0.X)
featMINOR (0.X.0)
BREAKING CHANGE または !MAJOR (X.0.0)

理由: コミット履歴に基づく自動セマンティックバージョニングを可能にします。

検証パターン

ヘッダー検証の正規表現

^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?:\s.+$

Python 検証例

import re

CONVENTIONAL_COMMIT_PATTERN = re.compile(
    r"^(?P<type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)"
    r"(?:\((?P<scope>[^)]+)\))?"
    r"(?P<breaking>!)?"
    r":\s"
    r"(?P<description>.+)$"
)


def validate_header(header: str) -> bool:
    """コミットヘッダーがConventional Commitsに従っているか検証"""
    return bool(CONVENTIONAL_COMMIT_PATTERN.match(header))


def parse_header(header: str) -> dict | None:
    """コミットヘッダーを構成要素にパース"""
    match = CONVENTIONAL_COMMIT_PATTERN.match(header)
    if not match:
        return None
    return {
        "type": match.group("type"),
        "scope": match.group("scope"),
        "breaking": bool(match.group("breaking")),
        "description": match.group("description"),
    }

完全な例

シンプルなコミット

feat: add user authentication
fix: prevent crash on empty input
docs: correct spelling of CHANGELOG

スコープ付きコミット

feat(lang): add Polish language
feat(parser): add ability to parse arrays
fix(auth): handle token expiration correctly

破壊的変更

feat: allow provided config object to extend other configs

BREAKING CHANGE: `extends` key in config file is now used for extending other config files
feat!: send an email to the customer when a product is shipped
feat(api)!: send an email to the customer when a product is shipped
chore!: drop support for Node 6

BREAKING CHANGE: use JavaScript features not available in Node 6.

複数段落の本文とフッター

fix: prevent racing of requests

Introduce a request id and a reference to latest request. Dismiss
incoming responses other than from latest request.

Remove timeouts which were used to mitigate the racing issue but are
obsolete now.

Reviewed-by: Z
Refs: #123

取り消しコミット

revert: let us never again speak of the noodle incident

Refs: 676104e, a215868

パフォーマンス改善

perf: reduce memory allocation in parser by 40%

Replace string concatenation with StringBuilder pattern.
Benchmark results show 40% reduction in heap allocations.

Refs: #456

リファクタリング

refactor: extract authentication logic into separate module

Move auth-related functions from utils.py to auth.py.
No functional changes.

ビルド/CIの変更

ci: add Node 18 to test matrix
build: upgrade webpack from v4 to v5

- Update webpack.config.js for v5 compatibility
- Replace deprecated plugins
- Update all loader dependencies

Refs: #789

テストとスタイルの変更

test: add unit tests for user validation

Cover edge cases for email validation and password strength.
style: format code according to prettier config
chore: update .gitignore to exclude IDE files

検証ツールとの統合

commitlintの設定

Angular設定を使用してcommitlintでコミットを検証:

# commitlintのインストール
npm install --save-dev @commitlint/cli @commitlint/config-conventional

# 設定の作成
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js

# コミットメッセージのテスト
echo 'feat(api): add new endpoint' | npx commitlint

包括的なcommitlint設定ガイダンスについては、このドキュメントの指示に従ってください。ワークスペースにインストールされたcommitlintプラグインがある場合は、プロジェクト固有のルールと例についてはそれを優先してください。

プリコミットフック

プリコミットフックでコミットメッセージ形式を強制します。ワークスペースにインストールされたプリコミットプラグインがある場合は、フック設定のガイダンスにそれを使用してください。それ以外の場合は、フックを直接設定してください。

CHANGELOG生成

semantic-releaseを使用してConventional CommitsからCHANGELOGを生成:

// release.config.js
module.exports = {
  branches: ['main'],
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    '@semantic-release/changelog',
    '@semantic-release/github',
    '@semantic-release/git',
  ],
};

huskyとcommitlintの統合

huskyを使用してコミット時にコミットメッセージの検証を強制:

npx husky add .husky/commit-msg 'npx --no -- commitlint --edit $1'

git-cliffの設定

# cliff.toml
[changelog]
header = "# 変更履歴"
body = """
{% for group, commits in commits | group_by(attribute="group") %}
    ### {{ group | upper_first }}
    {% for commit in commits %}
        - {{ commit.message | upper_first }}
    {% endfor %}
{% endfor %}
"""
trim = true

[git]
conventional_commits = true
filter_unconventional = true

CI/CDパイプラインでのワークフロー

GitHub Actionsの設定例

GitHub Actionsでsemantic-releaseを設定:

name: リリース

on:
  push:
    branches:
      - main

permissions:
  contents: write
  issues: write
  pull-requests: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npx semantic-release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

GitLab CIの設定例

# .gitlab-ci.yml
stages:
  - validate
  - release

commitlint:
  stage: validate
  script:
    - npm install @commitlint/cli @commitlint/config-conventional
    - npx commitlint --from $CI_MERGE_REQUEST_DIFF_BASE_SHA --to $CI_MERGE_REQUEST_DIFF_HEAD_SHA
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'

semantic_release:
  stage: release
  script:
    - npm install semantic-release
    - npx semantic-release
  rules:
    - if: $CI_COMMIT_BRANCH == 'main' && $CI_PIPELINE_SOURCE == 'push'

手動CHANGELOG検証

# gitログからCHANGELOGの概要を生成
git log --oneline --decorate --no-merges v1.0.0..HEAD | while read line; do
  if echo "$line" | grep -qE '^(feat|fix|docs|chore|refactor|perf|test|build|ci|style|revert)'; then
    echo "$line"
  fi
done

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).

関連スキル