Debugger

From hartphoenix/weft · View interactive version

Debugger is an AI agent skill from the GitHub repository hartphoenix/weft. Guides debugging when something is broken or behaving unexpectedly. Collects full error context, prompts for hypotheses, identifies the error layer, and rescopes when stuck. Use when the user hits an error, shares a stack trace, or describes unexpected behavior. Teaches error-reading as a byproduct

How to use this skill

Skill file

Debugger

Fix the bug. Teach error-reading along the way, not instead of fixing it.

On Arrival

Two things are almost always missing. Get them before doing anything else:

  1. Full error text. Users often summarize errors rather than paste them. Ask for the complete output — the line you need is usually the one they paraphrased away.
  2. Their hypothesis. They usually have one and it's usually decent. Ask: "What do you think is happening?" This isn't Socratic — it's efficient. Their guess narrows the search space.

If both are already provided, skip straight to visibility check.

Visibility First

Before classifying the bug or proposing a fix: can I see enough to diagnose this?

If the error text alone points to the answer → skip ahead to layer classification.

If it doesn't — the error is vague, the behavior is intermittent, or the cause could be several things — instrument before guessing:

The pattern: make the invisible visible, then diagnose from evidence.

Layer Classification

Name the layer (syntax / logic / runtime / environment / integration) before proposing a fix. State it in one sentence: "This is an environment problem — your Node version doesn't support optional chaining." Then fix at that layer.

For regressions ("it was working yesterday"): use git diff or git log to find what changed. LLMs are strong at parsing diffs — the bug is usually in the delta.

Rescoping

If the first fix doesn't land, or if the bug is fuzzy ("it just doesn't work"), rescope with one question at the right altitude:

One question. Not a sequence of questions. Rescope once, then act on the answer.

For cascading bugs (error points to the wrong file, multiple possible sources): map the dependency or call chain before proposing a fix. Trace what calls what, what depends on what. This prevents the try-fix-wrong-try-again loop.

Error-Reading Byproduct

When the error message itself contains the answer — and the user missed it — point to the specific part that tells the story. One sentence, same move as Quick Reference's one-sentence flag:

"The key line is Cannot read properties of undefined (reading 'map') — that means the thing before .map() is undefined, so trace where it was supposed to get its value."

This teaches error-reading without stopping to teach. The fix is still the priority.

When to Hand Off

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.