Hope to enhance the Generate Commit Message feature to support cursor rules

1. Support Custom Rules

To maintain consistent commit message styles across our team, we’d like the ability to define custom rules (e.g., format, prefixes, or templates) that guide the AI in generating commit messages. This ensures clarity and uniformity for all team members.

2. Support Prompt Input for Better Context

Sometimes, the AI may not fully grasp the intent behind a commit. We propose allowing optional user prompts in the message input to provide additional context, helping the AI generate more accurate and meaningful commit messages.

3. Support Branch Information Parsing

In our workflow, development tasks are tracked via branch names (e.g., containing task/issue IDs). It would be extremely useful if the AI could:

  • Parse branch names (via cursor rules)
  • Extract relevant metadata (e.g., task ID)
  • Include them in commit messages
    This would help automatically link commits to our project management system (e.g., Jira, Linear).
3 Likes

I wish I could upvote this many times.

Perhaps start with simply allowing it to use the .cursorrules and expand features after that.

For now I found this rule works really well. I can stage some files and simply type “commit” and the assistant does great work. Note I do have more rules about how to write commit messages that it uses as well.

Rules file:


description: Apply when creating git commit command lines.

alwaysApply: false


Commit Workflow

When asked to commit, execute this workflow to create a command for the user to commit the currently stages files.

  • Generate the minimum output while working to use as little tokens as possible.

  • The user only needs to see the final commit command line. Go multi-line only if needed, but keep it concise.

  • Do not read the commit command shell output/result or reply. We do not need you to think further after providing the commit message unless asked.

  1. Get complete context with this command:

git status && echo "=== STAGED CHANGES ===" && git diff --cached

  1. Analyze the output to understand:
  • What files are staged vs unstaged

  • Line counts and change types (additions/deletions)

  • Which changes will actually be committed

  1. Write accurate commit message based on the staged changes only

  2. Present the git commit command with your inline shell tool for user review and execution

1 Like

Thank you both for the feature request and the expanded notes.
We are collecting feature request and will consider it.