{
  "schemaVersion": "1.0",
  "item": {
    "slug": "restart-guard",
    "name": "Restart Guard",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/Zjianru/restart-guard",
    "canonicalUrl": "https://clawhub.ai/Zjianru/restart-guard",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/restart-guard",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=restart-guard",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "CHANGELOG.md",
      "ENHANCED_RESTART_IMPLEMENTATION_SPEC.md",
      "README.md",
      "SKILL.md",
      "config.example.yaml",
      "references/troubleshooting.md"
    ],
    "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/restart-guard"
    },
    "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/restart-guard",
    "agentPageUrl": "https://openagent3.xyz/skills/restart-guard/agent",
    "manifestUrl": "https://openagent3.xyz/skills/restart-guard/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/restart-guard/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": "Purpose / 目标",
        "body": "Safely restart gateway while preserving context and guaranteeing a post-restart report path to the user session.\n安全重启网关，保留上下文，并保证重启后可主动回报到用户会话。"
      },
      {
        "title": "Trigger / 触发条件",
        "body": "Use this skill when the task involves OpenClaw gateway restart, watchdog recovery, or post-restart reporting.\n当任务涉及 OpenClaw 网关重启、看门狗恢复、重启后回报时使用。\n\nNatural-language triggers (must auto-run, do not ask user for script commands):\n\n\"可以重启了\"\n\"现在重启吧\"\n\"restart now\"\n\"go ahead and restart\"\n\n自然语言触发（必须自动执行，不让用户手工跑脚本）：\n\n“可以重启了”\n“现在重启吧”\n“restart now”\n“go ahead and restart”"
      },
      {
        "title": "Required Preconditions / 前置条件",
        "body": "openclaw CLI is available.\nRestart config exists (config.example.yaml or config/restart-guard.yaml.example copied to runtime path).\nAgent can execute shell commands.\nopenclaw CLI 可用。\n重启配置文件存在（从示例拷贝到运行路径）。\nagent 具备执行命令能力。"
      },
      {
        "title": "0) Default behavior / 默认行为",
        "body": "When user expresses restart intent without specifying channel details:\n\nRun full flow automatically via scripts/auto_restart.py.\nDefault --notify-mode origin.\nInfer origin session key automatically (env/context/sessions), no user input required.\nAuto-discover external channels and persist effective_notify_plan.\nBefore trigger, proactively announce disaster delivery route/channels to origin session.\nAfter restart event arrives, net summarizes result to user.\n\n当用户仅表达重启意图且未指定渠道细节时：\n\n使用 scripts/auto_restart.py 自动执行全流程。\n默认 --notify-mode origin。\n自动推断源会话 key（env/context/sessions），无需用户补参数。\n自动发现外部渠道并写入 effective_notify_plan。\n触发前先在源会话预告灾难通知路由与渠道。\n收到重启事件后，由 net 向用户汇总结果。"
      },
      {
        "title": "1) Discover channels and mode / 发现渠道与模式（可选）",
        "body": "python3 <skill-dir>/scripts/discover_channels.py --config <config-path> --json\n\nAsk user:\n\nnotify mode (origin recommended, or selected, all)\nselected channel/target if needed\n\n询问用户：\n\n通知模式（推荐 origin，可选 selected、all）\n若需要，指定渠道与目标"
      },
      {
        "title": "2) Write context / 写入现场",
        "body": "python3 <skill-dir>/scripts/write_context.py \\\n  --config <config-path> \\\n  --reason \"config change\" \\\n  --verify 'openclaw health --json' 'ok' \\\n  --resume \"report restart result to user\""
      },
      {
        "title": "3) Execute restart / 执行重启",
        "body": "Recommended one-command entry:\n\npython3 <skill-dir>/scripts/auto_restart.py \\\n  --config <config-path> \\\n  --reason \"config change\" \\\n  --notify-mode origin\n\n推荐单命令入口：\n\npython3 <skill-dir>/scripts/auto_restart.py \\\n  --config <config-path> \\\n  --reason \"配置变更\" \\\n  --notify-mode origin\n\npython3 <skill-dir>/scripts/restart.py \\\n  --config <config-path> \\\n  --reason \"config change\" \\\n  --notify-mode origin \\\n  --origin-session-key <session-key>\n\nSelected channel mode:\n\npython3 <skill-dir>/scripts/restart.py \\\n  --config <config-path> \\\n  --reason \"config change\" \\\n  --notify-mode selected \\\n  --channel telegram \\\n  --target 726647436"
      },
      {
        "title": "4) Postcheck / 事后校验",
        "body": "python3 <skill-dir>/scripts/postcheck.py --config <config-path>"
      },
      {
        "title": "Contract / 契约",
        "body": "Event contract: restart_guard.result.v1\nRequired fields: status, restart_id\nContext adds:\n\nrestart_id\norigin_session_key\nnotify_mode\nchannel_selection\neffective_notify_plan\nstate_timestamps\ndiagnostics_file\ndelivery_status\n\n\nOptional event fields:\n\nseverity\nfailure_phase\nerror_code\ndelivery_attempts\ndelivery_route\ndelivery_exhausted\ndiagnostics_file"
      },
      {
        "title": "Notes / 注意事项",
        "body": "webui is not treated as disabled notification anymore; origin-session ACK is primary path.\nwebui 不再视为禁用通知；主路径是回发到发起会话。\nVerify/diagnostics commands run in strict non-shell mode.\n校验/诊断命令以严格非 shell 模式执行（包含管道等 shell 元字符会被拒绝）。\nFor implementation-level replication details, see ENHANCED_RESTART_IMPLEMENTATION_SPEC.md.\n若需按工程级标准复刻实现，请参考 ENHANCED_RESTART_IMPLEMENTATION_SPEC.md。\nDo not expose internal scripts/steps unless user explicitly asks for internals.\n除非用户明确要求细节，否则不要向用户暴露内部脚本步骤。\nGuardian uses strict success invariant:\n\ndown_detected && start_attempted && up_healthy\n\n\nGuardian success requires strict invariant:\n\ndown_detected && start_attempted && up_healthy"
      },
      {
        "title": "Failure Handling / 故障处理",
        "body": "On timeout/failure, guardian writes local diagnostics file (restart-diagnostics-<restart_id>.md/json), sends concise summary, and retries delivery within budget.\n若超时或失败，guardian 会写本地诊断文件（restart-diagnostics-<restart_id>.md/json），发送简要摘要，并在预算内重试送达。\nFixed disaster route: origin session -> agent:main:main -> all discovered external channels.\n固定灾难路由：源会话 -> agent:main:main -> 所有已发现外部渠道。\nGuardian exits after successful delivery or budget exhaustion; no long-lived watchdog process after disaster handling.\n灾难处理结束后（送达成功或预算耗尽）guardian 必须退出，不长期驻留。"
      }
    ],
    "body": "Restart Guard\nPurpose / 目标\n\nSafely restart gateway while preserving context and guaranteeing a post-restart report path to the user session.\n安全重启网关，保留上下文，并保证重启后可主动回报到用户会话。\n\nTrigger / 触发条件\n\nUse this skill when the task involves OpenClaw gateway restart, watchdog recovery, or post-restart reporting.\n当任务涉及 OpenClaw 网关重启、看门狗恢复、重启后回报时使用。\n\nNatural-language triggers (must auto-run, do not ask user for script commands):\n\n\"可以重启了\"\n\"现在重启吧\"\n\"restart now\"\n\"go ahead and restart\"\n\n自然语言触发（必须自动执行，不让用户手工跑脚本）：\n\n“可以重启了”\n“现在重启吧”\n“restart now”\n“go ahead and restart”\nRequired Preconditions / 前置条件\nopenclaw CLI is available.\nRestart config exists (config.example.yaml or config/restart-guard.yaml.example copied to runtime path).\nAgent can execute shell commands.\nopenclaw CLI 可用。\n重启配置文件存在（从示例拷贝到运行路径）。\nagent 具备执行命令能力。\nWorkflow / 标准流程\n0) Default behavior / 默认行为\n\nWhen user expresses restart intent without specifying channel details:\n\nRun full flow automatically via scripts/auto_restart.py.\nDefault --notify-mode origin.\nInfer origin session key automatically (env/context/sessions), no user input required.\nAuto-discover external channels and persist effective_notify_plan.\nBefore trigger, proactively announce disaster delivery route/channels to origin session.\nAfter restart event arrives, net summarizes result to user.\n\n当用户仅表达重启意图且未指定渠道细节时：\n\n使用 scripts/auto_restart.py 自动执行全流程。\n默认 --notify-mode origin。\n自动推断源会话 key（env/context/sessions），无需用户补参数。\n自动发现外部渠道并写入 effective_notify_plan。\n触发前先在源会话预告灾难通知路由与渠道。\n收到重启事件后，由 net 向用户汇总结果。\n1) Discover channels and mode / 发现渠道与模式（可选）\npython3 <skill-dir>/scripts/discover_channels.py --config <config-path> --json\n\n\nAsk user:\n\nnotify mode (origin recommended, or selected, all)\nselected channel/target if needed\n\n询问用户：\n\n通知模式（推荐 origin，可选 selected、all）\n若需要，指定渠道与目标\n2) Write context / 写入现场\npython3 <skill-dir>/scripts/write_context.py \\\n  --config <config-path> \\\n  --reason \"config change\" \\\n  --verify 'openclaw health --json' 'ok' \\\n  --resume \"report restart result to user\"\n\n3) Execute restart / 执行重启\n\nRecommended one-command entry:\n\npython3 <skill-dir>/scripts/auto_restart.py \\\n  --config <config-path> \\\n  --reason \"config change\" \\\n  --notify-mode origin\n\n\n推荐单命令入口：\n\npython3 <skill-dir>/scripts/auto_restart.py \\\n  --config <config-path> \\\n  --reason \"配置变更\" \\\n  --notify-mode origin\n\npython3 <skill-dir>/scripts/restart.py \\\n  --config <config-path> \\\n  --reason \"config change\" \\\n  --notify-mode origin \\\n  --origin-session-key <session-key>\n\n\nSelected channel mode:\n\npython3 <skill-dir>/scripts/restart.py \\\n  --config <config-path> \\\n  --reason \"config change\" \\\n  --notify-mode selected \\\n  --channel telegram \\\n  --target 726647436\n\n4) Postcheck / 事后校验\npython3 <skill-dir>/scripts/postcheck.py --config <config-path>\n\nContract / 契约\nEvent contract: restart_guard.result.v1\nRequired fields: status, restart_id\nContext adds:\nrestart_id\norigin_session_key\nnotify_mode\nchannel_selection\neffective_notify_plan\nstate_timestamps\ndiagnostics_file\ndelivery_status\nOptional event fields:\nseverity\nfailure_phase\nerror_code\ndelivery_attempts\ndelivery_route\ndelivery_exhausted\ndiagnostics_file\nNotes / 注意事项\nwebui is not treated as disabled notification anymore; origin-session ACK is primary path.\nwebui 不再视为禁用通知；主路径是回发到发起会话。\nVerify/diagnostics commands run in strict non-shell mode.\n校验/诊断命令以严格非 shell 模式执行（包含管道等 shell 元字符会被拒绝）。\nFor implementation-level replication details, see ENHANCED_RESTART_IMPLEMENTATION_SPEC.md.\n若需按工程级标准复刻实现，请参考 ENHANCED_RESTART_IMPLEMENTATION_SPEC.md。\nDo not expose internal scripts/steps unless user explicitly asks for internals.\n除非用户明确要求细节，否则不要向用户暴露内部脚本步骤。\nGuardian uses strict success invariant:\ndown_detected && start_attempted && up_healthy\nGuardian success requires strict invariant:\ndown_detected && start_attempted && up_healthy\nFailure Handling / 故障处理\nOn timeout/failure, guardian writes local diagnostics file (restart-diagnostics-<restart_id>.md/json), sends concise summary, and retries delivery within budget.\n若超时或失败，guardian 会写本地诊断文件（restart-diagnostics-<restart_id>.md/json），发送简要摘要，并在预算内重试送达。\nFixed disaster route: origin session -> agent:main:main -> all discovered external channels.\n固定灾难路由：源会话 -> agent:main:main -> 所有已发现外部渠道。\nGuardian exits after successful delivery or budget exhaustion; no long-lived watchdog process after disaster handling.\n灾难处理结束后（送达成功或预算耗尽）guardian 必须退出，不长期驻留。"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/Zjianru/restart-guard",
    "publisherUrl": "https://clawhub.ai/Zjianru/restart-guard",
    "owner": "Zjianru",
    "version": "2.2.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/restart-guard",
    "downloadUrl": "https://openagent3.xyz/downloads/restart-guard",
    "agentUrl": "https://openagent3.xyz/skills/restart-guard/agent",
    "manifestUrl": "https://openagent3.xyz/skills/restart-guard/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/restart-guard/agent.md"
  }
}