# Commit Message Generation Custom Prompt

**URL:** <https://forum.cursor.com/t/commit-message-generation-custom-prompt/39631>\
**Category:** Feature Requests\
**Created:** [January 7, 2025, 6:50am UTC](https://forum.cursor.com/t/commit-message-generation-custom-prompt/39631 "2025-01-07T06:50:36Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![setage](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/setage/32/110935_2.png) [@setage](https://forum.cursor.com/u/setage)\
**Post date:** [June 7, 2026, 3:56pm UTC](https://forum.cursor.com/t/commit-message-generation-custom-prompt/39631/9 "2026-06-07T15:56:02Z")

</div>

I came up with a following solution for all the agents at once:

Add instruction to `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, or whatever else you use (you also can reference file with a rule in some common file).

**Mine looks like this:**

```auto
## Commit messages

At the end of any task implementation, provide the intended commit message.
It must follow `apps/web-public/docs/CONTRIBUTING.md` and pass commitlint.
Keep every commit message line at or below 100 characters. Use bullet points in
the commit body description so the changes are easy to scan and understand.

```

You can customize it to the style and commit rules you prefer.

**Now Cursor, Codex, Claude return something like:**

`Intended commit message:`

```auto
refactor(ui): extract collapsible preview section into its own component

- Move the preview form into a dedicated component
- Add a collapsible heading with chevron toggle

```

with copy button within the message box.

It doesn’t fix Cursor’s built-in Generate Commit Message function, but allows you just copy-paste and commit.  
Also, it will teach Cursor to generate messages like this over time, as u/ijorb already mentioned before.

And use [commitlint](https://github.com/conventional-changelog/commitlint/tree/master) with preffered config, to keep it in sync and as an additional guardrail for agents and yourself 😉

---

_[View the full topic](https://forum.cursor.com/t/commit-message-generation-custom-prompt/39631)._
