rebase

Rebases git branches onto their base ref with verification gates before force-pushing.

6|1|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/jl-cmd/claude-dev-env --skill rebase-jl-cmd
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: rebase
Source: https://github.com/jl-cmd/claude-dev-env/tree/main/skill-archive/rebase
Command: npx skills add https://github.com/jl-cmd/claude-dev-env --skill rebase-jl-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Rebases that compile but are logically broken are a common failure mode: auto-merged files can duplicate or drop content, squash-merged stacked PRs leave absorbed commits, and removed symbols leave stale references that textual conflict detection never catches. This Skill enforces verification gates that catch these issues before any force-push rewrites remote history. ## Core Features & Use Cases - Scenario-aware rebase playbooks: Distinguishes stacked PRs with merged bases, stacked PRs with open bases, and long-lived feature branches, re-resolving the canonical base ref via GitHub before starting. - Mandatory verification gates: Runs real import checks, pytest collection, content-diff-scoped test suites, and symbol reference scans to prove the rebased tree is logically correct, not just textually clean. - Safe push discipline: Requires explicit authorization for force-push, refuses to rewrite main/master/release branches, and always uses --force-with-lease pinned to the pre-rebase SHA. - Use Case: A stacked PR's base just merged via squash and GitHub reports conflicts. The Skill rebases onto main, verifies the squash-absorbed commit with a diff before skipping it, runs targeted tests on packages the rebase actually changed, and force-pushes only after authorization. ## Quick Start Ask the AI to rebase this branch onto main and verify the result before pushing.

Frequently Asked Questions about rebase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rebase a branch onto main safely?▼

Fetch fresh refs first, resolve the canonical base via gh pr view, then rebase and run verification gates: python -m compileall, pytest --collect-only, and targeted test suites for packages with content diffs. Push only with --force-with-lease after explicit authorization.

When should I merge instead of rebase a branch?▼

Merge when the branch has multiple authors, more than 5 commits or over 2 weeks of divergence, or an open PR with approving reviews on the current SHA that a force-push would invalidate. Rebase suits solo branches 1-5 commits ahead.

How do I rebase a stacked PR after its base merged via squash?▼

Rebase onto main and expect to --skip the squash-absorbed commit, but only after verifying content equivalence with git diff between the skipped commit and origin/base for the touched files. Never skip on the heuristic that main is downstream.

Why does a rebase pass py_compile but still break at runtime?▼

py_compile validates syntax only, not import resolution or runtime correctness. A rebase can remove or rename symbols that unchanged files still import, so run real import checks, pytest --collect-only, and reference scans for deleted symbols.

Can I force-push main or release branches after a rebase?▼

No. The Skill refuses to force-push main, master, release/*, production, or any branch with more than one unique author. For other branches it requires explicit authorization and always uses --force-with-lease pinned to the pre-rebase SHA.