Debug and Resolve Code Issues
An AI-assisted debugging workflow: observability data collection, ranked hypotheses, production-safe instrumentation, and fixes.
Why it matters
Automate the debugging process for complex software issues. This skill analyzes errors, gathers observability data, generates hypotheses, and proposes fixes, accelerating root cause analysis and resolution.
Outcomes
What it gets done
Analyze error messages and stack traces
Gather and interpret observability data (logs, traces, metrics)
Generate and rank hypotheses for root causes
Propose and validate code fixes
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-debugging-toolkit-smart-debug | bash Overview
Debugging Toolkit Smart Debug
A ten-step AI-assisted debugging workflow spanning triage, observability data collection, ranked hypothesis generation, strategy selection, production-safe instrumentation, root cause analysis, fix, validation, and prevention. Use for debugging production or staging issues, especially intermittent failures that benefit from observability-data correlation and structured hypothesis testing.
What it does
Debugging Toolkit Smart Debug is an AI-assisted debugging specialist skill covering modern debugging tools, observability platforms, and automated root cause analysis. It runs a ten-step workflow: (1) Initial Triage using the Task tool's debugger subagent for error-pattern recognition, stack-trace analysis, dependency analysis, severity assessment, and 3-5 ranked hypotheses; (2) Observability Data Collection from error trackers (Sentry, Rollbar, Bugsnag), APM tools (DataDog, New Relic, Dynatrace), distributed tracing (Jaeger, Zipkin, Honeycomb), log aggregation (ELK, Splunk, Loki), and session replay (LogRocket, FullStory); (3) Hypothesis Generation scoring each hypothesis 0-100% with supporting evidence, falsification criteria, and expected symptoms, across categories like race conditions, stale cache, integration failures, resource exhaustion, configuration drift, and data corruption; (4) Strategy Selection among Interactive (VS Code/Chrome DevTools), Observability-Driven (Sentry/DataDog/Honeycomb), Time-Travel (rr/Redux DevTools), Chaos Engineering (Chaos Monkey/Gremlin), and Statistical/delta debugging; (5) Intelligent Instrumentation suggesting breakpoint/logpoint placement at entry points, decision nodes, state mutations, and integration boundaries; (6) Production-Safe Techniques - OpenTelemetry dynamic instrumentation, feature-flagged debug logging, sampling-based profiling (Pyroscope), read-only debug endpoints, and canary traffic shifting; (7) Root Cause Analysis via full execution-path reconstruction, variable-state tracking, and similar-bug-pattern identification; (8) Fix Implementation with code changes, impact assessment, risk level, and rollback strategy; (9) Validation via test suite run, performance comparison, and canary deployment monitoring; and (10) Prevention through AI-generated regression tests, knowledge-base updates, new monitoring/alerts, and runbook documentation.
When to use - and when NOT to
Use this skill when working on debugging toolkit smart-debug tasks or needing guidance, best practices, or checklists for AI-assisted debugging - particularly for production or staging issues that benefit from observability-data correlation and structured hypothesis testing. It is not for tasks unrelated to debugging or for work in a different domain or tool outside this scope.
Inputs and outputs
Input is the issue description passed as $ARGUMENTS, parsed for error messages/stack traces, reproduction steps, affected components, performance characteristics, environment, and failure pattern (intermittent vs consistent). Output is a structured report: Issue Summary (error, frequency, impact), Root Cause (detailed diagnosis with evidence), Fix Proposal (code changes, risk, impact), Validation Plan, and Prevention (tests, monitoring, documentation). A worked example walks a "checkout timeout errors" case from initial AI analysis through observability queries, trace-based hypothesis confirmation of an N+1 query pattern, instrumentation, canary rollout, and a validated fix that cut latency 70% and query count from 15 to 1:
const sentryData = await getSentryIssue("CHECKOUT_TIMEOUT");
const ddTraces = await getDataDogTraces({
service: "checkout",
operation: "process_payment",
duration: ">5000ms"
});
Integrations
Names a wide observability and debugging toolchain: Sentry, Rollbar, Bugsnag for error tracking; DataDog, New Relic, Dynatrace for APM; Jaeger, Zipkin, Honeycomb for distributed tracing; ELK, Splunk, Loki for log aggregation; LogRocket, FullStory for session replay; VS Code and Chrome DevTools for interactive debugging; rr and Redux DevTools for time-travel debugging; Chaos Monkey and Gremlin for chaos engineering; OpenTelemetry for dynamic instrumentation spans; and Pyroscope for sampling-based continuous profiling. Initial triage delegates to the Task tool's debugger subagent.
Who it's for
Engineers debugging production or staging incidents - especially intermittent or hard-to-reproduce failures - who want an AI-assisted, observability-driven workflow that generates ranked, falsifiable hypotheses and production-safe instrumentation strategies rather than guessing from a stack trace alone.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.