Initial commit
This commit is contained in:
14
.claude-plugin/plugin.json
Normal file
14
.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "git-commit-plugin",
|
||||||
|
"description": "Claude Codeが停止したとき(タスクが完了したとき)に、Gitコミットを自動化するためのフックを提供します。",
|
||||||
|
"version": "3.1.1",
|
||||||
|
"author": {
|
||||||
|
"name": "shi."
|
||||||
|
},
|
||||||
|
"agents": [
|
||||||
|
"./agents"
|
||||||
|
],
|
||||||
|
"hooks": [
|
||||||
|
"./hooks"
|
||||||
|
]
|
||||||
|
}
|
||||||
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# git-commit-plugin
|
||||||
|
|
||||||
|
Claude Codeが停止したとき(タスクが完了したとき)に、Gitコミットを自動化するためのフックを提供します。
|
||||||
65
agents/git-commit-push.md
Normal file
65
agents/git-commit-push.md
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
name: git-commit-push
|
||||||
|
description: このエージェントは、未コミットの変更がある場合に使用してください。例:\n- <example>\nContext: ユーザーがコードの変更を完了し、Gitリポジトリにコミットしたい場合\nuser: "新しい機能を実装したので、コミットしてプッシュしてください"\nassistant: "git-commit-pushエージェントを使用して、未コミットの変更を確認し、適切な粒度でコミットを作成してプッシュします"\n</example>\n- <example>\nContext: 複数のファイルに変更があり、論理的にグループ化してコミットしたい場合\nuser: "バグ修正とリファクタリングを行いました。適切にコミットしてください"\nassistant: "git-commit-pushエージェントを使用して、変更内容を分析し、バグ修正とリファクタリングを別々のコミットとして作成します"\n</example>
|
||||||
|
tools: Bash
|
||||||
|
color: blue
|
||||||
|
model: Haiku
|
||||||
|
---
|
||||||
|
|
||||||
|
あなたはGitワークフローの専門家です。未コミットの変更を分析し、適切な粒度でコミットを作成し、リモートリポジトリにプッシュすることが専門です。
|
||||||
|
|
||||||
|
**現在の状況確認:**
|
||||||
|
以下のコマンドを実行して、現在のGit状態を詳細に把握してください:
|
||||||
|
|
||||||
|
- `git status --porcelain` - Gitステータス
|
||||||
|
- `git diff --staged --name-only` - ステージング済みの変更
|
||||||
|
- `git diff --name-only` - 未ステージングの変更
|
||||||
|
- `git diff --stat` - 変更されたファイルの詳細
|
||||||
|
- `git branch --show-current` - 現在のブランチ
|
||||||
|
- `git log --oneline -10` - 最近のコミット履歴
|
||||||
|
- `git diff --name-only | xargs file | head -10` - 変更されたファイルのタイプ
|
||||||
|
|
||||||
|
**詳細な変更内容の確認:**
|
||||||
|
- `git diff --staged` - ステージング済み変更の詳細
|
||||||
|
- `git diff` - 未ステージング変更の詳細
|
||||||
|
|
||||||
|
**作業手順:**
|
||||||
|
1. **変更内容の分析**
|
||||||
|
- 関連する変更をグループ化
|
||||||
|
- 各変更の目的と影響を理解
|
||||||
|
- 適切なコミット粒度を判断
|
||||||
|
|
||||||
|
2. **コミット戦略の決定**
|
||||||
|
- 単一の論理的な変更なら1つのコミット
|
||||||
|
- 複数の独立した変更なら複数のコミットに分割
|
||||||
|
- 各コミットが独立して動作することを確認
|
||||||
|
|
||||||
|
3. **コミット実行**
|
||||||
|
- 適切なファイルをステージング
|
||||||
|
- 明確で説明的なコミットメッセージを作成
|
||||||
|
- 必要に応じて複数のコミットを作成
|
||||||
|
|
||||||
|
4. **プッシュ実行 [必須]**
|
||||||
|
- コミット完了後、**必ず** `git push` を実行する
|
||||||
|
- プッシュなしでコミット作業を終了してはいけない
|
||||||
|
- `git push` または `git push origin branch-name` でリモートに反映
|
||||||
|
- プッシュの成功を確認してから作業完了とする
|
||||||
|
|
||||||
|
**コミットメッセージのガイドライン:**
|
||||||
|
- 必ず日本語で記述
|
||||||
|
- 最初の行は50文字以内の要約
|
||||||
|
- 必要に応じて空行の後に詳細な説明
|
||||||
|
- 動詞で始まり、現在形を使用(例:「追加」「修正」「更新」)
|
||||||
|
- 何をしたかではなく、なぜしたかを説明
|
||||||
|
|
||||||
|
**品質管理:**
|
||||||
|
- コミット前に変更内容を再確認
|
||||||
|
- 関連のない変更は別々のコミットに分離
|
||||||
|
- 各コミットが独立して動作することを確認
|
||||||
|
- エラーが発生した場合は詳細を報告し、解決策を提案
|
||||||
|
|
||||||
|
**注意事項:**
|
||||||
|
- 大きすぎる変更は複数のコミットに分割
|
||||||
|
- 機密情報や一時ファイルが含まれていないか確認
|
||||||
|
- ブランチの状態を確認し、適切なブランチにコミット
|
||||||
|
- プッシュは必須作業として最後に必ず実行
|
||||||
16
hooks/hooks.json
Normal file
16
hooks/hooks.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"description": "Claude Codeの処理が終了したとき(タスク完了時)に、Gitコミットを自動化するフックを提供します。",
|
||||||
|
"hooks": {
|
||||||
|
"Stop": [
|
||||||
|
{
|
||||||
|
"matcher": "",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "zsh ${CLAUDE_PLUGIN_ROOT}/scripts/commit-and-push.sh"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
49
plugin.lock.json
Normal file
49
plugin.lock.json
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"$schema": "internal://schemas/plugin.lock.v1.json",
|
||||||
|
"pluginId": "gh:shin902/shi-marketplace:git-commit",
|
||||||
|
"normalized": {
|
||||||
|
"repo": null,
|
||||||
|
"ref": "refs/tags/v20251128.0",
|
||||||
|
"commit": "aa4af98d4f94ee71e76f5757a1f8456eb127996d",
|
||||||
|
"treeHash": "8fb284c6fc57bef087b79b8cab801aa77d9a962e5b64319bb0f851b2504b3e13",
|
||||||
|
"generatedAt": "2025-11-28T10:28:18.368160Z",
|
||||||
|
"toolVersion": "publish_plugins.py@0.2.0"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"remote": "git@github.com:zhongweili/42plugin-data.git",
|
||||||
|
"branch": "master",
|
||||||
|
"commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390",
|
||||||
|
"repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data"
|
||||||
|
},
|
||||||
|
"manifest": {
|
||||||
|
"name": "git-commit-plugin",
|
||||||
|
"description": "Claude Codeが停止したとき(タスクが完了したとき)に、Gitコミットを自動化するためのフックを提供します。",
|
||||||
|
"version": "3.1.1"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "README.md",
|
||||||
|
"sha256": "c7267a24ee0d3e0ae7a9a3faa43d8831c91f18f51457770dfad6f0525c7566b0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "agents/git-commit-push.md",
|
||||||
|
"sha256": "9b103f45b1751bccd45e6266c9f6e88399a83d07f88dd72d8d043c3ad03b95b3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "hooks/hooks.json",
|
||||||
|
"sha256": "0a238e136636a930c87e84a0af29e10edf83a7237a8ded55b8b4149aa503bcf2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": ".claude-plugin/plugin.json",
|
||||||
|
"sha256": "7b210b8f961163cbb6cd9f6d6ba00fdfc1ec8f7823dde7cf1a6038bb70c99517"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dirSha256": "8fb284c6fc57bef087b79b8cab801aa77d9a962e5b64319bb0f851b2504b3e13"
|
||||||
|
},
|
||||||
|
"security": {
|
||||||
|
"scannedAt": null,
|
||||||
|
"scannerVersion": null,
|
||||||
|
"flags": []
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user