skills/baoyu-sync-upstream-main/SKILL.md
Guides syncing a forked repository's local main branch with upstream/main through a temporary sync branch, conflict resolution, verification, and final merge. Use when user asks to sync source updates, merge upstream into main, or keep a personal fork current without opening a PR.
npx skillsauth add stonehah/qunz-skills baoyu-sync-upstream-mainInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Synchronize a fork's main with upstream/main using a temporary sync branch.
Sync Upstream Progress:
- [ ] Step 1.1: Check preferences (EXTEND.md)
- [ ] Step 1.2: Inspect remotes, branches, and worktree state
- [ ] Step 2: Confirm sync inputs and branch names
- [ ] Step 3: Fetch upstream and create sync branch
- [ ] Step 4: Merge upstream/main into sync branch
- [ ] Step 5: Resolve conflicts and verify repository state
- [ ] Step 6: Merge sync branch back into main
- [ ] Step 7: Push and clean up temporary branches
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .baoyu-skills/baoyu-sync-upstream-main/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.baoyu-skills/baoyu-sync-upstream-main/EXTEND.md" && echo "user"
┌──────────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├──────────────────────────────────────────────────────────────┼───────────────────┤ │ .baoyu-skills/baoyu-sync-upstream-main/EXTEND.md │ Project directory │ ├──────────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.baoyu-skills/baoyu-sync-upstream-main/EXTEND.md │ User home │ └──────────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬────────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼────────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, display summary, apply configured remote and branch names │ ├───────────┼────────────────────────────────────────────────────────────────────────────┤ │ Not found │ Ask user whether to save defaults now, or continue with built-in defaults │ └───────────┴────────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports: Upstream remote name | Upstream branch | Target branch | Sync branch prefix | Verification commands
Schema: references/config/preferences-schema.md
First-time setup: references/config/first-time-setup.md
Use these values when EXTEND.md is missing and the user does not override them:
| Field | Default |
|-------|---------|
| upstream_remote | upstream |
| upstream_branch | main |
| target_branch | main |
| sync_branch_prefix | sync/upstream |
git status --short is not empty, stop and ask the user to commit or stash first.upstream/main directly into main as the first step.git reset --hard unless the user explicitly requests them.Use this workflow for requests such as:
Run:
git remote -v
git status --short --branch
git branch -vv
Confirm:
Determine the effective values:
upstream_remoteupstream_branchtarget_branchsync_branch_prefixIf the repository uses different names such as develop, use those names consistently in every command.
Run:
git fetch --all --prune
git checkout ${target_branch}
git pull origin ${target_branch}
git checkout -b ${sync_branch_prefix}-YYYYMMDD
Record the created branch name as SYNC_BRANCH and reuse that exact name in later steps.
Branch naming guidance:
-YYYYMMDD-HHMMSSExample:
git checkout main
git pull origin main
git checkout -b sync/upstream-20260310
Run:
git merge ${upstream_remote}/${upstream_branch}
Possible outcomes:
| Result | Action | |--------|--------| | Fast-forward or clean merge | Continue to verification | | Merge conflicts | Resolve conflicts before any further merge | | Remote missing | Stop and ask user to configure or correct the upstream remote |
When conflicts appear:
git statusgit addgit commit if Git does not auto-create the merge commitMinimum verification:
git status --short --branch
git log --oneline --decorate --max-count=10
If the repository has project-specific verification commands in EXTEND.md, run them before returning to main.
After verification passes:
git checkout ${target_branch}
git merge ${SYNC_BRANCH}
Prefer the explicit branch name in practice:
git checkout main
git merge sync/upstream-20260310
If the merge back into main conflicts, resolve them with the same conflict-resolution rules from Step 5.
Run:
git push origin ${target_branch}
Optional cleanup after the push succeeds:
git branch -d sync/upstream-20260310
Keep the sync branch when:
Report:
upstream/main to mainCustom configurations via EXTEND.md. See Step 1.1 for paths and supported options.
tools
Extracts and downloads videos from Douyin and Kuaishou short URLs using Playwright browser automation. Use when user shares "v.douyin.com" or "v.kuaishou.com" links, or asks to "download video", "extract video", "save short video", "提取视频", "下载短视频".
testing
Generates Xiaohongshu (Little Red Book) infographic series with 11 visual styles and 8 layouts. Breaks content into 1-10 cartoon-style images optimized for XHS engagement. Use when user mentions "小红书图片", "XHS images", "RedNote infographics", "小红书种草", or wants social media infographics for Chinese platforms.
development
Fetch any URL and convert to markdown using Chrome CDP. Saves the rendered HTML snapshot alongside the markdown, and automatically falls back to the pre-Defuddle HTML-to-Markdown pipeline when Defuddle fails. Supports two modes - auto-capture on page load, or wait for user signal (for pages requiring login). Use when user wants to save a webpage as markdown.
documentation
Translates articles and documents between languages with three modes - quick (direct), normal (analyze then translate), and refined (analyze, translate, review, polish). Supports custom glossaries and terminology consistency via EXTEND.md. Use when user asks to "translate", "翻译", "精翻", "translate article", "translate to Chinese/English", "改成中文", "改成英文", "convert to Chinese", "localize", "本地化", or needs any document translation. Also triggers for "refined translation", "精细翻译", "proofread translation", "快速翻译", "快翻", "这篇文章翻译一下", or when a URL or file is provided with translation intent.