debug-first

Analyzes error messages to guide debugging across codebases.

Updated May 5, 2026
One-click install
npx skills add https://github.com/sonhaicoder/haiclaudeskill --skill debug-first
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-first
Source: https://github.com/sonhaicoder/haiclaudeskill/tree/main/skills/debug-first
Command: npx skills add https://github.com/sonhaicoder/haiclaudeskill --skill debug-first

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Reading and interpreting error messages is the fastest path to diagnosing bugs. This skill codifies a disciplined approach to debugging by starting from the error trace and locating the exact source without speculative fixes.

Core Features & Use Cases

  • Error-reading discipline: follow a 3-layer protocol to understand the error type, location, and context.
  • Traceback-to-source workflow: read from the bottom of the stack to identify where your code triggers the error, then isolate a minimal repro.
  • Structured debugging across stacks: apply to Python, JavaScript/TypeScript, and Dart/Flutter projects, as well as HTTP APIs like FastAPI.
  • Real-world use cases: when facing TypeError, KeyError, ImportError, runtime exceptions, or 500/CORS issues, use this guide to quickly locate the root cause.

Quick Start

Identify the error message, open the indicated file at the mentioned line, and insert a temporary print/log statement to inspect runtime data.

Frequently Asked Questions about debug-first

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read a Python stack trace to find the exact bug location?

Read a Python stack trace from the bottom up to identify the error type, then trace upward to locate the exact file and line number in your code that triggered the exception, isolating the root cause quickly.

What is the best way to debug TypeError and KeyError exceptions in JavaScript and Python?

The best way to debug TypeError and KeyError exceptions is to follow a structured 3-layer protocol: understand the error type, trace its location from the stack trace, and check the runtime context using temporary print or log statements to inspect variables.

How do I debug 500 errors and CORS issues in a FastAPI backend?

Debug 500 errors and CORS issues in FastAPI by reading the server traceback from the bottom to find the triggering file, opening the specified line, and inserting temporary log statements to inspect runtime data and isolate a minimal reproduction case.

Can I use this structured debugging workflow for Dart and Flutter tracebacks?

Yes, you can apply this structured debugging workflow to Dart and Flutter tracebacks. The error-reading discipline works across Python, JavaScript/TypeScript, and Dart environments by standardizing how you identify error types and locate the source.

Why do I get ImportError tracebacks and how can I trace them to the source?

You get ImportError tracebacks when a module cannot be found or loaded. Trace them to the source by reading the stack trace from the bottom to locate the failing import statement, then verify your module paths and dependencies in the specified file.