agentleFS
IcodeNetIcodeNet/agent-skills/skills/rebase-onto-main/SKILL.md

rebase-onto-main

Skill0 starsChanged 4 months agoMITView on GitHub

Rebase the current branch onto main with guardrails. Manual command — run with /rebase-onto-main when the user asks to rebase the current branch on main.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    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
  1. Distinctive:

    Run git branch --show-current.

    line 12
  2. Distinctive:

    If the working tree is dirty, stop and ask whether to commit or stash first.

    line 14
  3. Distinctive:

    If the default branch isn't main, detect it (git remote show origin) and use that instead throughout.

    line 18
  4. Distinctive:

    If a conflict occurs:

    line 24
  5. Distinctive:

    Run git status --short and report conflicted files.

    line 25
  6. Distinctive:

    Stop and ask the user whether to continue resolving, abort (git rebase --abort), or take a narrower scope.

    line 26
  7. Distinctive:

    Run git log --oneline -5 for a quick verification summary.

    line 30
  8. Very specific:

    If the branch was previously pushed, note that the next push requires --force-with-lease — never plain --force.

    line 31

≈ “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.

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

Rebase Onto Main

Rebase the current branch onto the latest main safely.

  1. Branch + cleanliness checks
    • Run git branch --show-current; abort if on main/master.
    • Run git status --short.
    • If the working tree is dirty, stop and ask whether to commit or stash first.
  2. Fetch latest main
    • Run git fetch origin main.
    • If the default branch isn't main, detect it (git remote show origin) and use that instead throughout.
  3. Rebase
    • Run git rebase origin/main.
  4. Conflict handling (mandatory)
    • If a conflict occurs:
      • Run git status --short and report conflicted files.
      • Stop and ask the user whether to continue resolving, abort (git rebase --abort), or take a narrower scope.
  5. Post-rebase verification
    • Run git status.
    • Run git log --oneline -5 for a quick verification summary.
    • If the branch was previously pushed, note that the next push requires --force-with-lease — never plain --force.

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.

Reviews can't be read right now.

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.