Agent skill

openclaw-guardian

Deploy and manage a Guardian watchdog process for OpenClaw Gateway. Provides automated health monitoring, self-repair via `doctor --fix`, git-based workspace rollback, daily snapshots, and optional Discord alerting. Use when a user wants to harden their OpenClaw instance against crashes, config corruption, or bad workspace edits — or when setting up Guardian for the first time on a new server/container.

Stars 1,878
Forks 294

Install this agent skill to your Project

npx add-skill https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/openclaw-guardian

SKILL.md

OpenClaw Guardian

Guardian is a standalone bash watchdog that keeps OpenClaw Gateway alive 24/7.

Repair ladder:

  1. Detect Gateway down (every 30s)
  2. Run openclaw doctor --fix (up to 3 attempts)
  3. If still down → git reset --hard to last stable commit, restart Gateway
  4. If all fails → cooldown 300s, resume monitoring
  5. Daily automatic git snapshot of workspace

Setup Steps

1. Initialize git (required for rollback)

bash
cd ~/.openclaw/workspace
git config --global user.email "guardian@example.com"
git config --global user.name "Guardian"
git init && git add -A && git commit -m "initial"

Skip if repo already exists. Without git, doctor --fix still works; rollback is skipped.

2. Install guardian.sh

Copy scripts/guardian.sh from this skill to ~/.openclaw/guardian.sh:

bash
cp scripts/guardian.sh ~/.openclaw/guardian.sh
chmod +x ~/.openclaw/guardian.sh

3. Start Guardian

Container / no systemd (nohup):

bash
nohup ~/.openclaw/guardian.sh >> /tmp/openclaw-guardian.log 2>&1 &

Linux VPS with systemd: See references/setup.md → Pattern B.

4. Auto-start on container restart

Add to ~/.openclaw/start-gateway.sh (before the final exec line):

bash
pkill -f "guardian.sh" 2>/dev/null || true
nohup /home/ubuntu/.openclaw/guardian.sh >> /tmp/openclaw-guardian.log 2>&1 &

5. Optional: Discord alerts

bash
export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..."

Or add to start-gateway.sh as a persistent export.

Verify

bash
pgrep -a -f "guardian.sh"          # confirm process running
tail -f /tmp/openclaw-guardian.log  # watch live logs

Configuration

All settings via environment variables. Defaults work out of the box. See references/setup.md for full variable reference, systemd config, and architecture diagram.

Notes

  • Guardian coexists with gw-watchdog.sh — run both for layered resilience
  • Rollback targets the 2nd-newest non-auto commit (skips daily-backup, rollback, auto-backup commits)
  • Log path: /tmp/openclaw-guardian.log

Expand your agent's capabilities with these related and highly-rated skills.

LeoYeAI/openclaw-master-skills

audit-website

Audit websites for SEO, performance, security, technical, content, and 15 other issue cateories with 230+ rules using the squirrelscan CLI. Returns LLM-optimized reports with health scores, broken links, meta tag analysis, and actionable recommendations. Use to discover and asses website or webapp issues and health.

1,878 294
Explore
LeoYeAI/openclaw-master-skills

firecrawl

Web search and scraping via Firecrawl API. Use when you need to search the web, scrape websites (including JS-heavy pages), crawl entire sites, or extract structured data from web pages. Requires FIRECRAWL_API_KEY environment variable.

1,878 294
Explore
LeoYeAI/openclaw-master-skills

computer-use

Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag, etc). Unlike OpenClaw's browser tool, operates at the X11 level so websites cannot detect automation. Includes VNC for live viewing.

1,878 294
Explore
LeoYeAI/openclaw-master-skills

social-media-analyzer

Social media campaign analysis and performance tracking. Calculates engagement rates, ROI, and benchmarks across platforms. Use for analyzing social media performance, calculating engagement rate, measuring campaign ROI, comparing platform metrics, or benchmarking against industry standards.

1,878 294
Explore
LeoYeAI/openclaw-master-skills

business-growth-skills

4 production-ready business and growth skills: customer success manager with health scoring and churn prediction, sales engineer with RFP analysis, revenue operations with pipeline and GTM metrics, and contract & proposal writer. Python tools included (all stdlib-only). Works with Claude Code, Codex CLI, and OpenClaw.

1,878 294
Explore
LeoYeAI/openclaw-master-skills

contract-and-proposal-writer

Contract & Proposal Writer

1,878 294
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results