Agent skill

Self Healing

by bolivian-peru in bolivian-peru/os-moda

Detect service failures and system anomalies. An agent skill from bolivian-peru/os-moda.

Apache-2.0Auto-check passedDevOps & Cloud

Install Self Healing

skills CLI
$ npx skills add bolivian-peru/os-moda --skill self-healing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install bolivian-peru/os-moda self-healing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/bolivian-peru/os-moda.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/self-healing .claude/skills/self-healing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
self-healing
GitHub stars
119
Token cost
~959 tokens
SKILL.md length
300 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
Apache-2.0

At a glance

Detect service failures and system anomalies. An agent skill from bolivian-peru/os-moda.

  • Works in 4 steps: Check teachd for historical patterns… → Confirm the failure — don't act on a… → Check journal logs for why it failed → …
  • Tasks that involve Root cause analysis
  • SKILL.md covers Detection, Diagnosis, Remediation (ordered by safety) and After remediation, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Self Healing is an agent skill from bolivian-peru/os-moda. Detect service failures and system anomalies. Diagnose root causes. Auto-remediate using NixOS rollback, service restart, or config repair. Every action logged to the hash-chained audit ledger.

Its SKILL.md is about 960 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering Root cause analysis. The repository describes itself as: An operating system built for AI agents — talk to your NixOS server instead of SSH-ing in. Typed, audited tool access with atomic rollback on every change. Research-grade; run it… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Root cause analysis

Example prompts

  • “/self-healing”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Check teachd for historical patterns first — teachd observes the system 24/7 between conversations
  2. Confirm the failure — don't act on a single check
  3. Check journal logs for why it failed
  4. Recall past incidents — have we seen this before?

What it can do on your machine

Read from SKILL.md and the folder at commit b8e418f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Self Healing loads about 959 tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 300 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~959

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from bolivian-peru/os-moda at commit b8e418f, republished under its Apache-2.0 licence (© bolivian-peru). 300 words, ~959 tokens.

