Skip to content
Skills Library
Programming · Analysis

debug

/debug

Evidence-first debugging for correctness issues. Invoke when diagnosing bugs, crashes, logic errors, data corruption, connectivity problems, intermittent failures (incl. flaky tests with environment divergence), or 'works on my machine' issues. For performance issues (slow / high latency / CPU / memory), use the profiling skill instead. For perf regressions with known change attribution, profiling is still primary — measure first, don't guess from the deploy diff.

Repository
autopilot ↗
Licence
MIT
Last repository change
27.10.2026

Assessment and security

95/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
1
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • SKILL.md zawiera komentarze HTML (1). Nie widać ich w podglądzie Markdown, a model je czyta.

What it does and when to use it

Evidence-first debugging for correctness issues. Invoke when diagnosing bugs, crashes, logic errors, data corruption, connectivity problems, intermittent failures (incl. flaky tests with environment divergence), or 'works on my machine' issues. For performance issues (slow / high latency / CPU / memory), use the profiling skill instead. For perf regressions with known change attribution, profiling is still primary — measure first, don't guess from the deploy diff.

Triggers from the description

works on my machine
Original author description

Evidence-first debugging for correctness issues. Invoke when diagnosing bugs, crashes, logic errors, data corruption, connectivity problems, intermittent failures (incl. flaky tests with environment divergence), or 'works on my machine' issues. For performance issues (slow / high latency / CPU / memory), use the profiling skill instead. For perf regressions with known change attribution, profiling is still primary — measure first, don't guess from the deploy diff.

How it works

  1. Coexistence with Superpowers
  2. Core Principle
  3. Available Scripts
  4. Relationship with Profiling
  5. Debug Cycle
  6. Evidence Collection Guide
  7. Log Query Funnel
  8. Anti-Patterns
  9. See Also
Original SKILL.md headings · 99 lines, 961 words
SKILL.md preview
---
name: debug
description: Evidence-first debugging for correctness issues. Invoke when diagnosing bugs, crashes, logic errors, data corruption, connectivity problems, intermittent failures (incl. flaky tests with environment divergence), or 'works on my machine' issues. For performance issues (slow / high latency / CPU / memory), use the profiling skill instead. For perf regressions with known change attribution, profiling is still primary — measure first, don't guess from the deploy diff.
---

# Evidence-First Debugging

> Routing overlap? If this intent better matches a sibling skill, redirect per [references/routing-tiebreaks.md](../../references/routing-tiebreaks.md) (prefer single-bug diagnosis over baseline test design).

## Coexistence with Superpowers

This skill is autopilot's standalone fallback for debugging methodology. If the `superpowers` plugin is installed, you may prefer `superpowers:systematic-debugging` — both work; `.claude/dispatch-config.md`'s `## Debugging` chain controls which one orchestrator skills (ceo-agent / finish-flow / quality-pipeline) dispatch.

Differences worth knowing:

- **autopilot:debug** is evidence-first (tool → log → code) with explicit Three Red Lines integration and `debug-config.md` project context injection. Stricter discipline; prescriptive ordering.
- **superpowers:systematic-debugging** is more general-purpose with broader hypothesis-driven framing. Less prescriptive, broader applicability.

<!-- Project-specific config (tool tables, log locations, common commands) -->
!`cat .claude/debug-config.md 2>/dev/null || echo "No project-specific debug config found. Use generic evidence collection below."`

## Core Principle

```
1. Tool-collected evidence  -> profiler, logs, EXPLAIN, debugger, DevTools
2. Log analysis             -> correlate with tool findings
3. Source code analysis     -> informed by evidence from 1 + 2
```

**Never guess from code alone.** Always collect evidence first.

## Available Scripts

| Script | Replaces LLM-judgment for | When invoked |
|--------|---------------------------|--------------|
| [`scripts/probe-unknown.js`](../../scripts/probe-unknown.js) | Count refuted hypotheses and the other ladder signals; recommend one rung (U0–U3) | Step 4, after every refuted hypothesis |
| [`scripts/dispatch-consult.sh`](../../scripts/dispatch-consult.sh) | Ask the consult seat one bounded question, advice only; `--ladder-receipt` stamps the U1 row | Step 4, only on `recommend: U1` |
| [`scripts/decision-ledger.js`](../../scripts/decision-ledger.js) | `append --kind hypothesis` — every hypothesis and its refutation as a ledger row (the S1 counter) | Steps 3–4 |

## Relationship with Profiling

| Skill | When to Use |
|-------|-------------|
| **debug** | Correctness: crashes, bugs, logic errors, data corruption, connectivity |
| **profiling** | Performance: slow queries, high memory, CPU spikes, latency |

If unsure, start with `debug`. If evidence points to a performance root cause, switch to `profiling`.

## Debug Cycle

