Back to Skills

Enforcing Git Commit Workflow

camoneart
Updated Today
27 views
2
2
View on GitHub
Developmentautomation

About

This skill enforces semantic Git commit practices by ensuring proper file staging and prefix usage. It prevents bulk `git add -A` operations and requires focused, purpose-driven commits with appropriate semantic prefixes. Use it when committing code, managing Git history, or when users mention Git-related operations.

Documentation

Enforcing Git Commit Workflow

意味のあるコミット履歴を保つための厳格なGitワークフロー管理スキル。

いつ使うか

  • コードをコミットする時
  • ユーザーがgit関連の操作を要求した時
  • コミットメッセージの作成が必要な時

基本原則

1. 機能別コミットを原則とする

各コミットは1つの明確な目的を持つこと。

2. git add -A 禁止

例外: pnpx changeset version が生成した大量のパッケージ更新を commit する場合のみ。

3. 必ず個別ステージング

# ✅ 正しい
git add path/to/changed-file.ts
git add another/file.test.ts
git commit -m "test: add edge-case tests for suggest command"

# ❌ 間違い
git add -A
git commit -m "update files"

Prefix 一覧

詳細は prefix-reference.md を参照。

主要なPrefix

Prefix用途 (日本語)説明
fixバグ修正コードの不具合を修正するコミット
hotfixクリティカルなバグ修正サービス停止レベルの緊急バグ対応
add新規機能追加新しいファイルや小規模機能を追加するコミット
feat新機能ユーザー向けの大きな機能追加または変更
update機能修正既存機能に対する修正・改善(バグ修正ではない)
change仕様変更仕様そのものを変更するコミット
clean整理使われていないコードの削除や軽微な整理
disable無効化機能を一時的に無効化(コメントアウト等)
refactorリファクタリング挙動を変えずに内部構造のみ改善
remove削除ファイル・ライブラリ・機能を削除するコミット
upgradeバージョンアップ依存ライブラリや FW のメジャーアップデート
revert変更取り消し以前のコミットを打ち消すコミット
docsドキュメントREADME やコメントのみの変更
styleスタイル修正コードフォーマット、空白、セミコロンなど動作に影響しない変更
perfパフォーマンスパフォーマンス改善のための実装変更
testテストテストコードの追加・更新・リファクタ
chore雑多メンテビルド、CI、依存更新など本番コードに影響しない作業

実行フロー

ステップ1: ファイル分類

変更ファイルを目的別にグループ化:

  • テストコード
  • 実装コード
  • ドキュメント
  • 設定ファイル

ステップ2: 個別ステージング

# テストを先にコミット
git add src/__tests__/feature.test.ts
git commit -m "test: add tests for new feature"

# 次に実装
git add src/feature.ts
git commit -m "feat: implement new feature"

ステップ3: 不明点の確認

判断できない場合は必ずユーザーに確認

  • 「この変更はどのカテゴリに属しますか?」
  • 「これらのファイルは一緒にコミットして良いですか?」

警告・中断処理

以下を検出した場合、警告を表示し処理を中断

  • git add -A の使用(例外: changeset version)
  • 不明確なコミットメッセージ
  • 複数の目的が混在するコミット

ユーザーが強制実行を指定しない限り続行しない。

自動コミット禁止

Claude Code 自身が判断して Push まで行う場合でも、上記手順に従ってログを分割すること。

参考

詳細なPrefix一覧とガイドラインは prefix-reference.md を参照。

Quick Install

/plugin add https://github.com/camoneart/claude-code/tree/main/enforcing-git-commit-workflow

Copy and paste this command in Claude Code to install this skill

GitHub 仓库

camoneart/claude-code
Path: skills/enforcing-git-commit-workflow

Related Skills

sglang

Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill

business-rule-documentation

Meta

This skill provides standardized templates for systematically documenting business logic and domain knowledge following Domain-Driven Design principles. It helps developers capture business rules, process flows, decision trees, and terminology glossaries to maintain consistency between requirements and implementation. Use it when documenting domain models, creating business rule repositories, or bridging communication between business and technical teams.

View skill

Algorithmic Art Generation

Meta

This skill helps developers create algorithmic art using p5.js, focusing on generative art, computational aesthetics, and interactive visualizations. It automatically activates for topics like "generative art" or "p5.js visualization" and guides you through creating unique algorithms with features like seeded randomness, flow fields, and particle systems. Use it when you need to build reproducible, code-driven artistic patterns.

View skill

generating-unit-tests

Meta

This skill automatically generates comprehensive unit tests from source code when developers request test creation. It supports multiple testing frameworks like Jest, pytest, and JUnit, intelligently detecting the appropriate one or using a specified framework. Use it when asking to "generate tests," "create unit tests," or using the "gut" shortcut with file paths.

View skill