workspace-backup
БесплатноЗапускает вложенные скриптыНе проверенPURE LOCAL file backup of this Mac's workspace: mirrors ~/playground, ~/experiment and ~/WorkBuddy into BOTH a fixed local folder and an external drive…
от vincentjiang06681 установка в других каталогахОб этом скилле
workspace-backup
The scripts are the safety. You are the routing, the reporting, and the
natural-language entry point. Where this prose and a script's exit code
disagree, the exit code wins — prose can be paraphrased, argued down by a
user who typed --force at 23:40, or evicted by a long run's context
compaction; a non-zero exit cannot.
run-chain
Fixed order. No step is skipped because the user says the drive is fine.
inventory -> guard -> plan -> [user go-ahead] -> copy -> verify -> report
| # | run | what it owns |
|---|---|---|
| 1 | scripts/inventory.py --config C --out inventory.json |
measures the SOURCE; emits units, properties, and the UNCOVERED list. Read-only. Starts the run and flags any TORN previous run. |
| 2 | scripts/guard_destination.py --config C --dest-id D --json |
says NO. Runs for every destination before any writer exists. Cannot write — that is the point. |
| 3 | scripts/plan.py --config C --inventory inventory.json --out plan.json |
classifies A/B/C, routes to cleared destinations, re-observes the destination for every unit the source fingerprint calls unchanged, pools free space per container, emits the space verdict. Re-runs the guard itself. Writes nothing to any destination. |
| 4 | — | show the user plan.json's byte totals, destination verdicts, any DESTINATION DRIFT or SPACE_ESTIMATE_LOWER_BOUND lines and the space verdict, and wait for a go. |
| 5 | scripts/copy.py --config C --plan plan.json --dest D --go |
moves bytes for the changed units. Without --go it is a dry run and writes nothing. |
| 6 | scripts/verify.py --config C --plan plan.json --dest D |
re-enumerates the destination independently and is the ONLY thing that can mark a unit safe. |
| 7 | scripts/status.py --config C |
renders the report. Every factual claim in your reply comes from here. |
Rules that hold across the chain:
- Dry-run is the default. A write run happens only after step 4.
guard_destination.pymust exit 0 for a destination before any process that can write is spawned for it. It is a separate process precisely so "zero bytes and no directory created" is provable at the process boundary rather than by an internal flag.plan.jsonis data, not authority.copy.pyandverify.pyderive the write target from the guarded config destination + the unit id and REFUSE (exit 11) any plan that names a different path. A stale plan after the destination path changed inconfig.jsonis the ordinary way that goes wrong.- Never hand-write an
rsync,dittoorcpcommand as a substitute forcopy.py. Ifcopy.pycannot handle a case, that is a defect to report, not a case to improvise around. (The obvious command is measured to fail here — see the pointer below.)
Exit codes. Every script, not just the guard. The exit code outranks this prose, so none of it may be a surprise:
| code | who | meaning |
|---|---|---|
0 |
all | success; also OFFLINE-and-skipped, which is a normal outcome |
1 |
plan | at least one destination is BLOCKED (a policy refusal, not a crash) |
2 |
all | usage error, including a config error (unknown key, no source_roots, two roots with one basename) |
3 |
copy | this destination is BLOCKED in the plan |
4 |
copy | the guard did not clear this destination |
5 |
copy | rsync --version was not recognised; no flag set is guessed |
6 |
copy, verify | another run holds the lock |
7 |
copy | at least one unit failed to copy |
8 |
verify | the memo was written by a newer major schema |
9 |
verify | at least one unit FAILED verification |
10 |
guard | OFFLINE — absent, or a removable path that is not a mount point |
11 |
copy, verify | plan.json named a target the guard never cleared |
20 |
guard | Time Machine store. No override exists |
21 |
guard | the destination resolves inside a source root |
30 |
guard | needs a human confirmation (foreign machine, no marker yet, undeclared cloud-sync path) |
Two exceptions to the chain. A status-only question — "what's not backed up
yet?", "上次备份是什么时候", "Philosophy 这个目录现在一共有几份拷贝" — runs
inventory + plan + status.py and never reaches copy. plan.py is in that
list on purpose: it is the step that re-observes the destination, and a status
answer that never looked at the destination cannot say what is safe there.
A resume after an interruption re-enters at guard, not at copy: the drive
may have been swapped since the torn run.
On-demand reading — do NOT read these on a clean run.
| read | ONLY when |
|---|---|
references/openrsync-compat.md — the measured, dated flag matrix |
copy.py reports an unrecognised rsync --version banner, selects the GNU branch, or a copy exits non-zero on a flag error |
references/destination-policy.md — that code's rule and the exact wording to explain the refusal |
guard_destination.py exits non-zero or emits |
Установить workspace-backup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл workspace-backup?
PURE LOCAL file backup of this Mac's workspace: mirrors ~/playground, ~/experiment and ~/WorkBuddy into BOTH a fixed local folder and an external drive, incremental and verified, so an interrupted run resumes. Use-when: '备份一下工作区', 'back up my workspace to the external drive', 'what is not backed up yet / 备份状态', 'the drive is plugged in, catch up the backup', '$workspace-backup'. Do-NOT use for: Time Machine repair or restore; git push to a remote; iCloud or cloud sync; database dumps; deleting node_modules to free space (this skill never deletes from the source); or a single-file .bak.
Как установить скилл workspace-backup?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл workspace-backup запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic