diagnose-fix-loop — скилл для Claude Code: цикл диагностики и правок
Скилл ведёт агента по кругу: диагноз, точечная правка, проверка тем же сигналом и снова диагноз. Пока не найдётся причина, а не симптом.
npx skills add LegendApp/legend-skills --skill diagnose-fix-loop -a claude-codeЧто делает diagnose-fix-loop
Скилл запускает полный цикл улучшения, а не одну отладочную попытку. Сначала формулируется цель: симптом, падающий тест, регрессия или просадка производительности. Дальше идёт проход $diagnose, который собирает доказательства причины и запоминает сигнал для повторной проверки. Правки начинаются только на доказательствах уровня Proven или Supported.
План правок ранжируется, и реализуется ровно один пункт — самый маленький из убедительных. Потом тот же сигнал прогоняется заново, затем точечные регрессионные проверки. После этого $diagnose запускается на новом состоянии: смотрит на факты, а не на замысел правки. Ищет оставшийся дефект рядом, внесённую регрессию или следующий узкий участок. Каждая итерация должна иметь цель острее предыдущей.
Важное условие: скилл не ставит зависимости сам. Если $diagnose не установлен, работа останавливается до изменений — сначала npx skills add LegendApp/legend-skills --skill diagnose, потом повторный запуск. Ведётся короткий журнал: номер итерации, доказательства, выбранная правка, результат проверки. Если две итерации не дали измеримого улучшения, реализация ставится на паузу и пересматривается сам цикл обратной связи. Остановка возможна и по другим причинам: нужен доступ к продакшену или учётные данные, запрошена диагностика без правок, либо свежий проход не находит убедительных дефектов.
Какие задачи решает
- разобраться, почему падает тест, и починить причину, а не симптом
- провести серию правок по просадке производительности с проверкой каждой
- откатить неудачный эксперимент и не считать его прогрессом
- отличить внесённую регрессию от оставшегося дефекта рядом
- остановиться, когда улучшения стали косметическими или спорными
Примеры запросов агенту
- запусти diagnose-fix-loop: тест checkout падает на пустой корзине
- прогони diagnose-fix-loop по регрессии в списке заказов
- diagnose-fix-loop: страница тормозит на первом рендере, найди причину и почини
Как установить diagnose-fix-loop
1Через Skills CLI (Vercel)
npx skills add LegendApp/legend-skills --skill diagnose-fix-loop -a claude-code2Вручную: положить файлы
~/.claude/skills/diagnose-fix-loop/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/diagnose-fix-loop/
1Через Skills CLI (Vercel)
npx skills add LegendApp/legend-skills --skill diagnose-fix-loop -a codex2Вручную: положить файлы
.agents/skills/diagnose-fix-loop/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add LegendApp/legend-skills --skill diagnose-fix-loop -a cursor2Вручную: положить файлы
.cursor/skills/diagnose-fix-loop/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install LegendApp/legend-skills diagnose-fix-loop2Вручную: положить файлы
.github/skills/diagnose-fix-loop/SKILL.md1Через Skills CLI (Vercel)
npx skills add LegendApp/legend-skills --skill diagnose-fix-loop -a gemini-cli2Командой платформы
gemini skills install https://github.com/LegendApp/legend-skills --path diagnose-fix-loopВручную: положить файлы
.devin/skills/diagnose-fix-loop/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add LegendApp/legend-skills --skill diagnose-fix-loop -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о diagnose-fix-loop
Как установить diagnose-fix-loop в Claude?
Выполните npx skills add LegendApp/legend-skills --skill diagnose-fix-loop -a claude-code. Файл скилла окажется в ~/.claude/skills/diagnose-fix-loop/SKILL.md.
Что делает diagnose-fix-loop?
Гоняет цикл: диагноз через $diagnose, одна точечная правка, проверка исходным сигналом, снова диагноз. Продолжает, пока есть убедительная следующая правка.
Нужно ли ставить что-то ещё?
Да, скилл опирается на $diagnose. Без него он останавливается до внесения изменений и просит поставить npx skills add LegendApp/legend-skills --skill diagnose.
Исходный текст
SKILL.md · MIT
--- name: diagnose-fix-loop description: "Use only when explicitly asked to run diagnose-fix-loop: repeat diagnosis, scoped fixes, and verification." --- # Diagnose Fix Loop Use this skill to drive a complete improvement loop, not a single debugging pass. Before starting, load and follow `$diagnose`. Treat `$diagnose` as the evidence engine for each pass; this skill only adds the outer loop that plans, implements, re-runs diagnosis, and decides whether to continue. Explicit invocation opts in to `$diagnose` and authorizes scoped local fixes and verification. This skill owns implementation once evidence supports a credible cause and fix. Selected installs do not install dependencies automatically. If `$diagnose` is not installed or available, stop before making changes. Tell the user to install it with: ```bash npx skills add LegendApp/legend-skills --skill diagnose ``` Then ask them to retry after installation. ## Loop 1. State the target outcome. Anchor the loop to the user's symptom, performance goal, failing test, UX defect, regression, or code quality concern. If the user gave no concrete anchor, create the fastest observable feedback loop first. 2. Run a `$diagnose` pass. Record the causal evidence and exact validation signal to rerun after the fix. Proceed on **Proven** or **Supported** evidence that justifies a scoped fix. If evidence remains **Incomplete**, continue useful available probes; stop when unavailable evidence prevents a credible fix, and report the gap. If the user asked for delegation, use it only for bounded evidence collection inside this pass; keep bottleneck ranking, fix selection, code edits, and final interpretation in the main loop. 3. Make a ranked fix plan. Prefer one smallest credible fix at a time. The plan must include: - what evidence supports the change - what file or boundary will change - what validation should improve - what would make the plan wrong 4. Implement only the top plan item. Keep the edit scoped to the supported causal boundary. Avoid stacking speculative cleanup, broad refactors, or adjacent improvements unless the diagnosis showed they are part of the same fault. 5. Verify with the original signal. Re-run the reproduction path or measurement from step 2, then focused regression coverage, then broader checks when the touched surface warrants them. 6. Re-run `$diagnose`. Diagnose the new state from evidence, not from the intent of the change. Look for: - the original symptom still failing - a nearby remaining fault - a regression introduced by the fix - a stronger next bottleneck revealed by the first fix - missing coverage at the real seam 7. Decide whether to continue. Continue when evidence identifies a credible next fix and the next action is safe to take. Each new iteration should have a sharper target than the previous one. ## Iteration Discipline Keep a short running log while working: - iteration number - current evidence - chosen fix - validation result - next remaining issue or stop reason If an experiment fails, revert it unless it is independently useful and intentionally kept. Do not count a failed experiment as progress unless it narrowed the diagnosis. If two iterations produce no measurable improvement and no sharper evidence, pause implementation and re-diagnose the feedback loop itself before making more edits. ## Stop Rules Stop only when one of these is true: - `$diagnose` cannot build or run a credible feedback loop with available code, tools, or artifacts - the next action requires user input, inaccessible external state, credentials, production access, or a destructive operation - the user requested read-only diagnosis and the next useful step would edit files - validation is clean and a fresh `$diagnose` pass finds no remaining credible fault to fix - remaining improvements are speculative, cosmetic, or outside the user's target outcome When stopping, report the final state, the validation evidence, remaining known risk, and the smallest user action or artifact needed if work is blocked.
© LegendApp · MIT · LegendApp/legend-skills