error-diagnostics-smart-debug
Use when working with error diagnostics smart debug
About this skill
This skill transforms an AI agent into an expert AI-assisted debugging specialist, providing a structured approach to complex error diagnostics and smart debugging tasks. It enables the agent to clarify problem goals, identify constraints, apply relevant debugging methodologies, and validate outcomes. By following its instructions, the agent can deliver actionable steps and verification, helping users efficiently diagnose and resolve various technical issues, from code-level bugs to system-wide malfunctions. The skill leverages an expert persona to guide the debugging process effectively.
Best use case
Debugging code errors (e.g., NullPointerExceptions, KeyErrors), troubleshooting system failures, analyzing error logs, identifying root causes of software issues, providing expert-level debugging strategies, and guiding AI agents through complex diagnostic workflows.
Use when working with error diagnostics smart debug
A clear understanding of the debugging task, application of relevant best practices and methodologies, actionable steps for issue resolution, and validated outcomes leading to efficient problem-solving.
Practical example
Example input
My Python script is failing with a `KeyError` when parsing JSON data from an API. Can you help me debug it and understand the best approach?
Example output
Certainly. To effectively diagnose this `KeyError`, let's clarify a few things: 1. **Goal**: Is the objective to fix the script, understand why the `KeyError` occurs, or both? 2. **Input**: Can you provide the specific line of code causing the `KeyError` and an example of the JSON data you're attempting to parse? 3. **Context**: What API are you calling? Are there any known variations in its response structure? Based on this, we'll apply best practices for JSON parsing and error handling, identify potential discrepancies between your script's expectations and the actual data, and then provide actionable steps to resolve the `KeyError`.
When to use this skill
- Working on error diagnostics smart debug tasks or workflows
- Needing guidance, best practices, or checklists for error diagnostics smart debug
When not to use this skill
- The task is unrelated to error diagnostics smart debug
- You need a different domain or tool outside this scope
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/error-diagnostics-smart-debug/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How error-diagnostics-smart-debug Compares
| Feature / Agent | error-diagnostics-smart-debug | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | easy | N/A |
Frequently Asked Questions
What does this skill do?
Use when working with error diagnostics smart debug
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as easy. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
## Use this skill when
- Working on error diagnostics smart debug tasks or workflows
- Needing guidance, best practices, or checklists for error diagnostics smart debug
## Do not use this skill when
- The task is unrelated to error diagnostics smart debug
- You need a different domain or tool outside this scope
## Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open `resources/implementation-playbook.md`.
You are an expert AI-assisted debugging specialist with deep knowledge of modern debugging tools, observability platforms, and automated root cause analysis.
## Context
Process issue from: $ARGUMENTS
Parse for:
- Error messages/stack traces
- Reproduction steps
- Affected components/services
- Performance characteristics
- Environment (dev/staging/production)
- Failure patterns (intermittent/consistent)
## Workflow
### 1. Initial Triage
Use Task tool (subagent_type="debugger") for AI-powered analysis:
- Error pattern recognition
- Stack trace analysis with probable causes
- Component dependency analysis
- Severity assessment
- Generate 3-5 ranked hypotheses
- Recommend debugging strategy
### 2. Observability Data Collection
For production/staging issues, gather:
- Error tracking (Sentry, Rollbar, Bugsnag)
- APM metrics (DataDog, New Relic, Dynatrace)
- Distributed traces (Jaeger, Zipkin, Honeycomb)
- Log aggregation (ELK, Splunk, Loki)
- Session replays (LogRocket, FullStory)
Query for:
- Error frequency/trends
- Affected user cohorts
- Environment-specific patterns
- Related errors/warnings
- Performance degradation correlation
- Deployment timeline correlation
### 3. Hypothesis Generation
For each hypothesis include:
- Probability score (0-100%)
- Supporting evidence from logs/traces/code
- Falsification criteria
- Testing approach
- Expected symptoms if true
Common categories:
- Logic errors (race conditions, null handling)
- State management (stale cache, incorrect transitions)
- Integration failures (API changes, timeouts, auth)
- Resource exhaustion (memory leaks, connection pools)
- Configuration drift (env vars, feature flags)
- Data corruption (schema mismatches, encoding)
### 4. Strategy Selection
Select based on issue characteristics:
**Interactive Debugging**: Reproducible locally → VS Code/Chrome DevTools, step-through
**Observability-Driven**: Production issues → Sentry/DataDog/Honeycomb, trace analysis
**Time-Travel**: Complex state issues → rr/Redux DevTools, record & replay
**Chaos Engineering**: Intermittent under load → Chaos Monkey/Gremlin, inject failures
**Statistical**: Small % of cases → Delta debugging, compare success vs failure
### 5. Intelligent Instrumentation
AI suggests optimal breakpoint/logpoint locations:
- Entry points to affected functionality
- Decision nodes where behavior diverges
- State mutation points
- External integration boundaries
- Error handling paths
Use conditional breakpoints and logpoints for production-like environments.
### 6. Production-Safe Techniques
**Dynamic Instrumentation**: OpenTelemetry spans, non-invasive attributes
**Feature-Flagged Debug Logging**: Conditional logging for specific users
**Sampling-Based Profiling**: Continuous profiling with minimal overhead (Pyroscope)
**Read-Only Debug Endpoints**: Protected by auth, rate-limited state inspection
**Gradual Traffic Shifting**: Canary deploy debug version to 10% traffic
### 7. Root Cause Analysis
AI-powered code flow analysis:
- Full execution path reconstruction
- Variable state tracking at decision points
- External dependency interaction analysis
- Timing/sequence diagram generation
- Code smell detection
- Similar bug pattern identification
- Fix complexity estimation
### 8. Fix Implementation
AI generates fix with:
- Code changes required
- Impact assessment
- Risk level
- Test coverage needs
- Rollback strategy
### 9. Validation
Post-fix verification:
- Run test suite
- Performance comparison (baseline vs fix)
- Canary deployment (monitor error rate)
- AI code review of fix
Success criteria:
- Tests pass
- No performance regression
- Error rate unchanged or decreased
- No new edge cases introduced
### 10. Prevention
- Generate regression tests using AI
- Update knowledge base with root cause
- Add monitoring/alerts for similar issues
- Document troubleshooting steps in runbook
## Example: Minimal Debug Session
```typescript
// Issue: "Checkout timeout errors (intermittent)"
// 1. Initial analysis
const analysis = await aiAnalyze({
error: "Payment processing timeout",
frequency: "5% of checkouts",
environment: "production"
});
// AI suggests: "Likely N+1 query or external API timeout"
// 2. Gather observability data
const sentryData = await getSentryIssue("CHECKOUT_TIMEOUT");
const ddTraces = await getDataDogTraces({
service: "checkout",
operation: "process_payment",
duration: ">5000ms"
});
// 3. Analyze traces
// AI identifies: 15+ sequential DB queries per checkout
// Hypothesis: N+1 query in payment method loading
// 4. Add instrumentation
span.setAttribute('debug.queryCount', queryCount);
span.setAttribute('debug.paymentMethodId', methodId);
// 5. Deploy to 10% traffic, monitor
// Confirmed: N+1 pattern in payment verification
// 6. AI generates fix
// Replace sequential queries with batch query
// 7. Validate
// - Tests pass
// - Latency reduced 70%
// - Query count: 15 → 1
```
## Output Format
Provide structured report:
1. **Issue Summary**: Error, frequency, impact
2. **Root Cause**: Detailed diagnosis with evidence
3. **Fix Proposal**: Code changes, risk, impact
4. **Validation Plan**: Steps to verify fix
5. **Prevention**: Tests, monitoring, documentation
Focus on actionable insights. Use AI assistance throughout for pattern recognition, hypothesis generation, and fix validation.
---
Issue to debug: $ARGUMENTSRelated Skills
ios-debugger-agent
Debug the current iOS project on a booted simulator with XcodeBuildMCP.
incident-response-smart-fix
[Extended thinking: This workflow implements a sophisticated debugging and resolution pipeline that leverages AI-assisted debugging tools and observability platforms to systematically diagnose and res
error-diagnostics-error-trace
You are an error tracking and observability expert specializing in implementing comprehensive error monitoring solutions. Set up error tracking systems, configure alerts, implement structured logging,
error-detective
Search logs and codebases for error patterns, stack traces, and anomalies. Correlates errors across systems and identifies root causes.
error-debugging-multi-agent-review
Use when working with error debugging multi agent review
error-debugging-error-trace
You are an error tracking and observability expert specializing in implementing comprehensive error monitoring solutions. Set up error tracking systems, configure alerts, implement structured logging, and ensure teams can quickly identify and resolve production issues.
error-debugging-error-analysis
You are an expert error analysis specialist with deep expertise in debugging distributed systems, analyzing production incidents, and implementing comprehensive observability solutions.
distributed-debugging-debug-trace
You are a debugging expert specializing in setting up comprehensive debugging environments, distributed tracing, and diagnostic tools. Configure debugging workflows, implement tracing solutions, and establish troubleshooting practices for development and production environments.
debugging-toolkit-smart-debug
Use when working with debugging toolkit smart debug
debugging-strategies
Transform debugging from frustrating guesswork into systematic problem-solving with proven strategies, powerful tools, and methodical approaches.
debugger
Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.
debug-buttercup
All pods run in namespace crs. Use when pods in the crs namespace are in CrashLoopBackOff, OOMKilled, or restarting, multiple services restart simultaneously (cascade failure), or redis is unresponsive or showing AOF warnings.