sync-fork
Sync Fork
Sync a forked repository with its upstream remote. The fork's shared branches (e.g., main) are maintained as the equivalent of upstream plus local patches re-merged on top — a "patched upstream" model. Each sync resets to upstream, rebases fork-only branches, and re-merges them.
If upstream hasn't advanced (i.e., upstream/main is already an ancestor of fork/main), the sync is a no-op.
Usage
/sync-fork [<fork-remote> <upstream-remote>]
- With no arguments — auto-detect if exactly two remotes exist. If more than two, ask the user to specify.
- With one argument — the provided name is ambiguous. Look up its URL with
git remote get-url <name>and ask the user: "<name>points to<url>— is this your fork, or the repo you forked from?" Then ask for the other remote name. - With two arguments — first is the fork remote, second is the upstream remote.
When auto-detecting with exactly two remotes, use heuristics to guess which is the fork and which is upstream (e.g., a remote named origin is more likely the fork; a remote whose URL org differs from the other is more likely upstream). Present your guess and ask the user to confirm.
⚠️ Credential safety: Remote URLs may contain embedded credentials (e.g., https://user:token@github.com/...). Before displaying any URL to the user, redact the userinfo portion: replace user:token@ with ***@. Never output raw credentials from git remote -v or git remote get-url.
Diagram legend
More from shhac/skills
image-to-svg
Convert raster images (photos, illustrations, AI-generated art) into high-quality SVG recreations. Breaks the image into isolated features, builds each as a standalone SVG layer, then composites them. Use when the user wants to recreate an image as SVG, create vector versions of artwork, or extract specific elements from images as scalable graphics.
89orchestrate-subagents
Activate orchestrator mode for complex multi-task work using subagents. Use when you need to coordinate multiple independent Task subagents to accomplish work while keeping the main context window clean.
64team-solve
Investigate and solve problems using a team of specialist agents. Use when facing complex, multi-faceted problems that benefit from parallel research and structured implementation.
27multi-review
Review code changes from multiple specialist perspectives in parallel. Use when you want a thorough review of a PR, branch, or set of changes covering security, performance, correctness, edge cases, and ripple effects. Spawns parallel reviewer agents that each focus on a different lens, then synthesizes into a unified review.
26competing-hypotheses
Debug problems by investigating multiple hypotheses in parallel. Use when you have a bug, unexpected behaviour, or mystery where the root cause is unclear. Spawns parallel investigator agents each pursuing a different theory, then compares evidence to identify the most likely cause and fix.
26brainstorm
Brainstorm competing solutions to a problem using parallel agents. Use when you need to explore multiple different approaches to the same problem, compare trade-offs, and choose the best path forward. Spawns parallel proposer agents who each design an independent solution, then peer-review each other's work before a structured comparison.
20