rebase
Skill548 starsChanged 10 days agoApache-2.0View on GitHub
Rebases a feature branch onto its latest base, resolving conflicts while preserving the intent of local changes, optionally force-pushing and watching CI afterward. TRIGGER when: the user wants to rebase a feature branch, update a branch against its base, or replay local work on top of the latest upstream. DO NOT TRIGGER when: merging a release branch into dev → merging-branches; only watching CI on an already-open PR → monitoring-pull-requests.
- 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 9 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
- burhancodes/fagramdesktop★ 205same name
- fagramdesktop/fadesktop★ 205same name
- tbhb/vale-ai-tells★ 118same name
- Jamie-BitFlight/claude_skills★ 67same 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 repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- backend/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- analyzing-ci-flakinessSkill
- audit-docsSkill
- commitSkill
- creating-changelog-entriesSkill
- creating-issuesSkill
- creating-prdSkill
- grilling-ideasSkill
- harvesting-reviewSkill
- migrate-feature-pageSkill
- monitoring-pull-requestsSkill
- neo4j-cypher-guideSkill
- opsmill-dev-analyzing-bugsSkill
- opsmill-dev-fixing-bugsSkill
- opsmill-dev-test-driving-bugsSkill
- pre-ciSkill
- prSkill
- reviewing-pull-requestsSkill
- speckit-agent-context-updateSkill
- speckit-analyzeSkill
- speckit-checklistSkill
- speckit-clarifySkill
- speckit-constitutionSkill
- speckit-convergeSkill
- speckit-critique-runSkill
- speckit-git-commitSkill
- speckit-git-featureSkill
- speckit-git-initializeSkill
- speckit-git-remoteSkill
- speckit-git-validateSkill
- speckit-implementSkill
- speckit-opsmill-autoSkill
- speckit-opsmill-extractSkill
- speckit-opsmill-implementSkill
- speckit-opsmill-prepSkill
- speckit-opsmill-retrospectSkill
- speckit-opsmill-summarySkill
- speckit-planSkill
- speckit-review-codeSkill
- speckit-review-commentsSkill
- speckit-review-errorsSkill
- speckit-review-runSkill
- speckit-review-simplifySkill
- speckit-review-testsSkill
- speckit-review-typesSkill
- speckit-specifySkill
- speckit-tasksSkill
- speckit-taskstoissuesSkill
- upgrading-infrastructure-dependenciesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. 0 are common, 17 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 27 edited versions we read keep these.
17
Distinctive
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
- Distinctive: line 36
Run git status to check for uncommitted changes.
- Distinctive: line 37
Run git branch --show-current to identify the current branch.
- Distinctive: line 39
Prefer the repository's default branch.
- Very specific: line 46
If origin/HEAD is not set, fall back to whichever of main, master, develop, or stable exists on the remote.
- Very specific: line 47
If the current branch was clearly forked from a different long-lived branch — including a release branch (e.g.
- Distinctive: line 48
When the base branch is still ambiguous, ask the user which branch to rebase onto.
- Distinctive: line 70
If the rebase completes cleanly, skip to Phase 4.
- Distinctive: line 74
When conflicts arise, understand what the local commits intended to do and preserve that intent while incorporating upstream changes.
- Distinctive: line 85
Read the file to see the conflict markers.
- Distinctive: line 102
After all conflicts are resolved, show the user a summary of what was resolved.
- Distinctive: line 103
Escape hatch: If a conflict is unresolvable, or the user wants to bail out at any point, run git rebase --abort to restore the branch to …
- Distinctive: line 107
Run a quick sanity check:
- Very specific: line 120
When push IS provided:
- Very specific: line 128
Use --force-with-lease as a safety measure to avoid overwriting unexpected upstream changes.
- Distinctive: line 138
If nothing has started after a few minutes, investigate whether the push triggered a workflow.
- Distinctive: line 140
Wait for the run to finish with a single blocking call instead of polling repeatedly:
- Distinctive: line 148
If any jobs fail:
- Distinctive: line 156
After approval, commit the fix, push, and continue monitoring.
- Distinctive: line 172
When both sides modify the same logic in incompatible ways, ask the user.
- Distinctive: line 173
After resolution, run the project's formatters/linters (if any) to catch issues introduced by the merge.
- Distinctive: line 178
Forgetting the abort path: When a conflict cannot be resolved cleanly, git rebase --abort is the way back.
- Very specific: line 182
Counting commits against a stale local base: Use origin/<base-branch>..HEAD, not the local ref, or the count can be wrong on an out-of-date …
“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 Branch
Introduction
Rebase the current branch onto the latest base branch, resolving any merge conflicts by preserving the intent of local changes. Optionally force-push and monitor CI status on GitHub.
Arguments
<arguments> $ARGUMENTS </arguments>
Supported arguments:
push— After a successful rebase, force-push the branch upstream and monitor GitHub Actions CI until completion.
Main Tasks
1. Assess Current State
Understand the branch topology and working tree before doing anything destructive.
- Run
git statusto check for uncommitted changes. - Run
git branch --show-currentto identify the current branch. - Determine the base branch (the long-lived branch this feature branch should land on):
Prefer the repository's default branch. Detect it with:
git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/nullThis typically returns
origin/main,origin/master,origin/develop, ororigin/stable. Use the branch name afterorigin/.- If
origin/HEADis not set, fall back to whichever ofmain,master,develop, orstableexists on the remote. - If the current branch was clearly forked from a different long-lived branch — including a release branch (e.g.
release/*,release-*, or a version-named branch like1.2/v1.2) — use that instead. - When the base branch is still ambiguous, ask the user which branch to rebase onto.
- If the current branch IS a long-lived branch — STOP: Rebasing these branches is not allowed. Inform the user and exit. Long-lived branches include the detected default branch,
main/master/develop/stable, and release branches (release/*,release-*, version-named branches). - If there are uncommitted changes — STOP: Inform the user they must commit or stash changes before rebasing. Do not proceed.
- Show the user a summary:
- Current branch name.
- Base branch.
- Number of local commits (
git log origin/<base-branch>..HEAD --oneline).
2. Update Base Branch & Rebase
Fetch the latest remote state:
git fetch originStart the rebase:
git rebase origin/<base-branch>- If the rebase completes cleanly, skip to Phase 4.
3. Resolve Merge Conflicts
When conflicts arise, understand what the local commits intended to do and preserve that intent while incorporating upstream changes. For each conflict, read both sides and make an informed resolution.
For each conflict that arises during the rebase:
Identify conflicting files:
git diff --name-only --diff-filter=U- For each conflicting file:
- Read the file to see the conflict markers.
- Inspect the commit currently being replayed — that is
REBASE_HEAD, notHEAD(git show REBASE_HEAD, orgit log -1 REBASE_HEAD). Mid-rebase,HEADpoints at the last successfully applied commit, not the one that is conflicting. - Understand what the upstream change did vs what the local change intended.
- Resolve the conflict by preserving the intent of local changes while incorporating any non-conflicting upstream changes.
Stage the resolved file:
git add <file>
Continue the rebase:
git rebase --continue- Repeat until the rebase completes. If a conflict is ambiguous, present both sides to the user and ask how to resolve it.
- After all conflicts are resolved, show the user a summary of what was resolved.
- Escape hatch. If a conflict is unresolvable, or the user wants to bail out at any point, run
git rebase --abortto restore the branch to its exact pre-rebase state — nothing is lost. Never leave the user stranded in a half-finished rebase.
4. Verify Rebase Result
Run a quick sanity check:
git log origin/<base-branch>..HEAD --oneline- Confirm the commit history looks correct (same number of local commits, no duplicates).
- If the project defines fast validation commands (formatters, linters), run them to catch any issues introduced by conflict resolution. Discover them from the project's own context — for example
AGENTS.md/CONTAINER-style docs, aMakefile/Taskfile/justfile,package.jsonscripts,pyproject.toml/tox.ini, or apre-commitconfig. Run whatever the project actually defines, then fix any issues introduced by conflict resolution. If the project defines no such commands, skip this step.
5. Force Push & Monitor CI (only when push argument is provided)
Skip this phase entirely if push was NOT passed as an argument. Instead, inform the user the rebase is complete and they can push when ready.
When push IS provided:
Force-push the rebased branch:
git push --force-with-lease origin <branch-name>Use
--force-with-leaseas a safety measure to avoid overwriting unexpected upstream changes.Note: the
git fetch originin Phase 2 already advanced the remote-tracking ref that a bare--force-with-leasecompares against, so a concurrent push to this branch between the fetch and the push would not be caught. If that risk matters, pin the SHA captured before the fetch:git push --force-with-lease=<branch-name>:<sha> origin <branch-name>.Discover the run the push triggered (be patient — CI can take several minutes to start):
gh run list --branch <branch-name> --limit 5If nothing has started after a few minutes, investigate whether the push triggered a workflow.
Wait for the run to finish with a single blocking call instead of polling repeatedly:
gh run watch <run-id> --exit-status--exit-statusreturns non-zero if the run fails, so you can branch on the result directly. Fall back to periodicgh run listonly ifgh run watchis unavailable.- If any jobs fail:
Read failure logs:
gh run view <run-id> --log-failed- Analyze the failure and propose a fix to the user.
- After approval, commit the fix, push, and continue monitoring.
- Report final CI status to the user.
Notes
Branch Safety:
- This skill will NEVER rebase a long-lived branch — the repository's default branch,
main/master/develop/stable, or a release branch (release/*,release-*, version-named branches). - Uses
--force-with-leaseinstead of--forceto prevent overwriting unexpected remote changes. - Will not proceed with uncommitted changes in the working tree.
git rebase --abortalways restores the exact pre-rebase state — use it whenever a rebase cannot be completed cleanly rather than leaving the branch half-rebased.
Conflict Resolution Strategy:
- Local changes take priority — the goal is to land our work on top of the latest base.
- When both sides modify the same logic in incompatible ways, ask the user.
- After resolution, run the project's formatters/linters (if any) to catch issues introduced by the merge.
Common Mistakes
- Rebasing onto the wrong base. Confirm the detected base branch with the user before starting — landing work on the wrong long-lived branch is painful to unwind.
- Forgetting the abort path. When a conflict cannot be resolved cleanly,
git rebase --abortis the way back. Don't leave the user stranded mid-rebase. - Resolving by blindly taking one side. Accepting one side wholesale (e.g.
-X ours/-X theirs) discards intent. Read both sides and preserve what the local commit meant to do. - Inspecting
HEADduring a conflict. The commit being replayed isREBASE_HEAD, notHEAD. Looking atHEADshows the wrong commit. - Force-pushing without
--lease. Plaingit push --forcecan silently clobber a teammate's push. Always use--force-with-lease. - Counting commits against a stale local base. Use
origin/<base-branch>..HEAD, not the local ref, or the count can be wrong on an out-of-date or freshly cloned checkout.
Expected Outcome
A branch that:
- Is cleanly rebased onto the latest base branch.
- Has all merge conflicts resolved preserving local intent.
- Passes the project's formatters and linters (if defined) after resolution.
- (When
pushis provided) Is force-pushed upstream with passing CI.
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.

