From d9415cde7638c9e093ab51cf16c7aae48af7f3a8 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:25:12 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 14 ++++++++++ README.md | 3 +++ commands/commit.md | 44 +++++++++++++++++++++++++++++++ hooks/hooks.json | 16 ++++++++++++ plugin.lock.json | 53 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/commit.md create mode 100644 hooks/hooks.json create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..a1d6179 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,14 @@ +{ + "name": "git", + "description": "Common repository operations for git", + "version": "0.3.0", + "author": { + "name": "Aotokitsuruya" + }, + "commands": [ + "./commands" + ], + "hooks": [ + "./hooks" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7fee854 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# git + +Common repository operations for git diff --git a/commands/commit.md b/commands/commit.md new file mode 100644 index 0000000..b904fb4 --- /dev/null +++ b/commands/commit.md @@ -0,0 +1,44 @@ +--- +allowed-tools: Read, TodoWrite, Bash(git status:*), Bash(git log:*), Bash(git diff:*) +description: Create a git commit message based on current context +--- + +# Rule + +The `ARGUMENTS` will execute the main procedure. + +# Role + +You are a assistant to write git commit messages. + +# Conventional Commits + +By the default, follow Conventional Commits specification unless instructed otherwise. + +- According the context determine the appropriate type, scope, and description for the commit message. +- Ensure the scope is relevant to the changes made. e.g. monorepo subdirectory, specific feature, bug fix area. + +# Co-Authored-By + +When this command is executed without any prior conversation history, it means the changes is made solely by the user. In this case, do not include any "Co-Authored-By" lines in the commit message. + +# Definition + + + Create a git commit message based on current context + + 1. Analyze the recent conversation history to understand the changes made + + 2. Use "git" command to get changed files and their statuses + 3. Based on the changes and conversation context, generate a concise and descriptive git commit message + 4. Use same style and tone as previous commit messages if available + + 6. Remove "Co-Authored-by" lines from the commit message if present + + 5. Use Bash tool to make commit for the changes with the generated message + Commit confirmation message + + +# Task + +$ARGUMENTS diff --git a/hooks/hooks.json b/hooks/hooks.json new file mode 100644 index 0000000..9cdf859 --- /dev/null +++ b/hooks/hooks.json @@ -0,0 +1,16 @@ +{ + "description": "Automatic make git operation if condition met", + "hooks": { + "Stop": [ + { + "matcher": "", + "hooks": [ + { + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/dist/commit.js" + } + ] + } + ] + } +} diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..cae74c0 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,53 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:elct9620/claudekit:plugins/git", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "1e96034590a18695826b53eb48b2f2ca5bb6cef5", + "treeHash": "27457f223a84b0bca38d20b1a58e9d119c602d368e33ee9aa816cf8238bb96fd", + "generatedAt": "2025-11-28T10:16:44.755669Z", + "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", + "description": "Common repository operations for git", + "version": "0.3.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "6f638774e3d9001e686422041cdc4a69a468227487a2f73d0399cd0d701e5c1a" + }, + { + "path": "hooks/hooks.json", + "sha256": "6cb87d08b245550d97bb03484b4621834632978bd07b50eec975b0118e938d0b" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "7843554c98685c7a04212483232989d836a46565624363a085baef3a678fdfd8" + }, + { + "path": "commands/ignore.md", + "sha256": "bcb9ac9132d27e5d17250f3ff785273f6f764950fb2544f3358fed739f7ac9fb" + }, + { + "path": "commands/commit.md", + "sha256": "4f1fbafaba4071740a115c92fbe99522816421b4a5a06ae58f2e04f47cdac81f" + } + ], + "dirSha256": "27457f223a84b0bca38d20b1a58e9d119c602d368e33ee9aa816cf8238bb96fd" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file