
Openclaw Self Healing
Keep OpenClaw shell automation healthy with CI ShellCheck, bash syntax gates, and repeatable self-healing workflows when scripts break in production.
Overview
Openclaw Self-Healing is an agent skill most often used in Operate (also Ship) that enforces ShellCheck and bash syntax CI on shell scripts so OpenClaw automation can be repaired and re-validated without ad-hoc manual hu
Install
npx skills add https://github.com/ramsbaby/openclaw-self-healing --skill openclaw-self-healingWhat is this skill?
- GitHub Actions workflow runs ShellCheck at warning level on real `#!` shell scripts under `scripts/`
- Separate lint job runs `bash -n` across all `.sh` files in the repo with fail-fast reporting
- Skips non-shell payloads (e.g. base64-encoded files) via shebang probe before ShellCheck
- Pairs static analysis with syntax validation for defense-in-depth on bash maintenance
- ShellCheck runs at `-S warning` with `-e SC2317` on shebang-backed scripts
- Lint job scans all `*.sh` files except `.git` paths with `bash -n`
Adoption & trust: 871 installs on skills.sh; 37 GitHub stars; 0/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent or deploy scripts fail in CI or production and you lack a repeatable lint-and-syntax gate before merges.
Who is it for?
Indie maintainers of bash-driven OpenClaw tooling who want CI to catch script drift on every push and PR.
Skip if: Teams that need no shell maintenance, only TypeScript app logic, or a skill with full self-healing runbooks when the repo readme is only partial CI YAML.
When should I use this skill?
Maintaining or fixing OpenClaw shell scripts and wanting CI-aligned ShellCheck plus bash syntax validation.
What do I get? / Deliverables
Shell scripts get ShellCheck and `bash -n` coverage in CI with clear pass/fail output so you can fix and re-run merges confidently.
- Passing ShellCheck and `bash -n` CI logs for shell scripts
- Documented skip rules for non-shell files in `scripts/`
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Self-healing and script repair sit in Operate because they run after deploy when automation fails; canonical shelf is iterate for fix-and-harden loops. Iterate covers tightening scripts and CI after incidents—not first-time greenfield build.
Where it fits
Add a new `scripts/deploy.sh` and mirror the skill’s ShellCheck exclusions before first merge.
Wire PR checks so every `.sh` file passes `bash -n` before release tags.
After a failed nightly job, re-run the documented lint sequence to isolate syntax vs ShellCheck warnings.
How it compares
Ops-focused script CI gates—not a React Three Fiber or vector-database migration playbook.
Common Questions / FAQ
Who is openclaw-self-healing for?
Solo and indie builders maintaining OpenClaw-related shell automation who want agents to follow the same ShellCheck and bash syntax checks their GitHub Actions enforce.
When should I use openclaw-self-healing?
During Ship when adding CI quality gates on `.sh` files; during Operate when a deploy or agent hook fails and you need systematic script validation; during Build when authoring new `scripts/*.sh` under OpenClaw.
Is openclaw-self-healing safe to install?
Review the Security Audits panel on this Prism page and inspect the skill sources in your repo before letting an agent run shell or CI-changing steps.
SKILL.md
READMESKILL.md - Openclaw Self Healing
name: ShellCheck on: push: branches: [main] pull_request: branches: [main] jobs: shellcheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install ShellCheck run: sudo apt-get install -y shellcheck - name: Run ShellCheck run: | echo "🔍 Checking scripts..." # base64 인코딩된 파일 제외, 실제 쉘 스크립트만 검사 for f in scripts/*.sh; do if head -c 4 "$f" | grep -q "^#!"; then echo " checking $f" shellcheck -S warning -e SC2317 -x "$f" else echo " skipping $f (not a shell script)" fi done echo "✅ All scripts passed!" name: Lint on: [push, pull_request] jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Lint shell scripts run: | echo "🔍 Checking bash syntax for all .sh files..." FAILED=0 while IFS= read -r f; do if bash -n "$f"; then echo " ✅ OK: $f" else echo " ❌ FAIL: $f" FAILED=1 fi done < <(find . -name "*.sh" -not -path "./.git/*") if [[ $FAILED -ne 0 ]]; then echo "" echo "❌ One or more scripts have syntax errors." exit 1 fi echo "" echo "✅ All scripts passed bash -n syntax check." --- name: openclaw-self-healing version: 2.0.1 description: 4-tier autonomous self-healing system for OpenClaw Gateway with persistent learning, reasoning logs, and multi-channel alerts. Features Claude Code as Level 3 emergency doctor for AI-powered diagnosis and repair. metadata: { "openclaw": { "requires": { "bins": ["tmux", "claude", "jq"] }, "install": [ { "id": "tmux", "kind": "brew", "package": "tmux", "bins": ["tmux"], "label": "Install tmux (brew)", }, { "id": "claude", "kind": "node", "package": "@anthropic-ai/claude-code", "bins": ["claude"], "label": "Install Claude Code CLI (npm)", }, { "id": "jq", "kind": "brew", "package": "jq", "bins": ["jq"], "label": "Install jq (brew) - for metrics dashboard", }, ], }, } --- # OpenClaw Self-Healing System > **"The system that heals itself — or calls for help when it can't."** A 4-tier autonomous self-healing system for OpenClaw Gateway. ## Architecture ``` Level 1: Watchdog (180s) → Process monitoring (OpenClaw built-in) Level 2: Health Check (300s) → HTTP 200 + 3 retries Level 3: Claude Recovery → 30min AI-powered diagnosis 🧠 Level 4: Discord Alert → Human escalation ``` ## What's Special (v2.0) - **World's first** Claude Code as Level 3 emergency doctor - **Persistent Learning** - Automatic recovery documentation (symptom → cause → solution → prevention) - **Reasoning Logs** - Explainable AI decision-making process - **Multi-Channel Alerts** - Discord + Telegram support - **Metrics Dashboard** - Success rate, recovery time, trending analysis - Production-tested (verified recovery Feb 5-6, 2026) - macOS LaunchAgent integration ## Quick Setup ### 1. Install Dependencies ```bash brew install tmux npm install -g @anthropic-ai/claude-code ``` ### 2. Configure Environment ```bash # Copy template to OpenClaw config directory cp .env.example ~/.openclaw/.env # Edit and add your Discord webhook (optional) nano ~/.openclaw/.env ``` ### 3. Install Scripts ```bash # Copy scripts cp scripts/*.sh ~/openclaw/scripts/ chmod +x ~/openclaw/scripts/*.sh # Install LaunchAgent cp launchagent/com.openclaw.healthcheck.plist ~/Library/LaunchAgents/ launchctl load ~/Library/LaunchAgents/com.opencla