debugging

Diagnose software bugs using targeted log injection and runtime analysis patterns.

Updated Oct 7, 2022
One-click install
npx skills add https://github.com/tamagusko/linux-cfg --skill debugging-tamagusko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debugging
Source: https://github.com/tamagusko/linux-cfg/tree/main/dotfiles/claude/skills/debugging
Command: npx skills add https://github.com/tamagusko/linux-cfg --skill debugging-tamagusko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When code fails silently or behaves unexpectedly, developers waste time guessing at root causes. This Skill provides a structured methodology for injecting temporary debug logs, recognizing common bug patterns, and scoring hypothesis confidence so issues get isolated faster. ## Core Features & Use Cases - Standardized Log Injection: Inserts [DEBUG]-prefixed logs with file:line locations and contextual values for React, Next.js, Node.js, Express, and API call flows. - Bug Pattern Recognition: Maps symptoms like "Cannot read property of undefined" or intermittent failures to known patterns such as null access, race conditions, stale closures, and silent errors. - Confidence Scoring & Cleanup: Rates root-cause hypotheses on a 0-100 scale and removes all injected logs after debugging, with a grep command for manual verification. - Use Case: A user reports "the dashboard broke after the last deploy." The Skill guides adding lifecycle and state logs to the React components, identifies a stale closure in a useEffect dependency array, and cleans up all debug output afterward. ## Quick Start Ask the assistant to debug why your component is not rendering updated data by injecting targeted debug logs and analyzing the runtime output.

Frequently Asked Questions about debugging

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

FAQPage Schema
How do I debug a React component that is not updating?

Inject [DEBUG] logs at mount, inside useEffect, and before setState calls to trace props, dependencies, and state transitions. Stale closures from missing useCallback or useEffect dependencies are a common cause of components using outdated values.

What is the best log format for temporary debugging?

Use a consistent prefix like [DEBUG] followed by [file:line], a short description, and an object of relevant values. The prefix makes logs easy to grep for cleanup, and the location enables quick navigation back to the source.

How do I find the cause of intermittent race condition bugs?

Race conditions appear as failures that happen randomly or only under timing pressure. Add logs around async operations and state updates to capture ordering, then compare execution sequences between passing and failing runs.

Does this debugging approach work with Node.js and Express APIs?

Yes, the same log patterns apply to server code: log incoming requests with method and path, caught errors with name and message, and fetch calls with URL and response status. This traces request flow through routes and services.

How do I remove all debug logs after fixing a bug?

Logs injected with the [DEBUG] prefix are removed automatically after debugging. To verify manually, run grep -rn '\[DEBUG\]' over your source files with extensions like .ts, .tsx, .js, and .jsx.