| name | skill-fixer |
| description | Automatically patches skill files (SKILL.md and associated scripts) when Claude detects and resolves an error during skill execution. Use this skill whenever Claude has just worked around a problem caused by a skill's instructions — such as a wrong path, an unavailable command, an outdated flag, a broken script, or a missing dependency — and wants to record the fix so the same error never happens again. Triggers automatically after error recovery during any skill usage. Also triggers when the user says things like "fix this skill", "update the skill", "save this fix", "patch the skill", or "don't make me deal with this error again".
|
Skill Fixer
This skill patches skill files in-place after Claude detects and resolves a recurring error. Its goal is to eliminate wasted tokens and friction by making fixes permanent.
When to use this skill
Activate this skill when all three conditions are true:
- Claude was executing another skill and encountered an error or had to deviate from the skill's instructions.
- Claude found a working solution (i.e., the task was eventually completed).
- The root cause was in the skill's files — not in the user's input or an external service.
Common root causes this skill addresses:
- Wrong or non-existent paths (e.g., a script referenced at
./scripts/run.sh that lives elsewhere)
- Unavailable CLI commands (e.g., a tool not installed, or named differently on this OS)
- Outdated flags or options (e.g., a deprecated
--flag that was renamed)
- Broken or buggy scripts (e.g., a Python script with a syntax error or wrong shebang)
- Missing dependencies not mentioned in the skill (e.g., a required
pip package)
- OS/environment mismatches (e.g., macOS vs Linux path conventions)
- Stale documentation (e.g., a step that no longer applies to the current version of a tool)
Do not activate if:
- The error was caused by the user's input, not the skill.
- The fix was a one-time workaround specific to this task (e.g., a file that just didn't exist yet).
- The skill files are in a read-only location and no writable copy exists.
Step 1 — Locate the skill directory
Default location: ~/.agents/skills/
Check this location first:
ls ~/.agents/skills/
If the skill directory isn't there, ask the user:
"I couldn't find the skills directory at ~/.agents/skills/. Where are your skills stored?"
Once confirmed, locate the specific skill that had the error:
ls ~/.agents/skills/<skill-name>/
Note: If the skill is in a read-only location (e.g., /mnt/skills/public/), inform the user and skip to the end. You cannot patch read-only skills.
Step 2 — Identify the fix
Before proposing any change, clearly document:
- What failed: The exact command, path, or instruction that caused the error.
- What the working solution was: What Claude actually did to succeed.
- Where the fix belongs: Which file needs to change (SKILL.md, a script, a config file).
- What the change is: The exact diff — old text vs. new text.
Example summary to present to the user:
Skill: jira
File: SKILL.md
Problem: Line 42 references `python3 scripts/jira_auth.py` but the script is at `scripts/auth/jira_auth.py`.
Fix: Update the path to `python3 scripts/auth/jira_auth.py`.
Keep fixes minimal and surgical. Only change what caused the error. Do not refactor or rewrite unrelated sections.
Step 3 — Ask for confirmation
Always ask the user before writing any changes. Present the fix clearly:
¿Quieres que corrija la skill [nombre] para evitar este error en el futuro?
Haré el siguiente cambio en [ruta/al/archivo]:
- línea incorrecta o ruta antigua
+ línea corregida o ruta nueva
Esto hará que la próxima vez que uses esta skill ya funcione directamente, sin necesidad de volver a resolver el mismo error.
Wait for explicit confirmation ("yes", "sí", "go ahead", "hazlo", etc.) before proceeding.
If the user declines, acknowledge and move on. Do not apply the fix.
Step 4 — Apply the fix
Once confirmed, apply the change using str_replace (preferred for targeted edits) or by rewriting the relevant section.
For SKILL.md files:
cat ~/.agents/skills/<skill-name>/SKILL.md
Then apply the targeted edit. After writing:
grep -n "<changed_term>" ~/.agents/skills/<skill-name>/SKILL.md
For scripts:
cat ~/.agents/skills/<skill-name>/scripts/<script-name>
Step 5 — Confirm the patch and summarize
After applying the fix, tell the user what was changed and where:
✅ Skill [nombre] actualizada.
Se ha corregido [archivo]: [descripción breve del cambio].
La próxima vez que uses esta skill, este paso ya funcionará correctamente.
If multiple files needed fixing, list each one.
Edge cases
The skill has no writable copy
If the skill lives in a read-only location, inform the user:
"La skill [nombre] está en una ubicación de solo lectura ([ruta]). No puedo modificarla directamente. Si quieres, puedo copiarla a ~/.agents/skills/ y aplicar allí la corrección."
Multiple problems found
If Claude noticed more than one issue during execution, list all of them in Step 3 and ask the user to confirm each fix individually or all at once.
The fix is uncertain
If Claude isn't sure the fix is correct (e.g., the workaround was a guess), say so:
"Creo que el problema era X, pero no estoy completamente seguro. ¿Quieres que aplique igualmente el cambio?"
The skill directory doesn't match the installed name
Some skills may be installed under a different directory name than their name frontmatter field. Use the name field in SKILL.md as the authoritative identifier; the directory name is secondary.
Configuration (optional)
If the user has a non-default skills directory, they can tell Claude once and Claude should remember it for the session:
"Mis skills están en /ruta/personalizada/skills/"
Claude should use that path for all subsequent skill-fixer operations in the session.