К основному содержанию
скилл CX Codex

diagnose · legendapp — скилл для Claude Code: разбор багов через пробы

Скилл ведёт расследование бага: строит гипотезы о причине, проверяет их пробами и выдаёт вывод с оценкой уверенности.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add LegendApp/legend-skills --skill diagnose -a claude-code
Открыть на GitHub

Что делает diagnose

Скилл запускается только по явному вызову — обычные сообщения о багах и просьбы починить его не включают. Дальше он идёт от вашей точки опоры: файл, маршрут, ошибка, лог, экран, ветка или шаг воспроизведения. Смотрит заметки по архитектуре, ADR, глоссарии и тестовые документы, читает код, гоняет безопасные тесты.

Работа идёт циклом. Сначала список правдоподобных причин, у каждой — предсказание, которое её отличает от остальных. Потом выбираются доказательства, которые эти причины разводят: сначала существующие тесты, трейсы и логи, при нехватке — временные структурированные пробы на границах. Перед воспроизведением скилл описывает контракт пробы: триггер, видимый симптом, какие вопросы прогон закроет, какие поля и correlation ID проверят предсказания. Дальше воспроизведение самым быстрым детерминированным способом — тест, скрипт, браузерный тест, повторный прогон, профилировщик, автоматизация приложения.

Явный вызов diagnose уже даёт согласие на временную инструментацию, не меняющую поведение, в границах запроса. Если для следующего шага нужно что-то ещё — доступ, которого нет, или решение, которое не принять без вас, — скилл спросит. В конце он ставит один статус: Proven, Supported или Incomplete, и называет сигнал проверки. Оценки уверенности — суждение, а не измеренная вероятность. Временные логи остаются, пока вы не попросите их убрать.

Какие задачи решает

  • найти причину падения по логу или трейсу
  • развести две похожие гипотезы одной пробой
  • воспроизвести плавающий баг нужным числом повторов
  • отделить корневую причину от сопутствующих
  • собрать доказательства до правки кода

Примеры запросов агенту

  • diagnose: падает на шаге оплаты, вот лог и ветка
  • diagnose-fix-loop: тест падает через раз, найди причину и предложи правку
  • diagnose: экран профиля пустой после логина, воспроизведение в шагах ниже

Как установить diagnose

1Через Skills CLI (Vercel)

npx skills add LegendApp/legend-skills --skill diagnose -a claude-code

2Вручную: положить файлы

~/.claude/skills/diagnose/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/diagnose/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о diagnose

Как установить diagnose в Claude?

Выполните npx skills add LegendApp/legend-skills --skill diagnose -a claude-code. Скилл встанет в ~/.claude/skills/diagnose/SKILL.md.

Что делает diagnose?

Ищет и объясняет причину заявленного симптома через различающие доказательства: гипотезы, пробы, воспроизведение. В конце выдаёт статус Proven, Supported или Incomplete и называет сигнал проверки.

Когда diagnose включается?

Только после явного вызова diagnose или diagnose-fix-loop. Обычные сообщения о багах и просьбы починить его не запускают.

Исходный текст

SKILL.md · MIT
---
name: diagnose
description: "Use only when explicitly asked to run diagnose: investigate a bug through causal probes and recorded evidence."
---

# Diagnose

Use this workflow after an explicit diagnose or diagnose-fix-loop invocation. Ordinary bug reports and fix requests do not opt in.

Find and explain the cause of the requested symptom using discriminating evidence. Pursue stronger proof while a practical probe can change the conclusion; do not require a numeric confidence threshold before a credible, scoped fix.

Start from the user's concrete anchor: file, route, error, log, screen, branch, artifact, or reproduction step. Consult relevant architecture notes, ADRs, glossaries, and test docs. Inspect code, run safe tools or tests, and analyze existing artifacts.

Explicit invocation of Diagnose constitutes approval for behavior-neutral temporary instrumentation within the requested scope. Reuse authorization already present in the conversation or the diagnose-fix-loop invocation for scoped fixes. Ask only when a next action lacks that authorization or requires unavailable access or a material unresolved decision.

