debugging-strategies

Diagnose bugs and performance issues using systematic debugging workflows and profiling tools.

5|Updated Dec 8, 2025
One-click install
npx skills add https://github.com/portalshq/portals-studio --skill debugging-strategies-portalshq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debugging-strategies
Source: https://github.com/portalshq/portals-studio/tree/main/.cursor/skills/debugging-strategies
Command: npx skills add https://github.com/portalshq/portals-studio --skill debugging-strategies-portalshq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging often devolves into guesswork and random code changes. This Skill replaces that with a structured scientific method—reproduce, gather information, hypothesize, test—so you can find root causes faster across any language or stack. ## Core Features & Use Cases - Systematic Four-Phase Process: Reproduce the issue, collect environment and error data, form hypotheses, and verify fixes with binary search and isolation techniques. - Language-Specific Tooling: Ready-to-use debugger setups for JavaScript/TypeScript (VS Code launch configs, Chrome DevTools), Python (pdb, breakpoint, cProfile), and Go (Delve, pprof). - Pattern Playbooks: Targeted strategies for intermittent bugs, performance bottlenecks, memory leaks, and production-only failures. - Use Case: A Node.js API intermittently returns wrong totals in production. Use the differential debugging technique to compare working vs broken environments, add trace logging, and run git bisect to pinpoint the regressing commit. ## Quick Start Help me debug an intermittent race condition in my Node.js order processing service using a systematic approach.

Frequently Asked Questions about debugging-strategies

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

FAQPage Schema
How do I debug intermittent bugs that only happen sometimes?

Intermittent bugs require extensive logging of timing, state transitions, and external interactions. Look for race conditions in async code, check setTimeout and Promise ordering, and stress test by running the scenario many times under varied load.

How to find which commit introduced a bug using git?

Use git bisect to binary search your commit history. Mark the current commit as bad and a known working commit as good, then test each checked-out midpoint until git identifies the exact regressing commit.

What tools can I use to debug Python performance issues?

Python's built-in cProfile module profiles function call times, and pstats sorts results by cumulative time to reveal bottlenecks. For interactive debugging, use breakpoint() or ipdb, and add structured logging to trace execution flow.

How do I detect memory leaks in Node.js applications?

Monitor process.memoryUsage() for growing heap usage and generate heap snapshots with v8.writeHeapSnapshot(). In Chrome DevTools, compare heap snapshots before and after an action to find retained objects that should have been freed.

Why does my bug only happen in production but not locally?

Production-only bugs usually stem from environment differences like dependency versions, data volume, configuration, or user permissions. Gather evidence from error tracking and logs, then reproduce locally with anonymized production data and matching environment settings.