Skip to content
Back to skills

Agent Defibrillator

BSecurity

Watchdog that monitors your AI agent gateway and restarts it when it crashes. Triggers on "install defibrillator", "agent watchdog", "gateway monitor", "auto-restart agent", or "keep agent alive". macOS launchd service with optional Discord notifications.

  • 21 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 7, 2026
toolsgobashgit

Security analysis

B88/100
  • criticalModifies startup scripts or system services for persistence

Pro scans all 4 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill agent-defibrillator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Defibrillator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Defibrillator
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-agent-defibrillator/badge)](https://www.skillsdirectory.com/skills/modbender-agent-defibrillator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-defibrillator
description: Watchdog that monitors your AI agent gateway and restarts it when it crashes. Triggers on "install defibrillator", "agent watchdog", "gateway monitor", "auto-restart agent", or "keep agent alive". macOS launchd service with optional Discord notifications.
---

# Agent Defibrillator

Watchdog service that monitors your AI agent gateway and restarts it when it crashes.

## What It Does

- Checks gateway health every 10 minutes
- Detects crashes and stale processes
- Auto-restarts with cooldown protection
- Optional Discord notifications on restart
- Detects version mismatches after updates

## Install

**Recommended (review code first):**
```bash
git clone https://github.com/hazy2go/agent-defibrillator.git
cd agent-defibrillator
./install.sh
```

## Verify

```bash
launchctl list | grep defib
```

## Configure

Edit `~/.openclaw/scripts/defibrillator.sh`:

| Variable | Default | Description |
|----------|---------|-------------|
| `DEFIB_GATEWAY_LABEL` | `ai.openclaw.gateway` | launchd service label |
| `DEFIB_RETRY_DELAY` | `10` | Seconds between retries |
| `DEFIB_MAX_RETRIES` | `3` | Retries before restart |
| `DEFIB_COOLDOWN` | `300` | Seconds between restarts |
| `DISCORD_CHANNEL` | (empty) | Your channel ID for notifications |

## Commands

```bash
# View logs
tail -f ~/.openclaw/logs/defibrillator.log

# Manual check
~/.openclaw/scripts/defibrillator.sh

# Stop watchdog
launchctl bootout gui/$(id -u)/com.openclaw.defibrillator

# Restart watchdog
launchctl kickstart -k gui/$(id -u)/com.openclaw.defibrillator
```

## Uninstall

```bash
launchctl bootout gui/$(id -u)/com.openclaw.defibrillator
rm ~/Library/LaunchAgents/com.openclaw.defibrillator.plist
rm ~/.openclaw/scripts/defibrillator.sh
```

## Requirements

- macOS (uses launchd)
- AI agent running via launchd (OpenClaw, etc.)

Files in this skill

  • README.md5.6 KB
  • SKILL.md1.9 KB
  • defibrillator.sh7.5 KB
  • install.sh4.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.