## References

Load only what applies:

- Browser or React web: [browser-react.md](references/browser-react.md)
- iOS, Android, React Native, macOS, TV, or physical device: [app-device.md](references/app-device.md). macOS app sessions default to agent-device's native backend; read its setup and XCTest fallback before opening the app.
- Logs, runtime probes, metrics, or debug hooks: [instrumentation.md](references/instrumentation.md)

## Evidence Loop

1. **Locate likely causes.** Inspect the code path and existing evidence around the user's anchor. Form the smallest useful set of likely areas and falsifiable candidate causes, including independent or contributing causes when applicable. Give each cause a distinguishing prediction and identify where those predictions diverge.

2. **Choose discriminating evidence.** Use existing tests, traces, and logs first. When they cannot distinguish the leading causes, load [instrumentation.md](references/instrumentation.md) and add temporary structured probes at the relevant boundaries. Instrument competing causes together when one reproduction can distinguish them.

   Before reproducing, define the probe contract:

   - the exact trigger and visible symptom
   - the questions this run will answer
   - each candidate cause's distinguishing prediction
   - the events, fields, and correlation IDs that test those predictions
   - how the evidence will be tied to the exact visible failure
   - the intended process, build, window, document, and runtime identity when applicable

   A baseline reproduction may establish the symptom before instrumentation. Before treating a reproduction as causal evidence, ensure its observations distinguish the leading candidates and confirm the exact symptom.

3. **Reproduce the issue.** Use the fastest deterministic signal that represents the reported symptom: focused test, script, browser test, trace replay, harness, repeat loop, profiler, app/device automation, or structured human reproduction. Run it when safe and observable. For intermittent failures, run enough repetitions to compare causes.

   When reproduction requires inaccessible state, credentials, devices, subjective interaction, or risky actions, first prepare the capture, exact steps, expected observation, and artifact to inspect. Ask the user to reproduce and reply `done`; confirm the returned evidence matches the reported failure.

   If the user corrects the trigger, affected component, lifecycle, or visible symptom, invalidate evidence and probes that target the previous interpretation. Return to cause location and instrumentation before reproducing again; do not continue with a nearby but mismatched reproduction.

4. **Collect and analyze.** Collect the complete output, correlate events across boundaries, compare it with each prediction, and record evidence for and against every cause. If the logs are incomplete or ambiguous, identify how the likely areas or instrumentation must change before another reproduction.

5. **Determine confidence.** Rank each cause by role (root, contributing, or alternative), `0-100%` confidence, supporting and conflicting evidence, and the next evidence that could change its score or rank. Treat scores as qualitative judgments, not calibrated statistical probabilities. Assign 100% operational confidence only when:

   - the exact symptom is reproduced
   - the causal chain from trigger to failure is observed
   - controlling the suspected boundary reliably controls the symptom
   - the cause or combination of causes explains every relevant observation
   - plausible alternatives are falsified or included as contributing causes
   - intermittent behavior is repeated enough to distinguish causality from coincidence

   If proof is incomplete, choose the safest practical probe likely to add discriminating evidence and state which results would raise, lower, or redistribute confidence. Revise the likely areas or instrumentation and repeat the loop only while such a probe exists; do not repeat an equivalent pass without changing its inputs, boundary, or instrumentation.

   Stop probing when no available probe should increase confidence, a pass adds no evidence and no distinct boundary remains, or the needed evidence requires unavailable access, user action, unacceptable risk, or disproportionate effort. Report Supported if the available evidence justifies a credible cause and scoped fix; otherwise report Incomplete. Never label unresolved proof as proven.

## Output

Lead with one status:

- **Proven — 100%:** every applicable cause meets the proof standard with no unresolved plausible alternative.
- **Supported:** evidence identifies a credible cause and scoped fix, with specific remaining uncertainty.
- **Incomplete:** available evidence does not yet support a credible cause or fix.

