rebase
Skill8 starsChanged 2 months agoMITView on GitHub
Fetch the latest default branch and rebase the current branch on top of it, resolving any merge conflicts automatically. Use when asked to "rebase", "rebase on main", "update branch with main", "sync with main", "rebase onto latest", or "/rebase".
- 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 5 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
Hugging FaceSkillimplement
Make tests pass. Invoke after /write-tests produces failing tests.
Also in 4 projects that use this
Other versions27 projects use a version of this.
Word for word · 1
- deadlock-mod-manager/deadlock-mod-manager★ 584100% same
Edited · 0
None found.
Wrote their own version · 26
- telegramdesktop/tdesktop★ 33ksame name
- raine/workmux★ 3ksame name
- TDesktop-x64/tdesktop★ 3ksame name
- openmeterio/openmeter★ 2.4ksame name
- kukuruzka165/materialgram★ 1.2ksame name
- opsmill/infrahub★ 548same name
- burhancodes/fagramdesktop★ 205same name
- fagramdesktop/fadesktop★ 205same name
- tbhb/vale-ai-tells★ 118same name
- Jamie-BitFlight/claude_skills★ 67same name
16 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 repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .deepsec/AGENTS.mdAGENTS.md
- .cursor/rules/010-workflow.mdcCursor rule
- .cursor/rules/020-codebase-structure.mdcCursor rule
- .cursor/rules/030-coding-style.mdcCursor rule
- .cursor/rules/031-never-use-any.mdcCursor rule
- .cursor/rules/032-import-rules.mdcCursor rule
- .cursor/rules/050-testing.mdcCursor rule
- .cursor/rules/070-comments-defensive-programming.mdcCursor rule
- .cursor/rules/080-ai-interaction.mdcCursor rule
- .cursor/rules/090-changesets.mdcCursor rule
- .cursor/rules/095-calldiff.mdcCursor rule
- .cursor/rules/990-cursor-rule-editing-workaround.mdcCursor rule
- .cursor/rules/999-mdc-format.mdcCursor rule
- adversarial-reviewSkill
- agent-browserSkill
- calldiffSkill
- changesetSkill
- commitSkill
- deslopSkill
- fix-prSkill
- git-conventionsSkill
- humanizerSkill
- improve-codebase-architectureSkill
- logging-best-practicesSkill
- opensrcSkill
- recomposing-commitsSkill
- security-reviewSkill
- show-meSkill
- simplifySkill
- thermo-nuclear-code-quality-reviewSkill
- wait-whatSkill
- writing-for-agentsSkill
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 26 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
- Distinctive: line 12
Before doing anything, verify the working tree state:
- Very specific: line 14
Run git status --porcelain=v1 --branch.
- Very specific: line 16
Ask whether to stash (git stash push -u -m "rebase-skill autostash") or abort
- Distinctive: line 17
Do NOT silently discard work
- Distinctive: line 18
Run git rev-parse --abbrev-ref HEAD to capture the current branch name.
- Distinctive: line 34
If the fetch fails (network/auth), report the exact error and stop.
- Very specific: line 58
Run git status --porcelain=v1.
- Very specific: line 62
Read the full file (do not rely on <<<<<<< markers alone for context)
- Very specific: line 80
After editing, ensure no <<<<<<<, =======, or >>>>>>> markers remain:
- Distinctive: line 93
If the rebase reports "No changes - did you forget to use 'git add'?", the commit became empty after resolution.
- Distinctive: line 95
If new conflicts appear on the next commit, return to step 4a.
- Distinctive: line 97
If at any point you are stuck (more than 2 attempts on the same file produce conflict markers, or the user asked to stop), run git rebase …
- Distinctive: line 104
If lockfiles or generated files were taken from base in Step 4, regenerate them now:
- Distinctive: line 109
If a stash was created in Step 1, ask the user before popping it (git stash pop).
- Very specific: line 122
NEVER run git push --force (without --with-lease) on the user's behalf
- Distinctive: line 123
NEVER push at all unless the user explicitly asks
- Distinctive: line 124
NEVER run git rebase --skip to bypass conflicts you do not understand — only for genuinely empty commits
- Distinctive: line 125
NEVER discard uncommitted work without explicit confirmation
- Distinctive: line 126
NEVER resolve a conflict by deleting code from one side without reading both sides in full
“Common” is measured: kept by at least 6 in 10 of the 26 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 Current Branch on Latest Main
Fetch the latest default branch from origin and rebase the current branch on top of it, resolving conflicts as they appear. Do not push unless the user asks.
Step 1: Pre-Flight Checks
Before doing anything, verify the working tree state:
- Run
git status --porcelain=v1 --branch. Confirm there are no uncommitted changes. If there are:- List them to the user
- Ask whether to stash (
git stash push -u -m "rebase-skill autostash") or abort - Do NOT silently discard work
- Run
git rev-parse --abbrev-ref HEADto capture the current branch name. If it ismain,master, or the default branch, stop and tell the user there is nothing to rebase. - Determine the default branch:
Fall back togh repo view --json defaultBranchRef --jq '.defaultBranchRef.name'git symbolic-ref refs/remotes/origin/HEAD --short | sed 's@^origin/@@'ifghis unavailable. Cache the result as$BASE. - Confirm an
originremote exists withgit remote get-url origin.
Step 2: Fetch the Latest Base
Fetch only what is needed and prune stale refs:
git fetch --prune origin "$BASE"If the fetch fails (network/auth), report the exact error and stop. Do not start a rebase against stale refs.
Step 3: Start the Rebase
Run:
git rebase "origin/$BASE"Capture both stdout and stderr. There are three outcomes:
| Outcome | How to Detect | Action |
| Clean rebase | Exit 0, no CONFLICT lines | Go to Step 5 |
| Conflicts | Exit non-zero, output contains CONFLICT or could not apply | Go to Step 4 |
| Other failure | Exit non-zero without conflict markers | Run git rebase --abort, restore any stash from Step 1, report error, stop |
Step 4: Resolve Conflicts (Loop)
Repeat this loop until git status reports the rebase is no longer in progress.
4a. Inventory the Conflicts
Run git status --porcelain=v1. Conflicted files are marked UU, AA, DU, UD, AU, UA, or DD.
For each conflicted file:
- Read the full file (do not rely on
<<<<<<<markers alone for context) - Identify the conflict regions delimited by
<<<<<<<,=======,>>>>>>> - Identify which side is "ours" (the rebased commit being replayed) and "theirs" (the base branch tip). During
git rebase, "ours" is the upstream base and "theirs" is the commit being replayed — this is the opposite ofgit merge. Verify withgit log --oneline -1 HEADandgit log --oneline -1 REBASE_HEADif unsure.
4b. Resolve Each File
Apply this decision logic per conflict region:
| Situation | Resolution |
Lockfiles (pnpm-lock.yaml, Cargo.lock, package-lock.json, yarn.lock, bun.lockb, uv.lock) | Take the base branch version, then regenerate (pnpm install, cargo build, npm install, etc.) at the end of the rebase, not per-step |
| Generated files (build output, snapshots, codegen) | Take the base branch version and regenerate after the rebase completes |
| Both sides changed unrelated lines in the same hunk | Combine both changes, preserving intent from each |
| Same line changed differently with clear semantic conflict | Read surrounding code, infer intent, prefer the change that is consistent with the rest of the diff being replayed; if ambiguous, ask the user |
Import/export lists, CHANGELOG.md, version bumps | Merge by union (keep entries from both sides, deduplicated, sorted as the file dictates) |
| Whitespace-only / formatting-only conflicts | Take whichever side matches the project's formatter; run the formatter after if needed |
| Truly ambiguous business logic | Stop, present both versions to the user with file paths and line ranges, and ask which to keep |
After editing, ensure no <<<<<<<, =======, or >>>>>>> markers remain:
git grep -nE '^(<{7}|={7}|>{7})( |$)' -- ':(exclude)*.md'4c. Stage and Continue
git add <resolved files>
git rebase --continueIf the rebase reports "No changes - did you forget to use 'git add'?", the commit became empty after resolution. Run git rebase --skip.
If new conflicts appear on the next commit, return to step 4a.
If at any point you are stuck (more than 2 attempts on the same file produce conflict markers, or the user asked to stop), run git rebase --abort, restore the stash, and report.
Step 5: Post-Rebase Validation
Once the rebase completes:
- Confirm state:
git statusshould show "nothing to commit, working tree clean" and the branch ahead oforigin/$BASE. - If lockfiles or generated files were taken from base in Step 4, regenerate them now:
pnpm installifpnpm-lock.yamlwas touchedcargo build(orcargo check) ifCargo.lockwas touched- The project-appropriate codegen command for any generated sources Stage and amend into the relevant commit only if regeneration produced changes; otherwise leave alone.
- If a stash was created in Step 1, ask the user before popping it (
git stash pop).
Step 6: Report
Tell the user:
- The base branch and SHA you rebased onto (
git rev-parse --short "origin/$BASE") - How many commits were replayed (
git rev-list --count "origin/$BASE..HEAD") - Which files had conflicts and a one-line summary of how each was resolved
- Any follow-up they should do (e.g., "lockfile regenerated, please verify"), and whether a force-push is required (
git push --force-with-lease) — but do not push unless explicitly asked
Hard Rules
- NEVER run
git push --force(without--with-lease) on the user's behalf - NEVER push at all unless the user explicitly asks
- NEVER run
git rebase --skipto bypass conflicts you do not understand — only for genuinely empty commits - NEVER discard uncommitted work without explicit confirmation
- NEVER resolve a conflict by deleting code from one side without reading both sides in full
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.

