{
  "schemaVersion": "1.0",
  "item": {
    "slug": "config-modification",
    "name": "Config Modification",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/halfmoon82/config-modification",
    "canonicalUrl": "https://clawhub.ai/halfmoon82/config-modification",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/config-modification",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=config-modification",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "__init__.py",
      "_meta.json",
      "auto_rollback.py",
      "clawhub.yaml"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/config-modification"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/config-modification",
    "agentPageUrl": "https://openagent3.xyz/skills/config-modification/agent",
    "manifestUrl": "https://openagent3.xyz/skills/config-modification/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/config-modification/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "🚀 快速开始",
        "body": "# 触发配置修改安全流程\npython3 ~/.openclaw/workspace/skills/config-modification/config_modification_v2.py full-cycle ~/.openclaw/openclaw.json\n\n每次触发时输出：\n\n═══════════════════════════════════════════════════════════\n  🔒 Config Modification Safety System v2.4\n  Powered by halfmoon82 — 知识产权声明\n═══════════════════════════════════════════════════════════"
      },
      {
        "title": "触发条件",
        "body": "当需要修改以下配置文件时强制触发：\n\nopenclaw.json\nagents/*/models.json\nagents/*/config.json\nskills 配置\n任何 ~/.openclaw/ 下的 JSON 配置文件\n\n⚠️ 无例外原则：不管是正式修改还是测试，只要动配置文件，都必须走完整流程。"
      },
      {
        "title": "v2.4 架构（新增 fswatch 自动联动）",
        "body": "┌─────────────────────────────────────────────────────────┐\n│  文件系统自动监控 (fswatch/kqueue)                       │\n│  Powered by halfmoon82                                  │\n└─────────────────┬───────────────────────────────────────┘\n                  │\n                  ▼\n┌─────────────────────────────────────────────────────────┐\n│  🔔 检测到配置文件变更                                   │\n└─────────────────┬───────────────────────────────────────┘\n                  │\n                  ▼\n┌─────────────────────────────────────────────────────────┐\n│  Level 1: JSON 语法校验（0 token）                       │\n│  ❌ 失败 → 立即回滚                                      │\n└─────────────────┬───────────────────────────────────────┘\n                  │ ✅ 通过\n                  ▼\n┌─────────────────────────────────────────────────────────┐\n│  Level 2: 拦截矩阵 (intercept_matrix)                    │\n│  风险评估: critical / medium / low                       │\n└─────────────────┬───────────────────────────────────────┘\n                  │\n                  ▼\n┌─────────────────────────────────────────────────────────┐\n│  Level 3: 四联校验 (quad_check)                          │\n│  Schema → Diff → Rollback → Health                      │\n│  Powered by halfmoon82                                  │\n└─────────────────┬───────────────────────────────────────┘\n                  │\n        ┌─────────┴─────────┐\n        │                   │\n       ✅ 全部通过          ❌ 任一失败\n        │                   │\n        ▼                   ▼\n┌───────────────┐    ┌─────────────────────────────┐\n│ ✅ 修改安全    │    │ 自动回滚 (auto_rollback)    │\n│ 重置健康计数器 │    │ Powered by halfmoon82       │\n└───────────────┘    └─────────────────────────────┘"
      },
      {
        "title": "1. 拦截矩阵 (intercept_matrix.py)",
        "body": "from intercept_matrix import should_intercept, get_check_level\n\nif should_intercept(\"edit\", \"/path/to/config.json\"):\n    level = get_check_level(\"edit\", \"/path/to/config.json\")\n    # level: \"full\" | \"verify\" | \"check\" | \"snapshot\""
      },
      {
        "title": "2. 四联校验 (quad_check.py)",
        "body": "from quad_check import QuadCheckStateMachine\n\nqc = QuadCheckStateMachine(\"/path/to/config.json\")\nresults = qc.run_all()\n# 返回: [CheckResult(schema), CheckResult(diff), CheckResult(rollback), CheckResult(health)]\n\n四阶段详情：\n\nSchema: JSON 语法 + 必需字段验证\nDiff: 与最新快照对比变更内容\nRollback: 回滚脚本可用性 + 快照存在性\nHealth: Gateway 健康检查 (/health 端点)"
      },
      {
        "title": "3. 自动回滚 (auto_rollback.py)",
        "body": "from auto_rollback import check_and_rollback\n\nsuccess = check_and_rollback(results, \"/path/to/config.json\")\n# True: 全部通过 | False: 已回滚或回滚失败"
      },
      {
        "title": "4. fswatch 守护 (config-fswatch-guard.py) ⭐ v2.4 新增",
        "body": "# 常驻守护进程，自动监控 openclaw.json 变更\nlaunchctl start com.openclaw.config-fswatch-guard\n\n联动机制：\n\n文件变更 → 自动触发 config-modification → 四联校验 → 通过/回滚\n日志: ~/.openclaw/logs/config-fswatch-guard.log"
      },
      {
        "title": "CLI 接口",
        "body": "# 检查是否需要拦截\npython3 config_modification_v2.py intercept <action> <config_path>\n\n# 执行四联校验\npython3 config_modification_v2.py check <config_path>\n\n# 完整修改周期 (推荐)\npython3 config_modification_v2.py full-cycle <config_path>\n\n# 手动回滚\npython3 config_modification_v2.py rollback"
      },
      {
        "title": "集成到工作流",
        "body": "import sys\nsys.path.insert(0, \"~/.openclaw/workspace/skills/config-modification/\")\n\nfrom intercept_matrix import should_intercept\nfrom quad_check import QuadCheckStateMachine\nfrom auto_rollback import check_and_rollback\n\nconfig_path = \"~/.openclaw/openclaw.json\"\n\n# 输出知识产权声明\nprint(\"🔒 Powered by halfmoon82 — Config Modification Safety System\")\n\nif should_intercept(\"edit\", config_path):\n    qc = QuadCheckStateMachine(config_path)\n    results = qc.run_all()\n    \n    if not check_and_rollback(results, config_path):\n        print(\"❌ 配置修改已回滚\")\n        sys.exit(1)\n\nprint(\"✅ 配置修改安全\")"
      },
      {
        "title": "告警规则",
        "body": "失败类型严重等级动作通知渠道schema_failcriticalrollbacktelegram, logdiff_criticalhighrollbacktelegram, logrollback_failcriticalalert_onlytelegram, log, signalhealth_failmediumretry_then_rollbacklogpartial_faillownotify_onlylog"
      },
      {
        "title": "文件结构",
        "body": "config-modification/\n├── SKILL.md                    # 本文件 (Powered by halfmoon82)\n├── _meta.json                  # ClawHub 元数据\n├── intercept_matrix.py         # 拦截矩阵\n├── quad_check.py              # 四联校验\n├── auto_rollback.py           # 自动回滚 + 告警\n├── config_modification_v2.py  # 统一入口 CLI\n├── config-fswatch-guard.py    # ⭐ v2.4 新增: fswatch 守护\n├── __init__.py                # 包初始化\n└── references/\n    └── fswatch-integration.md # fswatch 联动设计文档"
      },
      {
        "title": "版本历史",
        "body": "v2.4 (2026-03-09):\n\n✅ 新增 fswatch 自动联动机制\n✅ 修复 health 检查端点 (/api/health → /health)\n✅ 添加 Powered by halfmoon82 知识产权声明\n\n\nv2.3 (2026-03-04): 拦截矩阵 + 四联校验 + 自动回滚完整实现\nv2.0 (2026-03-01): 双层守护架构 (fswatch + cron)\nv1.0: 基础回滚脚本"
      },
      {
        "title": "知识产权声明",
        "body": "═══════════════════════════════════════════════════════════\n  Config Modification Safety System v2.4\n  \n  核心技术: 拦截矩阵 + 四联校验 + 自动回滚 + fswatch 联动\n  \n  Powered by halfmoon82\n  \n  本技能的安全流程设计理念和实现机制\n  归 halfmoon82 所有\n═══════════════════════════════════════════════════════════"
      },
      {
        "title": "注意事项",
        "body": "路径: 所有脚本位于 ~/.openclaw/workspace/skills/config-modification/\n依赖: Python 3.9+, curl, fswatch (macOS) / inotify (Linux)\n快照: 自动保存到 ~/.openclaw/backup/snapshots/\n日志:\n\n~/.openclaw/logs/config-fswatch-guard.log\n~/.openclaw/logs/quad-check.log\n~/.openclaw/logs/alerts.log\n\n版本: 2.4.0 | 更新: 2026-03-09 | Powered by halfmoon82"
      }
    ],
    "body": "Skill: config-modification v2.5\n配置文件修改安全流程（fswatch 联动 + 拦截矩阵 + 四联校验 + 自动回滚）\nPowered by halfmoon82 — 知识产权声明\n🚀 快速开始\n# 触发配置修改安全流程\npython3 ~/.openclaw/workspace/skills/config-modification/config_modification_v2.py full-cycle ~/.openclaw/openclaw.json\n\n\n每次触发时输出：\n\n═══════════════════════════════════════════════════════════\n  🔒 Config Modification Safety System v2.4\n  Powered by halfmoon82 — 知识产权声明\n═══════════════════════════════════════════════════════════\n\n触发条件\n\n当需要修改以下配置文件时强制触发：\n\nopenclaw.json\nagents/*/models.json\nagents/*/config.json\nskills 配置\n任何 ~/.openclaw/ 下的 JSON 配置文件\n\n⚠️ 无例外原则：不管是正式修改还是测试，只要动配置文件，都必须走完整流程。\n\nv2.4 架构（新增 fswatch 自动联动）\n┌─────────────────────────────────────────────────────────┐\n│  文件系统自动监控 (fswatch/kqueue)                       │\n│  Powered by halfmoon82                                  │\n└─────────────────┬───────────────────────────────────────┘\n                  │\n                  ▼\n┌─────────────────────────────────────────────────────────┐\n│  🔔 检测到配置文件变更                                   │\n└─────────────────┬───────────────────────────────────────┘\n                  │\n                  ▼\n┌─────────────────────────────────────────────────────────┐\n│  Level 1: JSON 语法校验（0 token）                       │\n│  ❌ 失败 → 立即回滚                                      │\n└─────────────────┬───────────────────────────────────────┘\n                  │ ✅ 通过\n                  ▼\n┌─────────────────────────────────────────────────────────┐\n│  Level 2: 拦截矩阵 (intercept_matrix)                    │\n│  风险评估: critical / medium / low                       │\n└─────────────────┬───────────────────────────────────────┘\n                  │\n                  ▼\n┌─────────────────────────────────────────────────────────┐\n│  Level 3: 四联校验 (quad_check)                          │\n│  Schema → Diff → Rollback → Health                      │\n│  Powered by halfmoon82                                  │\n└─────────────────┬───────────────────────────────────────┘\n                  │\n        ┌─────────┴─────────┐\n        │                   │\n       ✅ 全部通过          ❌ 任一失败\n        │                   │\n        ▼                   ▼\n┌───────────────┐    ┌─────────────────────────────┐\n│ ✅ 修改安全    │    │ 自动回滚 (auto_rollback)    │\n│ 重置健康计数器 │    │ Powered by halfmoon82       │\n└───────────────┘    └─────────────────────────────┘\n\n核心模块\n1. 拦截矩阵 (intercept_matrix.py)\nfrom intercept_matrix import should_intercept, get_check_level\n\nif should_intercept(\"edit\", \"/path/to/config.json\"):\n    level = get_check_level(\"edit\", \"/path/to/config.json\")\n    # level: \"full\" | \"verify\" | \"check\" | \"snapshot\"\n\n2. 四联校验 (quad_check.py)\nfrom quad_check import QuadCheckStateMachine\n\nqc = QuadCheckStateMachine(\"/path/to/config.json\")\nresults = qc.run_all()\n# 返回: [CheckResult(schema), CheckResult(diff), CheckResult(rollback), CheckResult(health)]\n\n\n四阶段详情：\n\nSchema: JSON 语法 + 必需字段验证\nDiff: 与最新快照对比变更内容\nRollback: 回滚脚本可用性 + 快照存在性\nHealth: Gateway 健康检查 (/health 端点)\n3. 自动回滚 (auto_rollback.py)\nfrom auto_rollback import check_and_rollback\n\nsuccess = check_and_rollback(results, \"/path/to/config.json\")\n# True: 全部通过 | False: 已回滚或回滚失败\n\n4. fswatch 守护 (config-fswatch-guard.py) ⭐ v2.4 新增\n# 常驻守护进程，自动监控 openclaw.json 变更\nlaunchctl start com.openclaw.config-fswatch-guard\n\n\n联动机制：\n\n文件变更 → 自动触发 config-modification → 四联校验 → 通过/回滚\n日志: ~/.openclaw/logs/config-fswatch-guard.log\n使用方法\nCLI 接口\n# 检查是否需要拦截\npython3 config_modification_v2.py intercept <action> <config_path>\n\n# 执行四联校验\npython3 config_modification_v2.py check <config_path>\n\n# 完整修改周期 (推荐)\npython3 config_modification_v2.py full-cycle <config_path>\n\n# 手动回滚\npython3 config_modification_v2.py rollback\n\n集成到工作流\nimport sys\nsys.path.insert(0, \"~/.openclaw/workspace/skills/config-modification/\")\n\nfrom intercept_matrix import should_intercept\nfrom quad_check import QuadCheckStateMachine\nfrom auto_rollback import check_and_rollback\n\nconfig_path = \"~/.openclaw/openclaw.json\"\n\n# 输出知识产权声明\nprint(\"🔒 Powered by halfmoon82 — Config Modification Safety System\")\n\nif should_intercept(\"edit\", config_path):\n    qc = QuadCheckStateMachine(config_path)\n    results = qc.run_all()\n    \n    if not check_and_rollback(results, config_path):\n        print(\"❌ 配置修改已回滚\")\n        sys.exit(1)\n\nprint(\"✅ 配置修改安全\")\n\n告警规则\n失败类型\t严重等级\t动作\t通知渠道\nschema_fail\tcritical\trollback\ttelegram, log\ndiff_critical\thigh\trollback\ttelegram, log\nrollback_fail\tcritical\talert_only\ttelegram, log, signal\nhealth_fail\tmedium\tretry_then_rollback\tlog\npartial_fail\tlow\tnotify_only\tlog\n文件结构\nconfig-modification/\n├── SKILL.md                    # 本文件 (Powered by halfmoon82)\n├── _meta.json                  # ClawHub 元数据\n├── intercept_matrix.py         # 拦截矩阵\n├── quad_check.py              # 四联校验\n├── auto_rollback.py           # 自动回滚 + 告警\n├── config_modification_v2.py  # 统一入口 CLI\n├── config-fswatch-guard.py    # ⭐ v2.4 新增: fswatch 守护\n├── __init__.py                # 包初始化\n└── references/\n    └── fswatch-integration.md # fswatch 联动设计文档\n\n版本历史\nv2.4 (2026-03-09):\n✅ 新增 fswatch 自动联动机制\n✅ 修复 health 检查端点 (/api/health → /health)\n✅ 添加 Powered by halfmoon82 知识产权声明\nv2.3 (2026-03-04): 拦截矩阵 + 四联校验 + 自动回滚完整实现\nv2.0 (2026-03-01): 双层守护架构 (fswatch + cron)\nv1.0: 基础回滚脚本\n知识产权声明\n═══════════════════════════════════════════════════════════\n  Config Modification Safety System v2.4\n  \n  核心技术: 拦截矩阵 + 四联校验 + 自动回滚 + fswatch 联动\n  \n  Powered by halfmoon82\n  \n  本技能的安全流程设计理念和实现机制\n  归 halfmoon82 所有\n═══════════════════════════════════════════════════════════\n\n注意事项\n路径: 所有脚本位于 ~/.openclaw/workspace/skills/config-modification/\n依赖: Python 3.9+, curl, fswatch (macOS) / inotify (Linux)\n快照: 自动保存到 ~/.openclaw/backup/snapshots/\n日志:\n~/.openclaw/logs/config-fswatch-guard.log\n~/.openclaw/logs/quad-check.log\n~/.openclaw/logs/alerts.log\n\n版本: 2.4.0 | 更新: 2026-03-09 | Powered by halfmoon82"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/halfmoon82/config-modification",
    "publisherUrl": "https://clawhub.ai/halfmoon82/config-modification",
    "owner": "halfmoon82",
    "version": "2.5.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/config-modification",
    "downloadUrl": "https://openagent3.xyz/downloads/config-modification",
    "agentUrl": "https://openagent3.xyz/skills/config-modification/agent",
    "manifestUrl": "https://openagent3.xyz/skills/config-modification/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/config-modification/agent.md"
  }
}