feat(skills): add archive and restore subcommands - #246
Merged
Conversation
Add `wukong skills archive` to move installed skills out of the active folder (`.agents/skills` -> `.agents/skills-archive`) and remove the `.claude/skills` symlink so agents no longer see them, and `wukong skills restore` to move them back and recreate the symlink. Non-destructive alternative to `skills remove`.
…ocal commands - restore: recreate .claude symlink idempotently so a stale leftover link no longer fails with EEXIST and leaves a half-restored, misreported state - archive/restore: extract pure archive_skill/restore_skill helpers - skills: build a config-tolerant context so local-only commands (init, remove, archive, restore) run without `wukong init`; registry commands still require it - archive: write a self-documenting README.md into .agents/skills-archive/ - tests: add unit coverage for the archive/restore file operations
Archived and removed skills keep their mv-manifest.json entry, so `skills update` would recreate their .agents/skills/<slug> folder when an update was available. Skip manifest entries whose active source is gone.
mfauzaan
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new subcommands to
wukong skillsfor temporarily deactivating skills without deleting them:wukong skills archive— interactive multi-select of installed skills; moves each.agents/skills/<slug>→.agents/skills-archive/<slug>(per scope: project/global) and removes the.claude/skills/<slug>symlink so agents no longer see it.wukong skills restore— interactive multi-select of archived skills; moves them back into.agents/skills/<slug>and recreates the.claude/skills/<slug>symlink via the existingcreate_skill_symlink().This is a non-destructive alternative to
skills remove. Themv-manifest.jsonis left untouched so update-tracking is preserved across archive/restore.Details
fs::rename(same root/filesystem → atomic, simple).removepattern.archive_skill()/restore_skill()helpers so they can be unit-tested independently of the interactive prompt.Follow-up hardening
.claude/skills/<slug>/SKILL.mdbefore recreating the symlink. Previously, a leftover link (e.g. from a partially-failed archive) madecreate_skill_symlink()fail withEEXIST, so the skill was moved back and the archive dir deleted but the command reportedFailed— leaving a half-restored state that re-runs never repaired ("already active"). Restore is now safe to re-run.~/.config/wukong/.../config.tomlwas missing (Run wukong init), even thougharchive/restore/remove/inittouch no network or auth. Added a config-tolerantget_skills_context()so local-only commands run withoutwukong init; the registry-backed commands (list/find/add/update/publish) still load config themselves and surface the same error if it's missing.archivewrites aREADME.mdinto.agents/skills-archive/explaining what the folder is and that the Wukong CLI created it, so the (intentionally reversible) folder isn't a mystery — including the empty parent left behind after a full restore.Test plan
cargo fmt --all✅cargo clippy -- -D warnings✅cargo test --test skillsand--test completion✅ (completion snapshots regenerated for the two new subcommands).claudelink (regression for the fix above), restore already-active skip.