← Back to Skills Marketplace
weidongkl

Change Safeguard

by wei dong · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
87
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install change-safeguard
Description
确保对工作区文件、配置和脚本的改动经过全面影响分析、逐项修改和严格复验,防止遗漏或错误修改。
README (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.mdnew/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
❌ 跳过影响分析 不列清单直接开始改
❌ 跳过用户确认 不告知影响范围就执行

场景速查

场景 关键搜索 注意事项
目录重构 旧路径 区分哪些文件要改、哪些不动
函数重命名 旧函数名 包括定义和所有调用点
删除文件 文件名 先清引用再删文件
配置迁移 旧配置名 区分硬编码和变量引用

自检

说"完成"前,自问:

  1. grep 过旧字符串了吗?结果清零了吗?
  2. 搜索了所有常见文件类型吗?
  3. 区分了需要改和不需要改的引用吗?

任何一题回答"没有" → 不准说完成。


全局技能,所有 Agent 必须遵循

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install change-safeguard
  3. After installation, invoke the skill by name or use /change-safeguard
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: safe workflow for workspace file changes
Metadata
Slug change-safeguard
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Change Safeguard?

确保对工作区文件、配置和脚本的改动经过全面影响分析、逐项修改和严格复验,防止遗漏或错误修改。 It is an AI Agent Skill for Claude Code / OpenClaw, with 87 downloads so far.

How do I install Change Safeguard?

Run "/install change-safeguard" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Change Safeguard free?

Yes, Change Safeguard is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Change Safeguard support?

Change Safeguard is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Change Safeguard?

It is built and maintained by wei dong (@weidongkl); the current version is v1.0.0.

💬 Comments