zjianru
作者:zjianru更新日 2026-05-17全 7 バージョン · 最新版の公開日 2026-03-02restart-guard@clawhub_zjianru/restart-guard
サーバー運用障害対応設定生成

AlphaMoatによると、2026-09時点でRestart Guardのダウンロード数は3,411、スター数は4で、AIスキル全体5,078件中3,281位、IT運用・セキュリティでは264件中211位です。

インストール数
115
ダウンロード数
3411
スター数
4
総合順位
#3,281
全体の上位 65% · IT運用・セキュリティの上位 80%
プラットフォームインストール数ダウンロード数スター数コメント
ClawHub ↗107320641
SkillHub ↗11534114—

プラットフォームごとに集計方法と集計時点が異なります。

このスキルでできること

再起動理由、検証コマンド、通知先を保存し、再起動後にゲートウェイの健全性を確認して、開始元のセッションへ結果を通知できます。失敗時はローカル診断情報を作成し、通知を試みます。管理された環境でのみ使い、再起動前に運用担当者の明示的な承認を得てください。 診断コマンドを制限し、完全に信頼できない場合はゲートウェイをローカルに限定して、token と再起動情報を保護してください。

資料公開日 2026-10-29

できること

  • ゲートウェイ再起動と事後ヘルスチェックを計画する
  • 復旧コンテキストと通知経路を保存する
  • 再起動状況と障害診断を確認する

使う場面

  • OpenClawゲートウェイの再起動が実際に必要なとき
  • 復旧を確認して開始元セッションへ報告する必要があるとき

プロンプト例

スキルのドキュメントをもとに生成した例であり、実際の実行結果ではありません。

再起動と確認手順を説明し、運用担当者の明示的な承認を待ってください。今は再起動しないでください。
再起動結果と診断状況を確認し、復旧できたか要約してください。

月次の推移

ダウンロード数3411
2002275935152026-03 · ダウンロード数 21062026-05 · ダウンロード数 26772026-06 · ダウンロード数 28052026-07 · ダウンロード数 30212026-08 · ダウンロード数 31212026-09 · ダウンロード数 341126-0326-09
スター数4
3452026-03 · スター数 42026-05 · スター数 42026-06 · スター数 42026-07 · スター数 42026-08 · スター数 42026-09 · スター数 426-0326-09

2026-09 から集計方法を変更し、同名スキルを作者ごとに分けて集計し、全スキルを対象にしました。破線は変更前の月で、変更後のデータとは直接比較せず、変更をまたぐ増減も計算していません。

月ダウンロード数前月比スター数
2026-093411—4
2026-083121+3.3%4
2026-073021+7.7%4
2026-062805+4.8%4
2026-052677—4
2026-032106—4

SKILL.md 原文

作者が公開した元のファイルをテキストのまま表示しています。AlphaMoat による編集や審査はしていません。リンクはクリックできません。コマンドは内容を確認してから実行してください。取得日 2026-10-23。

6.0 KB・ClawHub v2.2.0
---
name: restart-guard
version: 2.2.0
description: Deterministic OpenClaw gateway restart with down/up state-machine verification, origin-session proactive ACK, and backward-compatible config.
metadata: {"openclaw":{"requires":{"bins":["python3","curl"],"env":["GATEWAY_AUTH_TOKEN"],"env_any":["TELEGRAM_BOT_TOKEN","DISCORD_WEBHOOK_URL","SLACK_WEBHOOK_URL","RESTART_GUARD_WEBHOOK_URL","FEISHU_WEBHOOK_URL"]}}}
---

# Restart Guard

## Purpose / 目标
すべて表示(全 175 行)

Safely restart gateway while preserving context and guaranteeing a post-restart report path to the user session.  
安全重启网关,保留上下文,并保证重启后可主动回报到用户会话。

## Trigger / 触发条件

Use this skill when the task involves OpenClaw gateway restart, watchdog recovery, or post-restart reporting.  
当任务涉及 OpenClaw 网关重启、看门狗恢复、重启后回报时使用。

Natural-language triggers (must auto-run, do not ask user for script commands):
- "可以重启了"
- "现在重启吧"
- "restart now"
- "go ahead and restart"

自然语言触发(必须自动执行,不让用户手工跑脚本):
- “可以重启了”
- “现在重启吧”
- “restart now”
- “go ahead and restart”

## Required Preconditions / 前置条件

- `openclaw` CLI is available.
- Restart config exists (`config.example.yaml` or `config/restart-guard.yaml.example` copied to runtime path).
- Agent can execute shell commands.
- `openclaw` CLI 可用。
- 重启配置文件存在(从示例拷贝到运行路径)。
- agent 具备执行命令能力。

## Workflow / 标准流程

### 0) Default behavior / 默认行为

