From brandtam-skills
Generate structured commit messages and optionally commit for the user. Checks for repo-level commit templates, handles staging decisions, and enforces user approval before any commit. Use when user says "commit", "write a commit message", "stage and commit", or invokes /write-commit.
How this skill is triggered — by the user, by Claude, or both
Slash command
/brandtam-skills:write-commitThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a commit message for the current changes, then optionally execute the commit with user approval.
Generate a commit message for the current changes, then optionally execute the commit with user approval.
Run all three in parallel — never reuse results from earlier in the conversation:
git status
git diff HEAD
git diff --cached
Determine: are there staged files? Unstaged changes? Untracked files?
If there are no changes at all (nothing staged, unstaged, or untracked), tell the user there's nothing to commit and stop.
If there are already staged files AND unstaged/untracked changes, ask the user:
git add -A, then write commit for everythingIf everything is already staged, skip this question. If nothing is staged, ask:
git add -AAfter staging is resolved, re-run git diff --cached to see exactly what will be committed.
Check for a repo-level commit template:
git config --get commit.template
Also check for .gitmessagetemplate or .git-commit-template in the repo root.
Describe the result, not the process. No "Fix bug that was introduced when..." or "Refactor after code review found..."
Each bullet: a discrete capability, integration, or architectural change as it exists in the final code
Imperative mood ("Add X", "Extract Y", "Update Z")
If CONTEXT.md exists in the repo, use its domain terms. If absent, proceed silently.
Group related changes into single bullets rather than listing every file
Omit intermediate steps, failed approaches, iterative fixes — only the current state
Never describe corrections to things that were never committed. If a value was wrong in the working tree but never in git history, describe the current (correct) state.
8–15 bullets for large changes, fewer for small ones
Never append Co-Authored-By, Signed-off-by, or any trailer lines to the commit message
Display the full commit message to the user in a code block.
After displaying the message, ask the user:
git commit with the displayed messageNEVER commit without the user choosing "Commit now."
When committing, use a HEREDOC to pass the message:
git commit -m "$(cat <<'EOF'
<message here>
EOF
)"
After a successful commit, show the user the commit hash and summary.
npx claudepluginhub brandtam/skills --plugin brandtam-skillsGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.