git-commit-workflow
Skill1 starsChanged 18 days agoMITView on GitHub
Commit coding work as verified, rollback-sized Git checkpoints with conventional messages. Use whenever the user asks to commit, stage, write or fix a commit message, split a large feature into incremental commits, decide when to checkpoint during long work, recover from a wrong or failed commit, coordinate commits across parallel agents, or clean generated files out of Git — even if they do not mention "conventional commits.
- Deletes or force-pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- MishraShardendu22/agent-skills-hub-sync-enginetheir own version, first seen Oct 25, 2026
- Ygohel18/skillstheir own version, first seen Sep 27, 2026
- HeathWang/hw-cc-plugintheir own version, first seen Aug 21, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- HeathWang/hw-cc-plugin★ 1same name
- MishraShardendu22/agent-skills-hub-sync-engine★ 1same name
- Ygohel18/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 repository2 other files it gives its agents.
- design-notesSkill
- readme-i18nSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
21 rules. 0 are common, 19 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
19
Distinctive
This author's own choices. Worth a look.
2
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
Treat a commit as a verified, coherent checkpoint, not a save button.
- Distinctive: line 12
Default to rollback-sized checkpoints: the smallest independently revertible unit that still leaves the repository buildable and the …
- Distinctive: line 14
Commit at each verified slice as the work progresses.
- Distinctive: line 35
Do not commit code with failing checks on a shared branch.
- Distinctive: line 39
If a generated file appears, fix the ignore rule first, then stage again:
- Distinctive: line 55
Use git add -A / git add .
- Distinctive: line 85
Before committing, ask: if this one commit is reverted, does the repository stay buildable and does the revert undo exactly one behavior?
- Distinctive: line 88
Commit after each green vertical slice (schema/parser, one endpoint, one client path, its tests, its docs) even when the overall …
- Distinctive: line 95
Do not postpone all commits until "the feature is done": that creates a large, hard-to-revert blob and loses the ability to bisect or …
- Distinctive: line 97
Do not over-split into mechanical micro-commits that cannot stand alone.
- Distinctive: line 110
If a slice cannot be made green independently, keep it on a private branch and commit the smallest green prerequisite first.
- Very specific: line 114
Use a wip(...) commit only on a private scratch branch.
- Distinctive: line 133
Use the body for rationale/tradeoffs.
- Distinctive: line 156
Before committing in a shared worktree:
- Distinctive: line 161
do not run git reset --hard or discard changes you did not create.
- Distinctive: line 162
if a commit accidentally includes another agent's work, coordinate before rewriting history.
- Distinctive: line 167
Do not amend or force-push published commits.
- Very specific: line 168
Do not bypass hooks with --no-verify.
- Distinctive: line 169
If a hook or commit fails, fix the cause and create a new commit.
- Distinctive: line 194
Ask before rewriting. If approved, amend the local commit.
- Distinctive: line 219
If the change spans implementation + docs, ask whether the user wants one release commit or separate phase commits.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Commit Workflow
Treat a commit as a verified, coherent checkpoint, not a save button. A useful history lets a reviewer answer: what changed, why, what was verified, and which phase/gate it belongs to.
Default to rollback-sized checkpoints: the smallest independently revertible unit that still leaves the repository buildable and the relevant checks green. Commit at each verified slice as the work progresses; do not wait until the whole feature, phase, or milestone is finished. Avoid both one giant end-of-feature commit and a noisy commit per edit.
1. Before committing
Inspect before you stage:
git status --short
git diff --stat
git diff
git log --oneline -10Check three things:
- Scope — every changed path is intentional. Revert debug edits, scratch files, editor settings, and unrelated formatting.
- Verification — run the focused check that proves the change: build, targeted tests, conformance suite, doc link check, or artifact hash check. Do not commit code with failing checks on a shared branch.
- Generated artifacts — builds, caches, logs, binaries, coverage output,
__pycache__/, and release artifacts belong in.gitignore, not in Git.
If a generated file appears, fix the ignore rule first, then stage again:
git rm --cached path/to/generated
# add the pattern to .gitignore2. Stage deliberately
Prefer explicit paths:
git add src/core/server.cpp tests/unit/server_test.cpp docs/roadmap.md
git diff --cachedUse git add -A / git add . only after reading every path in
git status --short. In multi-agent work, other agents may have uncommitted
changes in the same worktree; blind staging can capture their work.
Never stage:
build/,build-*,out/,dist/, coverage/benchmark output__pycache__/,*.pyc, logs, temporary files- credentials, local config, editor state
- another agent's unreviewed partial work
3. Commit granularity and phase history
One commit should be one coherent change that can be reviewed and reverted independently. Do not mix an unrelated refactor with a feature or a bug fix.
For multi-phase or gated work, keep the phase story visible:
- Implementation — feature/fix plus its tests.
- Review remediation — separate
fix(...)commit after a review/gate, containing only the accepted findings and focused evidence. - Documentation/roadmap — separate
docs(...)commit that records status, decisions, test counts, and next steps.
That pattern makes it possible to see what was implemented, what review changed, and what was merely recorded. Do not squash remediation into the feature commit unless the user explicitly asks for a single commit.
Rollback-first commit sizing
Before committing, ask: if this one commit is reverted, does the repository stay buildable and does the revert undo exactly one behavior? If not, split it.
- Commit after each green vertical slice (schema/parser, one endpoint, one client path, its tests, its docs) even when the overall requirement is still in progress.
- A phase/gate is a review boundary, not necessarily a commit boundary. A large phase should usually contain several checkpoints.
- For long or multi-day work, save verified checkpoints early. A private branch may hold intentionally incomplete WIP, but prefer commits that build.
- Do not postpone all commits until "the feature is done": that creates a large, hard-to-revert blob and loses the ability to bisect or revert one slice.
- Do not over-split into mechanical micro-commits that cannot stand alone. Each commit must be coherent, reviewable, and green.
Example of slicing a large feature instead of one final blob:
feat(protocol): parse resultType on tool results
feat(server): emit ttlMs/cache fields for 2026 reads
feat(client): accept the 2026 discover response
test(protocol): cover MRTR request/retry pairing
docs(protocol): record the wire decisionIf a slice cannot be made green independently, keep it on a private branch and commit the smallest green prerequisite first; do not merge a half-working slice into the main history merely to make the log look granular.
Use a wip(...) commit only on a private scratch branch. Do not publish WIP
history as the final story of a change.
4. Commit message format
<type>(<scope>): <imperative summary>
Optional body: why this change exists, a non-obvious constraint,
or the verification evidence a reviewer should know.- Type:
feat,fix,test,docs,chore,refactor,perf,build. - Scope: the component, not the file:
core,protocol,http,server,client,executor,security,legacy,conformance,amalgamation,examples,roadmap,docs. - Summary: imperative, lowercase after the colon, no trailing period, roughly ≤ 72 characters. State the behavior, not "update files".
- Omit the scope when it adds no information (
chore: ignore python bytecode). - Use the body for rationale/tradeoffs; do not paste full logs.
Examples from a real phase-gated project:
feat(protocol): align 2026 wire with official conformance (D18)
fix(executor): freeze IExecutor contract and self-call shutdown
test(conformance): add fixture server and runner; clear 2025/2026 required suites
docs(roadmap): record M2 completion and Gate 2b
chore: ignore python bytecodeAvoid:
fix
update stuff
wip
feat: lots of changes5. Multi-agent coordination
Before committing in a shared worktree:
- inspect
git statusandgit difffor files you do not own; - stage only your lane's paths;
- reconcile or wait for other lanes instead of committing their partial work;
- do not run
git reset --hardor discard changes you did not create; - if a commit accidentally includes another agent's work, coordinate before rewriting history.
6. Amend, force, and hooks
- Do not amend or force-push published commits.
- Do not bypass hooks with
--no-verify. - If a hook or commit fails, fix the cause and create a new commit.
- Amend only when the user explicitly asks and the commit is local/unpublished.
- Force-push only on explicit user request, never as a convenience.
These rules protect collaborators and keep review evidence intact.
7. Recovery
Wrong files staged
git restore --staged path/to/file
git add path/to/intended-fileGenerated file already committed
git rm --cached path/to/generated
# update .gitignore
git commit -m "chore: ignore generated artifacts"Commit message is wrong but not pushed
Ask before rewriting. If approved, amend the local commit; otherwise add a follow-up commit describing the correction.
A commit was made on the wrong branch or with mixed work
Inspect first (git log, git show, git status). Prefer a corrective commit
over history rewriting. Never reset --hard without confirming the user has no
uncommitted work to lose.
8. Pre-commit checklist
git status --short # only intended paths
git diff --stat # expected surface
git diff # real content
git log --oneline -5 # message/style context
# run focused verification here
git add <explicit paths>
git diff --cached # final staged review
# can this commit be reverted alone and keep the build green?
git commit -m "<type>(<scope>): <summary>"
git status --short # clean or intentionally remaining
git log -1 --stat # confirm the checkpointIf the change spans implementation + docs, ask whether the user wants one release commit or separate phase commits; default to the repository's existing history style.
9. Anti-patterns
git add -Awithout readinggit status.- Committing build output to "make it work."
- Mixing a refactor, a feature, and a roadmap update in one commit.
- Saving all work until the whole feature/milestone is done, then committing one large blob.
- Committing only at phase gates when smaller green slices were available.
- Hiding failed verification in a WIP commit.
- Amending published history to make a review finding disappear.
- Committing another agent's uncommitted files.
- Writing a message that says what files changed but not what behavior changed.
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.

