git-commit skill
conventional commit メッセージ形式を使用して、変更のステージングとコミットの作成を自動化します。
- GitHubスター
- 45
- ファイル
- 1
- 最終コミット
- 2026年5月31日
- ライセンス
- MIT
- 許可されたツール
- 2
git-commit skillは何をしますか
git-commitはAgent Skillsです。 conventional commit メッセージ形式を使用して、変更のステージングとコミットの作成を自動化します。.
skillのSKILL.mdから生成された要約。
git-commit skill について
この SKILL は、conventional commit 形式を使用して、コード変更のステージングとコミットを自動化することを開発者に提供します。エージェントが変更の保存や作業のコミットの指示を受けた際、Bash を使用してリポジトリの状態を検査し、追跡されていないファイルを含むすべてのファイルをステージングします。その後、ステージングされた diff を分析して、feat、fix、refactor などの適切な type を決定し、命令形を使用する、説明を 72 文字以内に収めるなどの特定のルールに従って構造化されたメッセージを構築します。
ユーザーが git リポジトリでのタスクを完了させたいときは、エージェントはこの SKILL をロードする必要があります。このプロセスは、作業のコンテキストを理解するために git status、git add、および git diff コマンドを実行することに基づいています。もし pre-commit hook によってコミットの作成が妨げられた場合、この SKILL は具体的な失敗内容を報告するため、ユーザーは問題に対処できます。短いハッシュと標準化されたメッセージを持つ正式なコミットを作成し、プロジェクトの履歴がクリーンで一貫した状態に保たれることを保証します。
エージェントができること
- 1現在のすべての作業をコミットする現在の進捗状況とステージングされた変更を、新しい git コミットとして保存するようエージェントに依頼します。
- 2標準化されたコミットメッセージを生成するエージェントに diff を分析させ、conventional commit 仕様に従ったメッセージを記述させます。
- 3pre-commit hook のエラーを処理するローカルリポジトリの hook によりコミットが失敗した原因を特定するためにエージェントを使用します。
skill の SKILL.md から作成されています。すべてのユースケースは、その引用と照合されています。
git-commit skillのインストール方法
各コマンドはskillフォルダをクライアントのskillsディレクトリにコピーします。読み込むには、クライアントを再起動するか新しいセッションを開始してください。プラグインにgit-commit skillをインストールする
/plugin marketplace add sequenzia/agent-alchemy /plugin install agent-alchemy-git-tools@agent-alchemy
Claude Codeにgit-commit skillをインストールする
~/.claude/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.claude/skills/git-commitClaude Code (project)にgit-commit skillをインストールする
.claude/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit .claude/skills/git-commitCodexにgit-commit skillをインストールする
~/.agents/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.agents/skills/git-commitGemini CLIにgit-commit skillをインストールする
~/.gemini/skills/git-commit/SKILL.md
$ npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.gemini/skills/git-commitClaude.aiにgit-commit skillをインストールする
npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit git-commit && zip -r git-commit.zip git-commit # claude.ai → Customize → Skills → + → Create skill → Upload a skill → git-commit.zip
SKILL.md
GitHubで表示Git Commit
Create a commit with a conventional commit message based on staged changes. Automatically stages all changes and analyzes the diff to generate an appropriate commit message.
Workflow
Execute these steps in order.
Step 1: Check Repository State
Check for changes to commit:
git status --porcelain
- If output is empty, report: "Nothing to commit. Working directory is clean." and stop.
- If changes exist, continue to Step 2.
Step 2: Stage All Changes
Stage all changes including untracked files:
git add .
Report: "Staged all changes."
Step 3: Analyze Changes
View the staged diff to understand what changed:
git diff --cached --stat
git diff --cached
Analyze the diff to determine:
- The type of change (feat, fix, docs, refactor, etc.)
- The scope (optional, based on affected files/modules)
- A concise description of what changed
Step 4: Construct Commit Message
Build a conventional commit message following this format:
<type>(<optional-scope>): <description>
[optional body]
Types:
feat- New featurefix- Bug fixdocs- Documentation onlystyle- Formatting, no code changerefactor- Code restructuring without behavior changetest- Adding or updating testschore- Maintenance tasksbuild- Build system or dependenciesci- CI configurationperf- Performance improvement
Rules:
- Use imperative mood ("add" not "added")
- Use lowercase
- No trailing period
- Keep description under 72 characters
- Add a body only for complex changes or breaking changes
- Do NOT add co-author, attribution, or "Generated with" lines
Step 5: Create Commit
Create the commit using a heredoc for proper formatting:
git commit -m "$(cat <<'EOF'
<commit message here>
EOF
)"
Step 6: Handle Result
On success:
- Report the commit hash: "Committed: {short_hash} - {message}"
On pre-commit hook failure:
- Report: "Pre-commit hook failed. The commit was NOT created."
- Explain what the hook reported
- Instruct: "Fix the issues above and run the commit command again. Do NOT use --amend as that would modify the previous commit."
Error Recovery
If the commit fails:
- Hook failure: Fix the reported issues, then stage and commit again (do NOT amend)
- Unstage changes:
git reset HEADto unstage without losing changes
Notes
- This command stages ALL changes including untracked files
- Pre-commit hooks run automatically; their failures mean no commit was created
- Always create a NEW commit after hook failure, never amend the previous commit
このスキルのファイル
1git-commit skillに関する質問
Claude Codeにgit-commit skillをインストールするには
npx degit sequenzia/agent-alchemy/claude/git-tools/skills/git-commit ~/.claude/skills/git-commitを実行してください。Claude Codeは~/.claude/skills(すべてのプロジェクト)または.claude/skills(単一プロジェクト)からskillsを読み込み、説明がタスクに一致する場合にskillを使用します。
git-commit skillはどのクライアントで使用できますか
Agent Skills形式を読み込むすべてのクライアントで使用できます: Claude Code、Codex、Gemini CLI、claude.ai(ZIPとしてアップロード)。skill内のスクリプトは、クライアントがコード実行を許可した場合にのみ実行されます。
コミットメッセージはどのような形式に従いますか?
type、オプションのscope、およびdescriptionを含む conventional commit 形式に従います。