1. Reproduce the issue reliably
2. Collect evidence with appropriate tools
3. Form hypothesis based on evidence; write it down: `node scripts/decision-ledger.js append --ledger <ledger> --kind hypothesis --json '{"hypothesis_id":"h1","text":"…","status":"open","work_unit":"<task>"}'`
4. Verify hypothesis (don't assume). When it fails, append the same id with `"status":"refuted"` and an `evidence_refs` entry, then run `node scripts/probe-unknown.js classify --ledger <ledger> --work-unit <task> --terms <error nouns>` and act **only on `recommend`** (the probe counts the refutations — the "after two failed hypotheses" rule is its S1 threshold, not a rule you police by memory):
   - `U1` → `bash scripts/dispatch-consult.sh --question-file <q> --artifact <a> --ladder-receipt <ledger> --ladder-terms <terms> --ladder-unknown-type why --ladder-signals S1 --ladder-work-unit <task>` (advice only, never a verified fix)
   - `U2` → survey `issue-search` with the exact error string, then `node scripts/probe-unknown.js receipt --ledger <ledger> --rung U2 --unknown-type why --terms <terms> --signals S1 --work-unit <task>`
   - `U3` → dispatch `autopilot:debugger` (PUA mode), then `node scripts/probe-unknown.js receipt --ledger <ledger> --rung U3 --unknown-type why --terms <terms> --signals S1 --work-unit <task>`
   - `none` → keep verifying (the probe never recommends U4; when you stop for the owner, show the ledger) (a `reason` of `budget-exhausted` / `not-heterogeneous` / `knob-off` names why nothing is recommended)
   Ledger: `<project>/ledger/decisions.jsonl`, or the probe's default `~/.autopilot/ladder/<repo-hash>.jsonl` when no project exists.
5. Fix root cause (not symptoms)
6. Verify fix with same tool + same test
7. Record in knowledge base if non-trivial (invoke learn skill)

> **3-fix architecture gate.** If **3 fix attempts have failed**, STOP attempting fix #4 — the repeated failure is itself evidence that the **mental model of the architecture is wrong**, not that the next tweak is the right one. Step back and question the structure: is the bug where you think it is? Is a component boundary / assumption (data shape, ordering, ownership, environment) violated upstream of where you're patching? Re-collect evidence at the boundary above the suspected site before any further fix. (Changing a flag/parameter is not a new attempt; changing the diagnostic *angle* is.)

## Evidence Collection Guide

Identify the right tools for your problem category. If your project has a `debug-config.md`, it will list specific commands. Otherwise, use this generic guide:

| Problem Category | What to Look For | Generic Tool Examples |
|-----------------|-------------------|----------------------|
| **Crash / panic** | Stack trace, exit code, core dump | Debugger (gdb/lldb), backtrace env vars, crash logs |
| **Logic error** | Wrong output, unexpected state | Breakpoints, print/log statements, unit test isolation |
| **Data corruption** | Bad values in storage, schema mismatch | DB query tools, EXPLAIN plans, data validation scripts |
| **Connectivity** | Timeout, refused, DNS failure | curl, netcat, ping, tcpdump, browser Network tab |
| **Auth / permissions** | 401/403, token expiry, role mismatch | Token decode tools, request headers, auth middleware logs |
| **Build / compile** | Error messages, missing deps | Build tool verbose mode, dependency tree, clean rebuild |
| **State / concurrency** | Race condition, deadlock, stale cache | Thread dumps, lock analysis, cache inspection |

## Log Query Funnel

1. Filter by time range -- narrow to incident window
2. Filter by severity -- errors, warnings, panics, exceptions
3. Correlate by request -- trace ID, request ID, session context
4. Expand context -- surrounding log lines for the correlated events

## Anti-Patterns

| Anti-Pattern | Fix |
|-------------|-----|
| Guessing from code without evidence | Collect tool evidence first |
| Changing code to "see what happens" | Form hypothesis, then verify |
| Fixing symptoms instead of root cause | Trace the full causal chain |
| Ignoring intermittent failures | Reproduce under controlled conditions |
| Assuming "works on my machine" | Check environment differences |

## See Also

- `learn` -- record debugging discoveries
- `audit` -- systematic comparison for parity issues
- `profiling` -- performance-specific investigation
- [`references/probe-playbook.md`](../../references/probe-playbook.md) -- match symptom against playbook entries (discriminating checks); no match ⇒ escalate per ledger convention

Versions

RepositoryScoreLicence
This page · cookys/autopilot95MIT
ericrisco/rsc-harness100MIT
nicsuzor/academicops100MIT
duronext/jig100MIT
drosam/agents100MIT
rizukirr/vibekit100MIT
DingyangLyu/MatClaw100Apache-2.0
Kanevry/session-orchestrator100MIT
kdlbs/kandev100AGPL-3.0

Database snapshot: 13.11.2026 · package version f26a9b542f44 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90troubleshooting
    Diagnose and resolve common issues including test failures, build errors, performance regressions, and development environment problems. Use this skill whenever the user reports something broken, failing, timing out, hanging, or producing unexpected results. Trigger on test…
  • 90diagnose
    Evidence-first diagnosis and optional fix loop for bugs, regressions, crashes, flaky tests, and performance problems. Use when the user asks to debug, diagnose, find the root cause, explain why something is broken, trace a failure across system boundaries, investigate…
  • 90dev-debug
    Systematically debug software failures before proposing fixes. Use for test failures, runtime errors, build failures, flaky behavior, performance regressions, integration failures, logs, screenshots, or any unexpected technical behavior where root cause must be established from evidence.
  • 100performance-profiling
    Use when investigating a performance problem — slow endpoints, high latency, memory/CPU pressure, or N+1 queries. A measure-first method to find the real bottleneck and verify the gain, instead of guessing at optimizations.
  • 100skill-debug
    AL debugging and diagnostics for Business Central. Use when performing snapshot debugging, CPU profiling, analyzing telemetry, or troubleshooting runtime issues.
  • 100skill-debug
    AL debugging and diagnostics for Business Central. Use when performing snapshot debugging, CPU profiling, analyzing telemetry, or troubleshooting runtime issues.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.