home / skills / barefootford / buttercut / backup-library

backup-library skill

/.claude/skills/backup-library

This skill creates compressed ZIP backups of the libraries directory, including library.yaml and transcripts, and helps restore libraries when needed.

npx playbooks add skill barefootford/buttercut --skill backup-library

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
696 B
---
name: backup-library
description: Creates compressed ZIP backups of libraries directory. Backs up library.yaml, transcripts, and roughcuts (not video files). This skill can also be useful when you need to restore a library.
---

# Skill: Backup Library

Verify libraries directory exists:
```bash
ls -la libraries/
```

Run backup:
```bash
ruby .claude/skills/backup-library/backup_libraries.rb
```

Creates `backups/libraries_YYYYMMDD_HHMMSS.zip` containing the entire libraries directory.

## Restore Library

To restore from a backup, extract the ZIP file to the project root.
```bash
unzip backups/libraries_timestamp.zip -d .
```
This restores all libraries to their original locations.

Overview

This skill creates compressed ZIP backups of the libraries directory, capturing library metadata and editable assets while excluding large video files. It produces timestamped archives suitable for safe storage or transfer and supports straightforward restoration to the project root. Use it to snapshot library state before major edits or to prepare archives for handoff.

How this skill works

The script checks that a libraries directory exists and then compresses the directory contents into a single ZIP file placed in backups/, named libraries_YYYYMMDD_HHMMSS.zip. It includes library.yaml files, transcripts, roughcuts, and other small assets but intentionally skips raw video files to keep archives compact. To restore, simply extract the ZIP at the project root and the libraries are returned to their original paths.

When to use it

  • Before performing large edits or refactoring that could risk library metadata or transcripts
  • When preparing a portable snapshot to share libraries without heavy media files
  • As part of periodic project backups to preserve library state and annotations
  • Before upgrading tools or dependencies that might change library formats
  • When you need a quick way to move libraries between environments without video payloads

Best practices

  • Run the backup script from the project root so paths and timestamps are consistent
  • Store backups/ in a versioned or offsite storage system for redundancy
  • Verify the ZIP after creation (e.g., unzip -t) before deleting any originals
  • Keep a retention policy and clear old archives to manage disk usage
  • Include the timestamp and a short changelog outside the archive for traceability

Example use cases

  • Snapshotting library metadata and transcripts before merging a large feature branch
  • Creating a lightweight archive to send a library to a collaborator without video files
  • Restoring a damaged or accidental library deletion by extracting a recent ZIP
  • Automating a nightly backup job that preserves roughcuts and annotations

FAQ

Does the backup include video files?

No. The backup intentionally excludes raw video files to keep archives small; it focuses on YAML, transcripts, roughcuts, and related small assets.

How do I restore a library from a backup?

Unzip the timestamped archive at the project root (unzip backups/libraries_timestamp.zip -d .) and the libraries will be restored to their original locations.