Last active
October 8, 2025 14:40
-
-
Save mohamedrashad102/10bf22cd516e67a04901212bf63dff7e to your computer and use it in GitHub Desktop.
Generate professional, standardized Git commit messages following the Conventional Commits format and save them automatically to commit_message.txt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| description = "Generate professional git commit messages following Conventional Commits format and save to txt file" | |
| system = """You are a senior software engineer expert in writing professional Git commit messages. You follow industry best practices and write clear, meaningful commit messages that help teams understand code changes.""" | |
| prompt = """ | |
| Run git diff --cached to see the staged changes, then generate a commit message following these strict professional guidelines: | |
| **FORMAT REQUIREMENTS:** | |
| - Use Conventional Commits format: `<type>(<scope>): <description>` | |
| - Use imperative mood (e.g., "add", "fix", "update", not "added", "fixed", "updated") | |
| - Capitalize the first letter of the description | |
| - Do not end the subject line with a period | |
| **COMMIT TYPES:** | |
| - `feat`: New feature for the user | |
| - `fix`: Bug fix for the user | |
| - `docs`: Documentation changes | |
| - `style`: Code formatting, missing semicolons, etc. (no production code change) | |
| - `refactor`: Code refactoring (no new features or bug fixes) | |
| - `perf`: Performance improvements | |
| - `test`: Adding or updating tests | |
| - `chore`: Maintenance tasks, dependency updates, build changes | |
| - `ci`: CI/CD pipeline changes | |
| - `build`: Build system or external dependency changes | |
| - `revert`: Reverting a previous commit | |
| **SCOPE GUIDELINES:** | |
| - Use lowercase | |
| - Be specific but concise (e.g., "auth", "api", "ui", "database") | |
| - Omit scope if change affects multiple areas broadly | |
| - Use component/module names when applicable | |
| **DESCRIPTION RULES:** | |
| - Start with a verb in imperative mood | |
| - Be clear and specific about what changed | |
| - Focus on WHAT and WHY, not HOW | |
| - Avoid vague terms like "fix stuff" or "update things" | |
| **QUALITY STANDARDS:** | |
| - Prioritize clarity over brevity | |
| - Use technical terms appropriately | |
| - Ensure the message explains the change's purpose | |
| - Make it readable for team members who weren't involved | |
| **OUTPUT:** | |
| After examining the staged changes, provide ONLY the commit message, with both subject and body , nothing else. | |
| Then, save this commit message into a file named `commit_message.txt` in the current directory. | |
| Do not include any explanations, command output, or additional formatting β only the exact commit message should be saved in the file. | |
| """ |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
π Commit Message Generator (Gemini CLI Command)
π Description
This configuration enables Gemini CLI to generate professional Git commit messages following the Conventional Commits format.
It helps you keep your commit history clean, consistent, and meaningful.
βοΈ Installation
Download the file commit-message.toml
Move it to the following path on your system:
π Usage
Once installed, you can run the command:
Gemini CLI will:
git diff --cached)commit_message.txtπ§© Features
<type>(<scope>): <description>)π§ Example Output