← 返回 Skills 市场
halfdeadcat

Gateway Restore

作者 halfdeadcat · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
62
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gateway-restore
功能描述
Restore a gateway to its last known-good configuration, or tag the current config as known-good. Use when a gateway config change breaks something and you ne...
使用说明 (SKILL.md)

Gateway Restore

Roll back a gateway config to the last known-good state, then restart safely with health checks and automatic rollback on failure.

Usage (as slash command or natural language)

  • /restore — restore the Slack gateway to known-good
  • /restore discord — restore the Discord gateway to known-good
  • /restore tag — tag the current Slack config as known-good
  • /restore tag discord — tag the current Discord config as known-good

How It Works

  1. Backs up the current (broken) config with a timestamped filename
  2. Copies the known-good.json over the live config
  3. Runs the appropriate safe restart script (safe-slack-restart.sh or safe-gateway-restart.sh)
  4. The safe restart script validates health and rolls back if the gateway doesn't come up

Tagging Known-Good

After any successful config change + restart, tag the current config:

bash skills/gateway-restore/scripts/gateway-restore.sh slack --tag-current
bash skills/gateway-restore/scripts/gateway-restore.sh discord --tag-current

This saves it as config-backups/known-good.json. Old tagged versions are also kept as known-good-TIMESTAMP.json.

Script Location

skills/gateway-restore/scripts/gateway-restore.sh

When Invoked via Slash Command

The command-bypass hook handles /restore slash commands automatically — the script runs detached without LLM involvement. You do NOT need to execute the script.

If the hook fires, simply reply confirming the restore is in progress. Do not call exec.

When Invoked via Natural Language

If the user asks to restore via natural language (not a slash command), THEN run the script:

setsid bash /home/swabby/repos/swabby-brain/skills/gateway-restore/scripts/gateway-restore.sh [slack|discord] [--tag-current] > /tmp/restore-output.log 2>&1 &
sleep 2 && cat /tmp/restore-output.log

Parse the request:

  • "restore" / "rollback" → slack gateway
  • "restore discord" → discord gateway
  • "restore tag" → tag current slack config as known-good

If the gateway restarts mid-exec (SIGTERM), that's expected — the restart succeeded.

安全使用建议
This skill appears to implement config backup/restore logic you would expect, but it contains developer-local paths (e.g. /home/swabby/...) and expects external restart scripts (safe-slack-restart.sh, safe-gateway-restart.sh). Before installing or running it: 1) Inspect the referenced restart scripts in $HOME/bin to ensure they do nothing unexpected or network-exfiltratory; 2) Update SKILL.md and invocation commands to point to the actual packaged script path (or adjust to your environment) and remove hard-coded /home/swabby references; 3) Test on a non-production instance to confirm behavior and rollback works; 4) Confirm who can invoke the slash command or hook (the doc mentions a command-bypass hook that runs the script detached) and restrict it if necessary; 5) If you lack confidence in the restart scripts, consider running the restore steps manually rather than granting automated execution. These inconsistencies are likely sloppy engineering, but they merit manual review before trusting the skill in production.
功能分析
Type: OpenClaw Skill Name: gateway-restore Version: 1.0.0 The skill bundle provides a legitimate utility for backing up, restoring, and tagging configuration files for Slack and Discord gateways. The bash script (gateway-restore.sh) performs standard file operations and executes local restart scripts, while the SKILL.md provides clear instructions for the AI agent to handle both slash commands and natural language requests without any signs of malicious intent or data exfiltration.
能力评估
Purpose & Capability
The script reads/writes gateway config files and calls restart scripts for Slack/Discord, which aligns with the "Gateway Restore" purpose. However the script and SKILL.md include hard-coded user-specific paths (e.g. /home/swabby paths and inclusion of /home/swabby/.npm-global in PATH) that don't match a generic, portable skill and suggest leftover developer-local assumptions.
Instruction Scope
SKILL.md tells the agent to run an absolute path (/home/swabby/repos/swabby-brain/...) when invoked via natural language even though the included script is at skills/gateway-restore/scripts/gateway-restore.sh; it also instructs the agent to detach/run the script and then cat /tmp/restore-output.log. These instructions reference files and locations outside the packaged skill (and reference a "command-bypass" hook that will run the script without LLM involvement), which is inconsistent and could cause unexpected behavior.
Install Mechanism
There is no install spec (instruction-only + included script). Nothing is downloaded or written by an installer, which is low-risk for installation mechanism. The included script will be written to disk as part of the skill bundle, which is expected for an instruction-only skill with a script.
Credentials
No credentials or env vars are requested. The script does operate on files under $HOME and expects restart scripts at $HOME/bin/*. That is proportionate to restoring local gateway configs, but the explicit addition of /home/swabby/.npm-global to PATH and hard-coded /home/swabby references are disproportionate and may break or misroute behavior on other systems.
Persistence & Privilege
always is false and the skill is user-invocable. The skill does not request persistent privileges or modify other skills' configuration. It does perform file writes (backups, replacing configs) and calls external restart scripts, which is expected for its function but requires the runtime user to have appropriate local permissions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gateway-restore
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gateway-restore 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the "gateway-restore" skill. - Allows fast rollback of gateway configuration to the last known-good state via slash command or natural language. - Supports tagging the current config as known-good for future restores. - Automatically restarts the gateway with health checks and can roll back again if restart fails. - Slash command `/restore` is handled automatically; natural language requests execute the restore script directly.
元数据
Slug gateway-restore
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Gateway Restore 是什么?

Restore a gateway to its last known-good configuration, or tag the current config as known-good. Use when a gateway config change breaks something and you ne... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 62 次。

如何安装 Gateway Restore?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gateway-restore」即可一键安装,无需额外配置。

Gateway Restore 是免费的吗?

是的,Gateway Restore 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gateway Restore 支持哪些平台?

Gateway Restore 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gateway Restore?

由 halfdeadcat(@halfdeadcat)开发并维护,当前版本 v1.0.0。

💬 留言讨论