<< All versions

Skill v1.0.0

currentAutomated scan100/100
sdsrss/agentsmd/agentsmd-restore
──Details
PublishedOctober 20, 2026 at 08:05 AM
Content Hashsha256:3b1e99b25aaa22ff...
Git SHAd97009e9c7ed
──Files
Files (1 file, 2.6 KB)
SKILL.md2.6 KBactive
SKILL.md · 34 lines · 2.6 KB

version: "1.0.0" name: agentsmd-restore description: Restore hooks.json, config.toml, and AGENTS.md from an agentsmd pre-install snapshot. Use after a bad install/update merge. Not for ordinary uninstall; dry-run unless confirmed.


agentsmd-restore

Use the selected SKILL.md absolute path from the live skills list; never infer it from the process cwd. Define and call the adjacent launcher in the same shell. The launcher preserves selected bundle → manifest-owned standalone → versioned CLI identity checks and exports plugin context only for a verified selected bundle.

bash
SKILL_MD="<selected SKILL.md absolute path from the live skills list>"
agentsmd_skill_run() {
node "$(dirname "$SKILL_MD")/scripts/agentsmd-run.js" "$SKILL_MD" "$@"
}

install/update mutate three files shared with Codex and other tenants. The write is atomic (crash-safe), and also reversible: install snapshots all three into .agentsmd-state/backups/<id>/ before touching them (rotated — the newest 5 kept). If a merge came out logically wrong, restore the prior bytes:

bash
agentsmd_skill_run --list # snapshots + purpose
agentsmd_skill_run # DRY-RUN — newest compatible snapshot
agentsmd_skill_run --confirm # apply compatible snapshot
agentsmd_skill_run --id=<id> --confirm
  • Dry-run by default — a bare restore prints what it would overwrite and writes nothing; --confirm performs the write.
  • Backups are labeled pre-install or pre-uninstall. A bare restore selects the newest compatible pre-install snapshot. Both default and explicit --id restores reject a snapshot whose agentsmd hooks/spec footprint does not match the current install manifest, because restoring only the shared files would create a partial install. Legacy snapshots without these labels are classified from their actual hooks/spec contents and accepted only when that derived state matches.
  • Restore overwrites the live files with the snapshot, discarding any change made since that backup — by every tenant, not just agentsmd. That is the point (full rollback of a bad merge), but it is why it is dry-run-first.
  • Only files that existed at backup time are restored; a file that was absent then is left alone (never deleted).
  • To remove just agentsmd's own entries and preserve everyone else, use agentsmd uninstall instead — it is marker-scoped and multi-tenant-safe. Restore is the cruder "give me the exact prior bytes" tool for when a merge misbehaved.

The install manifest (.agentsmd-state/manifest.json) records the backup id from the last install. From the repo instead of an install: node scripts/restore.js.

All versions