dby-update: Reconcile Benya to the Latest Version
User has explicitly requested to update Doubaoya (Benya). Execute directly without a second confirmation; if the host requires shell permissions, the user will decide in the host permission window.
This Skill Does "Reconciliation", Not "Update"
Make the local set of Benya skills equal to the current full upstream set:
- Archive packages removed from upstream (otherwise they will remain on the old contract before being removed, and calls will definitely result in errors)
- Install newly added packages
- Refresh packages whose content hash is outdated compared to the current upstream version; leave those already on the current version untouched
So when "the local set is already consistent with upstream", the conclusion is
no action required — not a single package will be re-downloaded.
If you really want to reinstall a certain package (e.g., the file is corrupted), use
to re-download all packages in full.
⚠️ Don't use
: It only updates "already installed" packages,
and will never remove those already removed from upstream.
It's common for long-time users to have dozens of platform-specific skills that were removed long ago, and
will never touch them.
How to Determine "Is This Package Released by Benya?"
The criterion is the pair of slug × content hash, regardless of which source it was originally installed from. The upstream
is a closed set that records the content hash of each version of every slug released by Benya; first look up the entry by directory name, then compare the content hash. There are three states:
| Status | Criterion | Disposal |
|---|
| Current Version | Hash = Current upstream version | Keep, do not refresh (unless is used) |
| Our Old Version | Hash matches a historical version in the closed set | Can be archived or replaced |
| You Modified It | Slug belongs to Benya, but hash doesn't match any in the set | 🔴 Skip and include in report, leave untouched, no refresh allowed (refresh will overwrite your changes) |
| Third-Party | Slug is not in the closed set | Leave untouched |
This way, name changes (the repository was originally called
), missing
fields, and third-party packages with the same name will not be misjudged.
Deletion is Always Done as "Archiving"
Packages to be removed are
moved to <scope>/.doubaoya/archive/<timestamp>/
instead of being deleted with , and a
is left in the same directory stating where each package was originally located and how to move it back. The cost of an extra directory is exchanged for "being able to recover if deleted by mistake".
Three supporting tasks, must all be included when relaying results:
- How to recover: After archiving, the script will directly print a copy-pasteable recovery command (reads the manifest to move each package back to its original location). Relay this to the user exactly as is, don't just say "see manifest". The skill will be usable immediately after moving back (the host reads by directory), but the installation record in has been cleared; to make the CLI recognize it again, reinstall it once.
- Archive directory is invisible to git: The archive root is located in the user's own project repository, so the script will write a in to ignore the entire directory automatically (leave it untouched if the user already has this file). Do not modify the user's .
- 🔴 Packages tracked by git are never archived: If a package removed from upstream is tracked by git in the user's repository (versioning skills into the repository is a real usage), archiving would be equivalent to deleting tracked files from the user's workspace. The script will skip them and list them separately with an explanation — this section must be relayed to the user exactly as is, and the user decides how to handle them.
Execution Steps
1. Locate the Reconciliation Script
Find the first existing one in order:
~/.claude/skills/dby-update/scripts/reconcile.mjs
~/.agents/skills/dby-update/scripts/reconcile.mjs
./.claude/skills/dby-update/scripts/reconcile.mjs
./.agents/skills/dby-update/scripts/reconcile.mjs
If not found, it means the local installation is an old version of dby-update (which doesn't have reconciliation capability). First run the following command to upgrade itself, then look again:
bash
npx -y skills add zizhanovo/doubaoya-community -g -s '*' -a claude-code universal -y
2. First Check the List (🔴 Explicitly specify scope, don't rely on auto-guessing)
bash
node <path found in previous step> --dry-run --scope global # Installed with -g initially (most common)
node <path found in previous step> --dry-run --scope project --project-dir <project directory>
Why explicit specification is necessary:
guesses based on the
current working directory. If the cwd is chosen incorrectly, there are no Benya packages in the target scope ⇒ the plan silently becomes "add N packages to the entire repository, archive 0" — an entire duplicate set is added out of nowhere, while none of the dead packages that should be cleared are touched, and this plan looks
completely normal. The script now prints a ⚠️ warning for this situation; stop and confirm the scope before proceeding, don't execute directly.
If unsure where it's installed, check both (once with
, once with
--scope project --project-dir <directory>
).
It will fetch the full upstream set and historical closed set online, then print which packages will be archived, which will be installed, how many will be refreshed, and which will be left untouched because you modified them. No changes are made in this step. Relay this list to the user exactly as is — especially the names of the packages "to be archived" and those "you modified" (this tells the user: these are recognized as your modifications, so they are left untouched).
3. Execute After Confirmation
After the user has reviewed the list and approved it, run (keep the scope parameter consistent with the previous step):
bash
node <path> --yes --scope <the one used in previous step> [--project-dir <directory>]
The script will complete the following on its own: archive → fetch the full set → review → self-check (whether skills are saved to disk, whether
exists, whether doubaoya.com is reachable), finally print a result and tell the user where the archive is located.
Exit codes:
= all passed;
= reconciliation completed but self-check failed on some items;
= user canceled;
= confirmation required but not in an interactive terminal;
= error occurred.
4. Relay Results
- All passed → Tell the user how many were archived, how many were installed, the total number now, where the archive directory is, how to recover the archive (paste the recovery command printed by the script exactly as is), and remind the user to start a new conversation to access new capabilities. If there are categories like "you modified", "not archived due to git tracking", "skipped because git couldn't determine", must mention each separately, don't let the user think they were missed. 🔴 Don't mix the latter two: the former means "this is your versioned package, use to clear it yourself", while the latter means "git on this machine couldn't answer me, fix git first then re-run" — the user's required actions are completely different.
- Local set is already consistent with upstream → The script will directly say "no action required", relay exactly as is, don't add a sentence like "refreshed N packages".
- Self-check has ❌ → Clearly state where it got stuck (whether skills weren't saved to disk, no API key configured, or couldn't connect to the service), and include the handling suggestion provided by the script. Don't just say "failed".
Common Parameters
| Parameter | Function |
|---|
| Only check the list, never execute |
| Skip confirmation and execute directly (only use after the user has reviewed the list) |
| Re-download even packages that are already on the current version. By default, only refresh outdated ones; this flag is for "my package is corrupted and I want to reinstall it" |
| List names of third-party packages and modified ones as well |
--scope auto|global|project
| 🔴 Always specify explicitly. Default guesses based on cwd, which can silently lead to "full repository reinstall" if guessed wrong. If installed with initially, use |
--project-dir <directory>
| Specify when installed at the project level in another directory |
| Machine-readable output |
| Offline self-check of the script itself (no internet connection required) |
Boundaries
- Only touch packages released by Benya, based on the three-state table above (content hash matches the closed set). Leave third-party packages and your modified ones completely untouched.
- Packages to be removed are moved to the archive directory instead of being deleted, and can be moved back at any time according to ; the archive directory has its own to be invisible to git, so it won't pollute the user's repository.
- 🔴 Never archive packages tracked by git; if git detection fails or can't determine, skip conservatively rather than archive incorrectly. The script will print these two situations in separate sections because the handling is different (use yourself vs fix git first).
- Do not touch your local data / configuration: 's , 's creative DNA, cover/draft output files, etc., are not affected — reconciliation only overwrites files under version management in the skill directory.
- Do not create background tasks, scheduled tasks, or Agent Hooks.
- If the user only asks "what updates are there / what version is it now / should I update", answer first, don't execute ( is exactly for answering this). Only run step 3 when explicit synchronization is requested.
- To update only a single skill:
npx -y skills update <skill name> -g
, which only touches the specified skill (but it doesn't perform reconciliation).
Language
Reply in Chinese if the user uses Chinese, reply in English if the user uses English.