agentleFS
MarcusJellinghausMarcusJellinghaus/mcp-tools-py/.claude/skills/rebase/SKILL.md

rebase

Skill18 starsChanged 3 months agoMITView on GitHub

Rebase feature branch onto base branch with conflict resolution

  • Deletes or force-pushes
  • Commits and pushes

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use commit and review.

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

    commit

    Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 5 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 5

    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
  1. Very specific:

    Call mcp__mcp-workspace__git with command "status" before doing anything else.

    line 37
  2. Distinctive:

    If the rebase becomes complex, suggest switching to cherry-picking as an alternative approach.

    line 45
  3. Very specific:

    Call mcp__mcp-workspace__get_base_branch to detect the correct base branch.

    line 49
  4. Distinctive:

    If the base branch is not main or master, ask the user to confirm before proceeding.

    line 53
  5. Distinctive:

    Not already in rebase/merge state

    line 58
  6. Distinctive:

    Not on main/master branch

    line 59
  7. Very specific:

    Call mcp__mcp-workspace__git with command "fetch" and args ["origin"]

    line 65
  8. Very specific:

    If file is under pr_info/: auto-resolve with git checkout --theirs <file> (keep feature branch version), then git add <file> — no user …

    line 68
  9. Distinctive:

    Verify no conflict markers remain

    line 70
  10. Very specific:

    Run code checks: mcp__mcp-tools-py__run_pytest_check, mcp__mcp-tools-py__run_pylint_check, mcp__mcp-tools-py__run_mypy_check

    line 73

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

Rebase Branch onto Base Branch

First Step

Call mcp__mcp-workspace__git with command "status" before doing anything else.

Rebase the current feature branch onto its base branch and resolve conflicts.

Core philosophy: Main is the source of truth. The feature branch adapts to main. For source code conflicts, preserve main's improvements and rework the feature branch code to fit.

Note on --ours/--theirs during rebase: --ours = main (the branch being rebased onto), --theirs = feature branch commits being replayed.

If the rebase becomes complex, suggest switching to cherry-picking as an alternative approach.

Determine Base Branch

Call mcp__mcp-workspace__get_base_branch to detect the correct base branch. Use the returned branch name in subsequent git commands.

Base Branch Confirmation

If the base branch is not main or master, ask the user to confirm before proceeding. Display the detected base branch and wait for explicit approval.

Pre-flight Checks (Abort if any fail)

  1. Working directory is clean (no uncommitted changes)
  2. Not already in rebase/merge state
  3. Not on main/master branch
  4. Remote origin exists
  5. pr_info/ does not exist on the base branch — if it does, abort with error: "pr_info/ exists on <BASE_BRANCH>. This folder should only exist on feature branches. Check your branch setup."

Workflow

  1. Call mcp__mcp-workspace__git with command "fetch" and args ["origin"]
  2. git rebase origin/${BASE_BRANCH}
  3. For each conflict:
    • If file is under pr_info/: auto-resolve with git checkout --theirs <file> (keep feature branch version), then git add <file> — no user input needed
    • For all other files: resolve manually, preserving main's improvements; rework feature branch changes to fit
    • Verify no conflict markers remain
    • git add <file>
    • git rebase --continue
  4. Run code checks: mcp__mcp-tools-py__run_pytest_check, mcp__mcp-tools-py__run_pylint_check, mcp__mcp-tools-py__run_mypy_check
  5. Fix any issues from merge
  6. Report summary and ask for user confirmation
  7. git push --force-with-lease

Conflict Resolution Strategies

File TypeStrategy
pr_info/ filesAuto-resolve with --theirs (keep feature branch version)
Code files (.py, .js, etc.)Keep both sides, merge imports
Test filesKeep all tests from both sides
Config filesMerge additively, prefer HEAD for same keys
Lockfiles (*-lock.json, *.lock)Accept theirs (--theirs), notify user to regenerate after rebase

Abort Rules (in priority order)

  1. Any unexpected error - abort, report full error
  2. Binary file conflict - abort, cannot auto-resolve
  3. Conflict markers remain after resolution - abort
  4. Same file conflicts 3+ times - abort
  5. Code quality fails after 2 fix attempts - abort
  6. Any other unexpected situation - abort, suggest manual intervention

On abort: run git rebase --abort, report which rule triggered, suggest next steps.

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.