gh-fork-synclisted
Install: claude install-skill seansmithworks/agent-skills
# Fork Sync
Sync your fork's main branch with upstream. Shows the gap, confirms the strategy, syncs cleanly.
Triggered by: `/gh-fork-sync`, "sync fork", "sync with upstream", "update fork", "bring fork up to date".
## Steps
### 1. Detect upstream remote
```bash
git remote -v
```
Look for a remote named `upstream` pointing to the original repo. If none exists, prompt:
> No upstream remote found. Add one with:
> `git remote add upstream <original-repo-url>`
> Then re-run this skill.
Don't guess the upstream URL. Exit and wait.
### 2. Detect the default branch and check it out
```bash
git fetch upstream
```
Try `main` first, fall back to `master` if `upstream/main` doesn't exist (same fallback `gh-clean-branches` uses). Call the result `$BRANCH` for the rest of this skill.
```bash
git checkout $BRANCH
```
Check out the branch before measuring the gap — behind/ahead counts computed from whatever branch the user happened to be on are wrong.
### 3. Show the gap
```bash
git log HEAD..upstream/$BRANCH --oneline | wc -l # commits behind
git log upstream/$BRANCH..HEAD --oneline # commits unique to fork
```
Present a summary:
```
Fork status vs upstream/main
Behind: 14 commits
Ahead: 3 commits (your changes not in upstream)
Your commits:
a1b2c3d fix: button padding on mobile
e4f5g6h chore: update dependencies
i7j8k9l feat: add user avatar support
```
If already up to date, say so and exit.
### 4. Confirm sync strategy
Default