Awesome-omni-skill error-root-analyzer
Comprehensive error analysis and root cause resolution. Use when programs fail, crash, or produce errors during execution. This skill performs deep debugging by identifying root causes (not just surface-level symptoms), conducting thorough module reviews to uncover related bugs and exceptions, and implementing holistic fixes that address all discovered issues.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/error-root-analyzer" ~/.claude/skills/diegosouzapw-awesome-omni-skill-error-root-analyzer && rm -rf "$T"
skills/development/error-root-analyzer/SKILL.mdError Root Cause Analyzer
This skill provides a systematic approach to identify and resolve programming errors by analyzing root causes and conducting comprehensive module reviews.
Core Principles
- Root Cause Analysis: Never stop at surface-level error messages. Trace back to the fundamental cause.
- Holistic Review: When fixing a module, review its entire scope for related issues.
- Comprehensive Fixes: Address all discovered problems, not just the immediate error.
- Prevention: Identify and fix potential errors before they manifest.
Systematic Error Resolution Workflow
Phase 1: Error Capture and Initial Analysis
-
Capture Complete Error Information
- Full stack trace with line numbers
- Error type and message
- Input/state that triggered the error
- Environment context (Python version, OS, dependencies)
-
Identify Error Surface
- Immediate error location (file, function, line)
- Error category (syntax, runtime, logic, dependency, environment)
- Affected modules and components
Phase 2: Root Cause Investigation
Critical: Do not proceed to fixes until root cause is identified.
-
Trace Error Backwards
- Start from error line
- Trace execution flow backwards
- Identify the point where incorrect state/data originated
- Check all assumptions and preconditions
-
Analyze Error Patterns (See
)references/error-patterns.md- Import errors → dependency/path issues
- AttributeError → object lifecycle/initialization issues
- TypeError → data contract violations
- IndexError/KeyError → boundary/validation issues
- Connection errors → environment/configuration issues
-
Check Common Root Causes
- Missing or incorrect initialization
- Invalid assumptions about data/state
- Race conditions or timing issues
- Configuration mismatches
- Dependency version conflicts
- Resource availability (memory, disk, network)
- Permission issues
Phase 3: Comprehensive Module Review
When an error is found in a module, conduct a thorough review:
-
Static Code Analysis
- Review all functions/classes in the affected module
- Check for similar patterns that might fail
- Verify error handling completeness
- Validate input sanitization and boundary checks
- Check resource cleanup (file handles, connections, locks)
-
Dependency Analysis
- Review all imports and their usage
- Check for version compatibility
- Verify API contract assumptions
- Identify fragile dependencies
-
Logic Flow Analysis
- Trace critical paths through the module
- Identify edge cases not handled
- Check state management
- Verify transaction boundaries
- Review concurrency/threading issues
-
Exception Landscape
- Map all possible exceptions
- Verify exception handling coverage
- Check exception propagation correctness
- Ensure graceful degradation paths exist
-
Use Debugging Checklist (See
)references/debugging-checklist.md- Language-specific checks
- Framework-specific validations
- Common anti-patterns
Phase 4: Fix Design and Implementation
-
Design Comprehensive Fix
- Address root cause directly
- Fix all related issues found in module review
- Add missing error handling
- Implement defensive programming where needed
- Add validation/sanitization as appropriate
-
Prioritize Fixes
- Critical: Root cause and blocking issues
- High: Related bugs that will fail soon
- Medium: Missing error handling, edge cases
- Low: Code quality improvements
-
Implement Fixes Systematically
- Fix root cause first
- Apply related fixes in logical order
- Add tests for each fix if possible
- Document complex changes
-
Add Prevention Mechanisms
- Input validation
- Precondition checks
- Better error messages
- Logging for debugging
- Assertions for invariants
Phase 5: Verification and Testing
-
Verify Root Cause Fixed
- Test with original failure case
- Verify error no longer occurs
- Check fix doesn't introduce new issues
-
Test Related Fixes
- Test each identified issue
- Verify edge cases handled
- Check error messages are helpful
-
Regression Testing
- Test existing functionality still works
- Verify no new errors introduced
- Test with various inputs/scenarios
-
Integration Testing
- Test module in context of larger system
- Verify interactions with other modules
- Check end-to-end workflows
Error Analysis Strategies
For Import/Dependency Errors
- Check module installation and versions
- Verify import paths and PYTHONPATH
- Check for circular dependencies
- Verify virtual environment activation
- Review
orrequirements.txtpyproject.toml - Check for naming conflicts
For Runtime Errors
- Trace data flow to error point
- Check variable initialization
- Verify object lifecycle
- Review state mutations
- Check method call order
- Validate data types and contracts
For Logic Errors
- Review algorithm correctness
- Check boundary conditions
- Verify loop invariants
- Validate state machines
- Review calculation logic
- Check for off-by-one errors
For Performance/Timeout Errors
- Profile code execution
- Identify bottlenecks
- Check for infinite loops
- Review algorithm complexity
- Check database query efficiency
- Review memory usage patterns
Documentation and Communication
When reporting findings and fixes:
-
Error Summary
- What failed and how it manifested
- Root cause identified
- Why it occurred
-
Comprehensive Fix List
- Primary fix for root cause
- All related issues addressed
- Prevention mechanisms added
-
Risk Assessment
- Potential impact of changes
- Areas requiring extra testing
- Known limitations
-
Next Steps
- Recommended testing approach
- Monitoring suggestions
- Future improvements
Integration with Development Workflow
- Use this skill when any error occurs during development or testing
- Apply before deploying fixes to production
- Use for post-mortem analysis of production issues
- Apply during code review when bugs are found
Reference Materials
- Error Patterns: See
for common error patterns and their root causesreferences/error-patterns.md - Debugging Checklist: See
for language and framework-specific checksreferences/debugging-checklist.md