Install
openclaw skills install runbook-automatorConvert manual incident runbooks into automated, executable playbooks. Parse existing runbooks, generate scripts for each step, add health checks, rollback procedures, and notification hooks.
openclaw skills install runbook-automatorTransform manual runbooks into automated, executable playbooks. Parse existing documentation, generate step-by-step scripts with health checks, decision points, rollback procedures, and notification hooks — so incidents get resolved faster with less human intervention.
Use when: "automate this runbook", "convert runbook to script", "make this playbook executable", "incident automation", "turn this wiki page into a script", or when building on-call automation.
convert — Parse Runbook and Generate AutomationRead the input runbook (markdown, Confluence wiki, Google Doc, plain text) and extract:
For each step in the runbook, classify as:
| Type | Example | Automation |
|---|---|---|
| Command | "Run kubectl rollout restart" | Direct script execution |
| Check | "Verify pods are running" | Script with assertion |
| Decision | "If error rate > 5%, proceed to step 4" | Conditional branch |
| Manual | "Call the database team" | Notification + pause |
| Observation | "Watch the dashboard for 10 minutes" | Timed wait + metric check |
#!/usr/bin/env bash
set -euo pipefail
# ============================================
# Automated Runbook: [Title]
# Generated from: [source document]
# Last updated: [date]
# ============================================
SLACK_WEBHOOK="${SLACK_WEBHOOK:-}"
PAGERDUTY_KEY="${PAGERDUTY_KEY:-}"
DRY_RUN="${DRY_RUN:-false}"
log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*"; }
notify() {
log "NOTIFY: $1"
if [[ -n "$SLACK_WEBHOOK" ]]; then
curl -s -X POST "$SLACK_WEBHOOK" -H 'Content-Type: application/json' \
-d "{\"text\": \"🔧 Runbook: $1\"}" > /dev/null
fi
}
fail() { notify "❌ FAILED at step $1: $2"; exit 1; }
# --- Step 1: [Name] ---
step_1() {
log "Step 1: [description]"
if [[ "$DRY_RUN" == "true" ]]; then
log "DRY RUN: would execute [command]"
return 0
fi
# [actual command]
[command] || fail 1 "[error description]"
# Verify
[verification command] || fail 1 "Verification failed"
log "Step 1: ✅ Complete"
}
# --- Step 2: [Decision Point] ---
step_2() {
log "Step 2: Checking [condition]"
local metric
metric=$([check command])
if (( $(echo "$metric > 5" | bc -l) )); then
log "Threshold exceeded ($metric > 5) — escalating"
step_2a # escalation path
else
log "Within bounds ($metric <= 5) — continuing"
step_3
fi
}
# --- Rollback ---
rollback() {
notify "🔄 Rolling back..."
log "Rollback: [undo commands]"
[rollback command 1]
[rollback command 2]
notify "Rollback complete"
}
trap 'rollback' ERR
# --- Execute ---
notify "Starting runbook: [Title]"
step_1
step_2
# ... remaining steps
notify "✅ Runbook complete"
analyze — Audit Existing Runbooks for GapsRead all runbooks in a directory and flag:
# Find runbook-like documents
find . -maxdepth 3 \( -name "*.md" -o -name "*.txt" -o -name "*.adoc" \) | \
xargs grep -li "runbook\|playbook\|incident\|on-call\|troubleshoot" 2>/dev/null
For each runbook, check:
Output a coverage report:
# Runbook Audit Report
| Runbook | Steps | Automated | Rollback | Verified | Gaps |
|---------|-------|-----------|----------|----------|------|
| DB Failover | 8 | 3/8 (38%) | ✅ | 5/8 | Stale hostname in step 4 |
| API Scale-Up | 5 | 5/5 (100%) | ❌ Missing | 4/5 | No rollback procedure |
| Cache Flush | 3 | 2/3 (67%) | ✅ | 3/3 | Step 2 references removed tool |
test — Dry-Run a Generated PlaybookExecute the generated script with DRY_RUN=true:
template — Generate Runbook TemplateGiven an incident type (database, network, application, security), generate a structured template with: