/agent-workflows:git-rebase-syncfrom agent-workflows
Use when syncing a feature branch onto the latest origin base branch via git rebase.
Ships in agent-workflows. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when you need to sync a feature branch onto the latest origin/{base_branch} via git rebase, including deliberate conflict resolution. Invoking this skill is the order to rebase: the local rebase runs behind a backup tag as reversible interior work — print each history-rewriting command as a status line, do not wait for confirmation. Pushes follow per-ref publish semantics (step 9).
Operate on the current branch: do not create or switch to a different feature branch unless the user explicitly asks. Print each history-rewriting command (git rebase ..., git push --force*) as a one-line status before running it.
git branch --show-currentgit symbolic-ref --short refs/remotes/origin/HEAD (strip the origin/ prefix; if unset, use your forge CLI or git remote show origin)git fetch origingit statusgit status indicates an in-progress merge/rebase/cherry-pick, do not stack a rebase on top: investigate what it is and finish or abort it first; surface it to the user only if its state is genuinely unclear.HEAD:
git tag -a {branch_name}-rebase-backup-$(date +%Y%m%d-%H%M%S) -m "pre-rebase backup" HEAD{backup_ref} for recovery. Do not push backup refs unless the user explicitly asks.git rev-list --count --merges origin/{base_branch}..HEAD--rebase-merges) when the merge structure carries meaning, flatten (plain rebase) when it is noise. Log the call as a provisional decision.Other local branches may point at intermediate commits in the range being rewritten (origin/{base_branch}..HEAD) — common with phased NN-description stacks. A plain rebase rewrites those commits and orphans the stacked branches on the old, pre-rebase commits (along with every open PR built on them). --update-refs (the default in step 6) moves them onto the rewritten commits instead. Enumerate them so you can report what the rebase will carry along:
# Branches pointing into the range being rewritten — these get orphaned by a
# plain rebase and require --update-refs to follow the rewrite.
cur=$(git branch --show-current)
git for-each-ref --format='%(refname:short)' refs/heads | while read -r br; do
[ "$br" = "$cur" ] && continue
if git merge-base --is-ancestor "$br" HEAD \
&& ! git merge-base --is-ancestor "$br" origin/{base_branch}; then
echo "stacked: $br ($(git rev-parse --short "$br"))"
fi
done
--update-refs (git will not move a checked-out branch); flag these for manual verification after the rebase.--update-refs so any stacked branch pointing into the rewritten range follows the rewrite instead of being orphaned.git rebase --update-refs origin/{base_branch}git rebase --rebase-merges --update-refs origin/{base_branch}git config --global rebase.updateRefs true.When conflicts happen:
git statusgit add <file...>git rebase --continuegit rebase --abort is safe) and report an honest block: what was tried, why it cannot converge, and the batched questions.git log --oneline --decorate origin/{base_branch}..HEADgit rebase --update-refs prints an "Updated the following refs with --update-refs" summary; the moved branch refs should also appear as decorations on the new commits in the log above. Note any that did not move (e.g. checked out in another worktree) for manual handling.--force-with-lease, never plain --force.--update-refs only moves local refs. A normal git push updates the current branch only — each stacked branch (from step 5) that also exists on origin must be force-pushed individually.git shortlog -sn origin/{base_branch}..{ref} — other authors present means the ref is shared.git push --force-with-lease origin HEAD:{branch_name}git push --force-with-lease origin {stacked_branch}git reset --hard {backup_ref}What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub alleneubank/agent-profile --plugin agent-workflows22 skills in this plugin
/chief-of-staffUse when taking, holding, or onboarding a workspace's chief of staff (the human's intake and router above that workspace's repository coordinators), or when deciding whether a finding goes to the human, a coordinator, or an issue./contentUse when authoring or changing a work whose reader is outside the current conversation — product text (labels, messages, errors, notifications, emails, command output), documentation, announcements, a change description, or a brief, prompt, or handoff for another agent. Not for replies in the conversation or incidental one-line messages./coordinatorUse when coordinating agent lanes across hosts or workspaces, starting or resuming a campaign from a tee-up agreement, preparing unattended work, rotating coordinators, or planning a workspace's backlog by theme. Bounded attended implementation needs no coordinator./designUse when deciding how something people or agents use should look, read, or behave before it is built — a new or changed screen, flow, command output, error, tool or skill text, or a piece in another medium — or when a change reaches an established product surface that has no design record./dissolve-docsUse when the user calls a docs cleanup, a campaign has shipped, or the repo has accumulated narrative, planning, status, handoff, or loop docs whose authoritative content belongs in the standing docs (VISION, BRIEF, SPEC, README)./doneUse when claiming a change done, asking for acceptance or a merge, inviting someone to try a build (a bug bash, dogfood run, or visual or design review), requesting a plan or specialist review, or landing reviewed work.