error-fixer-loop
Recursive error-fix loop. Use when a bash command fails with a build/test/typecheck error, when the same class of error appears more than once, or when the…
от Andersonlimahw★ 19 звёзд на GitHub
Установить error-fixer-loop в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Error Fixer Loop
Every fixed error must reduce the chance of the same error returning. If the loop ends at the patch, it failed — even if the patch worked.
Recursive skill: it closes the cycle between execution, verification, and harness improvement. Each run produces evidence (error found, decision made, test run, rule created, harness adjusted) and leaves the system harder to break in the same way.
Reference pattern: Como Criar uma Skill Recursiva.
Trigger
Load this skill when ANY of these is true:
- A
bash/shelltool call returns output matching a known build/test/typecheck error pattern (seehooks/— they auto-inject a reminder). - The user says: "investigate this error", "fix this build", "test failed", "typecheck broken", "error keeps coming back".
- You are about to conclude a fix and have not yet written a persistent rule.
Do not load for:
- Transient network/permission errors (one-off, not repeatable).
- Errors in code owned by external vendors (no write access).
- Pure refactors with no failing signal (use
code-smellorarchitecture-deepenerinstead).
Protocol (non-negotiable)
Follow the steps in order. Skipping steps is the exact failure this skill prevents.
1. Capture the event
- Paste the exact command that failed.
- Paste the exact error output (trimmed to the relevant 50 lines).
- Note the working directory and exit code.
2. Declare the root cause in one sentence
Format: <Component> fails because <specific reason>, triggered by <minimal repro>.
If you cannot write this sentence yet, you are not at root cause — go back to step 1 with a tighter repro (see bug-diagnostics for repro-building techniques).
3. Classify the failure
Pick exactly one primary class. This decides where the fix lives.
| Class | Symptom | Where the fix belongs |
|---|---|---|
procedure |
Skill/agent didn't say to run the check | this SKILL.md or the calling skill |
missing-rule |
Project convention violated repeatedly | docs/rules/<topic>.md or AGENTS.md |
missing-test |
Bug escaped because no seam | test suite (add regression test) |
permission |
Tool denied, sandbox blocked, path forbidden | harness policy (~/.config/opencode/permission.json, Claude settings) |
observability |
No log, no checkpoint, no evidence | logging/checkpoint layer |
documentation |
Agent followed stale doc | doc file referenced by agent |
4. Apply the minimal fix
- Touch only what is load-bearing for the error.
- No drive-by improvements. No "while I'm here" refactors.
- Match existing style.
5. Run the relevant verification
- If a test exists: run it.
- If no test exists and the bug is repeatable: write a failing test first, then fix, then watch it pass.
- Always run
lintandtypecheckfor TS/JS projects (tsc --noEmit,biome check,eslint). - Paste the verification output in the final report.
6. Persist the rule
If the failure is repeatable (same class can appear again), write a rule. Use this decision tree:
Is it specific to THIS project?
├─ yes → docs/rules/<topic>.md in the project, link from AGENTS.md
└─ no → could other projects hit it?
├─ yes → this SKILL.md (anti-patterns section) or a new global rule
└─ no → record in the final report only; do NOT write a rule
Rule format (one line, operational, verifiable):
- **<Rule name>**: <imperative sentence>. Verify with: <command or check>.
Good: Never use as anyto silence a TS error without a// justified: comment. Verify with: grep -rn "as any" src/ | grep -v justified.
Bad: Be careful with types. (not operational, not verifiable)
7. Update the harness index
- If you wrote a rule in
docs/rules/, link it fromAGENTS.mdunder the relevant section. - If you updated this
SKILL.md, bump the version inplugin.jsonand note the change in the audit.
8. Generate the fix-prompt artifact
Write a dynamic fix-prompt file so the fix can be replayed, delegated, or audited later — even in another session or harness.
- Location:
.error-fixer-loop/<YYYYMMDD-HHMMSS>-<short-slug>.md(create the folder if missing; add it to.gitignoreif the project doesn't want it versioned). - Template: use
templates/fix-prompt.mdfrom this plugin. - Format: the file MUST follow the
senior-prompt-engineeroutput shape — Role/Context, Task, Inputs/files, Constraints, Plan with→ verify:per step, Output contract, Feedback DO, Feedback DO NOT, and a closingEXEC-MAP v1fenced block. - Slug: 3–6 lowercase words describing the error class (e.g.
ts2322-string-to-number,jest-module-not-found). - Fill placeholders with real values from steps 1–7. Never ship a template with
<...>still in it.
This artifact is what makes the loop recursive across sessions: the next agent (or the same a
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- README.md
- agents/error-fixer-loop-runner.md
- evals.json
- hooks/error-fixer-loop-codex.py
- hooks/error-fixer-loop-hook.sh
- hooks/error-fixer-loop.ts
- plugin.json
- scripts/detect-error.sh
- scripts/install.sh
- templates/audit.md
- templates/fix-prompt.md
- templates/rule-entry.md
FAQ
Что делает скилл error-fixer-loop?
Recursive error-fix loop. Use when a bash command fails with a build/test/typecheck error, when the same class of error appears more than once, or when the harness itself needs a persistent rule so the error does not come back. Detect → root-cause → minimal fix → test → lint/typecheck → persist rule (SKILL.md / AGENTS.md / docs/rules) → audit with evidence. Cross-harness (Claude Code, OpenCode, Codex, Gemini, Agy).
Как установить скилл error-fixer-loop?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл error-fixer-loop запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…