agentleFS
rawvvrawvv/before-you-spill/skills/backup/SKILL.md

backup

Skill0 starsChanged 5 months agoMITView on GitHub

Scan this Mac and back up the dev environment (dotfiles, Homebrew apps, editor settings, runtimes, macOS defaults, project list) into the user's private settings repo. Use when the user wants to back up machine settings, says "backup my machine", "back up my settings", "머신 백업", "설정 백업", or before switching laptops.

  • Reads credentials
  • Commits and pushes

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use update.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • AnthropicSkill

    update

    Sync tasks and refresh memory from your current activity. Use when pulling new assignments from your project tracker into TASKS.md, triaging stale or overdue tasks, filling memory gaps for unknown people or projects, or running a comprehensive scan to catch todos buried in chat and email.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 4 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Follow the allowlist and forbidden paths in modules.md §Global rules.

    line 17
  2. Very specific:

    Never read or copy SSH private keys, ~/.aws, ~/.docker, gh hosts.yml, ~/.claude.json, keychains, or .env files.

    line 18
  3. Distinctive:

    Never commit if the secret scan fails.

    line 20
  4. Very specific:

    Read ~/.config/before-you-spill/config (KEY=VALUE lines):

    line 25
  5. Distinctive:

    If it doesn't exist (first run):

    line 32
  6. Very specific:

    Ask the user where the settings repo should live (default ~/machine-settings) and whether to create a private GitHub repo for it (gh repo …

    line 33
  7. Distinctive:

    run git config core.hooksPath hooks inside the repo

    line 40
  8. Very specific:

    Ask which directories hold the user's active projects (default ~/Desktop/project).

    line 41
  9. Distinctive:

    Write the config file.

    line 42
  10. Very specific:

    Write modules/<name>/meta.yml per the template in modules.md, including:

    line 63
  11. Very specific:

    Write/refresh machine.yml at the repo root: hostname, sw_vers output, uname -m, backup timestamp, and versions of core tools (brew, git, …

    line 74
  12. Very specific:

    Run scripts/secret-scan.sh <repo root> from the settings repo.

    line 80
  13. Very specific:

    Ask the user before running git add -A && git commit && git push.

    line 94

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

before-you-spill: backup

Back up this machine into the user's private settings repo. You are the collector; modules.md (next to this file) is the catalog that defines exactly what to collect. The bundled scripts/secret-scan.sh is the safety rail.

Resolve the plugin root as ${CLAUDE_PLUGIN_ROOT} (fallback: the directory two levels above this SKILL.md).

Hard safety rules (non-negotiable)

  1. Follow the allowlist and forbidden paths in modules.md §Global rules. Never read or copy SSH private keys, ~/.aws, ~/.docker, gh hosts.yml, ~/.claude.json, keychains, or .env files.
  2. Never commit if the secret scan fails. Never bypass or remove the pre-commit hook.
  3. Scrub rules (npmrc etc.) are mandatory: if scrubbing fails, skip the file and warn.

Step 1 — Resolve the settings repo

Read ~/.config/before-you-spill/config (KEY=VALUE lines):

REPO_PATH=/Users/you/machine-settings
PROJECT_ROOTS=~/Desktop/project

If it doesn't exist (first run):

  1. Ask the user where the settings repo should live (default ~/machine-settings) and whether to create a private GitHub repo for it (gh repo create <name> --private).
  2. Initialize the repo from the plugin templates:
    • copy ${CLAUDE_PLUGIN_ROOT}/templates/settings-repo/.gitignore, .secretignore, and CLAUDE.md into the repo root
    • copy ${CLAUDE_PLUGIN_ROOT}/skills/backup/scripts/secret-scan.sh → scripts/secret-scan.sh (chmod +x)
    • copy templates/settings-repo/hooks/pre-commit → hooks/pre-commit (chmod +x)
    • run git config core.hooksPath hooks inside the repo
  3. Ask which directories hold the user's active projects (default ~/Desktop/project).
  4. Write the config file.

On every run, also refresh scripts/secret-scan.sh in the settings repo from the plugin copy if the plugin's version is newer (compare content).

Step 2 — Inventory scan

For each module in modules.md, run its detect check. Present a short table: module → will capture / skipped (not installed).

Discovery pass (offer, don't force): list config-looking entries in ~/.config/, ~/Library/Application Support/, and ~/.* dotfiles that are NOT covered by any module and NOT on the forbidden list. Present them as "found but not backed up" and let the user decide. If the user wants one, append a recipe to their settings repo's CLAUDE.md under a "custom modules" section and collect it the same structured way.

Step 3 — Collect per module

Execute each module's recipe from modules.md exactly. For every module:

  1. Populate modules/<name>/files/.
  2. Write modules/<name>/meta.yml per the template in modules.md, including:
    • captured.app_version via the module's version command
    • captured.os (sw_vers), arch (uname -m)
    • content_hash: sha256 over the sorted per-file sha256s of files/ (cd modules/<name> && find files -type f | sort | xargs shasum -a 256 | shasum -a 256)
    • Only rewrite captured.timestamp when content_hash actually changed. This keeps re-runs diff-clean — an unchanged machine produces an empty git diff.
  3. Collect warnings (dirty/unpushed projects, scrubbed credential lines, skipped files).

Step 4 — machine.yml

Write/refresh machine.yml at the repo root: hostname, sw_vers output, uname -m, backup timestamp, and versions of core tools (brew, git, node, zsh, claude). Apply the same rule: only bump the timestamp if anything else in the repo changed.

Step 5 — Secret scan (blocking)

Run scripts/secret-scan.sh <repo root> from the settings repo. If it fails: show every finding, do NOT stage or commit anything, and help the user remove or allowlist (.secretignore) each finding. Re-run until clean.

Step 6 — Report and commit

  1. Print a summary table: module | captured/skipped/unchanged | warnings.
  2. Print the red warning block for unrecoverable work (dirty repos, unpushed commits, repos without remotes) — these are exactly what a coffee spill destroys.
  3. Fill in the README placeholders ({{HOSTNAME}}, {{OS}}, {{ARCH}}, {{DATE}}, {{REPO_URL}}, {{MODULE_TABLE}}) from templates/settings-repo/README.md if the README is still a fresh template, or just update the "Last backup" line and module table otherwise. {{REPO_URL}} must be the HTTPS URL, never SSH — a fresh machine has no SSH keys.
  4. Ask the user before running git add -A && git commit && git push. The pre-commit hook will re-scan staged content; if it blocks, go back to Step 5.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.