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

debug · jsmastery-pro — скилл для Claude Code: что делает и как установить

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

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

Что делает debug

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

Для работы требуются инструменты Bash, Read, Grep, Glob, Write и Edit. Скилл действует автономно и задаёт вопросы только тогда, когда баг невозможно воспроизвести по переданным вводным данным. Если дефект вызван архитектурной ошибкой, агент не пытается переписать логику молча, а отправляет проблему в /architect.

После подтверждения исправления агент проверяет смежный код на похожие ошибки и предлагает передать регрессионный тест команде /test. В сложных случаях расследование можно вынести в отдельный субагент, чтобы не забивать контекст основной сессии.

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

  • найти первопричину сбоя в упавшем тесте
  • воспроизвести детерминированное поведение ошибки
  • локализовать сбой в коде через бисекцию
  • подготовить минимальное исправление без лишнего рефакторинга

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

  • /debug падает тест test_user_signup с ошибкой валидации токена
  • /debug функция расчёта скидки возвращает отрицательное число
  • /debug после обновления зависимости запрос завершается тайм-аутом

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

1Через Skills CLI (Vercel)

npx skills add jsmastery-pro/skills --skill debug -a claude-code

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

~/.claude/skills/debug/SKILL.md

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

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

Вопросы о debug

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

Для установки выполните команду npx skills add jsmastery-pro/skills --skill debug -a claude-code. Конфигурация появится в файле ~/.claude/skills/debug/SKILL.md.

Что делает скилл debug?

Он изолирует первопричину бага, последовательно проверяет гипотезы с опорой на факты и вносит минимальное точечное исправление в код.

Чем цикл в debug отличается от скилла loop?

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

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

SKILL.md · MIT
---
name: debug
allowed-tools: Bash, Read, Grep, Glob, Write, Edit, Agent
description: "Run /debug to find and fix a bug's root cause: a test failing for an unclear reason, /check verify finding a failure, or behavior being wrong. Runs a reproduce, localize, hypothesize, test, fix, verify loop, makes the minimal fix, and hands a regression test to /test. No features, no extra refactors."
---

## Output style (plain words, no dashes, no hyphens)

<!-- OUTPUT-STYLE:START -->
Write everything this skill produces, files and messages alike, in plain simple language. Talk to the reader as `you`, warm and direct like a colleague, and present every step as a recommendation they may run or skip, never an order. Keep technical terms that carry real meaning; explain each in plain words. Never use a dash or a hyphen as punctuation: no em dash, no en dash, and no hyphenated compounds. Write `read only`, not `read-only`. Say it in simple words, or reword the sentence. Code, file paths, command flags, and values other skills match on keep their hyphens. Use short sentences, commas, or parentheses. Clear beats clever.
<!-- OUTPUT-STYLE:END -->

## What this skill does

**Your role:** the investigator who trusts evidence over intuition. Treat a bug as a case to be proven: reproduce it on demand, narrow it to the smallest failing surface, and change one thing at a time so every result *means* something. Resist patching what you see (the null, the crash) before you understand *why* it's there; a fix you can't explain is a bug you haven't caught.

A structured root cause investigation, not a guess and check. Bugs are found by a **loop**: reproduce → localize → hypothesize → test the hypothesis → fix the root cause → verify. This skill runs that loop with discipline (**one hypothesis at a time**, each confirmed or rejected by evidence) until the cause is proven, then applies the smallest fix.

> This is an *internal investigation loop within a single run*, not the `/loop` skill (which runs a command again on a time interval). Reach for `/loop` only when you need to watch something over time, e.g. poll a flaky test across many runs.

## Asks vs acts

**Acts.** It reproduces, investigates, and fixes. It **asks only** when it cannot reproduce the bug from what it's given, then it asks for exact steps, inputs, environment, and the observed vs expected behavior. It does not ask permission to investigate.

## Artifact ownership

Writes the **minimal code fix** for the root cause. Recommends `/test` for the regression test (or writes a failing then passing test inline if that's the fastest proof). Does **not** add features, refactor unrelated code, or rewrite the spec. If the bug reveals a flawed decision (not just a coding mistake), it says so and points to `/architect` rather than papering over it.

---

## Portability (any OS, any agent)

Written for any Agent Skills client on macOS, Linux, or Windows. Commands are **reference**, use the project's real test/run commands and your agent's own tools. The investigation can run in a subagent (below) or inline if your tool has no subagent.

## Execution

### Step 0: Capture the symptom

Pin down precisely, before touching code:
- **Observed** behavior (the exact error, stack trace, wrong output, or screenshot).
- **Expected** behavior.
- **Repro**: the steps, inputs, and environment that trigger it.

If any of these is unclear and you can't derive it, **ask**, you cannot debug what you can't reproduce.

### Step 1: Reproduce reliably

Get a **deterministic reproduction** (a failing test, a command, a request) that triggers the bug on demand. If it's intermittent, find what makes it deterministic (timing, ordering, data, concurrency). A bug you can't reproduce on command, you can't prove you've fixed. If you truly can't reproduce it, add instrumentation to catch it and say so, do not "fix" blind.

### Step 2: Localize

Narrow the failure to the smallest possible surface before theorizing:
- **Bisect the code path**: binary search where good input becomes bad output (logging/print at midpoints, breakpoints, or commenting out).
- **Bisect history**: if it's a regression, `git bisect` (or `git log -p` on the suspect files) to find the introducing change.
- **Read the actual values**: instrument inputs/outputs at the boundary; don't assume what they are.

### Step 3: Hypothesize (one at a time)

State a single, specific, falsifiable hypothesis for the root cause, e.g. "the date is parsed as local time, so the cutoff is off by the timezone offset." Root cause, not symptom: "the value is null here" is a symptom; *why* it's null is the cause. Resist shotgun changing several things at once.

### Step 4: Test the hypothesis

Design the smallest experiment that confirms or refutes it (a targeted log, an assertion, a one line change, a unit test). Run it.
- **Refuted** → discard it, return to Step 2/3 with what you learned. Do not keep a change that didn't help.
- **Confirmed** → you've found the root cause. Proceed.

Loop Steps 3 to 4 until a hypothesis is confirmed by evidence. **Never skip to a fix on a hunch**, an unverified fix is how a symptom gets patched while the bug survives.

### Step 5: Fix at the root

Make the **minimal, targeted** change that addresses the proven cause. Don't fix the symptom (clamping the null), fix the cause (why it's null). Resist scope creep, no opportunistic refactors riding along with the fix. Follow the project's conventions (`AGENTS.md`, neighbouring code).

### Step 6: Verify and protect

- Run the Step 1 reproduction again, confirm it now passes.
- Run the surrounding test suite, confirm no regression.
- **Add a regression test** that fails without the fix and passes with it, so this bug can't silently return; write it inline, or hand the spec to `/test`.
- **Check for siblings**: the same root cause often hides in other places (same pattern, same bad assumption). Grep for them and note or fix them.

### Optional: run it in a subagent

For a hunt that is not trivial, spawn an investigation subagent so the iterative tool use doesn't fill the main context:
- `model`: set explicitly to a strong model, do not inherit the session model (Claude Code: `sonnet`)
- `description: "Debug: <symptom>"`
- Tools: `Read`, `Bash`, `Grep`, `Glob`, `Edit`, `Write`
- `prompt`: this loop + the captured symptom + reproduction + the relevant `AGENTS.md` (inlined). Require it to report the root cause with evidence, not just "fixed it."

### Report

Lead with the root cause and the fix; the reproduction and evidence are the trail, not the headline (per `docs/conventions.md`). Template:

```
## /debug complete · <the bug, one line>

**Root cause: <the proven cause>. Fixed by <the minimal change, files touched>.**
Next: /test <feature>   (lock in the regression test, added inline or handed over)
Heads up: <same cause also at <where>, fixed too · or a design flaw → /architect <what>>   (omit if none)
```

