Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Systematic debugging and error resolution using the TRACE framework (Trace, Read, Analyze, Check, Execute). Use when debugging errors, analyzing stack traces, investigating failures, root cause analysis, or troubleshooting production issues.
.claude/skills/aiskillstore-error-detective/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 150% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 179% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 220% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 182% | 0% |
Error Detective is a comprehensive debugging skill that applies systematic methodologies to identify, analyze, and resolve errors efficiently. Using the TRACE framework and structured analysis techniques, this skill guides you through debugging from initial error discovery to verified resolution.
TRACE is a systematic five-step approach to debugging any error:
Objective: Capture complete error information and context
Objective: Extract all information from the error itself
Objective: Understand the broader context around the error
Objective: Identify the underlying issue, not just symptoms
Objective: Implement and verify the solution
1. Read complete error message
2. Identify error type and severity
3. Check if error is reproducible
4. Assess impact (blocking, degraded, cosmetic)
5. Decide investigation priority1. Apply TRACE framework systematically
2. Use debugging tools (see scripts/debug_helper.py)
3. Generate and test hypotheses
4. Document findings as you go
5. Narrow down to root cause1. Design fix addressing root cause
2. Implement with proper error handling
3. Add logging and validation
4. Test thoroughly
5. Document solution1. Verify fix with original reproduction steps
2. Test related functionality
3. Add regression tests
4. Update documentation
5. Deploy and monitorAttributeError: 'NoneType' has no attribute 'X'
KeyError: 'key_name'
ImportError / ModuleNotFoundError
IndentationError
TypeError: Cannot read property 'X' of undefined
ReferenceError: X is not defined
Promise rejection / Uncaught (in promise)
SyntaxError: Unexpected token
NullPointerException
ClassNotFoundException
ConcurrentModificationException
pythonimport logging # Configure structured logging logging.basicConfig( level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s' ) # Log with context logger = logging.getLogger(__name__) logger.debug(f"Processing item: {item_id}, user: {user_id}") logger.error(f"Failed to process: {error}", exc_info=True)
python# Add contextual debug prints print(f"DEBUG: function_name called with {param1=}, {param2=}") print(f"DEBUG: variable state before operation: {var=}") print(f"DEBUG: condition check: {condition=}, result: {result=}")
When error location is unclear:
Explain code line-by-line to someone (or something):
The scripts/debug_helper.py utility provides automated assistance:
bash# Parse stack trace from file python scripts/debug_helper.py parse-trace error.log # Extract error patterns python scripts/debug_helper.py analyze-log application.log # Start debug session (creates log) python scripts/debug_helper.py session start "Login error investigation" # Add notes to session python scripts/debug_helper.py session note "Tested with different users - same error" # Close session with solution python scripts/debug_helper.py session close "Fixed: Added null check for user.profile"
Approach:
Common Causes:
Approach:
Common Causes:
Approach:
Common Causes:
Approach:
Common Causes:
Find which commit introduced a bug:
bashgit bisect start git bisect bad # Current version has bug git bisect good v1.2.0 # Version 1.2.0 was working # Git checks out middle commit # Test and mark as good/bad git bisect good/bad # Repeat until git identifies culprit commit git bisect reset
Errors that disappear when debugging:
Strategies:
For memory leaks and performance:
python# Python memory profiling import tracemalloc tracemalloc.start() # ... run code ... snapshot = tracemalloc.take_snapshot() top_stats = snapshot.statistics('lineno') for stat in top_stats[:10]: print(stat)
For API and integration errors:
Tools:
Check:
☐ T - TRACE
☐ Full error message captured
☐ Stack trace collected
☐ Reproduction steps documented
☐ Environment identified
☐ R - READ
☐ Error type identified
☐ Error message analyzed
☐ Error category determined
☐ Related errors checked
☐ A - ANALYZE
☐ Code reviewed
☐ Data inspected
☐ Environment verified
☐ State examined
☐ C - CHECK
☐ Error chain followed
☐ Hypotheses tested
☐ Root cause identified
☐ Assumptions verified
☐ E - EXECUTE
☐ Fix designed
☐ Fix implemented
☐ Fix verified
☐ Prevention measures addedImpact → Low Medium High Critical
Frequency ↓
High Medium High Critical Critical
Medium Low Medium High Critical
Low Low Low Medium High
Rare Backlog Low Medium Highexamples/debugging_workflow.md - Step-by-step debugging process examplesexamples/common_errors.md - Catalog of frequent error patterns and solutionsexamples/stack_traces.txt - Annotated stack trace examples with analysisscripts/debug_helper.py - Python debugging utilities for trace parsing and session managementRemember: Debugging is detective work. Be systematic, be patient, and let the evidence guide you to the truth. Every error message is a clue waiting to be understood.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 25,707 | 24,255 | -6% | 1 | 1 | 0% | 4,648 | 7,514 | +62% | 0 | 0 | — |
case-02 | fail→fail | 24,613 | 30,854 | +25% | 1 | 1 | 0% | 3,738 | 7,862 | +110% | 0 | 0 | — |
case-03 | pass→pass | 23,998 | 23,557 | -2% | 1 | 1 | 0% | 2,935 | 6,946 | +137% | 0 | 0 | — |
case-04 | fail→pass | 16,051 | 15,934 | -1% | 1 | 1 | 0% | 2,641 | 6,615 | +150% | 0 | 0 | — |
case-05 | pass→pass | 38,034 | 20,512 | -46% | 1 | 1 | 0% | 2,734 | 6,450 | +136% | 0 | 0 | — |
case-06 | pass→pass | 18,684 | 19,373 | +4% | 1 | 1 | 0% | 2,220 | 6,383 | +188% | 0 | 0 | — |
case-07 | pass→pass | 15,132 | 7,450 | -51% | 1 | 1 | 0% | 1,553 | 5,033 | +224% | 0 | 0 | — |
case-08 | pass→pass | 10,591 | 12,648 | +19% | 1 | 1 | 0% | 1,436 | 5,701 | +297% | 0 | 0 | — |
case-09 | pass→pass | 26,136 | 29,012 | +11% | 1 | 1 | 0% | 2,979 | 7,666 | +157% | 0 | 0 | — |
case-10 | pass→pass | 62,980 | 23,537 | -63% | 1 | 1 | 0% | 3,155 | 7,384 | +134% | 0 | 0 | — |
case-11 | pass→pass | 10,221 | 16,519 | +62% | 1 | 1 | 0% | 1,931 | 5,915 | +206% | 0 | 0 | — |
case-12 | pass→pass | 16,250 | 23,334 | +44% | 1 | 1 | 0% | 2,739 | 6,878 | +151% | 0 | 0 | — |
case-13 | pass→pass | 16,174 | 23,426 | +45% | 1 | 1 | 0% | 2,779 | 6,754 | +143% | 0 | 0 | — |
case-14 | pass→pass | 22,011 | 18,258 | -17% | 1 | 1 | 0% | 2,582 | 6,611 | +156% | 0 | 0 | — |
case-15 | pass→pass | 14,047 | 9,628 | -31% | 1 | 1 | 0% | 1,557 | 5,537 | +256% | 0 | 0 | — |
case-16 | pass→pass | 18,144 | 18,144 | 0% | 1 | 1 | 0% | 2,281 | 6,272 | +175% | 0 | 0 | — |
case-17 | fail→pass | 16,363 | 11,001 | -33% | 1 | 1 | 0% | 1,798 | 5,017 | +179% | 0 | 0 | — |
case-18 | fail→pass | 16,401 | 12,147 | -26% | 1 | 1 | 0% | 1,805 | 5,779 | +220% | 0 | 0 | — |
case-19 | fail→pass | 15,140 | 8,704 | -43% | 1 | 1 | 0% | 1,609 | 4,538 | +182% | 0 | 0 | — |
case-20 | pass→pass | 17,811 | 19,119 | +7% | 1 | 1 | 0% | 2,447 | 6,576 | +169% | 0 | 0 | — |
case-21 | pass→pass | 17,061 | 17,941 | +5% | 1 | 1 | 0% | 2,518 | 6,536 | +160% | 0 | 0 | — |
case-22 | pass→pass | 12,968 | 19,275 | +49% | 1 | 1 | 0% | 2,269 | 6,312 | +178% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.