← 返回 Skills 市场
87
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install change-safeguard
功能描述
确保对工作区文件、配置和脚本的改动经过全面影响分析、逐项修改和严格复验,防止遗漏或错误修改。
使用说明 (SKILL.md)
change-safeguard Skill
Description
工作区文件变更操作的安全保险箱。
任何对工作区文件、配置、脚本的优化、修改、移动、删除操作,都必须走此技能流程。确保不遗漏、不误改。
When to Use
触发场景:
- 文件/目录移动、重命名 → 更新所有引用
- 脚本路径/配置项修改 → 更新所有调用点
- 批量替换关键词/函数名/变量名
- 删除文件前 → 检查是否有引用
- 优化修改后 → 验证影响范围
不触发:
- 纯内容创作(不涉及已有文件引用)
- 读取文件后直接输出(不修改其他文件)
核心原则
| 原则 | 含义 |
|---|---|
| 🔍 搜索 ≠ 修改 | 看到搜索结果不代表已执行,必须逐一编辑 |
| ✅ 清零才算完成 | grep 旧字符串结果为空,才准说完成 |
| 🔄 改完必复验 | 最后一轮 grep 清零是不可跳过的强制步骤 |
5 步流程
1️⃣ 影响分析 ── grep 找出所有旧引用
2️⃣ 列清单 ── 逐个文件 + 具体位置 + 分类标记
3️⃣ 执行 ── 按清单逐一编辑,改一个打一个勾
4️⃣ 复验 ── 再次 grep 旧字符串,区分遗漏 vs 无需修改
5️⃣ 完成 ── 旧引用清零 → 展示修改总结
任何步骤不可跳过,不可合并。
步骤详解
步骤 1:影响分析
全量搜索,覆盖所有常见文件类型:
grep -rn "旧字符串" /path/to/ \
--include="*.md" --include="*.py" --include="*.json" \
--include="*.yaml" --include="*.yml" --include="*.sh" \
--include="*.js" --include="*.ts" --include="*.toml" \
2>/dev/null
搜索结果分类标记:
| 标记 | 含义 | 示例 |
|---|---|---|
| 📍 需修改 | 路径/名称变了,必须更新 | old/path/file.md → new/path/file.md |
| 🔒 无需修改 | 静态引用,位置未变 | README.md 路径未变 |
| ⚠️ 需确认 | 不确定是否需要改 | 注释、日志输出格式 |
步骤 2:列出清单
格式:
### 影响分析结果
共 X 处引用:Y 处需修改,Z 处无需修改
### 需修改清单
| # | 文件 | 需修改内容 | 状态 |
|---|------|-----------|------|
| 1 | file.md | old → new | ⬜ |
| 2 | script.py | 参数更新 | ⬜ |
列出后告知用户,等待确认后再执行。
步骤 3:执行修改
- 按清单逐一编辑,不跳跃
- 每改一个打勾
⬜→✅ - 不凭记忆修改,不跳过任何一项
步骤 4:复验(强制)
# 复验旧字符串
grep -rn "旧字符串" /path/to/ --include="*.md" --include="*.py" --include="*.json" ... 2>/dev/null
# 验证新字符串
grep -rn "新字符串" /path/to/ --include="*.md" --include="*.py" --include="*.json" ... 2>/dev/null
结果处理:
| 复验结果 | 动作 |
|---|---|
| 旧字符串 grep 结果为空 | ✅ 进入步骤 5 |
| 有残留但无需修改(注释/日志) | 解释后 ✅ 进入步骤 5 |
| 有残留是遗漏 | 回到步骤 3 补漏 |
步骤 5:完成总结
### 修改总结
共修改 X 个文件:
| # | 文件 | 修改内容 |
|---|------|----------|
| 1 | file.md | 路径更新 |
| 2 | script.py | 函数调用更新 |
✅ 复验通过,旧引用已清零。
禁止行为
| 行为 | 说明 |
|---|---|
| ❌ 搜了≠改了 | 看到搜索结果就以为处理了 |
| ❌ 改完不复验 | 编辑完直接说完成 |
| ❌ 凭记忆列举 | 不用 grep 就列受影响文件 |
| ❌ 漏掉文件类型 | 只搜 .md 忘了 .py、.json 等 |
| ❌ 跳过影响分析 | 不列清单直接开始改 |
| ❌ 跳过用户确认 | 不告知影响范围就执行 |
场景速查
| 场景 | 关键搜索 | 注意事项 |
|---|---|---|
| 目录重构 | 旧路径 | 区分哪些文件要改、哪些不动 |
| 函数重命名 | 旧函数名 | 包括定义和所有调用点 |
| 删除文件 | 文件名 | 先清引用再删文件 |
| 配置迁移 | 旧配置名 | 区分硬编码和变量引用 |
自检
说"完成"前,自问:
- grep 过旧字符串了吗?结果清零了吗?
- 搜索了所有常见文件类型吗?
- 区分了需要改和不需要改的引用吗?
任何一题回答"没有" → 不准说完成。
全局技能,所有 Agent 必须遵循
安全使用建议
This skill appears coherent and implements a conservative, manual-change workflow. Before installing: 1) Confirm your agent runtime actually enforces the 'wait for user confirmation' step and cannot bypass it when invoking the skill autonomously. 2) Confirm the agent has explicit and limited workspace access—avoid allowing broad root-level greps; limit the search paths to project folders. 3) Test the workflow in a safe repo/branch to validate the change-list and re-grep steps. 4) Note the SKILL.md's claim that it is 'global'—if you don't want a mandatory policy, ensure the platform does not set always:true or auto-run the skill. If those operational controls are acceptable, the skill's behavior is proportionate to its purpose.
功能分析
Type: OpenClaw Skill
Name: change-safeguard
Version: 1.0.0
The 'change-safeguard' skill is a procedural safety framework designed to ensure consistency during file refactoring and workspace modifications. It mandates a strict 5-step workflow involving impact analysis via grep, checklist creation, execution, and mandatory verification to prevent errors. The instructions in SKILL.md focus entirely on operational reliability and user transparency without any indicators of malicious intent, data exfiltration, or unauthorized execution.
能力评估
Purpose & Capability
Name/description (safeguard code/config changes) align with the instructions (search, list, edit, re-verify). The skill requires no external services, credentials, or unusual binaries—only the ability to search and edit workspace files, which is proportionate to its goal. Minor inconsistency: SKILL.md claims '_all agents must follow_,' but registry flags do not set always:true.
Instruction Scope
SKILL.md gives explicit runtime steps (grep across file types, build a change list, sequential edits, mandatory re-grep). These instructions stay within the stated purpose and do not call external endpoints or request secrets. However, they assume the agent can run shell commands and modify arbitrary workspace files; the example uses broad searches (e.g., /path/to or root-like patterns) which could scan large areas or sensitive files if misapplied. The skill does require user confirmation before edits (good), so ensure that step cannot be bypassed by the agent runtime.
Install Mechanism
Instruction-only skill with no install steps or downloaded artifacts. No code is written to disk by an installer—low install risk.
Credentials
No environment variables, credentials, or config paths are requested. The absence of secrets is proportionate to a purely local file-editing guardrail.
Persistence & Privilege
Registry flags: always:false and model invocation allowed (default). The skill's content insists it be treated as a global policy, but the manifest does not grant always:true. Because the skill's runtime actions modify files, allowlisting autonomous invocation could increase risk if the platform permits the agent to run edits without proper confirmation. This is not a defect in the skill itself, but an operational consideration for the platform and the user.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install change-safeguard - 安装完成后,直接呼叫该 Skill 的名称或使用
/change-safeguard触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: safe workflow for workspace file changes
元数据
常见问题
Change Safeguard 是什么?
确保对工作区文件、配置和脚本的改动经过全面影响分析、逐项修改和严格复验,防止遗漏或错误修改。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 87 次。
如何安装 Change Safeguard?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install change-safeguard」即可一键安装,无需额外配置。
Change Safeguard 是免费的吗?
是的,Change Safeguard 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Change Safeguard 支持哪些平台?
Change Safeguard 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Change Safeguard?
由 wei dong(@weidongkl)开发并维护,当前版本 v1.0.0。
推荐 Skills