commit-discipline
Skill0 starsChanged 8 days agoMITView on GitHub
Make git commits a reviewer can judge from the diff in minutes — atomic commits, specific staging, subject format, amend instead of stack, merge policy. Use whenever committing, writing or rewording commit messages, or preparing a branch for review or merge ("commit", "clean up the branch", "reword a commit", "prepare this for merge").
7 other projects use a version of this.
Adopted by
Most recently taken up by
- sayeedjoy/skillstheir own version, first seen Nov 29, 2026
- robinbril/claude-code-harnesstheir own version, first seen Nov 1, 2026
- whoaskedssselery/claude-workspacetheir own version, first seen Oct 20, 2026
- dfedoryshchev/weftworkstheir own version, first seen Oct 13, 2026
- applypack/applypacktheir own version, first seen Aug 27, 2026
- zaidmukaddam/skillstheir own version, first seen Aug 17, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- applypack/applypack★ 36same name
- zaidmukaddam/skills★ 18same name
- dfedoryshchev/weftworks★ 5same name
- robinbril/claude-code-harness★ 3same name
- ayush-singh-0601/commit-discipline-mcp★ 1same name
- sayeedjoy/skills★ 1same name
- whoaskedssselery/claude-workspace★ 0same 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.
- repo-setupSkill
- writing-testsSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
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
- Very specific: line 14
Never git commit -a, git add -A, git add .
- Distinctive: line 16
Check git status and git diff --staged before committing.
- Distinctive: line 31
Commit build and tooling changes with the code that needs them, so every commit builds: a rebuilt bundle goes in the commit that changed …
- Distinctive: line 36
Don't run the test suite during a rebase, neither per stopped commit nor after.
- Distinctive: line 57
Write one only when the diff cannot speak alone.
- Distinctive: line 85
Before a repo's first commit in a session, read its agent guidance (CLAUDE.md, AGENTS.md).
“Common” is measured: kept by at least 6 in 10 of the 6 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
commit-discipline
A commit is a unit of review. The reviewer — a person now, an archaeologist in two years, a bisect tonight — sees only the diff and the message. Every rule here keeps that pair sufficient to judge the change.
Staging: name the files, never -a
- Never
git commit -a,git add -A,git add .or anything that stages everything. Stage the specific files:git add src/pack.py tests/pipeline/pack/. - Check
git statusandgit diff --stagedbefore committing. A file the subject does not explain either changes the subject or leaves the commit. - Untracked personal files (scratchpads, local TODO lists) stay unstaged and unmentioned; they are not in history, so no message may refer to them.
Shape: one reviewable step per commit
- Each commit stands alone: reviewable, logical, a step toward the goal — even if the branch will be squash-merged later.
- Split where each part can be judged on its own, not by size. New code usually belongs with its first use, so the reviewer sees why it exists; an abstraction with its own tests can stand alone.
- Mixed commits are the failure mode: a feature plus the formatting it touched plus the dependency it needed. Formatting and dependency get their own commits; the feature reads alone.
- Commit build and tooling changes with the code that needs them, so every commit builds: a rebuilt bundle goes in the commit that changed its source.
- An unmerged branch is an essay stating intent without asides. Rewrite it
before merge with
rebase -i,fixup,amend. Exception: a pushed branch with extensive review comments — use judgment, or ask. - Don't run the test suite during a rebase, neither per stopped commit nor after. The rebase verifies itself (clean apply, no conflicts); the final tree is tested once, before push. Exception: when a fixup changed code its commit's tests pin, run those test files once. After a large rebase, at most run the test files the changed commits touch, once, before push.
Subject
area: imperative sentence- The area names the subsystem —
pipeline:,viewer:,cli:,tests:,docs:— not the module file. Without an agreed prefix list, use the subsystem's name. - Imperative mood: "Fix bug", "Add feature", "Remove unused import" — never "Fixing", "Adds", "Removed".
- Target 50–60 characters; then only a blank line and an optional body.
Body
- Write one only when the diff cannot speak alone.
- Each bullet is an imperative instruction followed by why: "Move X to Y, because Z". Describe the end result, not the path to it.
- Cover only what the diff shows. Never mention intermediate states — entries added then removed, failed attempts, things "corrected" — they never existed in git and mean nothing to readers of history. Never reference the commit's own review conversation.
Amend, don't stack
Review found a fault in an unmerged commit, whoever wrote it?
git commit --amend, or rebase -i with fixup when it sits deeper.
Stacking a fix makes the reader reconcile two commits to see one change.
Merging
- Merge a feature branch into
mainwithgit merge --no-ff, never squashed: its commits are the review record. - A one-commit branch may fast-forward.
- Push only when asked.
Attribution
The Co-Authored-By trailer names the model that wrote the commit; a subagent
names its own model. Never name anyone who did not contribute to the diff.
Repo-specific rules
Before a repo's first commit in a session, read its agent guidance
(CLAUDE.md, AGENTS.md). Its rules (prefixes, changelog, merge queue)
refine these; on conflict the repo wins.
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.

