Bring a new version of upstream Workory into this library - explain the changes in plain words, three-way merge the workflow files after the user confirms, keep local changes, and handle conflicts and data migration. Runs only when the user explicitly types /bb-sync; user mode only.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Bb Sync?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/oluul-bb-sync)
---
name: bb-sync
description: Bring a new version of upstream Workory into this library - explain the changes in plain words, three-way merge the workflow files after the user confirms, keep local changes, and handle conflicts and data migration. Runs only when the user explicitly types /bb-sync; user mode only.
disable-model-invocation: true
---
# bb-sync: sync from upstream
Rules: `CLAUDE.md` at the repository root (§15, §16). **Run only when the user explicitly types `/bb-sync`** (§14 item 7); **user mode only.**
Fixed strings are shown in English; write them into files in the library's language and reply in the language the person is speaking (CLAUDE.md §9, §13; `.workory/vocabulary.md`).
## Steps
1. **Prepare**: if `upstream_synced` in `.workory/config.md` is empty, `sync` detects the upstream commit matching the local workflow and uses it as the baseline; if it cannot, first run `python3 .workory/scripts/workory.py baseline` to see the candidates with the fewest differences, confirm one with the user, and write it with `baseline --write <commit>`.
Follow CLAUDE.md §12, including a clean Git state and a verified private origin, then update only by fast-forward. Verify the separate upstream URL against the configured Workory upstream before fetching it (add it if missing). Stop if either check fails.
2. **See what changed**:
- Compare `workflow_version` in `.workory/config.md` with `.workory/VERSION` on `upstream/main`; if they match and `python3 .workory/scripts/workory.py sync` shows no changes → say it is up to date and stop.
- Read the entries in `CHANGELOG.md` on `upstream/main` newer than the local version, and summarize in plain words: what was added, what changed, how it affects the user; call out **breaking changes** separately and explain their migration steps. Migration notes are marked "Migration:" (older entries use "迁移:"; recognize both).
3. **Preview**: run `python3 .workory/scripts/workory.py sync` and list for the user the files that will be Updated / Added / Removed / Merged / in Conflicts; "Kept local" means upstream did not change the file and your local change is kept (older scripts print these labels in Chinese). 📝 Ask the user to confirm.
4. **Apply**: `python3 .workory/scripts/workory.py sync --apply`.
- Exit code 2 means conflicts: open each conflicting file, explain what `local` (your library), `base` (the last sync) and `upstream` mean in the conflict markers (older scripts write them in Chinese), and resolve as the user decides (edit out the conflict markers, or decide to keep / delete the whole file). For a file upstream rewrote as a whole, use step 5 instead. When everything is resolved, run `python3 .workory/scripts/workory.py sync --resolved`; it checks that no conflict markers remain and updates the sync baseline. **Do not** rerun `sync --apply` to "try again".
5. **Whole-file rewrites** (when the changelog's migration note says upstream rewrote a file you changed, e.g. a file translated into another language): do not keep your side of the conflict, which would leave a file in two languages. Instead, before `sync --resolved`:
- List your own changes: `git diff <upstream_synced> HEAD -- <file>` (`upstream_synced` in `.workory/config.md` still holds the old baseline at this point).
- Take the upstream version of the whole file: `git show upstream/main:<file> > <file>`.
- Re-apply each of your changes: in rules and skills, in the language the file is now written in; for a template, in its counterpart for the library's language (e.g. `.workory/templates/project.zh-CN.md` for a Chinese library). The user confirms each change.
- Then continue with `sync --resolved` as in step 4.
6. **Migrate data** (if there are breaking changes): follow the changelog's migration notes item by item, in a separate commit `refactor(data): ...`, changing format only, never facts.
7. **Refresh README**: run `python3 .workory/scripts/workory.py readme` so the maintained part of README follows the new version (content outside the markers is untouched).
8. **Check and commit**: once `python3 .workory/scripts/check.py` passes, commit `chore(sync): update workflow to v<version>` (the body lists the main changes) and use the guarded push in CLAUDE.md §12.
9. **Wrap up**: use ✅ only if the workflow finished as described in CLAUDE.md §13; if local changes to the workflow were kept, remind the user they might contribute them upstream with `bb-contribute`.