# Send Gateway Watchdog Discord to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- 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.
## Suggested prompts
### New install

```text
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.
```
### Upgrade existing

```text
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.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openclaw-gateway-watchdog-skill",
    "name": "Gateway Watchdog Discord",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/JonathanJing/openclaw-gateway-watchdog-skill",
    "canonicalUrl": "https://clawhub.ai/JonathanJing/openclaw-gateway-watchdog-skill",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/openclaw-gateway-watchdog-skill",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-gateway-watchdog-skill",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "CHANGELOG.md",
      "README.md",
      "SKILL.md",
      "references/cron-agent-turn.md",
      "scripts/gateway-watchdog.sh",
      "scripts/install-launchd.sh"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.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/openclaw-gateway-watchdog-skill"
    },
    "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."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openclaw-gateway-watchdog-skill",
    "downloadUrl": "https://openagent3.xyz/downloads/openclaw-gateway-watchdog-skill",
    "agentUrl": "https://openagent3.xyz/skills/openclaw-gateway-watchdog-skill/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-gateway-watchdog-skill/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-gateway-watchdog-skill/agent.md"
  }
}
```
## Documentation

### Gateway Watchdog (Discord)

Discord-first watchdog for OpenClaw gateway incidents.

### 1. Ask OpenClaw (Recommended)

Tell OpenClaw: "Install the gateway-watchdog skill." The agent will handle the installation and configuration automatically.

### 2. Manual Installation (CLI)

If you prefer the terminal, run:

clawhub install gateway-watchdog

### Isolation model

Watchdog data is isolated under ~/.openclaw/watchdogs/gateway-discord/.
No edits to openclaw.json are required.
Default mode is read-only monitoring (GW_WATCHDOG_ENABLE_RESTART=0).
Automatic restart is opt-in and bounded by max attempts.

### Files in this skill

scripts/gateway-watchdog.sh - health checks + state machine + Discord notification.
scripts/install-launchd.sh - installs a user LaunchAgent from template.
references/com.openclaw.gateway-watchdog.plist.template - launchd template.
references/cron-agent-turn.md - isolated cron prompt template.

### Health checks

The watchdog checks:

openclaw gateway status --json
openclaw health --json --timeout <ms>

Pass criteria:

gateway runtime is running
RPC probe is healthy (when present)
health snapshot returns successfully

Failure classes:

runtime_stopped
rpc_probe_failed
health_unreachable
auth_mismatch
config_invalid

### Quick start (manual run)

bash "{baseDir}/scripts/gateway-watchdog.sh"

Optional env:

export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..."
export DISCORD_BOT_TOKEN="discord_bot_token"
export DISCORD_CHANNEL_ID="<your_discord_channel_id>"
export GW_WATCHDOG_SOURCE="manual"
export GW_WATCHDOG_FAIL_THRESHOLD=2
export GW_WATCHDOG_COOLDOWN_SECONDS=300

Delivery priority:

DISCORD_WEBHOOK_URL
DISCORD_BOT_TOKEN + DISCORD_CHANNEL_ID

### macOS background mode (LaunchAgent)

Install LaunchAgent (does not edit OpenClaw core config):

bash "{baseDir}/scripts/install-launchd.sh" --interval 30 --load

Check status:

launchctl list | rg "com.openclaw.gateway-watchdog"

### OpenClaw cron mode (internal path)

Use isolated job and keep messaging in one channel:

openclaw cron add \\
  --name "gateway-watchdog-internal" \\
  --cron "*/1 * * * *" \\
  --session isolated \\
  --message "Run bash {baseDir}/scripts/gateway-watchdog.sh and report state changes only." \\
  --announce \\
  --channel discord \\
  --to "channel:<your_channel_id>" \\
  --best-effort-deliver

### Auto-recovery policy (opt-in)

Enable bounded restart:

export GW_WATCHDOG_ENABLE_RESTART=1
export GW_WATCHDOG_MAX_RESTART_ATTEMPTS=2

Safety constraints:

restart only after failure threshold is met
max attempts enforced per incident window
no reinstall or destructive mutation

### Backup and audit artifacts

state file: ~/.openclaw/watchdogs/gateway-discord/state.json
state backups: ~/.openclaw/watchdogs/gateway-discord/backups/state-*.json
event log: ~/.openclaw/watchdogs/gateway-discord/events.jsonl

The script rotates old backups and keeps recent history for rollback/debugging.
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: JonathanJing
- Version: 1.0.2
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-23T16:43:11.935Z
- Expires at: 2026-04-30T16:43:11.935Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/openclaw-gateway-watchdog-skill)
- [Send to Agent page](https://openagent3.xyz/skills/openclaw-gateway-watchdog-skill/agent)
- [JSON manifest](https://openagent3.xyz/skills/openclaw-gateway-watchdog-skill/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/openclaw-gateway-watchdog-skill/agent.md)
- [Download page](https://openagent3.xyz/downloads/openclaw-gateway-watchdog-skill)