Back to Registry
View Author Profile
Official Verified
Config Modification
Skill by halfmoon82
skill-install — Terminal
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/halfmoon82/config-modificationOr
Skill: config-modification v2.3
配置文件修改安全流程(拦截矩阵 + 四联校验 + 自动回滚)
触发条件
当需要修改以下配置文件时强制触发:
openclaw.jsonagents/*/models.jsonagents/*/config.json- skills 配置
- 任何
~/.openclaw/下的 JSON 配置文件
⚠️ 无例外原则:不管是正式修改还是测试,只要动配置文件,都必须走完整流程。
v2.3 架构
配置文件修改操作 (edit/write/delete)
|
▼
┌─────────────────┐
│ 拦截矩阵 │
│ (风险评估) │
└────────┬────────┘
│
┌────────┴────────┐
│ 校验级别 │
│ full/verify/ │
│ check/snapshot │
└────────┬────────┘
│
┌────────┴────────┐
│ 四联校验 │
│ Schema → Diff │
│ → Rollback │
│ → Health │
└────────┬────────┘
│
┌────────┴────────┐
│ 失败? │
└────────┬────────┘
│ │
Yes No
│ │
▼ ▼
自动回滚 ✅ 完成
+ 告警
核心模块
1. 拦截矩阵 (intercept_matrix.py)
- 定义配置风险等级: critical / medium / low
- 动作触发规则: edit/write/delete/config.patch
- 敏感路径识别
from intercept_matrix import should_intercept, get_check_level
# 检查是否需要拦截
if should_intercept("edit", "/path/to/config.json"):
level = get_check_level("edit", "/path/to/config.json")
# level: "full" | "verify" | "check" | "snapshot"
2. 四联校验 (quad_check.py)
- Schema: JSON 语法 + 必需字段
- Diff: 与快照对比变更
- Rollback: 回滚能力验证
- Health: Gateway 健康检查
from quad_check import QuadCheckStateMachine
qc = QuadCheckStateMachine("/path/to/config.json")
results = qc.run_all()
# results: [CheckResult, CheckResult, CheckResult, CheckResult]
3. 自动回滚 (auto_rollback.py)
- 失败检测 → 自动回滚 → 告警通知
- 告警渠道: telegram / log / signal
from auto_rollback import check_and_rollback
success = check_and_rollback(results, "/path/to/config.json")
# success: True (全部通过) / False (已回滚)
使用方法
CLI 接口
# 检查是否需要拦截
python3 config_modification_v2.py intercept <action> <config_path>
# 例: python3 config_modification_v2.py edit ~/.openclaw/openclaw.json
# 执行四联校验
python3 config_modification_v2.py check <config_path>
# 完整修改周期 (推荐)
python3 config_modification_v2.py full-cycle <config_path>
# 手动回滚
python3 config_modification_v2.py rollback
集成到工作流
# 在任何配置修改前调用
import sys
sys.path.insert(0, "~/.openclaw/workspace/skills/config-modification/")
from intercept_matrix import should_intercept
from quad_check import QuadCheckStateMachine
from auto_rollback import check_and_rollback
config_path = "~/.openclaw/openclaw.json"
action = "edit"
# 1. 拦截检查
if should_intercept(action, config_path):
# 2. 四联校验
qc = QuadCheckStateMachine(config_path)
results = qc.run_all()
# 3. 失败回滚
if not check_and_rollback(results, config_path):
print("❌ 配置修改已回滚")
sys.exit(1)
print("✅ 配置修改安全")
告警规则
Metadata
AI Skill Finder
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skill Add to Configuration
Paste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-halfmoon82-config-modification": {
"enabled": true,
"auto_update": true
}
}
}Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.
Related Skills
Skill Trigger V2
Skill by halfmoon82
halfmoon82 2387
Complex Task Methodology
Skill by halfmoon82
halfmoon82 2387
semantic-router
让 AI 代理根据对话内容自动选择最合适的模型。四层识别(系统过滤→关键词→指示词→语义相似度),四池架构(高速/智能/人文/代理),五分支路由,全自动 Fallback 回路。支持 trigger_groups_all 非连续词组命中。
halfmoon82 2387
subagent-isolation-guard
固化子代理物理隔离与语义路由旁路。防止跨代理上下文污染及由于语义路由导致的子代理切模/重置问题。
halfmoon82 2387
skill-safe-install
L0 级技能安全安装流程。触发“安装技能/安全安装/审查权限”时,强制执行 Step0-5(查重→检索→审查→沙箱→正式安装→白名单)。
halfmoon82 2387