Implement GitOps workflows with ArgoCD and Flux for automated, declarative Kubernetes...
npx skills add tomwangowa/agent-skills --skill "commit-msg-generator"
Install specific skill from multi-skill repository
# Description
Generate high-quality commit messages following Conventional Commits specification. Use this Skill when the user asks to generate commit message, write commit message, or create commit description.
# SKILL.md
name: commit-msg-generator
description: Generate high-quality commit messages following Conventional Commits specification. Use this Skill when the user asks to generate commit message, write commit message, or create commit description.
Commit Message Generator
Purpose
This Skill generates well-structured commit messages that follow the Conventional Commits specification by:
1. Analyzing staged changes (git diff --cached)
2. Using Gemini CLI to understand the changes and their purpose
3. Generating a properly formatted commit message
4. Providing the message in a ready-to-use format
The Skill helps maintain consistent commit history and saves time writing descriptive commit messages.
Instructions
When the user expresses intent to generate a commit message (for example: "generate commit message", "write commit message", "help me commit"), follow the steps below strictly.
Execution steps
-
Run the script
scripts/generate_commit_msg.sh. -
The script will:
- Check that there are staged changes
- Analyze the diff to understand what changed
- Use Gemini to generate a commit message following Conventional Commits format
-
Display the generated message
-
Present the generated commit message to the user and explain:
- The commit type and scope
- Why this message accurately describes the changes
-
How to use it (copy it or use
git commit -Fcommand) -
Optional: Ask if the user wants to:
- Use the message as-is
- Make modifications
- Regenerate with different emphasis
Output requirements
Your response should include:
-
Generated commit message
Display the full commit message clearly -
Explanation
Brief explanation of why this type/scope was chosen -
Usage instructions
How to apply the message to the commit -
Alternative options
Offer to modify or regenerate if needed
Constraints
- Only works when there are staged changes (
git addmust be run first) - Requires Gemini CLI to be installed and configured
- Message format strictly follows Conventional Commits specification
- Subject line must be 50 characters or less
- Body lines wrapped at 72 characters
Examples
User:
Generate a commit message for my staged changes
Expected behavior:
- Run generate_commit_msg.sh
- Display the generated message with formatting
- Explain the commit type and reasoning
- Provide command to use the message
User:
Help me write a commit message
Expected behavior:
- Same workflow as above
- Show both the raw message and usage command
User:
I need a commit description
Expected behavior:
- Generate message following conventional commits
- Explain what makes this a good commit message
- Offer to regenerate if user wants different emphasis
Commit Message Format
The generated messages follow this format:
type(scope): subject line
Optional body explaining what and why, not how.
Can include bullet points for multiple changes.
Co-Authored-By: Gemini AI <[email protected]>
Types:
- feat: New feature
- fix: Bug fix
- docs: Documentation
- style: Formatting
- refactor: Code restructuring
- perf: Performance
- test: Tests
- chore: Maintenance
- ci: CI/CD
- build: Build system
Best Practices:
- Subject in imperative mood ("add" not "added")
- Subject starts with lowercase
- No period at end of subject
- Body explains "what" and "why", not "how"
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.