squash
Skill2 starsChanged 3 months agoMITView on GitHub
Rebase the current branch against its fork point (master/main) and squash the branch commits into a small, sensibly-grouped set. Larger restructuring is welcome — drop work that was later reverted, fold fixups into their parent. Commit messages follow the same category-prefixed terse style as /commit, authored as the user. Use when the user says "squash this branch", "clean up commits", "squash before merge", or invokes /squash.
- Deletes or force-pushes
- Commits and pushes
3 other projects use a version of this.
Adopted by
Most recently taken up by
- aymericbeaumet/dotfilestheir own version, first seen Sep 7, 2026
- Pradnyeshp/Claude-Skillstheir own version, first seen Jul 6, 2026
- TashanGKD/cc_pluginstheir own version, first seen Jan 13, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- aymericbeaumet/dotfiles★ 22same name
- TashanGKD/cc_plugins★ 4same name
- Pradnyeshp/Claude-Skills★ 2same 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 repository8 other files it gives its agents.
- comment-cleanupSkill
- commitSkill
- difit-openSkill
- difit-resolveSkill
- difit-reviewSkill
- refactor-proseSkill
- refine-skillsSkill
- ste-writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 11 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
5
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 12
All resulting commits in the user's name only.
- Distinctive: line 50
Read the branch's commits and the cumulative diff.
- Distinctive: line 54
Default to one commit: Only split when the branch genuinely does multiple independent things that a reviewer would want to evaluate …
- Distinctive: line 55
Drop reverted work: If a feature was added and later removed within the branch, the final history should contain neither — not "add X" …
- Distinctive: line 58
Respect the user's intent: If the branch clearly tells a story across 2–3 commits the user constructed deliberately, don't flatten it …
- Distinctive: line 70
Wait for confirmation unless the user pre-authorized.
- Very specific: line 74
Prefer the soft reset approach over rebase -i — it's mechanical, scriptable, and avoids editor interaction.
- Very specific: line 90
If conflicts surface during a true rebase (only needed if you also want to land on top of updated <base>):
- Distinctive: line 105
No bullet-list of folded commits.
- Very specific: line 106
No emojis. No Co-Authored-By.
- Distinctive: line 121
If non-empty, something was lost — reset to the backup ref and re-plan.
- Distinctive: line 125
If the branch was previously pushed and the user wants it updated:
- Very specific: line 131
Never plain --force. Never force-push to master/main.
- Distinctive: line 136
No force-push without explicit confirmation.
- Distinctive: line 137
No squashing on master/main.
- Distinctive: line 138
No silent dropping of commits the user might want — surface the plan first.
≈ “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
Squash
Collapse a feature branch into a clean, reviewable history before merge.
Authorship
All resulting commits in the user's name only. No Co-Authored-By: Claude. No --author. Preserve whatever the user already had; don't rewrite identity.
Step 1 — Find the fork point
Determine the base branch (usually master, sometimes main). Check what exists:
git rev-parse --verify master 2>/dev/null || git rev-parse --verify mainFind the actual fork point (not just master HEAD, which may have moved):
git merge-base HEAD <base>Show the user the branch range before doing anything:
git log --oneline <base>..HEAD
git diff --stat <base>...HEADStep 2 — Safety check
Before rewriting history:
- Working tree is clean (
git status). If not, stop and ask. - Branch is not
master/mainitself. - Note whether the branch is pushed (
git rev-parse @{u}succeeds). If yes, warn the user that this will require a force-push and confirm before proceeding. - Create a safety ref so the pre-squash state is recoverable:
Tell the user the backup ref name.git branch backup/squash-<branch>-<shortsha>
Step 3 — Plan the squash
Read the branch's commits and the cumulative diff. Decide the final commit set.
Guiding principles:
- Default to one commit. Only split when the branch genuinely does multiple independent things that a reviewer would want to evaluate separately (e.g. a backend change + an unrelated helm bump).
- Drop reverted work. If a feature was added and later removed within the branch, the final history should contain neither — not "add X" followed by "remove X".
- Fold fixups. "fix typo", "address review", "oops" → into their logical parent.
- Restructure freely. This is the moment for it. The branch's intermediate history is throwaway.
- Respect the user's intent. If the branch clearly tells a story across 2–3 commits the user constructed deliberately, don't flatten it without asking.
Present the plan to the user before rewriting:
Squashing 14 commits into 2:
1. backend: <headline> (folds: a1b2c3, d4e5f6, ...)
2. frontend: <headline> (folds: 7a8b9c, ...)
Dropping: "add experimental flag X" (reverted in same branch)
Backup: backup/squash-<branch>-<sha>Wait for confirmation unless the user pre-authorized.
Step 4 — Execute
Prefer the soft reset approach over rebase -i — it's mechanical, scriptable, and avoids editor interaction.
For a single resulting commit:
git reset --soft $(git merge-base HEAD <base>)
git commit -m "$(cat <<'EOF'
<category>: <headline>
<optional short body>
EOF
)"For multiple resulting commits, do it in passes: soft-reset to base, then stage and commit each logical group with explicit git add <paths>.
If conflicts surface during a true rebase (only needed if you also want to land on top of updated <base>):
git rebase <base>Resolve them; never --skip past a conflict without understanding it. Never use destructive escapes (rebase --abort is fine and non-destructive; reset --hard to discard is not).
Step 5 — Commit message rules
Identical to /commit:
- Headline ≤72 chars,
<category>: <imperative summary>. - Categories from recent
git log(backend:,frontend:,helm:,docs:,bugfix:,chore:,refactor:, ...). - Body optional, 1–3 short lines, high-level why.
- No bullet-list of folded commits. No "squashed from N commits". The history itself shows that.
- No emojis. No
Co-Authored-By.
Step 6 — Verify
git log --oneline <base>..HEAD
git diff <base>...HEAD --statConfirm the cumulative diff is identical to before the squash:
git diff <pre-squash-backup>..HEAD # should be emptyIf non-empty, something was lost — reset to the backup ref and re-plan.
Step 7 — Push (only if asked)
If the branch was previously pushed and the user wants it updated:
git push --force-with-leaseNever plain --force. Never force-push to master/main. Confirm before pushing even with --force-with-lease if you haven't already.
Don'ts
- No
Co-Authored-Bytrailer. - No force-push without explicit confirmation.
- No squashing on
master/main. - No silent dropping of commits the user might want — surface the plan first.
- No
git push --force(use--force-with-lease).
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.

