Fork Sync Rebase
Use this skill for repositories with a distinct upstream remote and fork remote. The goal is to keep the fork maintainable without treating upstream changes as automatically safe or desirable.
Invocation
Use one of these requests:
Run fork sync review for <repo>.
Review upstream changes for <repo>; do not alter branches.
Integrate upstream into <fork branch> using the fork sync workflow.
Default to review mode unless the user explicitly asks to integrate or rebase.
Safety Invariants
- Identify the actual repository root before running Git commands.
- Confirm which remote is the upstream source and which remote is the user's fork. Do not infer this from remote names alone.
- Never push to upstream. An upstream pull request requires a separate explicit user request.
- Never rebase the active development branch in place as the first action.
- Never force-push a shared or user-facing branch unless the user explicitly asks and understands the consequence.
- Preserve fork-specific identity, signing, storage, privacy, billing, updater, and local integration changes unless the user asks to remove them.
- Do not stage, delete, or reset unrelated tracked or untracked work.
Review Mode
- Inspect worktree status, remotes, current branch, tracking branch, recent commits, and existing integration/reference branches.
- Fetch upstream. Fetching is allowed in review mode; it must not merge or rebase anything.
- Compare the active fork branch to the refreshed upstream default branch:
- commit divergence and tags/releases
- changed subsystems and likely conflict areas
- upstream changes worth integrating now, deferring, or intentionally excluding
- Report a recommendation with a concise integration plan. Include whether an integration is low, medium, or high risk.
- Stop before rebasing, merging, changing branches, installing dependencies, building, or pushing unless the user explicitly requested integration.
Integration Mode
Use this only after explicit user authorization.
- Require no tracked worktree edits. List untracked files, but leave them untouched unless they directly block the operation.
- Fetch upstream and create a dated, read-only reference branch pointing at the refreshed upstream default branch, for example
agent/upstream-YYYY-MM-DD.
- Create a disposable integration branch from the active fork branch, for example
agent/rebase-YYYY-MM-DD.
- Rebase the disposable integration branch onto the dated upstream reference.
- Resolve conflicts by first preserving the fork's explicit local boundaries, then adapting feature code to upstream architecture. Avoid broad refactors unrelated to integration.
- Run the repository's focused build/test/install path. For desktop apps, distinguish compilation from runtime/manual validation.
- Review the resulting diff and summarize preserved local changes, adopted upstream changes, and deferred conflicts or exclusions.
- Only after successful validation, update the active fork branch from the verified integration branch. Push to the verified fork remote, never upstream.
Decision Criteria
Prefer integration when upstream includes security, data integrity, recording/capture, dependency, platform compatibility, or provider/runtime fixes that affect the fork.
Defer large upstream subsystems when they introduce architecture the fork does not yet need, carry unresolved privacy or product implications, or would make local feature maintenance materially harder. Record deferred items in the repository's existing project log when one exists.
Completion Report
State:
- upstream revision and dated reference branch
- active fork branch and verified fork remote
- integration branch, if used
- adopted, deferred, and excluded upstream areas
- build/test/install evidence and remaining manual checks
- exact push destination
1---2name: fork-sync-rebase3description: Safely review and selectively integrate an upstream repository into a long-lived personal, team, or client fork. Use when a fork has local features that must remain isolated while upstream continues to change.4---56# Fork Sync Rebase78Use this skill for repositories with a distinct upstream remote and fork remote. The goal is to keep the fork maintainable without treating upstream changes as automatically safe or desirable.910## Invocation1112Use one of these requests:1314- `Run fork sync review for <repo>.`15- `Review upstream changes for <repo>; do not alter branches.`16- `Integrate upstream into <fork branch> using the fork sync workflow.`1718Default to **review mode** unless the user explicitly asks to integrate or rebase.1920## Safety Invariants2122- Identify the actual repository root before running Git commands.23- Confirm which remote is the upstream source and which remote is the user's fork. Do not infer this from remote names alone.24- Never push to upstream. An upstream pull request requires a separate explicit user request.25- Never rebase the active development branch in place as the first action.26- Never force-push a shared or user-facing branch unless the user explicitly asks and understands the consequence.27- Preserve fork-specific identity, signing, storage, privacy, billing, updater, and local integration changes unless the user asks to remove them.28- Do not stage, delete, or reset unrelated tracked or untracked work.2930## Review Mode31321. Inspect worktree status, remotes, current branch, tracking branch, recent commits, and existing integration/reference branches.332. Fetch upstream. Fetching is allowed in review mode; it must not merge or rebase anything.343. Compare the active fork branch to the refreshed upstream default branch:35 - commit divergence and tags/releases36 - changed subsystems and likely conflict areas37 - upstream changes worth integrating now, deferring, or intentionally excluding384. Report a recommendation with a concise integration plan. Include whether an integration is low, medium, or high risk.395. Stop before rebasing, merging, changing branches, installing dependencies, building, or pushing unless the user explicitly requested integration.4041## Integration Mode4243Use this only after explicit user authorization.44451. Require no tracked worktree edits. List untracked files, but leave them untouched unless they directly block the operation.462. Fetch upstream and create a dated, read-only reference branch pointing at the refreshed upstream default branch, for example `agent/upstream-YYYY-MM-DD`.473. Create a disposable integration branch from the active fork branch, for example `agent/rebase-YYYY-MM-DD`.484. Rebase the disposable integration branch onto the dated upstream reference.495. Resolve conflicts by first preserving the fork's explicit local boundaries, then adapting feature code to upstream architecture. Avoid broad refactors unrelated to integration.506. Run the repository's focused build/test/install path. For desktop apps, distinguish compilation from runtime/manual validation.517. Review the resulting diff and summarize preserved local changes, adopted upstream changes, and deferred conflicts or exclusions.528. Only after successful validation, update the active fork branch from the verified integration branch. Push to the verified fork remote, never upstream.5354## Decision Criteria5556Prefer integration when upstream includes security, data integrity, recording/capture, dependency, platform compatibility, or provider/runtime fixes that affect the fork.5758Defer large upstream subsystems when they introduce architecture the fork does not yet need, carry unresolved privacy or product implications, or would make local feature maintenance materially harder. Record deferred items in the repository's existing project log when one exists.5960## Completion Report6162State:6364- upstream revision and dated reference branch65- active fork branch and verified fork remote66- integration branch, if used67- adopted, deferred, and excluded upstream areas68- build/test/install evidence and remaining manual checks69- exact push destination