Generate a git commit message and apply it immediately.
First, run git diff --staged --stat to check for staged changes.
- If there are staged changes, run
git diff --staged to see what will be committed.
- If there are no staged changes, run
git add -A to stage everything, then run git diff --staged to see what will be committed.
Also run git log --oneline -5 to understand recent context.
Then write a commit message following these rules:
- Use Conventional Commits format:
type(scope): short description
- Types: feat, fix, docs, style, refactor, test, chore
- Subject line: imperative tense, under 72 characters, no period at end
- If the change needs more explanation, add a blank line then a short body (2-4 sentences max)
- Body explains what and why, not how
- Do not include "Generated by", "Co-Authored-By", or any meta-commentary
Before committing, run ls CHANGELOG.md 2>/dev/null to check if a changelog file exists in the repo root. If it does, regenerate the ## Unreleased section using the same rules as the /changelog command — treating the changes about to be committed as already included — and overwrite CHANGELOG.md with the result. Then stage CHANGELOG.md with git add CHANGELOG.md so it is included in the commit.
Apply the commit immediately with git commit -m "...". Show the commit message and the output of git commit so the user can see what was committed. Do not ask for confirmation first.
$ARGUMENTS
1---2name: commit3description: Generate a git commit message and apply it immediately.4---56Generate a git commit message and apply it immediately.78First, run `git diff --staged --stat` to check for staged changes.9- If there are staged changes, run `git diff --staged` to see what will be committed.10- If there are no staged changes, run `git add -A` to stage everything, then run `git diff --staged` to see what will be committed.1112Also run `git log --oneline -5` to understand recent context.1314Then write a commit message following these rules:15- Use Conventional Commits format: `type(scope): short description`16- Types: feat, fix, docs, style, refactor, test, chore17- Subject line: imperative tense, under 72 characters, no period at end18- If the change needs more explanation, add a blank line then a short body (2-4 sentences max)19- Body explains *what* and *why*, not *how*20- Do not include "Generated by", "Co-Authored-By", or any meta-commentary2122Before committing, run `ls CHANGELOG.md 2>/dev/null` to check if a changelog file exists in the repo root. If it does, regenerate the `## Unreleased` section using the same rules as the `/changelog` command — treating the changes about to be committed as already included — and overwrite `CHANGELOG.md` with the result. Then stage `CHANGELOG.md` with `git add CHANGELOG.md` so it is included in the commit.2324Apply the commit immediately with `git commit -m "..."`. Show the commit message and the output of `git commit` so the user can see what was committed. Do not ask for confirmation first.2526$ARGUMENTS