sync
Sync local repository with origin/main. Use before starting new work, after completing a PR, or when needing latest upstream changes. Safely stashes uncommitted changes, fetches and pulls origin/main, restores stash, and cleans up stale local branches (merged or with deleted remotes). Invoke when switching contexts or preparing for new feature work.
What this skill does
# Sync - Repository Synchronization
When this skill is invoked, IMMEDIATELY output the banner below before doing anything else.
Pick ONE tagline at random — vary your choice each time.
CRITICAL: Reproduce the banner EXACTLY character-for-character. The first line of the art has 4 leading spaces — you MUST preserve them.
```
{tagline}
⠀ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗
██╔╝██╔════╝╚██╗ ██╔╝████╗ ██║██╔════╝
██╔╝ ███████╗ ╚████╔╝ ██╔██╗ ██║██║
██╔╝ ╚════██║ ╚██╔╝ ██║╚██╗██║██║
██╔╝ ███████║ ██║ ██║ ╚████║╚██████╗
╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═══╝ ╚═════╝
```
Taglines:
- 🎯 Pulling the latest moves...
- 🚂 All aboard the sync train!
- 🤝 Getting everyone on the same page!
- 📡 Fetching the latest plot twists!
- 🥷 Time to steal everyone else's code!
- ☕ Catching up on what you missed!
- 🔁 Rebase, merge, rinse, repeat!
- 🎬 Previously on main...
---
## Output Formatting
After the banner, display parsed input:
```
┌─ Input ────────────────────────────────────────
│ {Field}: {value}
│ Flags: {parsed flags or "none"}
└────────────────────────────────────────────────
```
Pre-flight results:
```
── Pre-flight ───────────────────────────────────
✅ {dep} {version or "found"}
⚠️ {dep} not found → {fallback detail}
❌ {dep} missing → stopping
──────────────────────────────────────────────────
```
Stage/phase headers: `━━ {N} · {Name} ━━━━━━━━━━━━━━━━━━━━━━━━━`
Status icons: ✅ done · ❌ failed · ⚠️ degraded · ⏳ working · ⏭️ skipped
---
Synchronize local repository with the remote default branch using a
deterministic bash script — no LLM subagent needed since all steps are
pure git commands.
## Flags
Parse optional flags from the request:
- `--no-stash`: Don't auto-stash uncommitted changes
- `--no-cleanup`: Don't delete stale local branches
- `--no-rebase`: Use merge instead of rebase when on a feature branch
---
## Pre-flight
Before starting, check all dependencies in this table:
| Dependency | Type | Check | Required | Resolution | Detail |
|-----------|------|-------|----------|------------|--------|
| git | cli | `git --version` | yes | stop | Install from https://git-scm.com |
For each row, in order:
1. Run the Check command (for cli/npm) or test file existence (for agent/skill)
2. If found: continue silently
3. If missing: apply Resolution strategy
- **stop**: notify user with Detail, halt execution
- **url**: notify user with Detail (install link), halt execution
- **install**: notify user, run the command in Detail, continue if successful
- **ask**: notify user, offer to run command in Detail, continue either way (or halt if required)
- **fallback**: notify user with Detail, continue with degraded behavior
4. After all checks: summarize what's available and what's degraded
---
## Pre-flight Detection
Before launching the subagent, detect the remote and default branch:
```
REMOTE=$(git remote | head -1) # usually "origin"
DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/$REMOTE/HEAD 2>/dev/null | sed 's|.*/||')
```
Fallback chain if `symbolic-ref` fails:
1. Check `git show-ref --verify refs/heads/main` → use `main`
2. Check `git show-ref --verify refs/heads/master` → use `master`
3. If neither exists, report error and stop
Pass `{REMOTE}` and `{DEFAULT_BRANCH}` into the subagent prompt.
---
## Execution
Run the sync script directly — no LLM subagent needed since all steps are
deterministic git commands:
```bash
# Resolve skill root (plugin install or direct install)
for SKILL_ROOT in \
"${CLAUDE_PLUGIN_ROOT:-}" \
"$HOME/.claude/plugins/marketplaces/slamb2k" \
"$(dirname "$(readlink -f "$0")")/.."
do
[ -f "$SKILL_ROOT/skills/sync/scripts/sync.sh" ] && break
done
bash "$SKILL_ROOT/skills/sync/scripts/sync.sh" \
"{REMOTE}" "{DEFAULT_BRANCH}" {FLAGS}
```
Parse the output between `SYNC_REPORT_BEGIN` and `SYNC_REPORT_END` markers.
Extract `key=value` pairs for the report fields: `status`, `remote`,
`default_branch`, `main_updated_to`, `current_branch`, `stash`, `rebase`,
`branches_cleaned`, `errors`.
Exit codes: 0=success, 1=fatal error, 2=partial success (conflict warnings).
---
## Report to User
Parse the subagent's SYNC_REPORT and present a clean summary:
```
┌─ Sync · Report ────────────────────────────────
│
│ ✅ Sync complete
│
│ 🌿 Main: {commit} — {message}
│ 🔀 Branch: {current_branch}
│ 📦 Stash: {restored|none|conflict}
│ 🧹 Cleaned: {branches or "none"}
│
└─────────────────────────────────────────────────
```
If errors occurred:
```
│ ❌ {error description}
│ {suggested resolution}
```
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.