rebase-clean
Skill1 starsChanged 2 months agoMITView on GitHub
Tidy a feature branch before it merges — squash fixup commits into their targets, drop "wip" noise, reorder so prefactors come first, rebase onto the base branch, keep history linear. Only on unshared branches. Use when asked to "clean up the branch", "squash the fixups", "rebase onto main", or before opening / updating a PR.
- Deletes or force-pushes
- Commits and pushes
In this repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- bigquery-analyticsSkill
- cache-invalidationSkill
- mongo-aggregationSkill
- mongo-modelingSkill
- postgres-aggregationSkill
- postgres-indexingSkill
- redis-coordinationSkill
- redis-patternsSkill
- review-querySkill
- code-migrationSkill
- cut-releaseSkill
- data-migrationSkill
- deploy-serviceSkill
- hotfixSkill
- rollbackSkill
- design-endpointSkill
- design-eventSkill
- design-schemaSkill
- evolve-contractSkill
- scaffold-nestjs-moduleSkill
- scaffold-projectSkill
- incident-responseSkill
- investigate-bugSkill
- on-callSkill
- postmortemSkill
- audit-skillsSkill
- distill-review-styleSkill
- write-skillSkill
- debug-with-tracesSkill
- define-alertsSkill
- instrument-serviceSkill
- evaluate-dependencySkill
- grillSkill
- handoffSkill
- orientSkill
- phased-deliverySkill
- spikeSkill
- to-questionnaireSkill
- write-adrSkill
- write-prdSkill
- devops-pr-reviewSkill
- go-backend-pr-reviewSkill
- nestjs-backend-pr-reviewSkill
- python-backend-pr-reviewSkill
- react-frontend-pr-reviewSkill
- bisectSkill
- break-couplingSkill
- dead-code-sweepSkill
- deslopifySkill
- extract-moduleSkill
- resolve-merge-conflictsSkill
- split-commitSkill
- tddSkill
- wait-whatSkill
- wide-renameSkill
- bullmqSkill
- kafkaSkill
- sqs-consumerSkill
- audit-dependenciesSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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
- Very specific: line 19
Fixups first, as you go: When you fix a review comment, commit it as git commit --fixup <sha> (or --squash).
- Distinctive: line 38
Don't rebase main or any long-lived shared branch.
≈ “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
Rebase a branch clean
Goal: the branch reads as the sequence of changes you wish you'd made — linear, each commit meaningful, ready to review commit-by-commit.
Before touching anything
- Is the branch shared? If someone else has it checked out or has built on it, don't rewrite without agreeing. A solo feature branch is fair game.
git fetchand note the base (main).
The passes
- Fixups first, as you go. When you fix a review comment, commit it as
git commit --fixup <sha>(or--squash). Then onegit rebase -i --autosquash <base>folds every fixup into its target automatically. - Interactive rebase (
git rebase -i <base>) for the rest:droppure noise ("wip", "typo", "revert the revert").squash/fixupcommits that only exist to patch an earlier one.rewordbad subjects into conventional form.moveprefactors and refactors ahead of the feature commit.
- Rebase onto the base — resolve conflicts as they come
(
quality/resolve-merge-conflicts),git rebase --continue. - Verify — build + tests on the final tip, and ideally spot-check that a
mid-branch commit builds (for
quality/bisect). - Force-push with lease —
git push --force-with-lease(never plain--force), so you don't clobber someone else's push.
Rules
--force-with-lease, not--force.- Don't rebase
mainor any long-lived shared branch. - Merge commits from
maininto the feature branch → prefer rebasing instead so history stays linear; if the team merges, follow the team.
Anti-patterns
- ❌ Rewriting a branch other people have based work on.
- ❌
git push --force(use--force-with-lease). - ❌ Squashing everything into one commit when the steps were meaningfully separate.
- ❌ A final tip that passes but broken commits in the middle.
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.

