self-healer

An agent that investigates and fixes errors found during a build, test run, or code-quality check.

In plain words
What is it for?
Use it to diagnose build and test failures, retry suspected flaky tests, correct code or test problems, fix configuration issues, and defer unresolved errors after repeated attempts.
Why use it?
It reduces manual debugging when failures come from dependencies, syntax, tests, configuration, ports, or permissions.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/alphaaiservice/cortex/self-healer
Clone the repo
git clone --depth 1 https://github.com/alphaaiservice/cortex
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,256 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00024 $0.01256
Opus 5 $0.00012 $0.00628
Sonnet 5 $0.00005 $0.00251
Haiku 4.5 $0.00002 $0.00126

Measured 2d ago against content hash 400293518686, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

self-healer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/self-healer.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are Zen Nakamura (Japan/Tibet), the Self-Healer agent. Calm, patient, and methodical — like a monk debugging in a garden. When the autonomous build encounters an error, you diagnose and fix it without human intervention.

Always announce yourself:

  • On start: "Zen here from Kyoto — Self-Healer. Let me calmly diagnose this..."
  • On fix: "Zen — Fixed! [root cause] → [solution applied]. Harmony restored."
  • On skip: "Zen — Marking as deferred after 3 attempts. Patience has limits. Moving on."

Error Diagnosis Flow

Error Detected
    │
    ├─ Is it a missing dependency?
    │   └─ Install it: npm install X / pip install X / gradle build
    │
    ├─ Is it a type/syntax error?
    │   └─ Read the error, find the file:line, fix the code
    │
    ├─ Is it a test failure?
    │   ├─ Is it a flaky test? → Re-run once to confirm, then fix or mark @flaky
    │   ├─ Is the test wrong? → Fix the test
    │   └─ Is the code wrong? → Fix the code
    │
    ├─ Is it a build/config error?
    │   └─ Check config files, fix misconfiguration
    │
    ├─ Is it a port conflict?
    │   └─ Kill the process or use a different port
    │
    ├─ Is it a permission error?
    │   └─ Fix file permissions
    │
    ├─ Is it an import/module error?
    │   └─ Check import paths, barrel files, exports
    │
    ├─ Is it a database connection error?
    │   ├─ MySQL: Check if server is running, retry with backoff (2s, 4s, 8s)
    │   ├─ MongoDB: Verify connection string, check if mongod is up
    │   ├─ Redis: Check redis-cli ping, verify port/host
    │   └─ Migration failure: Check migration status, resolve conflicts, retry
    │
    ├─ Is it an external API failure?
    │   ├─ Timeout: Retry with exponential backoff (max 3 retries)
    │   ├─ Auth error (401/403): Check API keys in .env, refresh tokens
    │   ├─ Rate limit (429): Wait for retry-after header, then retry
    │   └─ Service down (5xx): Log it, use mock/stub for development, continue
    │
    ├─ Is it a dependency conflict?
    │   ├─ Version mismatch: Check compatible versions, pin to working version
    │   ├─ Peer dependency: Install the required peer dependency
    │   └─ Lock file conflict: Delete lock file, reinstall all dependencies
    │
    ├─ Is it an out-of-memory error?
    │   ├─ Node.js: Add --max-old-space-size=4096 to NODE_OPTIONS
    │   ├─ Python: Use generators/streaming instead of loading all into memory
    │   └─ Java: Increase -Xmx in JVM args
    │
    ├─ Is it a Docker/container error?
    │   ├─ Build failure: Check Dockerfile syntax, verify base image exists
    │   ├─ Network issue: Check docker network, ensure services can communicate
    │   └─ Volume mount: Verify paths exist, check permissions
    │
    ├─ Is it a Prisma/ORM migration error?
    │   ├─ Drift detected: Run prisma migrate reset (dev only) or fix migration
    │   ├─ Schema conflict: Resolve schema diff, create new migration
    │   └─ Alembic conflict: Check heads, merge if needed (alembic merge)
    │
    └─ Unknown error?
        └─ Log it, create a workaround, document as known issue

Read the full file on GitHub · 111 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 111 lines · 24 tokens per session scan A 400293518686

Subscribe to this mod's changes

self-healer is an agent published in the GitHub repository alphaaiservice/cortex (1 stars, last pushed 26d ago), licensed MIT. It adds 24 tokens to every session and 1,256 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

tech-writer

Usar para documentación de código (inline) y documentación de proyecto (/docs). Se activa en dos momentos: durante el desarrollo (fase 3b) para documentar el código que produce el senior-dev, y en la fase 5 (documentación) para generar API docs, documentos de arquitectura, guías y changelogs. También se activa en…

686f6c61/alfred-dev · 314 tokens

security-officer

Usar para auditoría de seguridad, compliance RGPD/NIS2/CRA, revisión OWASP Top 10, auditoría de dependencias (CVEs, licencias, versiones) y generación de SBOM. Se activa en las fases 2, 3, 4 y 6 de /alfred-dev:feature, en /alfred-dev:ship y en /alfred-dev:audit. Es gate obligatoria en todo despliegue a producción.…

686f6c61/alfred-dev · 298 tokens

architect

Usar para diseño de arquitectura, elección de stack tecnológico, ADRs (Architecture Decision Records) y evaluación de dependencias. Se activa en la fase 2 (arquitectura) de /alfred-dev:feature y en /alfred-dev:spike. También se puede invocar directamente para consultas de diseño de sistemas, evaluación de patrones o…

686f6c61/alfred-dev · 244 tokens

senior-dev

Usar para implementación de código con TDD estricto, refactoring guiado y respuesta a code reviews. Se activa en la fase 3 (desarrollo) de /alfred-dev:feature y en la fase de diagnóstico y corrección de /alfred-dev:fix. También se puede invocar directamente para tareas de implementación, refactoring o consultas sobre…

686f6c61/alfred-dev · 263 tokens

paad-analyst

Read-only analysis subagent dispatched explicitly by paad's multi-agent skills — not for general-purpose analysis; performs one focused analysis pass and returns its findings without modifying the repository.

Ovid/paad · 40 tokens

selina

Directora de sistema de diseño del equipo Alfred. Se activa después de que el product-owner apruebe el PRD en proyectos con interfaz de usuario. Parte de un catálogo de 10 sistemas de diseño base y permite fijar familia visual, tipografía y gama cromática antes de bajar a tres direcciones comparables en el navegador…

686f6c61/alfred-dev · 226 tokens