agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/rebase/SKILL.md

rebase

Skill2 starsChanged 4 months agoMITView on GitHub

Replay a branch's commits onto a new base with git rebase — update a feature branch onto the latest main, move commits onto a different base, or linearize history — safely, with conflict handling and a recovery path. Use when the user says "rebase onto main", "update my branch with the latest main", "replay my commits", "move my branch onto", "rebase this branch", or "get the latest changes into my branch without a merge commit".

  • Deletes or force-pushes
  • Commits and pushes

28 other projects use a version of this.

Adopted by

Most recently taken up by

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.
  • telegramdesktopSkill

    dependency-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

  • telegramdesktopSkill

    perform-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

  • JerovinoSkill

    process-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-888Skill

    continue

    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

  • lepinkainenSkill

    code-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

  • dekozaSkill

    fix-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

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 28 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Fetch first: when rebasing onto a remote base so you replay onto the true latest (git fetch then rebase onto origin/main).

    line 26
  2. Distinctive:

    Verify nothing was lost: After rebasing, confirm the diff against the base reflects only the intended changes and the test suite still …

    line 33
  3. Distinctive:

    Never rebase with a dirty tree or without a recoverable backup (reflog/backup branch).

    line 37
  4. Very specific:

    Use --force-with-lease, never a bare --force, when the rebased branch must be pushed — and only after the user confirms.

    line 39

“Common” is measured: kept by at least 6 in 10 of the 28 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Branch state

!git status --short 2>/dev/null

!git branch --show-current 2>/dev/null

!git log --oneline --no-merges "$(git merge-base HEAD main 2>/dev/null || git merge-base HEAD master 2>/dev/null)"..HEAD 2>/dev/null | head -30

Instructions

Rebase the current branch onto the base in $ARGUMENTS (default main/master) so its commits replay on top of the latest base, giving a linear history without a merge commit. Rebasing rewrites commits — be careful and confirm before rewriting anything already pushed or shared.

Before rebasing

  1. Require a clean working tree. Uncommitted changes must be committed or stashed first (see the stash skill) — rebase refuses to start dirty and a half-rebase can lose uncommitted work.
  2. Make a safety net. Record the current tip (git rev-parse HEAD) or suggest git branch backup/<name> so the pre-rebase state is recoverable via the reflog if anything goes wrong.
  3. Check whether the branch is shared. Rebasing commits others have pulled forces a --force-push that rewrites their view. If the branch is already pushed, note that --force-with-lease will be needed afterward and confirm that's acceptable. For a shared branch, a merge is often the safer choice — say so.
  4. Fetch first when rebasing onto a remote base so you replay onto the true latest (git fetch then rebase onto origin/main).

Rebasing

  1. Run the rebase: git rebase <base> (or git rebase --onto <newbase> <upstream> to transplant only a range of commits onto a different base).
  2. Handle conflicts as a checkpoint. On conflict, do not guess — show the conflicted files, explain both sides, resolve like a merge (see resolve-conflicts), git add the resolved files, then git rebase --continue. Offer git rebase --skip for an already-applied commit and git rebase --abort to return cleanly to the pre-rebase state. Never leave the repo mid-rebase silently.
  3. Don't auto-squash here. Reordering/combining commits is the squash skill's job — this skill replays the existing commits onto a new base. Keep them intact unless the user asks otherwise.
  4. Verify nothing was lost. After rebasing, confirm the diff against the base reflects only the intended changes and the test suite still passes — the content should match what the branch contributed before, now on top of the new base.

Rules

  1. Never rebase with a dirty tree or without a recoverable backup (reflog/backup branch); state the recovery path.
  2. On conflict, stop and let the user resolve; never guess. Always surface --continue / --skip / --abort and never abandon the repo mid-rebase.
  3. Use --force-with-lease, never a bare --force, when the rebased branch must be pushed — and only after the user confirms. Don't push on their behalf unless asked.
  4. Be cautious on shared branches: call out who is affected and offer merge as the safer alternative before rewriting.
  5. End with the resulting git log --oneline, confirmation the content is intact and tests pass, and the exact git push --force-with-lease command to run.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.