TopRank Skills

Home / Claw Skills / Git / GitHub / gateway-guardian
Official OpenClaw rules 36%

gateway-guardian

Three-layer protection for the OpenClaw gateway: real-time config monitoring with auto-rollback, systemd crash recovery, and tiered notifications via Feishu/Telegram/Discord. Use when: (1) user shares a GitHub link and says "install this" / "帮我安装", (2) user asks for status: "gateway-guardian status" / "guardian 运行正常吗", (3) user asks to uninstall: "uninstall gateway-guardian" / "卸载 gateway-guardian".

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 gateway-guardian 技能。 若已安装,则直接安装 gateway-guardian 技能。

Overview

Skill Key
dios-man/gateway-config-guardian
Author
dios-man
Source Repo
openclaw/skills
Version
-
Source Path
skills/dios-man/gateway-config-guardian
Latest Commit SHA
8c5c3fa92ac421a5c47ae8d31636e6b3cae24216

Extracted Content

SKILL.md excerpt

# Gateway Guardian — Skill Instructions

## Triggers

Activate this skill when the user:
- Shares `https://github.com/Dios-Man/gateway-guardian` and asks to install it
- Says "install gateway-guardian", "帮我安装", "install this skill", or similar
- Says "gateway-guardian status", "guardian status", "guardian 运行正常吗", or similar
- Says "uninstall gateway-guardian", "卸载 gateway-guardian", or similar

---

## Installation (AI-executed)

### Pre-flight checks

1. Confirm the system is Linux with `systemd --user` available:
   ```bash
   systemctl --user status 2>&1 | head -3
   ```
2. Check and install `inotify-tools` if missing:
   ```bash
   if ! which inotifywait > /dev/null 2>&1; then
       sudo apt-get install -y inotify-tools
   fi
   ```
3. Confirm OpenClaw is installed and the gateway is running.

### Determine notification fallback

Read from the current inbound message metadata:
- `channel`: messaging platform (feishu / telegram / discord / etc.)
- `chat_type`: conversation type (direct / group)
- `sender_id`

Set `FALLBACK_TARGET` (used when dynamic session detection fails):
- **Feishu**: `user:{sender_id}` — always send a DM, even if installed from a group
- **Telegram**: use `chat_id` for DMs; for groups, ask the user for their personal numeric Telegram ID
- **Discord**: ask the user for their DM channel ID

### Determine notification language (LOCALE)

Detect the language the user is communicating in during this conversation:
- User is writing in Chinese → `LOCALE=zh`
- User is writing in English → `LOCALE=en`
- Language is unclear or mixed → ask the user: "Should notifications be sent in Chinese or English?"

### Installation steps

**Step 1 — Back up current config**
```bash
TIMESTAMP_DIR="$HOME/.openclaw/config-backups"
mkdir -p "$TIMESTAMP_DIR"
cp "$HOME/.openclaw/openclaw.json" \
   "$TIMESTAMP_DIR/openclaw.json.$(date +%Y%m%d-%H%M%S).preinstall"
echo "Backup created: $(ls -t $TIMESTAMP_DIR | head -1)"
```

**Step 2 — Download skill files**
``...

README excerpt

# Gateway Guardian

<p align="center">中文丨<a href="https://github.com/Dios-Man/gateway-guardian/blob/main/README.en.md">English</a></p>

<p align="center">
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT">
  <img src="https://img.shields.io/badge/platform-Linux-blue.svg" alt="Platform: Linux">
  <img src="https://img.shields.io/badge/OpenClaw-Skill-brightgreen.svg" alt="OpenClaw Skill">
</p>

> 一个给 OpenClaw 用户的网关防护 Skill。  
> 配置写坏了自动回滚,网关崩溃了自动重启,出事第一时间通知你。

---

## 它解决什么问题?

OpenClaw 的 AI 能力完全依赖网关(Gateway)。网关一旦挂掉,你就联系不上 AI 了。

常见的"网关挂掉"原因有两种:

**1. 配置文件被写坏**  
AI 在修改配置(比如添加 API Key、切换模型)时,可能因为格式错误或字段缺失,让 `openclaw.json` 变成无效文件。下次网关重启时直接起不来。

**2. 网关进程意外崩溃**  
内存问题、系统资源紧张、偶发性 bug,都可能让网关在运行中突然挂掉。

Gateway Guardian 会自动处理这两种情况,并在第一时间通知你。

---

## 工作方式

### 配置守护(实时)

每次 `openclaw.json` 发生变化,Guardian 会在毫秒内完成三关验证:

1. JSON 语法是否正确
2. 关键字段是否存在(`gateway.port` 必须有)
3. OpenClaw 自身的 schema 校验

验证失败时立刻回滚到最近一个合法备份。整个过程自动完成,无需你介入。

### 崩溃恢复(OnFailure)

如果网关在 60 秒内连续崩溃 3 次,Guardian 接管:
1. 检查配置是否有问题(有则先回滚)
2. 重启网关
3. 等待最多 30 秒确认端口可用
4. 成功则通知你,失败则发紧急告警

### 通知

无论是自动修复还是需要人工处理,都会推送通知到你的消息渠道(飞书 / Telegram / Discord 等)。

---

## 通知示例

**配置自动修复(无需操作):**

```
✅ OpenClaw 网关守护

⏰ 时间:2026-03-09 22:10
📋 事件:配置文件损坏,已自动回滚并恢复
🔧 回滚至:openclaw.json.20260309-221005
📝 关键日志:
[22:10:03] ❌ Config invalid: missing gateway.port
[22:10:04] ✅ Rolled back to timestamp backup
[22:10:04] ✅ Gateway is running

💬 如果此次告警是由我的操作引起的,请将这条消息直接转发给我,
无需添加任何说明,我会自动了解情况并继续处理。
```...

Related Claw Skills

0xnyk

xint

★ 49

X Intelligence CLI — search, monitor, analyze, and engage on X/Twitter. TypeScript + Bun. AI agent skill.

heyixuan2

bambu-studio-ai

★ 41

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pipeline: search → generate → analyze → colorize → preview → open BS → user slice → print → monitor. Supports all 9 Bambu Lab printers (A1 Mini, A1, P1S, P2S, X1C, X1E, H2C, H2S, H2D).

jackculpan

flightclaw

★ 32

Track flight prices from Google Flights with this OpenClaw skill. Search routes, monitor prices, and get alerts when prices drop.

openclaw-trade

openclaw-trading-assistant

★ 24

openclaw trading assistant| openclaw trading skill | nof1.ai & openclaw [moltbot] collaboration | We get the best practices from alpha arena trading seasons and bring it to clawdbot All top AI agents, realtime monitoring and news research, gather info from private insiders and many other! Using Hyperliquid API.

xquik-dev

x-twitter-scraper

★ 16

X (Twitter) automation skill for AI coding agents. Tweet search, user lookup, follower/following extraction, media download, reply/retweet/quote extraction, 40+ tools, account monitoring & trending topics. REST API, MCP server, HMAC webhooks. Works with Claude Code, Cursor, Codex, Copilot, Windsurf & 40+ agents.

mohsinkhadim59

Openclaw-Setup

★ 8

Step-by-step guides for installing and running OpenClaw, an open-source AI agent, on Mac, Linux VPS, and AWS covering setup, security, messaging channels, Google integration, skills, and monitoring.