For **Proven** or **Supported**, report the cause, causal chain, decisive evidence, code or runtime boundary, and any remaining uncertainty. For **Incomplete**, rank candidates, explain why evidence is insufficient, and identify the smallest useful next probe. Always name the validation signal. Confidence scores are judgments, not measured probabilities.

## Temporary Diagnostics

Keep diagnostic logs until the user requests cleanup or they become durable diagnostics. If committing while temporary diagnostics remain, stage only intended durable changes and report what remains unstaged.

## Delegation

Use subagents only when the user explicitly requests delegation, subagents, parallel work, or token optimization. Delegate bounded mechanical collection to faster or cheaper agents: known commands or repro loops, logs, screenshots, traces, profiles, extraction, or artifact comparison. Give each task a success condition, output format, runtime boundary, and no-edit instruction unless mutation is explicit.

Keep feedback-loop design, hypothesis ranking, confidence scoring, ambiguous interpretation, and the final diagnosis in the main thread. Verify delegated evidence and inspect the working tree and background processes before continuing.

© LegendApp · MIT · LegendApp/legend-skills

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →

Сначала — diagnose от других авторов.

diagnose официальный github Скилл проверяет AI-workflow по пяти измерениям и выдаёт оценки с приоритетными действиями. Подойдёт для аудита агента до запуска и после заметных изменений. 209установок diagnose getagentseal Скилл-маршрутизатор: помогает основателю понять, что именно сломалось, и выбрать один подходящий фреймворк вместо перебора наугад. CX Codex +1 646установок debug jsmastery-pro Скилл запускает цикл поиска первопричины бага: воспроизводит сбой, изолирует место ошибки, проверяет гипотезы и готовит минимальное исправление. CX Codex +1 4 400установок ce-debug EveryInc Находит причину бага по цепочке от триггера к симптому и предлагает решение через тесты. Пригодится при сбоях в CI или падении тестов. CX Codex +1 3 500установок bug-reproduction kindlmann Превращает расплывчатый баг-репорт в проверенный минимальный репро и падающий regression-тест. Пригодится, когда баг «иногда воспроизводится» и непонятно, с чего начать. CX Codex +1 1 400установок root-cause-tracing NeoLabHQ Скилл учит агента идти по стеку вызовов назад, пока не найдётся исходный триггер ошибки, и править там, а не на месте падения. CX Codex +1 1 300установок reproduce-and-fix-issues cursor Автоматизирует воспроизведение багов из тредов Slack через управление UI приложения и готовит черновой пуллреквест при наличии подтверждения. Работает в связке с системой Benny. CX Codex +1 822установок debugger zhaono1 Скилл ведёт агента по методике отладки: воспроизвести баг, сузить область, найти причину, починить и закрыть регрессионным тестом. CX Codex +1 745установок

Из того же набора7

legend-list-best-practices Скилл для работы с виртуализированным списком @legendapp/list: помогает внедрить его по контрактам библиотеки или провести аудит существующего кода. CX Codex +1 546установок legend-state-best-practices Скилл задаёт правила работы с @legendapp/state: где хранить состояние, как подписываться и что делать с персистентностью. Пригодится при рефакторинге и аудите реактивного кода. CX Codex +1 475установок react-coding-style Скилл для ИИ-агента: помогает писать и ревьюить React-код с узкими подписками, стабильными идентичностями и честными зависимостями хуков. CX Codex +1 466установок diagnose-fix-loop Скилл ведёт агента по кругу: диагноз, точечная правка, проверка тем же сигналом и снова диагноз. Пока не найдётся причина, а не симптом. CX Codex +1 420установок commit Превращает правки текущей задачи в один или несколько аккуратных коммитов и не тянет в них постороннюю работу. Пригодится, когда в дереве накопилось несколько несвязанных изменений. CX Codex +1 404установок git-integrate Ведёт rebase, merge, cherry-pick или revert до конца и не трогает постороннюю работу. Пригодится, когда операция встала на конфликте. CX Codex +1 389установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой