From superpowers-plus
Enforces a mandatory git fetch + pull before any work on an existing shared branch. Prevents stale-code incidents during development, testing, and PR review.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers-plus:branch-sync-gateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Wrong skill?** Starting a brand-new branch → `using-git-worktrees`. About to commit → `unified-commit-gate`. Branch work is done → `finishing-a-development-branch`.
Wrong skill? Starting a brand-new branch →
using-git-worktrees. About to commit →unified-commit-gate. Branch work is done →finishing-a-development-branch.
Before touching any existing shared branch — pull first.
This is not optional. It is not skippable. It applies even if you were just working on the branch 5 minutes ago.
Any time you are about to:
# Step 1: Where are we?
git branch --show-current
git remote -v
# Step 2: Fetch and check for remote changes
git fetch origin
git log HEAD..origin/$(git branch --show-current) --oneline 2>/dev/null
| Remote has commits not in local? | Action |
|---|---|
| Yes | git pull --rebase origin $(git branch --show-current) — then verify |
| No | Proceed — you are in sync |
| Unsure | Fetch and check. Never assume. |
# Step 3: Pull if behind
git pull --rebase origin $(git branch --show-current)
# Step 4: Confirm baseline
git log --oneline -5
git status
Do not start work, run tests, or write a single line of code until this gate passes.
If you find yourself already mid-work and realize you haven't pulled — stop, pull, verify the state hasn't changed under you, then continue.
Incident 2026-04-23: Agent began writing tests on an active PR branch without pulling first. A teammate had pushed two commits in the interim. The agent iterated tests against stale code, created a merge conflict on push, resolved it by discarding its own changes, then pushed a broken build (failing assertion + TypeScript error). Required multiple extra fix commits on a PR that was otherwise ready to merge.
Root cause: No skill enforced sync at session start. Every existing gate (sp-commit, sp-finish, pre-commit-gate) fires at commit time or later — zero enforcement at the moment work begins.
| Wrong | Right |
|---|---|
| Assume local is up to date because you just worked on it | git fetch and check |
| Pull after writing code | Pull before writing code |
| Merge conflicts on push | Prevented by pulling first |
| Re-fixing what a teammate already fixed | Prevented by pulling first |
| Symptom | Fix |
|---|---|
git fetch hangs | Check network / VPN; run git remote -v to verify remote URL |
| Merge conflict after pull | git status to identify conflicts; resolve, then git rebase --continue |
| Branch doesn't exist on remote | Verify with git branch -r; may be a new local-only branch |
| Remote HEAD diverged too far | Consider git fetch origin && git log --oneline origin/branch before rebasing |
npx claudepluginhub bordenet/superpowers-plus --plugin superpowers-plusGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.