con un clic
chezmoi-backup
Create timestamped backup of files that would be changed by chezmoi
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Create timestamped backup of files that would be changed by chezmoi
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Comprehensive chezmoi and dotfiles status overview
Analyze chezmoi changes and create safe integration plan
Restore files from a chezmoi backup
Safely review and process unmanaged chezmoi files
Log significant Claude Code actions to Obsidian vault. Invoke after completing features, bug fixes, refactors, deployments, cleanups, or any substantial task.
Use when unbiased analysis is needed without conversation context contamination. Launches an isolated read-only background agent with a self-contained prompt crafted from current context. Use for audits, reviews, reports, or any analysis where prior assumptions might bias results.
| name | chezmoi-backup |
| description | Create timestamped backup of files that would be changed by chezmoi |
| allowed-tools | Bash(chezmoi:*), Bash(mkdir:*), Bash(cp:*), Bash(ln:*), Write |
date +%Y-%m-%d_%H-%M-%Schezmoi diff --exclude=externals | grep '^diff' | wc -l<backup_process> Execute these steps:
Create backup directory structure:
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
BACKUP_DIR="$HOME/.chezmoi-backups/$TIMESTAMP"
mkdir -p "$BACKUP_DIR/files"
Identify files to backup:
chezmoi diff --exclude=externalsrun_once_ script artifacts: A run_once_ source script appears in the diff as a "new file" at its rendered name (e.g. install-packages-darwin.sh), but chezmoi only materializes it temporarily, runs it, then discards it. There is nothing on disk to back up and nothing will exist after apply. Cross-reference each "new file" entry with chezmoi source-path <target> — if the source path starts with run_once_, skip it.Copy files to backup:
# For each file that would be modified
cp -p "$HOME/.example" "$BACKUP_DIR/files/.example"
Save diff for reference:
chezmoi diff --exclude=externals > "$BACKUP_DIR/chezmoi-diff.txt"
Create manifest.json:
{
"timestamp": "2025-01-03_14-30-45",
"date": "2025-01-03 14:30:45",
"files_backed_up": [
".zshrc",
".gitconfig"
],
"chezmoi_version": "$(chezmoi --version)",
"total_files": 2
}
Update latest symlink:
ln -sfn "$BACKUP_DIR" "$HOME/.chezmoi-backups/latest"
</backup_process>
<output_format>
Backup ID: [timestamp] Location: ~/.chezmoi-backups/[timestamp]/ Files backed up: [count]
/integrate-changeschezmoi apply when ready/chezmoi-undo [timestamp]Tip: Your backup is also available at ~/.chezmoi-backups/latest/
</output_format>
<error_handling> Handle these scenarios gracefully:
No changes to backup:
chezmoi diff is empty, inform user no backup neededBackup directory exists:
Permission errors:
Disk space issues:
<manifest_structure> The manifest.json file should contain: