advanced-debugging

Instrument TypeScript/JavaScript code with debug logs and timing markers.

1|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/g97iulio1609/vscode-agent-skills --skill advanced-debugging-g97iulio1609
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: advanced-debugging
Source: https://github.com/g97iulio1609/vscode-agent-skills/tree/main/skills/advanced-debugging
Command: npx skills add https://github.com/g97iulio1609/vscode-agent-skills --skill advanced-debugging-g97iulio1609

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a structured, hypothesis-driven approach to debugging complex issues by instrumenting code, isolating changes, and analyzing traces and logs.

Core Features & Use Cases

  • Hypothesis Generation: Create testable hypotheses about bug causes.
  • Automatic Instrumentation: Inject debug logs and timing markers into code.
  • Isolated Testing: Support Git worktrees for parallel exploration of fixes.
  • Examples: When a race condition appears in a React app, generate hypotheses, instrument the code, and compare outcomes across isolated test environments.

Quick Start

Run instrumentation on a target file: npx ts-node scripts/instrument.ts <file> --functions --timing

Frequently Asked Questions about advanced-debugging

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

FAQPage Schema
How do I debug race conditions and flaky tests in TypeScript/JavaScript applications?

Race conditions and flaky tests in TypeScript/JavaScript can be debugged by instrumenting code with structured logging and timing markers, then isolating test environments using Git worktrees to compare outcomes across parallel explorations. This Skill automates instrumentation and log analysis to pinpoint timing-dependent failures.

What's the best way to add instrumentation to Node.js and browser code for debugging?

Instrumentation adds DEBUG logs and timing markers automatically to your code. Run the instrumentation script on target files to inject tracking points, then analyze collected traces to identify bottlenecks, state changes, and execution flow. This creates standardized logs for hypothesis-driven debugging.

Can I use Git worktrees to isolate debugging changes without affecting my main codebase?

Yes. Git worktrees let you explore multiple debugging hypotheses in parallel without branching. This Skill handles worktree setup and cleanup automatically, letting you test different instrumentation strategies and fixes side-by-side while keeping your main branch untouched.

How do I approach debugging hard-to-reproduce bugs and performance issues?

Hypothesis-driven debugging structures your investigation: generate testable theories about the root cause, instrument the code to capture relevant state and timing data, then analyze logs to validate or refute each hypothesis. This narrows search space in complex codebases where bugs emerge only under specific conditions.

Does this work with browser automation and Playwright-based testing?

Yes. The Skill integrates with Playwright-based browser automation for debugging browser context issues. Instrumentation and log analysis extend to browser-side errors, timing problems, and test flakiness, enabling end-to-end debugging across Node.js and browser environments.

What types of errors can instrumentation help me diagnose in TypeScript/JavaScript?

Instrumentation captures errors, stack traces, performance bottlenecks, race conditions, and hard-to-reproduce bugs. Standardized DEBUG logs with timing and state tracking reveal execution flow, variable changes, and async operation ordering—critical for diagnosing issues that don't surface consistently.