Rebase Branch onto Main

SkillDev tools

Lets your agent rebase a git branch onto main, handling squash-merged parent branches cleanly.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Rebase Branch onto Main skill

About this capability

Rebase a PX4 branch onto main, handling squash-merged parent branches without replaying inherited commits.

What this skill tells your AI

The instructions your AI receives, as published by px4/px4-autopilot in .agents/skills/rebase-onto-main/SKILL.md and read by ahel’s review.

Read .claude/skills/rebase-onto-main/SKILL.md from the repository root and follow its workflow with these adaptations:

  • Input is the branch in the user's request, defaulting to the current branch. Do not interpret $ARGUMENTS as a shell variable.
  • Use available tools; ignore claims about Claude's Bash execution environment. Explicitly check checkout and rebase failures regardless of shell behavior.
  • Inspect the working tree and worktrees first. Preserve unrelated changes and run in the worktree that owns the branch. Do not automatically stash user work.
  • If main is checked out in another worktree, fetch origin main and use origin/main as the new base rather than updating that checked-out branch.
  • Record the old head and the unique-commit boundary before rewriting history. For a squash-merged parent, compare only the branch's unique commits in git range-diff <first-unique-commit>^..<old-head> <new-base>..<new-head>. Inherited commits intentionally excluded from the replay are not lost work. Investigate any changed, missing, or added unique patch before proceeding.
  • Keep a backup ref until the result has been reviewed. Ask before force-pushing and use only --force-with-lease. Do not rewrite or push dependent branches without authorization.

Signals

GitHub stars
13k
Forks
16k
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
rebase-onto-main
Source
github.com/px4/px4-autopilot