verify-restore

Validates dotfiles backup and restore scripts by running them against a temporary fake HOME directory.

Updated Dec 25, 2021
One-click install
npx skills add https://github.com/kotahashihama/dotfiles --skill verify-restore-kotahashihama
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: verify-restore
Source: https://github.com/kotahashihama/dotfiles/tree/main/.claude/skills/verify-restore
Command: npx skills add https://github.com/kotahashihama/dotfiles --skill verify-restore-kotahashihama

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Restore scripts for dotfiles only truly run on a brand-new machine, so testing them on an existing machine silently skips the failure paths (e.g., ln failing with File exists). This Skill runs the full backup-to-restore flow inside a fake HOME created with mktemp -d, proving the restore actually works on a fresh machine without touching the real home directory. ## Core Features & Use Cases - End-to-end restore verification: Executes scripts/verify_restore.sh, which checks script syntax, fresh-machine restore, shell startup with aliases, idempotency across two runs, salvage behavior for existing files, missing-archive fallback, archive contents (AES-256, socket exclusion), pre-commit credential blocking, and template consistency. - Safe isolation: Never touches the real ~; the fake HOME is deleted afterward, and only read and staging operations are performed on the real repository. - Actionable failure reports: Failures print expected versus actual values so you can fix the script and re-run until all checks pass. - Use Case: After editing scripts/restore_dotfiles.sh or changing the public/private directory layout, run the verification to confirm a new machine could still be restored before committing. ## Quick Start Ask the assistant to verify that the dotfiles restore works on a fresh machine by running the verify-restore check.

Frequently Asked Questions about verify-restore

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test dotfiles restore scripts without a new machine?

Run the restore against a fake HOME created with mktemp -d instead of your real home directory. The verify_restore.sh script builds this temporary environment, runs the full restore, and deletes it afterward without touching your actual files.

Why does testing restore scripts on my existing machine not work?

On an existing machine, ln fails silently with File exists, so the restore script skips the exact paths that break on a fresh machine. Only a clean, empty HOME exercises the real restore code path.

What does the dotfiles restore verification check?

It checks script syntax, fresh-machine restore with correct symlink targets, shell startup and alias resolution, idempotency across two runs, salvage instead of deletion of existing files, missing-archive fallback, archive contents and AES-256 encryption, pre-commit credential blocking, and template consistency.

Why must the git staging area be empty before running restore verification?

The pre-commit hook inspects all staged files, so leftover staged changes alter the results of the credential-blocking checks. An empty staging area ensures section 8 of the verification produces trustworthy results.

Is it safe to run restore verification on my real machine?

Yes, because the script only operates on a temporary fake HOME and performs just read and staging operations on the real repository. It never runs the restore against your actual home directory.