Archive an Agent Skill by auditing first, selecting its exact ID, previewing the move with --dry-run, and confirming with --yes. Skill Manager records the original path, archive path, timestamp, hashes, and operation state. Run another audit after the move. Restore with the archive ID and verify again.
The recovery contract
A recoverable archive depends on more than moving a folder. The ledger must survive app restarts, map the archive back to its original path, record success or failure, and protect existing files during restore. Skill Manager keeps these fields in local app data.
| Ledger field | Why it matters |
|---|---|
| Skill and archive IDs | Stable selectors for inspect and restore |
| Original and archive paths | Exact recovery destination and current storage |
| Archived and restored times | Operation history |
| Content hashes | Integrity evidence around the move |
| Status and failure reason | Clear result when an operation stops |
Preview the exact target
Start with a JSON audit and copy the skill ID. IDs keep selection precise when two roots contain the same name.
$ npx github:Ryan-yang125/skill-manager archive <skill-id> --dry-run --jsonReview the title, agent, original path, proposed archive path, and operation. Confirm that the chosen folder belongs to the intended skill and that another canonical copy remains available when this is duplicate cleanup.
Archive and verify
$ npx github:Ryan-yang125/skill-manager archive <skill-id> --yes --json- Capture the returned archive ID and paths.
- Run the full audit again.
- Confirm that the active record moved to archived state.
- Exercise the related agent workflow.
- Keep the archive through an observation period.
Restore to the original path
$ npx github:Ryan-yang125/skill-manager restore <archive-id> --yes --jsonRestore checks the recorded source and destination. An occupied original path triggers a safe stop so you can inspect the conflict. After success, run the audit and confirm the skill appears under the original root.
Confirmation rule: treat every changed target set as a new write action. Preview the new IDs and paths before supplying --yes.
Archive and restore FAQ
Does archive delete the skill?
Archive moves the skill into managed storage and writes a ledger entry with its original path and operation details.
How do I preview an archive?
Use the exact skill ID with --dry-run. The CLI also returns a preview when the confirmation flag is absent.
What happens when the restore path already exists?
Restore protects the existing path and stops before overwrite. Inspect the conflict and choose an explicit resolution.
Keep cleanup reversible
Audit, preview, confirm, and verify. Every step keeps an exact recovery route in view.
Start with an audit