← ClaudeAtlas

smart-rebaselisted

現在の作業ブランチを origin/main などのベースブランチに rebase し、コンフリクトを解決して --force-with-lease で force push する。Use this skill whenever the user asks to rebase or sync/update/refresh their branch against main — "リベースして", "smart rebase", "/smart-rebase", "mainを取り込んで", "main の最新に追いつかせて", "rebase して force push", "最新mainに乗せて", "PRが遅れてる/behind", "rebase onto main" — even if they don't spell out every step. Also use it when a PR shows conflicts with its base branch and the fix is to rebase. Prefers existing GitHub tooling when it applies — `gh pr update-branch --rebase` for a server-side rebase with no local force-push, and `gh stack sync` on stacked branches — so also use it for "update branch", "PRのブランチを更新", "スタックを最新にして", "stack sync", "スタックPRをrebase", or updating a chain of stacked PRs against main.
tonkotsuboy/smart-rebase-skill · ★ 0 · AI & Automation · score 70
Install: claude install-skill tonkotsuboy/smart-rebase-skill
# smart-rebase — rebase onto the base branch and force-push The whole workflow is in `scripts/rebase-sync.sh`, split into subcommands so a conflict can stop the run, get fixed, and resume. Drive the script — don't hand-roll `git fetch`/`rebase`/`push` calls, because the script also carries the safety checks (refuse on the base branch, lease-protected push, autostash). `$SKILL_DIR` below is this skill's directory. ## Three paths, decided by `preflight` The guiding principle: **prefer the tool that already knows how to do this safely over a hand-rolled sequence.** `gh` covers two situations better than local git can — a chain of stacked PRs, and a plain PR that just needs catching up — so reach for those first and fall back to local git only when neither fits. `preflight` prints a `STACK:` line and a `SERVER:` line, and together they route everything that follows: | preflight says | Path | Why it wins | |---|---|---| | `STACK: stack` | **Stack path** — `stack-sync` | Cascade-rebases the whole chain | | `SERVER: eligible` | **Server path** — `server-sync` | GitHub rebases; no local force-push | | otherwise | **Plain path** — `rebase` → `push` | Handles everything else, incl. conflicts | Check `STACK:` first — it outranks `SERVER:`, because updating one PR branch of a stack in isolation strands the layers above it. Also read `STATUS:` before doing any work. `up-to-date` means the base is already contained in this branch and nothing needs to happen — say so and stop rather