git-auto-commit
Skill3 starsChanged 14 days agoApache-2.0View on GitHub
Analyze git status and diffs, group related changes into safe commits, stage files conservatively, and create clean commit history without interactive patching. Use when the user asks to commit code, submit current changes, auto-generate commit messages, split unrelated changes into multiple commits, or cleanly commit staged and unstaged work in a repository. Also load it before every automatic or routine content commit, such as the commit at the end of a task, even when the user did not ask to commit.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- cmstar/hyperpowers-skillstheir own version, first seen Nov 1, 2026
- dlimkin/agent-skillstheir own version, first seen Sep 27, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- cmstar/hyperpowers-skills★ 2same name
- dlimkin/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- codebase-designSkill
- develop-uniapp-miniappSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- frontend-designSkill
- github-cli-opsSkill
- harness-engineeringSkill
- release-opsSkill
- tddSkill
- wechat-miniprogram-ci-uploadSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
34 rules. About 0 are common, 25 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈25
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 8
Use message examples only when preparing a commit body.
- Distinctive: line 12
If the target directory is not a Git repository and the user asks to commit, run git init automatically before inspecting changes.
- Distinctive: line 13
After auto-initializing, verify git config user.name and git config user.email resolve.
- Distinctive: line 14
Do not set project-level Git identity during auto-init.
- Distinctive: line 15
Run git status --short, git diff --staged, and git diff before deciding what to commit.
- Distinctive: line 16
Treat staged content as an intentional boundary when it already forms a coherent change.
- Distinctive: line 22
Keep unrelated requirements and user work separate.
- Distinctive: line 28
Default to one final content commit for the current user requirement and its continuous feedback.
- Distinctive: line 29
Do not interpret "one requirement" as "everything currently changed": unrelated requirements, independent business changes, and unrelated …
- Distinctive: line 30
Avoid creating a commit after every feedback round.
- Distinctive: line 31
If the requirement already has one unshared commit, amend it for later corrections when doing so is safe.
- Distinctive: line 32
After amend, squash, or rebase changes the tested commit, rerun the relevant validation and git diff --check.
- Very specific: line 33
Treat a branch that already exists on a remote as shared.
- Very specific: line 38
Prefer git add <path> or an explicit list of paths.
- Distinctive: line 39
Use git add . only when every changed file belongs to the same logical change.
- Distinctive: line 41
Use non-interactive git commands only.
- Distinctive: line 42
Never use destructive reset or checkout commands just to force a clean tree.
- Very specific: line 46
Use one of these commit types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert.
- Distinctive: line 47
Keep the type in English.
- Distinctive: line 48
Write the subject in Chinese, imperative, under 50 characters, with no period.
- Very specific: line 49
When a body exists, the final commit message must be subject, then one blank line, then the bullet list body.
- Distinctive: line 50
Use a subject-only commit only when every staged file serves one clear change that the subject fully explains.
- Distinctive: line 53
If generated deliverables must be committed with source changes, describe both the source change and generated result in the body.
- Distinctive: line 54
Write the body in Chinese bullet lines when extra context is needed, with no blank lines between bullets.
- Very specific: line 55
Put all body bullets in a single commit-message paragraph.
- Very specific: line 56
Do not place the subject and body in the same -m argument in this workflow.
- Very specific: line 57
Never pass the literal characters \n inside normal quotes and assume Git will convert them to new lines.
- Very specific: line 58
Default to git commit -F <message-file> whenever a body is needed.
- Distinctive: line 60
Before committing, preview the message and sanity-check that it contains actual line breaks, and that the second line is blank when a body …
- Very specific: line 61
After committing with a body, run git log --format=%B -1 HEAD and verify the stored commit message still has the blank separator line.
- Distinctive: line 66
If the user clearly asks to commit changes, do not pause for confirmation.
- Distinctive: line 67
Commit one requirement-level logical group at a time, then rerun git status --short.
- Distinctive: line 70
If the user also asks to push, follow Git Worktree Workflow: inspect the target and task range, converge unshared commits, validate, and …
- Distinctive: line 71
If push fails, report the exact error and keep the local commit intact.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Auto Commit
Use message examples only when preparing a commit body. This skill governs commit grouping and message format; the global Git worktree workflow governs isolation, preflight, and push authorization.
Inspect Repository State
- If the target directory is not a Git repository and the user asks to commit, run
git initautomatically before inspecting changes. - After auto-initializing, verify
git config user.nameandgit config user.emailresolve. If either is missing, stop and ask the user to configure Git identity before committing. - Do not set project-level Git identity during auto-init; rely on normal global Git config resolution.
- Run
git status --short,git diff --staged, andgit diffbefore deciding what to commit. - Treat staged content as an intentional boundary when it already forms a coherent change.
- Ignore generated artifacts unless they are clearly required for the requested commit.
Decide Commit Groups
- Group by user requirement and independently meaningful behavior, not by file type or directory. Code, tests, documentation, configuration, and required generated output for one requirement belong together.
- Keep unrelated requirements and user work separate; prefer the smallest number of coherent commits.
- Do not use
git add -por stage a mixed file wholesale. When task changes are attributable, reconstruct only those changes in a clean worktree from a verified base, or apply a reviewed non-interactive task patch to an isolated index. Check the resulting staged diff and preserve the original working file and any pre-existing staged boundary. Ask only when attribution, a required dependency, or the intended result remains unresolved. - Respect an existing staged boundary when it forms a coherent authorized change.
Converge One Requirement
- Default to one final content commit for the current user requirement and its continuous feedback. Small fixes, style adjustments, and review corrections for the same outcome belong in that commit.
- Do not interpret "one requirement" as "everything currently changed": unrelated requirements, independent business changes, and unrelated user work remain separate commits.
- Avoid creating a commit after every feedback round. Finish and validate a coherent requirement before its first publication whenever practical.
- If the requirement already has one unshared commit, amend it for later corrections when doing so is safe. If it has multiple unshared local checkpoint commits, squash them into one before the first push or MR/PR.
- After amend, squash, or rebase changes the tested commit, rerun the relevant validation and
git diff --check. - Treat a branch that already exists on a remote as shared. Never automatically rebase, amend, or force-push shared history; prefer MR/PR squash so the target receives one content commit. Require separate explicit authorization before
--force-with-lease. - Allow a platform-required merge commit, but keep only one content commit for the requirement. Never rewrite an already integrated target branch solely to clean old history.
Stage Safely
- Prefer
git add <path>or an explicit list of paths. - Use
git add .only when every changed file belongs to the same logical change. - Never use
git add -p. - Use non-interactive git commands only.
- Never use destructive reset or checkout commands just to force a clean tree.
Write Commit Messages
- Use one of these commit types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert. - Keep the type in English.
- Write the subject in Chinese, imperative, under 50 characters, with no period.
- When a body exists, the final commit message must be
subject, then one blank line, then the bullet list body. - Use a subject-only commit only when every staged file serves one clear change that the subject fully explains.
- A mixed commit MUST include a body. This includes multiple modules, multiple business behaviors, code plus docs, source changes plus generated deliverables, or config changes plus feature/fix work.
- For a mixed commit, make the subject describe the change most important to the user's requirement and put secondary changes in the body, including mixed logic within one file. Judge importance by the resulting behavior, not file count or diff size.
- If generated deliverables must be committed with source changes, describe both the source change and generated result in the body.
- Write the body in Chinese bullet lines when extra context is needed, with no blank lines between bullets.
- Put all body bullets in a single commit-message paragraph. Do not use one body
-mflag per bullet, because Git will insert blank lines between paragraphs. - Do not place the subject and body in the same
-margument in this workflow. Git can store it correctly if you manually include a blank line, but this pattern is too easy for the model to get wrong and accidentally omit the separator line. - Never pass the literal characters
\ninside normal quotes and assume Git will convert them to new lines; that will produce a broken one-line body containing backslash-n text. - Default to
git commit -F <message-file>whenever a body is needed. Treat inline-mconstruction as a fallback only when a message file is not practical. - Build the message file with real line breaks, for example by writing
subject, then a blank line, then the bullet lines. - Before committing, preview the message and sanity-check that it contains actual line breaks, and that the second line is blank when a body exists.
- After committing with a body, run
git log --format=%B -1 HEADand verify the stored commit message still has the blank separator line; if not, immediately fix it withgit commit --amend -F <message-file>. scripts/check_commit_message.pyruns before shell commands in Claude Code (PreToolUsehook in~/.claude/settings.json), Codex (~/.codex/hooks.json, active once trusted in/hooks) and pi (~/.pi/agent/extensions/commit-message-check.ts), and blocks agit commitwhose subject breaks these rules (over 50 characters, a trailing period, several changes strung together without a body, no blank line before the body, a literal\n). Fix the message instead of working around the hook.
Execute Commits
- If the user clearly asks to commit changes, do not pause for confirmation.
- Commit one requirement-level logical group at a time, then rerun
git status --short. - Continue until the requested changes are committed or the remaining files are intentionally left out.
- Respect an existing staged set unless it is obviously broken and the user explicitly asks for regrouping.
- If the user also asks to push, follow Git Worktree Workflow: inspect the target and task range, converge unshared commits, validate, and run integration preflight before an authorized push.
- If push fails, report the exact error and keep the local commit intact.
- For commits with a body, use this safe sequence: write a temporary message file,
git commit -F <message-file>, verify withgit log --format=%B -1 HEAD, then remove the temporary file.
Report Results
Report each resulting commit hash and Chinese subject, validation, remaining changes, and actual local/remote state. Do not claim that all changes were handled when files were intentionally left out.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

