Committing changes
Commit via feature branch + PR + git hooks; never push main, never merge.From its SKILL.md
npx -y skills add swell-agents/coding-skills --skill committing-changesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 8 commands, including `bash <skills>/committing-changes/scripts/install-hooks.sh` and 7 more.
SKILL.md
4.5 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
Workflow
-
Install hooks (once per repo). From inside the repo, run the installer that ships with this skill:
bash <skills>/committing-changes/scripts/install-hooks.shThis copies
commit-msgandpre-pushinto.git/hooks/and makes them executable. Idempotent.Then install the PR-size CI workflow:
bash <skills>/committing-changes/scripts/install-pr-size-workflow.shThis drops
.github/workflows/pr-size.ymland appends.gitattributesexclusions. Idempotent. -
Branch check. If on
main, switch to a feature branch:git checkout -b <type>/<description>Valid
typeprefixes:feat,fix,refactor,docs,test,chore,infra,ai-native. -
Auto-fix before commit. Run the project's linter/formatter (e.g.,
ruff format && ruff checkfor Python,golangci-lint runfor Go,forge fmt && solhintfor Solidity). The pre-commit hook (if installed) runs the project's full quality gate. -
Commit & push.
git add <specific paths> git commit -m "<subject conforming to rules below>" git push -u origin <branch> -
Sync with main.
git fetch origin main git merge origin/mainResolve conflicts; commit the merge; push.
-
PR creation (first push only).
gh pr list --head <branch> gh pr create --fill # if no PR exists yet -
Branch cleanup (after the user has merged).
git fetch --prune git branch --merged main | grep -v '^\*\|main' | xargs -r git branch -d
Rules
- Never push directly to
main. Always feature branches + PRs. Thepre-pushhook blocks this. - Never merge branches or PRs. Always let the user merge.
- Never force-push. No
--force, no--force-with-lease. Create new commits instead. - One logical change per commit.
- PR size: ≤1000 changed lines per PR (excluding tests, docs, lockfiles, generated). Enforced by
.github/workflows/pr-size.yml. - Commit-message subject (enforced by
commit-msghook):- Capital start (imperative mood: "Add", "Fix", "Refactor", not "added"/"adds").
- ≤ 72 chars.
- No trailing period.
- No
Co-Authored-By:lines.
Why this discipline
Each rule traces to a specific failure mode:
- No direct push to main → no broken
main, every change is reviewable. - No agent-side merge → the human keeps the merge decision; agents never close the loop unilaterally.
- No force-push → preserves history; reviewers can trust commit hashes.
- One logical change per commit → bisect works; reverts are surgical.
- Subject rules → consistent log readability; no noisy attribution lines.
Cross-references
shell-discipline— issue thesegit/ghcommands one per call, no&&chains.engineering-philosophy— "Small Steps" and "Investigate, Don't Mask" map directly to one-logical-change-per-commit and don't-disable-failing-hooks.
Reference
- scripts/commit-msg — subject-line rules enforcer.
- scripts/pre-commit — runs project's lint/format/test before commit.
- scripts/pre-push — blocks direct push to
main/master. - scripts/install-hooks.sh — idempotent installer.
- templates/pr-size.yml — GitHub Actions workflow that labels PR size and fails when >1000 changed lines (excluding tests, docs, lockfiles, generated).
- templates/gitattributes.example —
linguist-generated/linguist-vendoredentries appended to.gitattributesso GitHub collapses generated files in PR diffs. - scripts/install-pr-size-workflow.sh — idempotent installer for the workflow +
.gitattributesblock. - reference/commit-md-original.md — original Claude-Code
commit.mdcommand verbatim. - reference/git-rule.md — original
rules/git.mdverbatim. - reference/hook-troubleshooting.md — common failure modes + fixes.
What ships with it: 10 files
11.3 KB alongside SKILL.md, 5 of them executable
reference/
- commit-md-original.md1.5 KB
- git-rule.md670 B
- hook-troubleshooting.md2.3 KB
scripts/
- commit-msgruns1006 B
- install-hooks.shruns747 B
- install-pr-size-workflow.shruns1.4 KB
- pre-commitruns1.2 KB
- pre-pushruns504 B
templates/
- gitattributes.example672 B
- pr-size.yml1.4 KB
Gives 1 of the 12 instructions most pr commit review skills give in ~1.1k tokens
Counted across 1,055 of the 1,911 authors here whose files we hold, read 2026-09-06
- Use conventional commit message formatin 150 of 1055, across 145 files
- Announce skill usage at startin 78 of 1055
- Use imperative mood for commit descriptionsin 54 of 1055, across 51 files
- Add directory to gitignore if not ignoredin 52 of 1055, across 41 files
- Use imperative mood for commit subjectin 52 of 1055
- Run tests to verify clean baselinein 42 of 1055, across 32 files
- Push branch to originin 40 of 1055, across 38 files
- Verify worktree directory is ignored before creationin 39 of 1055, across 32 files
- Delete branches after merginghere, and in 38 of 1055, across 30 files
- Create worktree with new branchin 37 of 1055, across 32 files
- Wrap body text at 72 charactersin 36 of 1055, across 34 files
- Auto-detect and run project setupin 35 of 1055, across 27 files
Said here and by no other author read
- Install git hooks and PR size workflow
- Run linter and formatter before committing
- Sync with main using fetch and merge
- Limit pull requests to 1000 changed lines
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.