guard
Helper for the guard CLI (https://github.com/florianbuetow/guard). Guard protects files from accidental edits by setting the immutable flag and root ownership. This skill composes the right guard commands for the user.
Routing
| Intent | Reference |
|---|---|
Set up guard / .guardfile missing |
references/init.md |
| Build a collection from a description or list | references/create-collection.md |
| Remove a collection | references/remove-collection.md |
| Restore everything, wipe the registry | references/clear-all.md |
| Show collections and loose guarded files | references/info.md |
The sudo rule (the only non-obvious thing)
The agent runs as the user, without sudo. Operations that change a file's guard state require root (clearing the immutable flag is root-only), so the agent cannot run them — it prints the exact sudo guard … command for the user to run.
- Print
sudo guard …for:enable,disable,toggle,reset, anddestroy/remove/clearwhen the target files are currently guarded. - Run directly (no sudo):
init,add,create,update … add,show,config, anddestroy/removewhen files are already unguarded.
Check guard state with guard show before deciding. A file is guarded when its line starts with G.
Quote arguments
Always quote collection names and file paths in any command you run or print: guard destroy "$name", sudo guard enable collection "$name". Paths can contain spaces.
CLI reference
For exact syntax of any subcommand, run guard help <sub>. Don't reproduce it here.