Localsetup localsetup-safety-and-backup
Security and safety (conservative), backup management, temporary file management, firewall management. Use for destructive ops, system config changes, backups, temp files, or when adding services.
install
source · Clone the upstream repo
git clone https://github.com/CruxExperts/localsetup
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/CruxExperts/localsetup "$T" && mkdir -p ~/.claude/skills && cp -r "$T/_localsetup/skills/localsetup-safety-and-backup" ~/.claude/skills/cruxexperts-localsetup-localsetup-safety-and-backup && rm -rf "$T"
manifest:
_localsetup/skills/localsetup-safety-and-backup/SKILL.mdsource content
Safety, backup, temp files, firewall
10. Security and safety (conservative)
- Conservative approach: Prioritize security and data safety over automation convenience.
- Risk categories: CRITICAL (data loss), HIGH (system-wide), MEDIUM (application), LOW (read-only). CRITICAL/HIGH require explicit second confirmation.
- Warning requirements: Simple language, list consequences, explain who/what affected. Provide options: Execute / Show manual steps / Cancel.
- Dangerous operations: Recursive deletes, permission changes, firewall changes, system service changes, package removal, disk operations, user/group deletion, operations on /usr, /etc, /bin (or Windows equivalents).
- Use: Source
and uselib/safety_checker.sh
for system commands.safe_execute_with_confirmation
11. Backup management
- Default: Create backups before modifying sensitive system config files. Naming:
. Location: same directory as original; hidden/read-only.original_filename.YYYYMMDD_HHMMSS.backup - Large files (>100MB): Warn and ask about backup routine; user can skip.
- User control: User can decline backups for session; respect preference.
- Use: Source
and uselib/backup_manager.sh
before editing. Restore:create_file_backup
.restore_from_backup <original_file>
9. Temporary file management
- Platform: Linux /tmp; macOS /tmp or $TMPDIR; Windows %TEMP% or %TMP%.
- Cleanup: Clean up immediately; use trap (Bash) or try/finally (PowerShell). Repo-local temp: under _localsetup/ or repo temp dir when v2 repo-local.
- Naming: Framework naming + descriptive name + timestamp. Use mktemp or New-TemporaryFile.
5a. Firewall management (for services)
- When adding new services: Configure firewall rules. Use
. Default scope "lan". Validate withsource lib/firewall_manager.sh && configure_firewall_rule "ServiceName" "PORT" "tcp" "lan"
. See FIREWALL_MANAGEMENT.md.validate_firewall_rule