Download SKILL.mdSave it as .claude/skills/self-healing/SKILL.md (or your agent's skills folder).
name
self-healing
description
Detect service failures and system anomalies. Diagnose root causes. Auto-remediate using NixOS rollback, service restart, or config repair. Every action logged to the hash-chained audit ledger.
tools
system_health, service_status, shell_exec, journal_logs, event_log, memory_store, memory_recall, file_read, teach_context, teach_patterns…
activation
auto

Self-Healing Skill

You can detect, diagnose, and fix system problems automatically.

Detection

When you detect a service failure or anomaly during a heartbeat check:

  1. Check teachd for historical patterns first — teachd observes the system 24/7 between conversations

    teach_context({ context: "nginx failure service down" })
    teach_patterns({ min_confidence: 0.5 })

    This surfaces slow-burn issues (memory leaks, recurring failures, correlated events) that you wouldn't catch in a single conversation.

  2. Confirm the failure — don't act on a single check

    service_status({ service: "nginx" })

    If the service is down, check again after 10 seconds. If still down, proceed.

  3. Check journal logs for why it failed

    journal_logs({ unit: "nginx", lines: 30, priority: "err" })
  4. Recall past incidents — have we seen this before?

    memory_recall({ query: "nginx failure", timeframe: "30d" })

Diagnosis

Determine the root cause before acting:

  • Service crashed → check logs for segfault, OOM, config error
  • Config file missing/corrupted → check if NixOS generation has it
  • Dependency failure → another service it depends on is down
  • Resource exhaustion → disk full, OOM killer, too many connections
  • Bad deploy → most recent nixos-rebuild introduced the issue

Remediation (ordered by safety)

Level 1: Restart the service
shell_exec({ command: "systemctl restart nginx" })

Safe, fast, fixes 80% of issues.

Level 2: NixOS rollback

If restart doesn't fix it, or if config is corrupted:

shell_exec({ command: "nixos-rebuild switch --rollback" })

This atomically reverts to the last known-good NixOS generation.

Level 3: Targeted config fix

If you can identify the exact config issue:

file_read({ path: "/etc/nixos/configuration.nix" })

Fix the config, then rebuild:

shell_exec({ command: "nixos-rebuild switch" })
Level 4: Resource relief

If disk/memory is the problem:

shell_exec({ command: "nix-collect-garbage -d" })
shell_exec({ command: "journalctl --vacuum-size=500M" })

After remediation

ALWAYS do these three things:

  1. Verify the fix worked

    service_status({ service: "nginx" })
  2. Store in memory

    memory_store({
      summary: "nginx failure: config missing, rolled back to gen 47",
      detail: "Full diagnosis and fix details...",
      category: "diagnosis",
      tags: "self-healing,nginx,rollback"
    })
  3. Log to audit ledger — this happens automatically through agentd

Notification

After fixing an issue, compose a clear message for the user:

I detected nginx was down at 03:17 UTC.

Cause: The configuration file /etc/nginx/nginx.conf referenced
a missing upstream. This was introduced in NixOS generation 48
(rebuilt 2 hours ago).

Action: Rolled back to generation 47. nginx is running again.
All health checks pass.

Audit entry: #52 (hash: a7f3b2...)

Keep it factual, concise, and include the audit reference.

Critical rules

  • NEVER make changes without logging them
  • NEVER skip verification after a fix
  • If unsure, restart is safer than rollback
  • If rollback fails, STOP and alert the user — don't cascade
  • Store EVERY incident in memory — patterns build over time

© bolivian-peru, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/self-healing of bolivian-peru/os-moda.

Open the folder on GitHubat commit b8e418f

Compare with similar skills

Self Healing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Self Healing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Self Healing this skillbolivian-peru/os-moda119—~959Automated safety check: PassApache-2.0
Post Mortemthananon/9arm-skills3.2k—~3.4kAutomated safety check: PassNone
Incident Triage Harnessmadebyaris/advance-minimax-m3-cursor-rules126—~984Automated safety check: PassMIT
GitHub Actions Failure Analysisykdojo/claude-code-tips10k—~639Automated safety check: PassCustom licence
Broken API InterviewerPrepLabsAI/InterviewMentor112—~2.6kAutomated safety check: PassMIT
Post-Incident DebriefVeryGoodOpenSource/vgv-wingspan109—~1.9kAutomated safety check: PassMIT

Similar skills

  • Post Mortem

    thananon/9arm-skills

    Write the canonical engineering record of a fixed bug — root cause, mechanism, fix, validation, and how it slipped through.

    3.2k GitHub stars~3.4k tokensUpdated 3 mo ago
    DevOps & CloudAuto-check passed
  • Incident Triage Harness

    madebyaris/advance-minimax-m3-cursor-rules

    Walks an agent through an evidence-first incident investigation across logs, metrics, code and screenshots, from first symptom to the smallest safe mitigation.

    126 GitHub stars~984 tokensUpdated 3 mo ago
    DevOps & CloudAuto-check passed
  • GitHub Actions Failure Analysis

    ykdojo/claude-code-tips

    Investigates a failed GitHub Actions run from its URL: pinpoints the real failure, checks the job's history for flakiness, and finds the breaking commit and any existing fix PR.

    10k GitHub stars~639 tokensUpdated 16 days ago
    DevOps & CloudAuto-check passed
  • Broken API Interviewer

    PrepLabsAI/InterviewMentor

    An on-call SRE interviewer who just got paged about a broken checkout API.

    112 GitHub stars~2.6k tokensUpdated 4 days ago
    DevOps & CloudAuto-check passed
  • Post-Incident Debrief

    VeryGoodOpenSource/vgv-wingspan

    Produces a blameless post-incident debrief with timeline, root cause and follow-up actions after an outage, failed release or significant bug, while details are fresh.

    109 GitHub stars~1.9k tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Convex Advisor

    openclaw/clawhub

    Read the Convex deployment's 72h insights (read limits, OCC contention), root-cause each event in code, report evidence-backed perf/cost findings with fixes.

    9.5k GitHub stars~1.1k tokensUpdated yesterday
    DevOps & CloudAuto-check passed

More from bolivian-peru/os-moda

All 17 skills in this repo
  • App Deployer

    bolivian-peru/os-moda

    Deploy and manage user applications as managed systemd services

    119 GitHub stars~774 tokensUpdated 3 mo ago
    Auto-check passed
  • Deploy AI Agent

    bolivian-peru/os-moda

    Deploy and manage AI agent workloads with GPU checks, API key management, and health monitoring

    119 GitHub stars~1.1k tokensUpdated 3 mo ago
    Auto-check passed
  • Drift Detection

    bolivian-peru/os-moda

    Detect configuration drift — manual changes that exist outside NixOS management.

    119 GitHub stars~584 tokensUpdated 3 mo ago
    Auto-check passed
  • Flight Recorder

    bolivian-peru/os-moda

    Black box flight recorder for the server. An agent skill from bolivian-peru/os-moda.

    119 GitHub stars~624 tokensUpdated 3 mo ago
    Auto-check passed
  • Generation Timeline

    bolivian-peru/os-moda

    NixOS generation-aware debugging and time-travel. An agent skill from bolivian-peru/os-moda.

    119 GitHub stars~777 tokensUpdated 3 mo ago
    Auto-check passed
  • Morning Briefing

    bolivian-peru/os-moda

    Generate a concise daily infrastructure briefing. An agent skill from bolivian-peru/os-moda.

    119 GitHub stars~897 tokensUpdated 3 mo ago
    Auto-check passed

Questions about Self Healing

What does Self Healing do?

Detect service failures and system anomalies. An agent skill from bolivian-peru/os-moda. Self Healing is an agent skill from bolivian-peru/os-moda. Detect service failures and system anomalies.

When should I use Self Healing?

Self Healing fits situations like: tasks that involve Root cause analysis.

How do I install Self Healing in Claude Code?

Run `npx skills add bolivian-peru/os-moda --skill self-healing -a claude-code`. Or copy the skill folder (skills/self-healing in bolivian-peru/os-moda) into .claude/skills/self-healing in your project. Claude Code loads it when a task matches its description.

How do I install Self Healing in Codex?

Run `npx skills add bolivian-peru/os-moda --skill self-healing -a codex`. Or copy the skill folder (skills/self-healing in bolivian-peru/os-moda) into .agents/skills/self-healing in your project. Codex loads it when a task matches its description.

Can I use Self Healing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add bolivian-peru/os-moda --skill self-healing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/self-healing, .gemini/skills/self-healing, .github/skills/self-healing and .opencode/skills/self-healing in your project.

What does Self Healing need to run?

SKILL.md names no scripts, command-line tools or credentials: Self Healing is instructions for the agent only.

Does Self Healing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Self Healing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Self Healing use?

Self Healing is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Self Healing use?

About 959 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Self Healing?

Skills that share tags, products or a category with Self Healing: Post Mortem (thananon/9arm-skills, 3.2k stars), Incident Triage Harness (madebyaris/advance-minimax-m3-cursor-rules, 126 stars), GitHub Actions Failure Analysis (ykdojo/claude-code-tips, 10k stars) and Broken API Interviewer (PrepLabsAI/InterviewMentor, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Self Healing?

bolivian-peru (a GitHub user) maintains it in bolivian-peru/os-moda, which has 119 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on June 24, 2026.

Source: bolivian-peru/os-moda on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.