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
Files22
View on GitHubSKILL.md.claude/skills/crav1-finalize-commit/SKILL.md
GitHubFinalize commit
No opening question (1.83.0)
Always draft first. There is no question before the wording. The draft rules are the message-only branch, branches/message-only/BRANCH.md, whose style, work-item mention, and work-item offer rules apply to every run.
First produce the Summary and Description. Then keep those two fields in play until they pick commit, copy, or stop.
Command: /crav1-finalize-commit.
Order (1.89.0): (1) generate and show Summary/Description, in the recommended style when no persist rule is saved, (2) then one prompt: the choices with commit first (top of the questions tool), then copy / change / stop, plus the style question when no persist rule is saved. There is no style menu before the draft.
Choice words
Read references/choice-words.md ("Choice words") when the invocation has any word after the command.
Headless or bot run with no choice word (no person in the chat to answer): draft, show the blocks, and end as copy. No git commit.
Draft
Follow branches/message-only/BRANCH.md for the first draft:
- Persist rule, else draft in the recommended style; the style question (
once/onward/log-once/log-onward) waits for the choices - Inspect staged first, else unstaged
- Output the Summary and Description paste blocks
- Work-item mention, when work-item-mention.md resolves one: 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 or change)
They choose after the message exists, not before.
When the style is not settled, ask CRAV1 style vs git log in the same questions call (1.70.0); a different style answer redrafts before anything is committed. Ask the style question at most once per run (1.90.5): once answered, or given as a choice word, every later draft in this run uses that answer without asking again.
On the turn that produces wording:
Finish the draft (git inspect; style from the persist rule, else the recommended style).
Write the Summary and Description paste blocks into the user-visible reply. This is required. Do not skip it.
Then offer the choices. The prompt is
Commit this message?. The blocks are already in the reply above; do not repeat them in the prompt.Options, in this order:
commit/copy/change/stop.commitis always the first/top option in the questions tool and in any bullet list.
Without a questions tool, use numbered lists, one per question, then end with Reply with choice words in one line, e.g. commit once strip trailers.
Never call the questions tool (or any blocking choice UI) before step 2.
Trailer hook (1.90.0): when no answer is saved and .githooks/commit-msg is missing or not turned on, the same prompt adds Strip tool trailers on every commit for this repo? (strip-trailers / keep-trailers), asked once per repo. Read references/trailer-hook.md ("When to ask") only then, and when a teammate has the hook but core.hooksPath is not .githooks. A reply that names neither word (for example only commit) leaves it unanswered: install no hook, save no answer, and ask again next run; never apply the Recommended pick on its own. A teammate with the hook but no config is asked turn-on-hook / skip-hook in that prompt; core.hooksPath is never set silently (1.182.0).
| 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. |
change |
Edit or rewrite | They say what to change (summary, description, or both), or say rewrite for a new draft from the diff. See below. |
stop |
Abort | No commit. They can still copy the last blocks. |
If they named copy/change/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). A push asked for after the commit is a new request.
Base branch (1.99.0). Before offering the choices, when HEAD is a base branch and anything staged is implementation code, read references/base-branch.md: the prompt becomes Commit on a work branch?, and nothing is committed on the base, even with commit-now; new-branch answers it.
When they pick change
Read references/change.md. Redraft or edit, show the new blocks, then the same choices; no commit in that turn.
When they pick commit
Work-item mention (1.193.0). commit-now may still ask one question: which work item to mention, when work-item.md has several Feature lines and none clearly matches the slice. It is one question card from scripts/work_item_pick.py, at most 4 options plus a typed Other. Never copy the mention from git log or the previous commit.
Read references/commit.md ("When they pick commit") only when they pick commit or commit-now. A pull request already open is named there: /crav1-open-pr to push to PR <n> and update its description or comment. Do not run it from this skill.
Added lines
The final message is exactly what this skill drafted. Any other line: read references/added-lines.md. Strip once by amend when HEAD is ours and unpushed; never loop.
Hard rules
- Never offer commit/copy/change before Summary/Description exist. After they exist, show the blocks, then the choices with
commitfirst. - No commit until
commit(or an unambiguous “commit this message now”) after they have seen the current blocks. copynever runsgit commit.- The committed message is exactly the drafted Summary + Description, including a trailing work-item mention. Added lines: references/added-lines.md.
- Do not install a hook to enforce the work-item line. Do not block the commit when
work-item.mdis missing. The only hook is the trailer hook, afterstrip-trailers. - Do not change product files except the persist rules the draft skill already writes, and the trailer hook and its saved answer (
.githooks/commit-msg,trailer-hookrule). 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. - Never commit implementation code on a base branch (references/base-branch.md).
- Never rebase. Push only on
commit-push(1.199.0): one plaingit pushafter the commit and its fetch check, never a force push. Do not open a PR. This run makes at most two commits: the drafted commit, and one merge commit when the branch was behind. Do not commit a notes index rebuild on its own. After a successful commit, the ending follows run-ending.md. Do not invoke the command it names.
Run ending (1.122.0)
End as run-ending.md says.
Every ending of this skill is Run next or nothing, never a Next: line (1.173.0). That covers commit, copy, stop, and a failed commit. Each label is on its own line above its command, and each command is alone in its code span. When nothing applies, there is no Run next. A suggestion to throw away an edit stays a plain sentence with the git command in a code span, for example: To throw the edit away, run git checkout -- docs/specs/orders-api/build-map.md.