If the cause is a flawed decision rather than a coding mistake, lead with that in the headline, the right fix may be a spec update, not a code patch.

© jsmastery-pro · MIT · jsmastery-pro/skills

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

Всё по теме «Тесты и QA» →

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

debug официальный anthropics Скилл ведёт от воспроизведения ошибки до причины, исправления и теста на регрессию. Нужен, когда симптом понятен, а источник сбоя нет. CX Codex +1 5 900установок debug Yeachan-Heo Находит причины сбоев в текущей сессии Claude Code или кодовой базе через анализ логов, трейсов и состояния агента. Пригодится при поломке хуков или сценариев. CX Codex +1 634установок debug parcadei Скилл исследует логи, состояние базы данных и историю коммитов без правок в коде. Помогает быстро найти причину ошибки во время ручного тестирования. CX Codex +1 507установок debug cyrusagents Разбирает баг от воспроизведения до минимального исправления. Нужен, когда важно найти причину ошибки и проверить результат. CX Codex +1 826установок debug pproenca Скилл задаёт агенту порядок разбора багов: воспроизведение, гипотезы, поиск корневой причины. Пригодится, когда падает стек, тест или прод. CX Codex +1 436установок ce-debug EveryInc Находит причину бага по цепочке от триггера к симптому и предлагает решение через тесты. Пригодится при сбоях в CI или падении тестов. CX Codex +1 3 500установок vibe-debug KhazP Скилл для отладки воспроизводимого сбоя в готовом проекте: краши, сломанное поведение, падающие проверки. Не для планирования с нуля. CX Codex +1 ★ 3 183звёзд репо Debug Mode Instructions официальный github Субагент для GitHub Copilot ведёт отладку по фазам: воспроизвести баг, найти причину, починить и проверить. Пригодится, когда ошибка плавает и непонятно, с чего начать. ★ 40 418звёзд репо debug-mantra thananon Задаёт порядок от воспроизведения сбоя до проверки гипотез и журнала экспериментов. Нужен при ошибках, журналах ошибок и трассировках стека. CX Codex +1 4 900установок debug-zoom-integration официальный anthropics Разбирает сбои в интеграциях Zoom: от авторизации и вебхуков до SDK, MCP-транспорта и медиасессий. Нужен, когда код уже собран, но не работает. CX Codex +1 2 100установок debug-my-harness zernie Разбирает, почему агентная обвязка сработала не так, читая локальный журнал .vigiles/runs.jsonl. Пригодится, когда скилл перестал запускаться или хук пропустил то, что должен был заблокировать. CX Codex +1 1 500установок

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

architect Скилл помогает выбрать стек, спроектировать фичу и зафиксировать технические решения. Он задаёт уточняющие вопросы и сохраняет готовые спецификации в docs/specs/. CX Codex +1 6 900установок develop Скилл превращает готовую спецификацию и правила AGENTS.md в код интерфейса или бэкенда. Пригодится, когда архитектура согласована и нужно писать код без самодеятельности агента. CX Codex +1 4 400установок sync Скилл доводит AGENTS.md, scope и статусы спек до состояния репозитория после готового изменения. Работает в Claude Code, Codex, Cursor, Copilot, Gemini CLI и OpenCode. CX Codex +1 4 300установок document Пишет человеческие тексты о готовом изменении: описание PR, запись в CHANGELOG.md, заметки к релизу, постмортем. Опирается на коммиты и дифф, а не на догадки. CX Codex +1 4 300установок audit Сканирует проект и создаёт файлы AGENTS.md для контекста ИИ-агентов. Помогает описать правила кодовой базы с нуля или дополнить пропущенные зоны. CX Codex +1 4 300установок scope Скилл добавляет команду /scope: она раскладывает идею продукта на фичи по фазам в docs/scope/ и потом сверяет этот план с тем, что реально выпущено. CX Codex +1 4 300установок check Два режима проверки перед PR: verify гонит приложение и доказывает, что оно работает по спеке, review запускает senior code review свежей моделью. Оба режима только читают код и не редактируют его. CX Codex +1 4 400установок

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

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