crav1-finalize-commit
Finalize a commit: style.md vs git log first if needed, then draft GitKraken Summary and Description, then offer git commit first, then copy / edit / rewrite / stop. Wording is shown before those choi
SKILL.md.claude/skills/crav1-finalize-commit/SKILL.md
GitHubFinalize commit
Opening question (1.56.0)
This skill now also replaces /crav1-draft-commit-message. Its rules are kept, unchanged, as a branch. Ask one question, with the questions tool when it is available:
- Commit. Draft, show, then offer git commit. Follow the rest of this file.
- Only write the message. A paste-ready Summary and Description, no git commit. Follow branches/message-only/BRANCH.md.
Skip the question when the message says which: "commit" or "finalize" is 1; "just the message", "draft", or "paste" is 2. The style, work-item mention, and work-item offer rules in branches/message-only/references/ apply to both choices, as they did before.
You wrap crav1-finalize-commit. First produce the same Summary and Description. Then keep those two fields in play until they pick commit, copy, or stop.
Command: /crav1-finalize-commit.
Order: (1) style menu if no persist rule, (2) generate and show Summary/Description, (3) then the choices with commit first (top of the questions tool), then copy / edit / rewrite / stop. Never put those choices before the wording exists.
Paste-only (no copy/edit/commit choices): tell them /crav1-finalize-commit instead, or they can pick copy here.
When the message or the files make one option the better fit, list it first and end its label with (Recommended). Otherwise keep the order above with no label.
Choice words
Exact words for bots and scripted runs. There are no --flags.
- Commit or message:
commit/message only.
When the invocation contains one of these words (for example /crav1-finalize-commit commit), take that choice and do not ask. This holds for a person, a bot, or a headless run.
When a choice is missing and the run is headless or started by a bot (no person in the chat to answer), do not guess. Stop and name the valid words, for example: Missing choice. Use one of: commit, message only.
Draft (same as the other skill)
Follow skill crav1-finalize-commit in full for the first draft (drop-in: .claude/skills/crav1-finalize-commit/branches/message-only/BRANCH.md; plugin: sibling skills/crav1-finalize-commit/branches/message-only/BRANCH.md):
- Style menu or persist rule (
once/onward/log-once/log-onward) - Inspect staged first, else unstaged
- Output the Summary and Description paste blocks
- Work-item mention, when references/work-item-mention.md resolves one (plugin: sibling
skills/crav1-finalize-commit/branches/message-only/references/work-item-mention.md): one blank line, then that mention as the last line of the Description. Subject stays as drafted.
Do not run git commit in that step. Do not skip the paste blocks — they stay GitKraken-copyable on every turn. The mention is inside the Description fence, so a GitKraken paste includes it. A work-item hint stays after the fences.
Remember the intended file set (the paths the message describes). Warn if agent-tools/ or build output is in that set.
After every new wording (first draft, edit, or rewrite)
They choose after the message exists, not before.
Do not open copy/edit/commit choices in the same turn as the CRAV1 style vs git-log menu. If style is needed, that turn is style only: no draft, no finalize choices.
On the turn that produces wording:
Finish the draft (git inspect, style already chosen).
Write the Summary and Description paste blocks into the user-visible reply. This is required. Do not skip it.
Then offer the choices (questions tool when available). Put the actual Summary and Description in the question prompt so the choice UI still shows the generated text, for example:
Summary: <one line>Description:(the body, including the trailing work-item line when the draft has one)What next?Options, in this order:
commit/copy/edit/rewrite/stop.commitis always the first/top option in the questions tool and in any bullet list.
Never call the questions tool (or any blocking choice UI) before step 2. Never call it as the first action of a draft turn. Draft first, choices last. Do not git commit until they pick commit.
| Id | Choice | What it does |
|---|---|---|
commit |
Create the git commit | Use the current Summary + Description. See below. Always list this first. |
copy |
Copy for GitKraken | Done. Same outcome as /crav1-finalize-commit. They paste Summary/Description. No git commit. |
edit |
Change the text | They say what to change (summary, description, or both). Apply only those edits. Keep the same style source. Show the new blocks, then the same choices again (commit still first). |
rewrite |
New draft from the diff | Run the draft skill’s draft step again on the same file set and style source. Discard the previous wording. Show the new blocks, then the same choices again (commit still first). |
stop |
Abort | No commit. They can still copy the last blocks. |
If they named copy/edit/commit before any wording exists, ignore it, draft, show blocks, then offer choices.
Do not invent extra options (push, amend, commit subsets they did not name). If they ask to push after a successful commit, that is a new request — only then git push. If they want a pull request, that is /crav1-open-pr in a later turn. Do not open it here.
When they pick edit
- If they paste a full new Summary and/or Description, use that text (cleanup only: no Conventional Commits unless the style source is git log that already uses them). Their pasted Description replaces the body, including its last line.
- If they give notes (“shorter summary”, “mention verify.md”), rewrite just those parts. Keep the trailing work-item mention as the last line of the Description unless the note changes or removes it.
- Ask which field if it is unclear.
- Then show the new paste blocks and then the same choices again (
commitstill first). Never commit in the same turn aseditunless they also saidcommitafter seeing the new blocks.
When they pick commit
- Confirm git works (same PATH fallback as the draft skill).
- Files: commit staged files if the index is non-empty. If the index is empty, ask whether to
git addthe intended file set from the draft. Do not addagent-tools/,artifacts/,bin/,obj/, or other build output. - Message:
git commitwith Summary as the subject (-m) and Description as the body (second-m, or a HEREDOC). The body is the Description paste, including a trailing work-item mention when the draft has one. Do not addCo-authored-by,Made-with: Cursor, or other trailers yourself. Do not drop the mention line. - Do not push.
- Read
git log -1 --format=%B. Compare to the drafted Summary + Description. The mention, when the draft has one, is the last line of that Description. A last line of#<id>orAB#<id>is the work-item mention, not Cursor attribution. - Show the new hash, subject, and
git statusshort result. - If the body has extra Cursor attribution (
Co-authored-by: Cursor,cursoragent@cursor.com,Made-with: Cursor) that was not in the draft: this is Cursor’s commit-attribution setting (or a cloud agent), not this skill and usually not a repo hook. Follow Cursor attribution below. - After the commit message is settled (including a one-time attribution strip), one optional line and nothing more: Next (optional):
/crav1-open-prwhen you want to push and open the PR. Do not run that skill in this turn. - If commit fails (hooks, empty index, identity), show the error. Keep the paste blocks, then offer the choices again (
commitstill first). Do not name/crav1-open-pron a failed commit.
Do not git commit --amend for wording tweaks unless they asked. Amending only to restore the drafted message (strip attribution) is allowed as below.
Cursor attribution
After a successful commit, if HEAD’s message is the draft plus a Cursor co-author/trailer:
- Tell them in one short sentence: Cursor appended it; it was not part of the message they accepted.
- Strip it once when all of these are true: this process created HEAD, HEAD is not pushed, they have not asked to keep the trailer.
git commit --amend --no-verifywith exactly the drafted Summary + Description (same-m/ HEREDOC as the original commit). No extra trailers. When the Description ends with the work-item mention, that line stays the last line of the amended message.- Read
git log -1 --format=%Bagain. If the trailer is gone, show the clean hash/message, then the optional/crav1-open-prline from the commit steps. Do not amend again. - If the trailer came back, Cursor wrapped
git commitagain. Do not loop amend. Offerstrip(they should turn attribution off first) orkeep.
- How to stop it on future local commits: Cursor Settings → Git & PRs → Attribution (older: Agent → Attribution) → turn commit attribution off. CLI:
attribution.attributeCommitsToAgentfalse in~/.cursor/cli-config.json. Enterprise admins can disable it org-wide. Cloud / background agents may still add co-author; the IDE toggle does not always apply there. - Do not install a
prepare-commit-msghook unless they ask.
If they say they want the Cursor trailer, leave it.
Hard rules
- Never offer commit/copy/edit before Summary/Description exist. After they exist, show the blocks, then the choices with
commitfirst. The question prompt includes that wording. - No commit until
commit(or an unambiguous “commit this message now”) after they have seen the current blocks. copynever runsgit commit.- After
commit, if Cursor appendedCo-authored-by/Made-withthat was not in the draft, strip it once with amend when HEAD is ours and unpushed; do not fight a second inject—tell them to turn Attribution off. The amend keeps the drafted Description, including a trailing work-item mention. - Do not install a hook to enforce the work-item line. Do not block the commit when
work-item.mdis missing. - Do not change product files except the persist rules the draft skill already writes. Cursor:
.claude/rules/draft-commit-style.mdor.claude/rules/draft-commit-gitlog.md. Claude Code project:.claude/rules/draft-commit-style.mdor.claude/rules/draft-commit-gitlog.md. Claude Code user:~/.claude/rules/draft-commit-style.mdor~/.claude/rules/draft-commit-gitlog.md. - Do not open a PR. After a successful commit, one optional line may name
/crav1-open-pr. Do not invoke it.