rebase
Skill6 starsChanged 26 days agoMITView on GitHub
Rebase the current working branch onto `upstream/main` (the remote base, NOT local `main`), resolving every conflict by consulting the authoritative RPython/PyPy source under `` rather than arbitrarily picking a side. Invoked via `/rebase`. Use whenever the user asks to "rebase", "rebase onto main", "restack on main", "replay on top of main", "pull main under my branch", or any equivalent request to rewrite the current branch on top of main while resolving conflicts. Before rebasing, this skill commits any unstaged work and squashes WIP noise into concise commits. During rebase, conflicts are resolved per-hunk — commit-level granularity is explicitly too coarse; each conflicting region is judged individually against upstream RPython/PyPy and merged to the more RPython-orthodox shape. Default to using this skill any time the user mentions rebasing, pulling main under the branch, or conflict resolution in the context of a long-running branch. Complements but does not replace `/merge` (which builds a green `-merge` branch) and `/parity` (which defines "RPython-orthodox").
- Deletes or force-pushes
- Commits and pushes
27 other projects use a version of this.
Adopted by
Most recently taken up by
- TDesktop-x64/tdesktoptheir own version, first seen Nov 9, 2026
- mazzsva/claude-skillstheir own version, first seen Nov 8, 2026
- mustafarslan/skillstheir own version, first seen Nov 8, 2026
- korya/swd-skillstheir own version, first seen Nov 1, 2026
- tkadauke/syrustheir own version, first seen Nov 1, 2026
- tony/skillstheir own version, first seen Oct 31, 2026
Used with
Projects with it also use dependency-watch, perform-task and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
telegramdesktopSkilldependency-watch
Audit Telegram Desktop dependencies on freshly fetched origin/dev for releases and security fixes, including upstream lag and backport candidates in patched forks. Use for the scheduled dependency monitor or an explicitly requested dependency report.
Also in 5 projects that use this
telegramdesktopSkillperform-task
Resolve, start or resume, implement, review, test, and publish exactly one existing ai-tdesktop task by short slug or full dated id, including rare blocked retries and split-required results. Use when the user invokes $perform-task or /perform-task with a known task name, or when the continue scheduler delegates one selected task. Runs standard review lenses with fast applicability bailouts and selects task-specific domain and evidence instruments without selecting additional work.
Also in 5 projects that use this
JerovinoSkillprocess-inbox
Processes tasks.md inbox items by triaging each one to its proper location in the vault
Also in 5 projects that use this
Trejon-888Skillcontinue
Load project context, alignment audit, status check, suggest next action. Auto-invoke at session start, after context switches, or when user says 'continue', 'pick up where we left off', 'resume', 'what's next', 'status check', 'what now'.
Also in 6 projects that use this
lepinkainenSkillcode-health
Analyze codebase health - large files, test coverage gaps, duplicate code, dead/legacy code, and documentation issues. Use when asked to scan, audit, or assess code quality, find refactoring targets, or identify technical debt.
Also in 3 projects that use this
dekozaSkillfix-pr
Repair an existing pull request's review findings and target-branch conflicts, verify the result, and update the same open PR.
Also in 3 projects that use this
Other versions27 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 27
- telegramdesktop/tdesktop★ 33ksame name
- raine/workmux★ 3ksame name
- TDesktop-x64/tdesktop★ 3ksame name
- openmeterio/openmeter★ 2.4ksame name
- kukuruzka165/materialgram★ 1.2ksame name
- deadlock-mod-manager/deadlock-mod-manager★ 584same name
- opsmill/infrahub★ 548same name
- burhancodes/fagramdesktop★ 205same name
- fagramdesktop/fadesktop★ 205same name
- tbhb/vale-ai-tells★ 118same name
17 more not listed
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 repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codex-reviewSkill
- paritySkill
- apple-containerSkill
- codex-reviewSkill
- mergeSkill
- paritySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. 0 are common, 13 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 27 edited versions we read keep these.
13
Distinctive
This author's own choices. Worth a look.
6
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 23
When the user types /rebase:
- Distinctive: line 26
Do the prep work in Step 1 before touching git rebase.
- Distinctive: line 83
If the rebase refuses to start because of a dirty working tree, go back to Step 1.
- Very specific: line 93
Locate the RPython/PyPy counterpart: Use the mechanical rule documented in the /parity skill — strip the crate root, swap .rs for .py, …
- Very specific: line 113
Remove the <<<<<<< / ======= / >>>>>>> markers and save.
- Distinctive: line 115
After every region in a file is resolved, git add the file.
- Distinctive: line 135
If more conflicts appear, return to Step 3.
- Distinctive: line 137
If at any step the rebase resolution is genuinely ambiguous and upstream gives no guidance, stop and ask the user rather than guess.
- Distinctive: line 139
If things go badly wrong:
- Distinctive: line 149
After the rebase completes:
- Very specific: line 152
Verify that the rebase kept the work.
- Distinctive: line 153
Test only as much as the rebase changed, following AGENTS.md "How much to verify":
- Distinctive: line 161
Do not push, merge, or force-push unless the user explicitly asks.
- Very specific: line 166
When upstream/main and origin/main disagree, ask which is the base — do not pick.
- Very specific: line 167
Every conflict region is judged individually.
- Distinctive: line 168
Every non-trivial resolution cites the upstream RPython/PyPy file:line it was judged against.
- Distinctive: line 169
Commit any unstaged work (or explicitly stash with user consent) before starting the rebase.
- Distinctive: line 171
Never git push --force without explicit user instruction, even after a successful rebase.
- Distinctive: line 172
When in doubt between two plausible resolutions, stop and ask the user — wrong silent resolutions compound.
“Common” is measured: kept by at least 6 in 10 of the 27 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
Rebase onto upstream/main, conflict-by-conflict, RPython-first
Why this skill exists
The working branch has drifted from upstream/main over time. Rebasing pulls upstream/main's progress under our work so that subsequent merging, reviewing, and landing operate against an up-to-date base. Two things make this rebase non-routine:
The base is a freshly-fetched remote
main, not localmain. Rebase onto the published main the branch will ultimately land against. Do not fall back to the localmainbranch, which only moves when pulled and so may lag the remote; rebasing onto a stale localmainleaves the branch still behind the real base.Fetch it first. A remote-tracking ref is only as current as the last fetch, and a stale one rebases the branch backwards onto a base that lacks already-merged work — silently, with zero conflicts, surfacing only as a compile error naming a symbol the dropped base provided.
origin/mainis not banned. It is a remote-tracking ref of the same kind asupstream/main, updated by the same fetch, and in this repositoryoriginandupstreamare the same URL — so preferring one and forbidding the other forbids an alias of what it mandates. The lag argument is about localmainalone. Resolve the base per Step 1.5 and verify, rather than assuming which remote the user keeps current.- Conflicts are not 50/50 choices. A conflict usually means both sides edited the same region with different intents. The right answer is almost always "whichever side matches RPython/PyPy upstream more faithfully" — sometimes that's ours, sometimes it's
upstream/main's, and sometimes it's a blend taking individual lines from both. Picking a side wholesale loses information.
Commit boundaries do not reliably align with these semantic units. A single commit can contain five unrelated hunks; one hunk in that commit may belong to us and four to upstream/main. Therefore conflict resolution must operate on the hunk/region level, not on git checkout --ours / --theirs at file level.
Invocation
When the user types /rebase:
- Parse any follow-up text as scoping hints (e.g.
/rebase finish what we started,/rebase skip the tests for now). Default is "rebase the current branch ontoupstream/main, resolve every conflict". - Do the prep work in Step 1 before touching
git rebase. - Execute the rebase per Steps 2–5.
Step 1 — Prepare the working tree
Goal: enter the rebase with a clean, conceptually-coherent commit history. Messy history makes conflict resolution harder because unrelated hunks pile up inside the same rebase step.
Check state:
git status --short git log upstream/main..HEAD --oneline git rev-parse --verify upstream/main- Unstaged / untracked changes — if there is real uncommitted work, commit it. Use this convention: factual English message, no
Co-Authored-By, no speculation about goals. If the changes are clearly WIP/scratch that should not land, confirm with the user before discarding or stashing. Squash WIP noise — if
git log upstream/main..HEADshows obvious fixups, revert-my-last-change, "typo", "trying X" commits, consolidate them withgit rebase -i upstream/main(before the real rebase) orgit reset --soft+ fresh commits. Rationale: during the real rebase, each small WIP commit will re-apply and may re-introduce conflicts that were already resolved one commit later. Squashing these out collapses the noise.Squashing is not for consolidating meaningful commits into one giant commit. Keep commits that represent distinct concepts separate — it makes per-hunk conflict reasoning easier, because each step's diff stays narrow.
- Confirm the squash plan with the user before rewriting history, especially if the branch is shared.
- Resolve the base before invoking
git rebase— see Step 1.5. Never fall back to localmain.
Step 1.5 — Fetch, then resolve the base
The base is a remote main, and which remote holds the current one is a question to answer, not to assume.
Fetch the candidates. This is cheap and it is what keeps a stale ref from silently rebasing the branch backwards:
git fetch upstream 2>/dev/null; git fetch originRead both tips:
git rev-parse upstream/main origin/main 2>&1- Choose:
- They agree — the common case here, where
originandupstreamare the same URL. Either name works; useupstream/main. - They disagree — do not pick silently. Show the user both tips and
git log --oneline upstream/main..origin/main(and the reverse), and ask which is the base. One of them is ahead, and rebasing onto the other drops whatever it is ahead by. upstreamdoes not exist — useorigin/main. It is a remote-tracking ref of the same kind; there is no reason to stop.- Neither exists — stop and ask the user to add and fetch a remote. Do not silently rebase onto local
main.
- They agree — the common case here, where
- Record the resolved SHA. Step 5 verifies against it, and a peer rebase mid-run can move the branch under you.
Step 2 — Start the rebase
git rebase upstream/mainSubstitute whichever base Step 1.5 resolved. If the rebase completes cleanly with no conflicts, skip to Step 5.
If the rebase refuses to start because of a dirty working tree, go back to Step 1.
Step 3 — Resolve each conflict per hunk, not per file or commit
When git rebase stops on a conflict, a single invocation may have produced multiple conflicted files, and each file may have multiple <<<<<<< / ======= / >>>>>>> regions. Each region is judged independently. Do not resolve them all the same way; do not run git checkout --ours / --theirs; do not accept IDE "Take Current" / "Take Incoming" bulk actions.
For each conflict region:
- Identify the semantic question. What did the current side (HEAD /
upstream/mainin a rebase — git flips ours/theirs during rebase; checkgit rebase --show-current-patchif unsure) change, and what did the incoming side (our branch's commit) change? State both intents in one sentence each before choosing. Locate the RPython/PyPy counterpart. Use the mechanical rule documented in the
/parityskill — strip the crate root, swap.rsfor.py, prepend the upstream root at ``. Open the upstream file. Read the region that corresponds to the conflicted region.If the mechanical rule fails to produce a valid path, read the
/parityskill's "When the mechanical transform fails" section — the failure itself may indicate that one side of the conflict has drifted away from upstream structure, which is a strong signal about who to side with.Judge RPython-orthodoxy per region. Lean toward the side whose:
- Structure matches the RPython file line-by-line (identifier names, argument order, control flow).
- Dependencies (helper functions, types, fields referenced) exist in upstream.
- Comments match or cite upstream.
Against the side whose:
- Names do not appear anywhere in
rpython/orpypy/under the project root. - Added side tables, caches, or feature flags without upstream basis (see
/parity's "Signals of NEW-DEVIATION"). - Comments say
// workaround,// pyre-only,// adaptationwithout a cited upstream line.
- Blend when both sides are partially orthodox. It is common that
upstream/mainfixed a real bug in the conflicted region and our branch renamed a variable in the same region. In that case the resolution isupstream/main's fix + our rename, not one or the other. Write the blended region by hand in the editor — do not rely on any conflict marker to auto-resolve a blend. - If neither side is orthodox, fix the region to match upstream even if that means writing code different from both sides. A rebase is a legitimate moment to fix a pre-existing deviation in a hunk you had to touch anyway. Don't expand scope beyond the conflicting region, though — an unrelated clean hunk is out of scope for this skill.
- Cite the upstream line(s) consulted in a brief note the user will see when you summarize. This is how the user audits your conflict resolution after the fact without re-running the rebase.
- Remove the
<<<<<<</=======/>>>>>>>markers and save.
After every region in a file is resolved, git add the file. Only after every conflicted file in the current rebase step is added, continue with Step 4.
Step 4 — Verify, then continue the rebase
Before git rebase --continue:
Re-read the diff for this step to catch accidental deletions:
git diff --cached- For each resolved file, sanity-check that the logic compiles and matches upstream structure. If the file is Rust and the change is non-trivial,
cargo check -p <crate>on the affected crate is cheap and catches obvious breakage before the next conflict compounds the damage. Fullcargo testis overkill between steps — save that for Step 5. Continue:
git rebase --continue- If more conflicts appear, return to Step 3. Each conflict region gets the same RPython-first treatment.
- If at any step the rebase resolution is genuinely ambiguous and upstream gives no guidance, stop and ask the user rather than guess. Partial rebases can be stashed and resumed; a wrong silent resolution propagates through the rest of the rebase.
If things go badly wrong:
git rebase --abort # returns to pre-rebase state; no work lost--abort is safe — it's the designed undo. Prefer aborting and restarting over git rebase --skip of a commit you don't understand.
Step 5 — Final sanity check
After the rebase completes:
git log upstream/main..HEAD --oneline— confirm the commit list is what was expected, and that the history is linear on top ofupstream/main.- Verify that the rebase kept the work. Commits that did not conflict must keep their patch-id (
git show <sha> | git patch-id --stable, old against new). No commit may be emptied. - Test only as much as the rebase changed, following AGENTS.md "How much to verify":
- The pre-rebase tip was green (locally or on CI): run
cargo checkon the crates whose conflicts you resolved by hand. If a resolution blended logic from both sides, also run the tests that exercise that region. Do not rerun the fullcargo test --allorpyre/check.pyjust because the base moved; CI does that. - The pre-rebase tip was never verified, or its last CI run was red: the rebase does not change that. Run the gate that the red, or the unverified change, calls for before the next push.
- The pre-rebase tip was green (locally or on CI): run
- Report to the user:
- Number of conflicts resolved.
- For each non-trivial resolution: file:line on our side, file:line upstream consulted, one-sentence justification.
- What was verified (check, targeted tests, or full gate), and why that much.
Do not push, merge, or force-push unless the user explicitly asks.
Hard rules (recap)
- Base is a remote
mainresolved and fetched per Step 1.5, never localmain. Fetch before reading a tip; an unfetched ref is the one failure of this skill that produces no conflict and no error until compile time. - When
upstream/mainandorigin/maindisagree, ask which is the base — do not pick. - Every conflict region is judged individually. No bulk
--ours/--theirs, no IDE "take all current", no trust-one-side-per-file shortcuts. - Every non-trivial resolution cites the upstream RPython/PyPy file:line it was judged against.
- Commit any unstaged work (or explicitly stash with user consent) before starting the rebase.
- Squash WIP noise only; do not collapse meaningful commits into one.
- Never
git push --forcewithout explicit user instruction, even after a successful rebase. - When in doubt between two plausible resolutions, stop and ask the user — wrong silent resolutions compound.
Interaction with other skills
/parity— defines "RPython-orthodox" in detail (mechanical upstream path lookup, NEW-DEVIATION signals, structural vs functional parity). Read its body when a conflict requires judging orthodoxy and the summary above is insufficient./merge— separate workflow./mergeaccumulates green slices on a<branch>-mergebranch starting fromupstream/main;/rebaserewrites the current branch on top ofupstream/mainin place. They are not interchangeable. Use/rebasewhen the goal is "my branch should be linear on top of currentupstream/main"; use/mergewhen the goal is "I need a staging branch wherepyre/check.pyis always green"./commit— the commit convention (factual English, noCo-Authored-By, no "improves X" speculation) applies to any commits this skill creates during Step 1 prep.
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.

