commit
Create git commits (protected branches, atomic grouping, Conventional Commit messages, signing readiness, result table). Use when staging or committing changes.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- commit
- description
- Create git commits (protected branches, atomic grouping, Conventional Commit messages, signing readiness, result table). Use when staging or committing changes.
03 SKILL.md 正文
Commit
Inspect the repository in a single shell command before choosing what to commit:
git branch --show-current; git config --get commit.gpgsign; git status --short; git diff HEAD
When the user gave guidance for this commit, apply it to the branch, grouping, and message decisions below.
Steps
- If the branch name is empty, stop and report
detached HEAD. Treatmain,master,dev,develop, andrelease/*branches as protected. On a protected branch, create a new branch from the current HEAD withgit switch -c <name>, building<name>with Branch slug from the user guidance when provided or from the overall intent ingit diff HEADotherwise. On any other branch, commit on the current branch. - Read relevant untracked files listed in
git status --short;git diff HEADomits their contents. Group changes by primary intent so each group forms one atomic commit, unless the user guidance requests a single commit. Order prerequisite groups first. If the user guidance, status, and diff do not establish the intended changes or group boundaries, ask the user before staging. - For each commit group, write a Conventional Commit message following the
repository's type and scope policy. When the repository defines no type
policy, use
feat,fix,build,chore,ci,docs,style,refactor,perf, andtest. Format the subject astype(scope): summaryortype: summarywith a lower-case summary. Keep self-explanatory changes to a single subject line; otherwise add a concise body. - If
commit.gpgsignistrue, stop before the first commit and ask the user to warm GPG pinentry in their own terminal. Wait for explicit confirmation before committing. Do not warm pinentry yourself or disable signing. - When creating multiple commits, first unstage existing entries across the
repository with
git restore --staged :/; this leaves working-tree files unchanged. For each group in order, stage only that group's files or hunks and inspectgit diff --cachedto confirm no other changes are staged. Rungit commit -m <subject>(and-m <body>when needed). If a commit hook or command fails, stop and report the failure.
Branch slug
Use <type>/<slug> under 50 characters, where <type> matches the overall
work. Apply the rules below only to <slug>.
- Lowercase ASCII only: transliterate accents and drop non-ASCII characters.
- Split on non-alphanumeric characters and discard empties.
- Drop stop words:
a,an,the,of,for,in,on,at,by,with,and,or,but. Keep:not,no,without,from,to. - Start with an imperative verb (
add,fix,rm,bump), usingrmfor removal. - Abbreviate words of 6+ characters with a standard CLI, Unix, or code
shorthand (
configtocfg,environmenttoenv,dependenciestodeps). Spell out colliding words; keep words with no shorthand intact. - Join with hyphens.
- When
<type>/<slug>is still 50 characters or longer, drop trailing words one at a time until it is under 50, keeping<slug>non-empty.
Output
Report the result as a Markdown table. Use these fields in this order, omitting a row only when it has nothing to report:
| Field | Value |
|---|---|
| Branch | <final-branch> |
| Base | <starting-branch-or-HEAD> (when a new branch was created) |
| Commits | <hash> <subject> (one per group) |
| Validation | <command: result> |
| Blockers | hook output, signing wait, or failure reason |
04 同仓库更多 Skills
writing-for-agents
Reference for writing documents an agent consumes: skills, AGENTS.md or CLAUDE.md, and docs reached by a pointer. Invoke when creating or editing a skill or an agent instruction file, or when a document's pointer wording, load, or structure is in question. Do not invoke merely because the user mentions writing-for-agents, names a skill, or writes 'skill <word>'.
wizard
Generate an interactive bash wizard for steps only a human can perform. Invoke when the user asks for a script or wizard for manual setup: infrastructure provisioning, credentials or CI secrets, a third-party dashboard, or a one-off migration or cutover. Do not invoke for steps the agent can perform, or merely because the user mentions wizard, names a skill, or writes 'skill <word>'.
wait-what
Stop and re-pitch the last message in plain, simplified language.
to-tickets
Split an agreed specification into reviewable vertical-slice issues with explicit blockers, then publish them after confirmation.
to-spec
Turn the current conversation into a specification and publish it after confirmation.
to-pr
Create a pull request from the current branch.