When user expresses restart intent without specifying channel details:
- Run full flow automatically via `scripts/auto_restart.py`.
- Default `--notify-mode origin`.
- Infer origin session key automatically (env/context/sessions), no user input required.
- Auto-discover external channels and persist `effective_notify_plan`.
- Before trigger, proactively announce disaster delivery route/channels to origin session.
- After restart event arrives, net summarizes result to user.

当用户仅表达重启意图且未指定渠道细节时:
- 使用 `scripts/auto_restart.py` 自动执行全流程。
- 默认 `--notify-mode origin`。
- 自动推断源会话 key(env/context/sessions),无需用户补参数。
- 自动发现外部渠道并写入 `effective_notify_plan`。
- 触发前先在源会话预告灾难通知路由与渠道。
- 收到重启事件后,由 net 向用户汇总结果。

### 1) Discover channels and mode / 发现渠道与模式(可选)

```bash
python3 <skill-dir>/scripts/discover_channels.py --config <config-path> --json
```

Ask user:
- notify mode (`origin` recommended, or `selected`, `all`)
- selected channel/target if needed

询问用户:
- 通知模式(推荐 `origin`,可选 `selected`、`all`)
- 若需要,指定渠道与目标

### 2) Write context / 写入现场

```bash
python3 <skill-dir>/scripts/write_context.py \
  --config <config-path> \
  --reason "config change" \
  --verify 'openclaw health --json' 'ok' \
  --resume "report restart result to user"
```

### 3) Execute restart / 执行重启

Recommended one-command entry:

```bash
python3 <skill-dir>/scripts/auto_restart.py \
  --config <config-path> \
  --reason "config change" \
  --notify-mode origin
```

推荐单命令入口:

```bash
python3 <skill-dir>/scripts/auto_restart.py \
  --config <config-path> \
  --reason "配置变更" \
  --notify-mode origin
```

```bash
python3 <skill-dir>/scripts/restart.py \
  --config <config-path> \
  --reason "config change" \
  --notify-mode origin \
  --origin-session-key <session-key>
```

Selected channel mode:

```bash
python3 <skill-dir>/scripts/restart.py \
  --config <config-path> \
  --reason "config change" \
  --notify-mode selected \
  --channel telegram \
  --target 726647436
```

### 4) Postcheck / 事后校验

```bash
python3 <skill-dir>/scripts/postcheck.py --config <config-path>
```

## Contract / 契约

- Event contract: `restart_guard.result.v1`
- Required fields: `status`, `restart_id`
- Context adds:
  - `restart_id`
  - `origin_session_key`
  - `notify_mode`
  - `channel_selection`
  - `effective_notify_plan`
  - `state_timestamps`
  - `diagnostics_file`
  - `delivery_status`
- Optional event fields:
  - `severity`
  - `failure_phase`
  - `error_code`
  - `delivery_attempts`
  - `delivery_route`
  - `delivery_exhausted`
  - `diagnostics_file`

## Notes / 注意事项

- `webui` is not treated as disabled notification anymore; origin-session ACK is primary path.
- `webui` 不再视为禁用通知;主路径是回发到发起会话。
- Verify/diagnostics commands run in strict non-shell mode.
- 校验/诊断命令以严格非 shell 模式执行(包含管道等 shell 元字符会被拒绝)。
- For implementation-level replication details, see `ENHANCED_RESTART_IMPLEMENTATION_SPEC.md`.
- 若需按工程级标准复刻实现,请参考 `ENHANCED_RESTART_IMPLEMENTATION_SPEC.md`。
- Do not expose internal scripts/steps unless user explicitly asks for internals.
- 除非用户明确要求细节,否则不要向用户暴露内部脚本步骤。
- Guardian uses strict success invariant:
  - `down_detected && start_attempted && up_healthy`
- Guardian success requires strict invariant:
  - `down_detected && start_attempted && up_healthy`

## Failure Handling / 故障处理

- On timeout/failure, guardian writes local diagnostics file (`restart-diagnostics-<restart_id>.md/json`), sends concise summary, and retries delivery within budget.
- 若超时或失败,guardian 会写本地诊断文件(`restart-diagnostics-<restart_id>.md/json`),发送简要摘要,并在预算内重试送达。
- Fixed disaster route: `origin session -> agent:main:main -> all discovered external channels`.
- 固定灾难路由:`源会话 -> agent:main:main -> 所有已发现外部渠道`。
- Guardian exits after successful delivery or budget exhaustion; no long-lived watchdog process after disaster handling.
- 灾难处理结束后(送达成功或预算耗尽)guardian 必须退出,不长期驻留。

IT運用・セキュリティの人気スキル

zjianruのその他のスキル

データ月:2026-09 · ダウンロード数、スター数、インストール数は公開スキルレジストリ(ClawHub、SkillHub)から月単位で集計しています。詳しくはデータの方法論をご覧ください。