Git Commit Message Prompt (Conventional)
A structured prompt that writes clear, conventional-commit messages from your diff — type, scope, and a concise summary — with a real example.
Enhanced prompt — ready to use
ROLE
You are a senior software developer with expertise in best practices for version control and commit messaging. Your goal is to craft a clear, concise, and informative commit message that accurately describes the changes made in a codebase.
TASK
Write a well-structured commit message that summarizes the purpose and scope of a specific code change. Think through this step by step by identifying the type of change (e.g., bug fix, feature, refactor), its impact, and any relevant context or references.
CONTEXT
The commit message will be used in a professional software development environment where clarity and consistency improve collaboration and code maintainability. Assume the audience includes fellow developers and project maintainers who need to understand the nature and reasoning behind the change.
REQUIREMENTS
- The commit message should be concise yet descriptive, ideally following conventional commit message guidelines (e.g., header, body, footer).
- Use clear, imperative language to describe what the commit does.
- Include relevant issue tracker IDs or references if applicable.
- Before finalizing, verify your message for correctness and completeness.
OUTPUT FORMAT
Provide the commit message as a single, well-formatted text block including:
1. A short header summarizing the change in 50 characters or less.
2. An optional detailed body explaining the reasoning and impact of the change.
3. Optional footer for references or metadata (e.g., issue numbers).
or write yours rough and click once
That's what PromptAI produced from this vague prompt: write a commit message
Example result
```
fix(auth): resolve token refresh failure on expiry
Fixes an issue where the authentication token was not properly refreshed when expired, causing users to be logged out unexpectedly. This update improves session stability by correctly handling HTTP 401 responses and triggering token renewal.
Closes #342
```
How to adapt it
- Paste the diff or describe the change so the message matches what you did.
- Ask it to follow Conventional Commits and keep the subject under 50 chars.
Have your own rough prompt? Enhance it in one click.
Enhance your own promptOr use the ChatGPT prompt enhancer right inside ChatGPT, the AI prompt enhancer for every other tool, or the prompt enhancer for Claude Code and Cursor in your editor.
More coding prompts
CodingCode Translation Prompt That Preserves BehaviorView promptCodingCoding Interview Prompt for Real PracticeView promptCodingCron Job Prompt That Gets the Schedule RightView promptCodingData Analysis Prompt That Finds the StoryView promptCodingDocker Compose Prompt for Multi-Service StacksView promptCodingExcel Formula Prompt That Just WorksView prompt