diff --git a/.claude/commands/README.md b/.claude/commands/README.md index 5dbc951..b5c301f 100644 --- a/.claude/commands/README.md +++ b/.claude/commands/README.md @@ -54,6 +54,16 @@ Create a comprehensive synthesis of the week's work. Best for: Weekly reviews, pattern recognition +### 💬 git-commit-msg + +AI-generated conventional commit messages from staged changes. + +``` +/git-commit-msg +``` + +Best for: Creating meaningful commit messages, maintaining clean git history + ## Creating Custom Commands 1. Create a new `.md` file in this directory diff --git a/.claude/commands/git-commit-msg.md b/.claude/commands/git-commit-msg.md new file mode 100644 index 0000000..f4260a8 --- /dev/null +++ b/.claude/commands/git-commit-msg.md @@ -0,0 +1,320 @@ +--- +allowed-tools: Bash, AskUserQuestion +description: AI-generated git commit messages from staged changes +argument-hint: [optional: type or scope hint] +--- + +# AI Git Commit Message Generator + +Analyzes your staged git changes and generates a well-structured conventional commit message using AI. Perfect for creating meaningful, consistent commit messages that follow best practices. + +## Task + +Review staged changes, analyze the modifications, and generate a descriptive conventional commit message that accurately describes what was changed and why. + +## Process + +### 1. **Check Git Status** + +First, verify there are changes to commit: + +```bash +git status +``` + +If no changes are staged, check if there are unstaged changes: +- If yes: Ask user if they want to stage all changes +- If no: Exit with message "No changes to commit" + +### 2. **Review Changes** + +Show detailed diff of staged changes: + +```bash +# Show staged changes +git diff --cached --stat +git diff --cached +``` + +Also check recent commits for context on commit message style: + +```bash +git log --oneline -5 +``` + +### 3. **Analyze Changes** + +Examine the diff output to understand: +- **What changed**: Files modified, added, or deleted +- **Scope**: Which modules/components are affected +- **Type**: Is this a feature, fix, refactor, docs, etc.? +- **Impact**: Breaking changes, new functionality, bug fixes +- **Details**: Specific changes worth mentioning + +### 4. **Generate Commit Message** + +Create a conventional commit message following this format: + +``` +(): + + + +