DonggangChen

debugging_tools

2
2
# Install this skill:
npx skills add DonggangChen/antigravity-agentic-skills --skill "debugging_tools"

Install specific skill from multi-skill repository

# Description

Debugging tools - console, debugger, network, profiling.

# SKILL.md


name: debugging_tools
router_kit: FullStackKit
description: Debugging tools - console, debugger, network, profiling.
metadata:
skillport:
category: quality
tags: [architecture, automation, best practices, clean code, coding, collaboration, compliance, debugging, debugging tools, design patterns, development, documentation, efficiency, git, optimization, productivity, programming, project management, quality assurance, refactoring, software engineering, standards, testing, utilities, version control, workflow] - debugging-methodology


πŸ› οΈ Debugging Tools

Debugging tools and techniques.


πŸ’» Console Methods

console.log('Value:', value);
console.table(arrayData);
console.group('Section');
console.trace('Stack trace');
console.time('op'); /* ... */ console.timeEnd('op');

πŸ”΄ Debugger

function process(data) {
  debugger; // Breakpoint
  return transform(data);
}
# Node Inspector
node --inspect src/index.js
# chrome://inspect

🌐 Network

// Axios interceptor
axios.interceptors.request.use(config => {
  console.log('Request:', config);
  return config;
});

πŸ“Š Logging

import pino from 'pino';

const logger = pino({ level: 'info' });
logger.info({ userId }, 'User logged in');
logger.error({ err }, 'Login failed');

πŸ”„ Workflow

Kaynak: OpenTelemetry Documentation & Chrome DevTools Debugging Guide

πŸ”„ Workflow

Source: OpenTelemetry Documentation & Chrome DevTools Debugging Guide

Phase 1: Observation & Reproduction

  • [ ] Logging Audit: Check if sufficient context is logged during error (Pino/Winston).
  • [ ] Reproduction: Identify necessary inputs to consistently reproduce the error in local or staging environment.
  • [ ] Network Analysis: Monitor API calls and payloads via Browser Network Tab or Proxyman/Charles.

Phase 2: Strategic Debugging

  • [ ] Breakpoints: Trace where state breaks step-by-step (Step-over/Step-into) using debugger or IDE breakpoints.
  • [ ] Binary Search: Temporarily disable large parts of code to find the faulty block (Divide and Conquer).
  • [ ] Memory Profiling: Analyze objects taking up most space by taking Heap Snapshot in case of Memory leak.

Phase 3: Fix & Verification

  • [ ] Root Cause Fix: Fix the root cause of the error, not just the symptom.
  • [ ] Regression Testing: Run relevant tests to ensure the fix didn't break anything else.
  • [ ] Observability Update: Add a new alert or metric for faster detection of similar errors in the future.

Checkpoints

Phase Verification
1 Was the error solved with persistent logs or "deletable" logs (console.log)?
2 Can entire request flow be traced via Trace ID (Distributed Tracing)?
3 Was a test scenario added for the bug fix?

Debugging Tools v1.5 - With Workflow

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.