Rules not being followed in Git commit message generation

I’m using the new custom slash-commands to commit, and I honestly don’t think I’d go back to the auto button even if it worked. I love this. To try it:

  1. Type a ’/’ in agent prompt and click on “+ Create Command
  2. Name the command whatever you want.
  3. Paste the content below. (Edit if you wish. I removed a line that tells it to use a rules file that has our commit standards in it, so that may help me more than this version, but maybe not.)
  4. Stage some changes (git add in a shell or stage in Cursor)
  5. Open a chat and type / to pick and run your new command!

(Note this was written by Haiku based on an older version I had in a rules + custom-mode workflow. Some of the syntax is the model’s, like the bolded not about getting context.)

# Git Commit Workflow

Execute the commit workflow following the project's commit message conventions.

## Workflow Steps

1. **Get staged changes context** with this command:

   ```bash

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

   ```

2. **Analyze the output** to understand:
- What files are staged vs un-staged
- Change types and scope (additions/deletions)
- Which changes will actually be committed

3. **Write accurate commit message** based on staged changes only:
- Format: `<type>(<scope>): <subject>`
- Use imperative present tense, max 100 characters for subject
- Types: feat, fix, docs, refactor, test (no perf, style, chore, revert)
- Include details in list form if helpful for larger commits

4. **Execute git commit command** using run_terminal_cmd for user review

## Important Notes

- Generate minimum output; user only needs final commit command
- Do not read/summarize git command output after execution unless asked
- User can modify the commit command in shell before executing
- Your shell is already at the project root so you do not need `cd` or 'bash', just use `git ...`

A major point: I have my auto-run allow-list set to ALLOW git status, git diff, and any other non-destructive commands it may use for this, but I do NOT allow all git(git with no subcommand), and especially not git commit. This makes it run really fast through the work, and then stop so i can review (and edit) the generated command, and then click commit when I am ready.

I highly recommend using either claude-4.5-haiku or grok-code-fast-1, They seem to produce the best and most consistent command content and structure and run really fast!

1 Like