Crash Snapshots

v1.0.2

每次 write/edit 前自动备份原文件到 .openclaw/backups/,防止误操作导致文件丢失。

0· 128·0 current·0 all-time
byECsss@olveww-dot

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for olveww-dot/crash-snapshots.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Crash Snapshots" (olveww-dot/crash-snapshots) from ClawHub.
Skill page: https://clawhub.ai/olveww-dot/crash-snapshots
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install crash-snapshots

ClawHub CLI

Package manager switcher

npx clawhub@latest install crash-snapshots
Security Scan
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (backup before write/edit) align with code and scripts: backup.ts copies existing files into a .openclaw/backups/ folder. Required tools (Node/tsx) are reasonable for a TypeScript script. No unrelated env vars, binaries, or config paths are requested.
Instruction Scope
SKILL.md instructs calling backup.ts before write/edit or running the provided scripts. The runtime code only reads specified file paths and writes local backups; it does not access network endpoints, other agents' configs, or unrelated system secrets. The SKILL.md does reference installing from a GitHub repo and mentions hooks but does not instruct reading other system state.
Install Mechanism
There is no registry 'install' entry, but SKILL.md suggests downloading a GitHub archive (github.com/olveww-dot/...) which is a common pattern. install.sh will attempt to install or rely on tsx (npm) and may run npm -g tsx (global package install), which modifies the system Node environment — moderate-risk but expected for TypeScript tools. No downloads from obscure hosts or extract-from-arbitrary-URL beyond GitHub are present in the shipped files.
Credentials
The skill requires no environment variables or credentials. The code only accesses files passed as arguments and writes backups alongside them; that access level matches the stated purpose.
Persistence & Privilege
The skill is not set always:true and does not modify other skills. The agent may invoke it autonomously (platform default), so backups could be created automatically before edits — this is consistent with intent but means backups could be produced without a separate explicit user action. The skill writes files to .openclaw/backups in target directories, which is expected but could accumulate sensitive copies or disk usage.
Assessment
This skill appears to do exactly what it says: copy existing files to {dir}/.openclaw/backups/ with timestamped names. Before installing: - Inspect the repository/source you're downloading (the SKILL.md's install curl pulls from github.com/olveww-dot/openclaw-hermes-claude). Only run the install command if you trust that repo. - Be aware install.sh may install tsx via npm globally (npm -g tsx) — that modifies your Node environment; if you prefer, install tsx into a virtual environment or run via npx. - Backups are full copies of files. If you edit sensitive files (credentials, keys), those will also be copied into .openclaw/backups/ in the same directories. Plan cleanup (the README suggests a find -mtime cleanup) and restrict backup directories with appropriate file permissions if needed. - The agent can invoke the skill autonomously by default; if you want explicit control, use the manual script (scripts/backup-file.sh or node src/backup.ts) rather than hooking it into automatic write/edit flows. If you want extra assurance, run the scripts locally in a controlled directory first and verify behavior before integrating into your regular workspace.

Like a lobster shell, security has layers — review code before you run it.

latestvk97cc23wsp8fgxnjfwmw9jq4bn857jcc
128downloads
0stars
3versions
Updated 1w ago
v1.0.2
MIT-0

Crash-Resistant Snapshots

🛡️ OpenClaw 混合进化方案 — 将 Hermes-agent(100K ⭐)+ Claude Code 核心能力移植到 OpenClaw

🛡️ 写文件前自动备份,崩溃也不怕。

这个 Skill 做什么?

在你使用 write / edit 工具修改文件前,自动把原文件复制一份到 .openclaw/backups/ 目录。

  • ✅ 只备份已存在的文件(新文件不备份)
  • ✅ 备份路径:{原文件目录}/.openclaw/backups/{timestamp}_{原文件名}
  • ✅ 时间戳精确到秒,不会覆盖旧备份
  • ✅ 备份目录不存在时自动创建

工作原理

在执行 write / edit 之前,Agent 会先调用 backup.ts 备份原文件。

🚀 一键安装

mkdir -p ~/.openclaw/skills && cd ~/.openclaw/skills && curl -fsSL https://github.com/olveww-dot/openclaw-hermes-claude/archive/main.tar.gz | tar xz && cp -r openclaw-hermes-claude-main/skills/crash-snapshots . && rm -rf openclaw-hermes-claude-main && echo "✅ crash-snapshots 安装成功"

使用方式

方式一:作为 OpenClaw Skill 直接调用

在对话中直接说:

"备份一下 src/utils.ts"
"帮我把 memory/notes.md 备份"

Agent 会调用 backup.ts 执行备份。

方式二:手动运行脚本

# 备份单个文件
node ~/.openclaw/workspace/skills/crash-snapshots/src/backup.ts /path/to/file.txt

# 备份多个文件
node ~/.openclaw/workspace/skills/crash-snapshots/src/backup.ts file1.ts file2.md

# 列出最近备份
ls -lt ~/.openclaw/workspace/skills/crash-snapshots/backups/

备份恢复

# 找到备份文件
ls -lt /path/to/dir/.openclaw/backups/

# 恢复(copy back,不要 mv)
cp /path/to/dir/.openclaw/backups/2026-04-19_22-30-00_file.txt /path/to/file.txt

备份目录结构

{文件所在目录}/
└── .openclaw/
    └── backups/
        ├── 2026-04-19_14-30-00_config.json
        ├── 2026-04-19_15-45-00_config.json
        └── ...

API

backup.ts

Usage: backup.ts <file1> [file2] ...

备份一个或多个文件到 .openclaw/backups/
- 只备份已存在的文件
- 新建文件跳过(无内容可备份)
- 备份路径:{dir}/.openclaw/backups/{timestamp}_{basename}

注意事项

  • 备份是额外保险,不等于版本控制
  • 建议同时使用 Git 进行真正的版本控制
  • 备份文件多了记得定期清理

🧩 配套技能

本 skill 是 OpenClaw 混合进化方案 的一部分:

Hermes-agent(100K ⭐)+ Claude Code 核心能力移植到 OpenClaw

🔗 GitHub 项目:olveww-dot/openclaw-hermes-claude

完整技能套件(6个):

  • 🛡️ crash-snapshots — 崩溃防护(本文)
  • 🧠 auto-distill — T1 自动记忆蒸馏
  • 🎯 coordinator — 指挥官模式
  • 💡 context-compress — 思维链连续性
  • 🔍 lsp-client — LSP 代码智能
  • 🔄 auto-reflection — 自动反思

版本历史

  • v1.0.0 (2026-04-19): 初始版本
    • 支持 write/edit 前自动备份
    • 时间戳精确到秒,防止覆盖
    • 自动创建备份目录

Comments

Loading comments...