File Backup
v1.0.0修改文件前的自动备份工具。 当需要修改重要文件时,先备份再修改,改完后让用户检查,确认无误后删除备份。
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
The name and description (backup-before-modify) match the instructions: create a copy (cp), perform modification, ask the user, then rm on confirmation. No unrelated binaries, credentials, or installs are requested.
Instruction Scope
Instructions are high-level and limited to copying and deleting backups and prompting the user. They rely on the agent to 'detect' when a file is about to be modified (the SKILL.md does not specify how detection occurs), which is vague and grants the agent discretion about when to act. The examples include filenames that may refer to agent-internal files (SOUL.md, MEMORY.md) — backing up these is coherent with the stated goal but worth confirming you want those files handled.
Install Mechanism
No install spec and no code files — instruction-only skills are lowest-risk because nothing is written to disk by the skill itself.
Credentials
No environment variables, credentials, or config path requirements are declared. The actions described (cp, rm) require only filesystem access consistent with the backup purpose.
Persistence & Privilege
Skill does not request always:true or other elevated persistent privileges. Model invocation is allowed (platform default) but the skill itself does not request extra persistence or modification of other skills.
Assessment
This skill appears to do what it says, but before installing you should: 1) confirm which exact file paths the agent may act on (avoid unintended system or secret files); 2) ensure the backup directory (default 'backups/') is secure (correct ownership and permissions) so sensitive data isn't exposed; 3) consider storing backups outside world-readable locations and/or encrypting them if they contain secrets; 4) verify how the agent 'detects' modifications in your environment to avoid unexpected automatic actions; 5) prefer explicit, unambiguous user confirmations (the skill expects the exact phrase '可以删除备份' — consider using a clearly auditable confirmation workflow); and 6) be aware of filesystem race/symlink risks (use atomic/careful copy semantics in automation). If you need stronger guarantees, require manual review of the agent's planned cp/rm commands or restrict the skill to operate only on a narrow, user-approved path list.Like a lobster shell, security has layers — review code before you run it.
latest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
File Backup Skill
触发条件
修改重要文件前,特别是:
- 配置文件
- 核心机制文件
- 用户指定的敏感文件
工作流程
1. 备份
检测到要修改重要文件时,先创建备份:
cp 原文件 备份目录/原文件.日期.bak
例如:cp config.json backups/config.json.2026-03-14.bak
2. 执行修改
正常执行修改操作
3. 主动提醒检查 ⚠️
修改完成后,必须主动让用户检查:
备份已创建:backups/xxx.bak
请检查文件,确认无误后告诉我"可以删除备份"
4. 删除备份
收到用户确认后:
rm backups/xxx.bak
备份已删除
重要规则
- 不备份不修改:没有备份就不能改重要文件
- 主动提醒:改完后必须让用户检查,不能等用户忘
- 确认才删:必须等用户明确说"可以删除"才能删
- 备份保留:如果用户没确认,备份一直保留
- 通用路径:备份目录可自定义,默认为
backups/
配置(可选)
可以指定需要触发备份的文件类型:
- 配置文件:config.json, settings.yaml
- 核心文件:SOUL.md, MEMORY.md, AGENTS.md
- 自定义:用户指定的其他文件
示例
[检测到要修改 config.json]
→ 备份:cp config.json backups/config.json.2026-03-14.bak
→ 执行修改
→ 提醒:"备份已创建 backups/config.json.2026-03-14.bak,请检查config.json,确认无误后告诉我'可以删除备份'"
[用户确认]
→ 删除备份
Files
1 totalSelect a file
Select a file to preview.
Comments
Loading comments…
