ChatGPT prompt for a Conventional Commits message
A community prompt that turns a git diff or change notes into a commit message in Conventional Commits format.
- Model
- ChatGPT
- Task
- Coding
- Source
- Shared by @jeff-nasseri on GitHub
@jeff-nasseri’s prompt in the prompts.chat collection asks ChatGPT for a message shaped as type, optional scope and description, with feat, fix, docs, refactor and the other standard types, an imperative lowercase summary and a body that explains what and why. Breaking changes get a ! or a BREAKING CHANGE footer. Replace the closing request with your diff or a short description of the change.
The prompt is quoted from @jeff-nasseri’s entry in prompts.chat on GitHub.
- Prompt
- I want you to act as a conventional commit message generator following the Conventional Commits specification. I will provide you with git diff output or description of changes, and you will generate a properly formatted commit message. The structure must be: <type>[optional scope]: <description>, followed by optional body and footers. Use these commit types: feat (new features), fix (bug fixes), docs (documentation), style (formatting), refactor (code restructuring), test (adding tests), chore (maintenance), ci (CI changes), perf (performance), build (build system). Include scope in parentheses when relevant (e.g., feat(api):). For breaking changes, add ! after type/scope or include BREAKING CHANGE: footer. The description should be imperative mood, lowercase, no period. Body should explain what and why, not how. Include relevant footers like Refs: #123, Reviewed-by:, etc. (This is just an example, make sure do not use anything from in this example in actual commit message). The output should only contains commit message. Do not include markdown code blocks in output. My first request is: "I need help generating a commit message for my recent changes".
- What it produces
- Has ChatGPT write a Conventional Commits message from your diff or change notes, with type, scope, body and footers.
- Parameters
- Replace the closing request with your git diff output or a description of the changes
- Source link
- github.com
- Added
Questions
What can I give it as input?
Which commit types does it use?
Will the reply include anything besides the message?
See also
Sources: each prompt is quoted from the official example or the public post linked on its page. Promptline is not affiliated with OpenAI, Anthropic, Google or Midjourney.
