etc/claude/skills/commit/SKILL.md
Creates meaningful git commits by analyzing changes and committing in logical units. Use when the user wants to commit changes to git, requests commit creation, or asks to save changes to version control. Supports --english and --japanese for commit language selection and --branch to create a new branch before committing.
npx skillsauth add shuymn/dotfiles commitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<skill-root> is the directory containing this SKILL.md. Resolve scripts/... and references/... relative to it (e.g. <skill-root>/references/examples.md), not the caller's current working directory.
/commit. Never commit automatically or as part of another task.git push, no pull requests (use the create-pr skill), no merge/rebase.First inspect the diff and infer the safest action from the rules below; form a tentative plan before asking. Ask the user only when proceeding would risk data loss, create an irreversible or policy-ambiguous commit, or require choosing between groupings the diff cannot resolve. When you do ask, lead with your recommended option and the trade-off — never an open-ended question when a bounded recommendation is possible.
Each commit is exactly one meaningful unit: one clear purpose, independently revertible, describable in a single specific subject with no "and". Bundling unrelated changes makes reverts dangerous (reverting one fix undoes an unrelated feature), review noisy, and git bisect useless. For good/bad groupings and common scenarios, see examples.md.
git status --shortgit branch --show-currentgit log --oneline -10git diff --statgit diff --cached --statCached snapshots may be stale — always re-verify with live commands before acting.
Allowed forms: type(scope): subject or type: subject.
Types: feat (new feature), fix (bug fix), docs, style (code style), refactor, perf, test, chore (maintenance), build (build system), ci.
Rules:
fix bug, not Fix bug). Japanese: である調, カタカナ for tech terms.scope is optional and names exactly one area. Never use multiple scopes (feat(mysql,cli): ...) — split into separate commits first, or omit scope (type: subject) when the change is one inseparable unit.and in an English subject as a red flag: split, or rewrite to a single purpose.Language selection:
--english: English description. --japanese: English type/scope with a Japanese description.git log --format='%s' -10). If recent commits are mixed or unclear, pick the safer default from the user's current language and repository context; ask only when those signals conflict.Examples: feat(auth): add OAuth2 login · fix(api): handle null user responses · feat: centralize request validation · feat(auth): OAuth2ログインを追加 · fix(api): ユーザーのnull処理を修正
git diff — identify every logical unit before committing anything. If changes are mixed, plan separate commits. A subject that wants multiple scopes or and is a signal to split first. If grouping stays ambiguous after self-analysis, see Identifying Meaningful Units.git add <specific-files>, or use Patch-Based Partial Staging for partial changes within a file.git diff --cached — ensure exactly one logical change is staged. If staging is wrong, stop and ask (see Prohibited Commands).git commit -m "<type>(<scope>): subject" (or git commit -m "<type>: subject"), then confirm with git log --oneline -1.With --branch: before staging (step 3), derive a descriptive branch name from the primary change (<type>/<descriptive-name>, no abbreviations) and create it with git switch -c <name>. Branch creation is mandatory when --branch is set. Base defaults to the current branch; with --base=<branch>, run git switch <base> first. Examples: feature/add-oauth-support, fix/handle-null-values.
Before committing, validate the drafted subject mechanically (run each as one complete shell command — do not pass printf and wc as separate tool arguments):
printf '%s' 'feat: centralize request validation' | wc -c
printf '%s\n' 'feat: centralize request validation' | rg -n '\band\b'
If wc -c exceeds 50, rewrite before committing. If rg matches and in an English subject, treat it as a forced reconsideration: split into separate commits first; if the change is truly inseparable, rephrase to a single purpose without and.
When one file holds multiple logical changes, stage hunks selectively via an editable patch. See examples.md for the full procedure.
To prevent accidental data loss, never run these while preparing partial commits — pause and ask the user for explicit direction instead:
git restore ..., git reset ..., git checkout -- ... (or git checkout -f), git switch --discard-changes ..., git clean ...Ask of each candidate unit: Can it stand alone if reverted? Does it have one purpose (one sentence, no "and")? Are all parts necessary to each other? Would its scope be clear to a future reader?
Scope decision order:
type: subject.type(scope): subject only when the unit is clearly centered on one area.When grouping is uncertain, decide yourself first: list the changed files/hunks by purpose, apply the questions above, prefer separate commits when independent revertibility is clear, and prefer one unscoped commit only when splitting would break a single logical change. Ask only if two or more groupings remain plausible — and then present the options with your recommendation first (which options are under consideration, how the choice affects commit count and revertibility, why yours is safest). Use AskUserQuestionTool if available, batching multiple decisions into its questions array; otherwise ask in one message using Q1/Q2 labels and request QID: <answer> replies (allow QID: OTHER(<detail>)). See examples.md.
@ in backticks (`@import`, `path/@file`) so GitHub does not turn them into user mentions.git config commit.gpgsign false, no --no-gpg-sign / -c commit.gpgsign=false). Wait for user instruction.Red flags that signal bundled changes: and in an English subject; vague messages like "various fixes"; comma-separated scopes; staging all files without reviewing each; a "cleanup" commit that hides functional changes; bundling a hotfix with a feature because "it's one line". When in doubt, make separate commits — you can always squash later.
development
Simplifies recently changed code by running three parallel reviews (reuse, quality, efficiency) and applying only behavior-preserving fixes. Use when the user asks to simplify, clean up, reduce duplication, improve code reuse, or optimize recently changed code, a staged diff, a branch diff, or explicitly listed files. Also use when the user says things like 'simplify this', 'まとめて整理して', 'コードをスリムにして', or invokes `/simplify`.
tools
Use when the user invokes /workflow. Injects project workflow methodology as context. Accepts argument: plan, exec, review (default: all).
development
Processes AI reviewer feedback and applies only verified fixes. Works in two modes: (1) fetches comments from a PR URL or current branch, (2) processes feedback pasted directly into the conversation. Trigger when the user wants to bulk-process or apply AI review suggestions — from a GitHub PR or pasted text. Do NOT trigger for single questions about what a bot said, or general code review discussion.
testing
Prepares .ralph/ runtime state from an approved and reviewed plan bundle. Syncs plan tasks into prd.json and updates prompt.run.md with project-specific context and quality gates. Use after plan approval, decompose-plan review PASS, and ralph init.