agentleFS
a1fa1f/agent-templates/skills/latest-rebase/SKILL.md

latest-rebase

Skill2 starsChanged 4 months agoMITView on GitHub

Use when the user invokes /latest-rebase or says "rebase on latest main". Rebases current branch onto latest remote main.

  • Deletes or force-pushes
  • Commits and pushes

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If there are unstaged changes, stash them first:

    line 18
  2. Distinctive:

    Check if commits are ahead of main:

    line 32
  3. Distinctive:

    If no commits ahead: branch was already merged.

    line 37
  4. Distinctive:

    If commits ahead: rebase succeeded with work remaining.

    line 38
  5. Distinctive:

    If rebase fails with conflicts:

    line 42
  6. Distinctive:

    Ask the user how to proceed (resolve, abort, or skip)

    line 44
  7. Distinctive:

    Do NOT automatically resolve conflicts

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Latest Rebase

Rebase the current branch onto the latest remote main. Handles stashing, conflict detection, and force-push.

Execution

1. Fetch and rebase

git fetch origin main

If there are unstaged changes, stash them first:

git stash
git rebase origin/main
git stash pop

Otherwise:

git rebase origin/main

2. Check result

Check if commits are ahead of main:

git log origin/main..HEAD --oneline
  • If no commits ahead: branch was already merged. Switch to main, pull, delete branch locally and remotely. Run validate and install.
  • If commits ahead: rebase succeeded with work remaining. Ask if the user wants to force-push (git push --force-with-lease).

3. If rebase had conflicts

If rebase fails with conflicts:

  • Show which files have conflicts
  • Ask the user how to proceed (resolve, abort, or skip)
  • Do NOT automatically resolve conflicts

4. Validate and install

./validate.sh
./install.sh --non-interactive --all

Common Mistakes

MistakeFix
Force-pushing without askingAlways ask before --force-with-lease
Auto-resolving conflictsShow conflicts and ask the user
Forgetting to validate after rebaseALWAYS run validate and install

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.