git-commit-executor
Gitの変更を分析して論理的なコミット単位に分割し、Conventional Commits形式で実際にコミットを実行する。
When & Why to Use This Skill
The Git Commit Executor is an intelligent automation skill designed to streamline the version control workflow. It analyzes uncommitted changes in a Git repository, groups them into logical, atomic units, and automatically executes commits following the Conventional Commits specification. By transforming messy working directories into structured repository histories, it enhances code maintainability and team collaboration.
Use Cases
- Scenario 1: Automatically splitting a large day's work of mixed bug fixes and new features into separate, logical commits to improve code review efficiency.
- Scenario 2: Enforcing standardized commit messages (e.g., feat:, fix:, refactor:) across a project to ensure compatibility with automated changelog generators and CI/CD pipelines.
- Scenario 3: Reducing the manual overhead of staging specific files and writing repetitive commit messages, allowing developers to focus on core coding tasks while maintaining a clean Git history.
| name | git-commit-executor |
|---|---|
| description | Gitの変更を分析して論理的なコミット単位に分割し、Conventional Commits形式で実際にコミットを実行する。 |
| short-description | 自動コミット実行 |
Git Commit Executor
変更内容を分析して論理的なコミット単位に分割し、実際にコミットを実行するための手順。
手順
現在のgitの状態と変更内容を分析
git statusでステージ済み/未ステージを確認git diff --stagedとgit diffで差分を確認- 必要に応じて変更されたファイル内容を確認
論理的なコミット単位に分割
- 関連する変更をグループ化(例:機能追加、バグ修正、リファクタ、ドキュメント)
- 1コミット=1論理変更
- 依存関係を考慮して順序を決定
各コミット単位で実行
- コミット対象を明確に説明
git addで該当ファイルだけステージング(まとめて全追加は避ける)- Conventional Commits形式のメッセージを作成して
git commitを実行
最後に確認
git log --oneline -5で直近コミットを確認
コミットメッセージ形式
<type>(<optional scope>): <subject>
使用可能なtype
feat: 新機能の追加fix: バグ修正docs: ドキュメントのみの変更style: 空白/フォーマットなどrefactor: 内部構造の改善perf: パフォーマンス向上test: テストコードの追加/修正build: ビルド関連の変更ci: CI設定やパイプライン変更chore: 雑務的な変更revert: コミットの取り消し
重要事項
- 実際にコミットを実行する
- コミット前に内容を明確に説明する
- エラー発生時は原因を特定して対処する