commit 02de91886584623dbbd6853f3c7fe36ef6124a19 Author: Zhongwei Li Date: Sat Nov 29 17:55:13 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..f7ef455 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "git-commit", + "description": "Professional git commit message generation following Conventional Commits specification with automatic diff analysis", + "version": "2.0.0", + "author": { + "name": "AnthemFlynn", + "email": "AnthemFlynn@users.noreply.github.com" + }, + "skills": [ + "./skills" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..65c01f4 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# git-commit + +Professional git commit message generation following Conventional Commits specification with automatic diff analysis diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..b460cda --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,73 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:AnthemFlynn/ccmp:plugins/git-commit", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "e75285328b429e6c01ab67f622d92ad894b91dc8", + "treeHash": "07548aa19bbe5949aa3cb642bbd39babf944d19c5243af92a806a3c76f0b645a", + "generatedAt": "2025-11-28T10:24:52.617149Z", + "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", + "description": "Professional git commit message generation following Conventional Commits specification with automatic diff analysis", + "version": "2.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "f092531a502f0a597c9a4b18089f6bf6374bbde5af93aadb7e4a2048f8223b4f" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "1da7a4b3f99daf08068a269393ed267fcaa1d2636fa9a79225e1a74c692e4d86" + }, + { + "path": "skills/git-commit/README.md", + "sha256": "89da246224599144eacacaf7ce9d1cb99b2212ff2fce7608d8197e79583a58bb" + }, + { + "path": "skills/git-commit/SKILL.md", + "sha256": "58f51b3671896d7c5dc63c7500f21c2bda3994bd29d43439aa8bc2bde4052fb9" + }, + { + "path": "skills/git-commit/references/slash-commands.md", + "sha256": "2b0955e50ac3c2d9fc69dd7dc4470ef9764f355646ed50fdf7b9836f2a0ccd0a" + }, + { + "path": "skills/git-commit/references/examples.md", + "sha256": "dd177ce89dc2451dc9b91ffd8cde6a4dcda5025b8efa4fe15c04673e3fdb3eb1" + }, + { + "path": "skills/git-commit/scripts/version.py", + "sha256": "8f33f318c6c093de8a043ec5ec488e702421de5737b9df933fb6e6868e027a6d" + }, + { + "path": "skills/git-commit/scripts/validate.py", + "sha256": "688a9b42d920fe84dac2ceb9a8ce52cdfd8ef0c32150927c9f7363b13c7b0e45" + }, + { + "path": "skills/git-commit/scripts/changelog.py", + "sha256": "07c40536622cb7e5e855c2dac1c9f1863c67175169ba90651403b4ddc43b13a5" + }, + { + "path": "skills/git-commit/scripts/analyze-diff.py", + "sha256": "0e712385957b8b0046c01dcb989a0f3637044d75868fcb5dc9ba6fcd03b6b472" + } + ], + "dirSha256": "07548aa19bbe5949aa3cb642bbd39babf944d19c5243af92a806a3c76f0b645a" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/git-commit/README.md b/skills/git-commit/README.md new file mode 100644 index 0000000..0cf06a7 --- /dev/null +++ b/skills/git-commit/README.md @@ -0,0 +1,147 @@ +# Git Commit Skill + +Claude will help you write professional commit messages following industry standards (Conventional Commits). + +## Installation + +1. Install `git-commit.skill` in Claude +2. That's it + +## Usage + +### Smart Analysis (NEW!) + +Stage your changes and ask Claude to help: + +``` +You: "Help me commit" + +Claude: [runs analyze-diff.py to examine your code] + +Based on your changes to auth/oauth.py: +- Added OAuth2 authentication functions +- Modified 15 lines in auth module + +Suggested commit: +git commit -m"feat(auth): add OAuth2 authentication" +``` + +The analyzer examines: +- **File paths** → suggests scope (e.g., auth, api, ui) +- **Added code** → suggests type (feat, fix, refactor) +- **Function names** → generates description +- **Removed APIs** → detects breaking changes + +You can also run it standalone: +```bash +git add . +python scripts/analyze-diff.py # Get suggestion +python scripts/analyze-diff.py --commit # Auto-commit with suggestion +``` + +### Manual Description + +Or just describe what you changed: + +``` +You: "Help me write a commit - I added OAuth login" + +Claude: git commit -m"feat(auth): add OAuth2 login support" +``` + +Claude will: +- Ask clarifying questions if needed +- Suggest the right commit type +- Format everything correctly +- Give you a ready-to-use git command + +## Slash Commands + +Use these commands for quick access to specific features: + +- **`/commit`** - Smart commit helper (analyzes code if staged, otherwise interactive) +- **`/validate `** - Check if a commit message is valid +- **`/types`** - Show all commit types with examples +- **`/scopes`** - Learn about scopes with project-specific suggestions +- **`/breaking`** - Guide for creating breaking change commits +- **`/changelog`** - Generate formatted changelog from commits +- **`/version`** - Calculate next semantic version number +- **`/examples`** - Show real-world commit examples +- **`/fix`** - Help amend or fix recent commits + +## How /commit Works + +**Smart and Adaptive:** + +1. **Has staged changes?** → Analyzes your code automatically +2. **No staged changes?** → Asks what you changed, builds interactively +3. **You described it already?** → Uses your description + +**Example with staged changes:** +```bash +git add auth/oauth.py +``` +``` +You: /commit + +Claude: 📊 Analyzed your changes... +Suggested: git commit -m"feat(auth): add OAuth2 authentication" + +Does this look good? +``` + +**Example without staged changes:** +``` +You: /commit + +Claude: No staged changes found. What did you change? + +You: I added OAuth login + +Claude: git commit -m"feat(auth): add OAuth login" +``` + +One command, smart behavior. + +## Examples of What to Ask + +- "Help me commit this change: [describe what you did]" +- "How should I write a commit for fixing the login bug?" +- "Is this commit message okay? fix: bug" +- "I made a breaking change to the API, help me write the commit" + +## Commit Format + +Claude follows this format: +``` +type(scope): description + +optional body + +optional footer +``` + +**Types:** feat, fix, refactor, perf, style, test, docs, build, ops, chore + +You don't need to memorize this - just describe what you did and Claude will format it correctly. + +## Optional: Git Hook + +If you want automatic validation, copy the included script: + +```bash +cp scripts/validate.py .git/hooks/commit-msg +chmod +x .git/hooks/commit-msg +``` + +Now all commits are validated before they're created. + +## That's It + +No documentation to read. No commands to memorize. Just ask Claude for help. + +--- + +**What it does:** Helps you write good commits +**How to use it:** Ask Claude naturally +**Learning curve:** Zero diff --git a/skills/git-commit/SKILL.md b/skills/git-commit/SKILL.md new file mode 100644 index 0000000..56587ec --- /dev/null +++ b/skills/git-commit/SKILL.md @@ -0,0 +1,213 @@ +--- +name: git-commit +description: Help users write professional git commit messages following Conventional Commits. Use when users ask about commits, need help writing commit messages, want to validate commit format, ask about git message conventions, or use slash commands like /commit, /validate, /changelog, /version. +--- + +# Git Commit Assistant + +Help users write clear, professional commit messages following the Conventional Commits specification. + +## Slash Commands + +Recognize and respond to these slash commands: + +- `/commit` - Smart commit helper (auto-analyzes code if staged, otherwise interactive) +- `/validate ` - Validate a commit message format +- `/types` - Show all commit types with descriptions +- `/scopes` - Explain scopes and show examples +- `/breaking` - Guide for creating breaking change commits +- `/changelog` - Generate changelog from recent commits +- `/version` - Determine next semantic version from commits +- `/examples` - Show comprehensive commit examples +- `/fix` - Help amend/fix the last commit + +When user types a slash command, execute that specific workflow. + +## User Intent Recognition + +When users ask questions like: +- "Help me write a commit for..." → Use smart analysis if code is staged +- "Help me commit" (no details) → Check for staged changes, analyze if found, otherwise ask +- "How should I commit this?" → Smart analysis mode +- "Is this commit message good?" → Validation mode +- "What's the right format for..." → Show format and examples + +Guide them naturally through creating a proper commit. + +## Commit Format + +Standard format: +``` +(): + + + +