agentleFS
drafaeldrafael/coding-harness/skills/debug-error/SKILL.md

debug-error

Skill1 starsChanged 7 months agoMITView on GitHub

Systematically debug and fix errors using structured investigation. Use when the user asks to "debug", "fix an error", "troubleshoot", "investigate a bug", or shares an error message or stack trace.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

38 rules. About 0 are common, 38 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈38

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Follow this comprehensive debugging methodology to resolve: $ARGUMENTS

    line 13
  2. Distinctive:

    Create a minimal test case that reproduces the error consistently

    line 22
  3. Distinctive:

    Document the exact steps needed to trigger the error

    line 23
  4. Distinctive:

    Test in different environments if possible

    line 24
  5. Distinctive:

    Read the stack trace from bottom to top to understand the call chain

    line 28
  6. Distinctive:

    Look for any obvious issues in the failing code

    line 31
  7. Distinctive:

    Check recent changes that might have introduced the bug

    line 35
  8. Distinctive:

    Use debugger, profiler, or logging as needed

    line 51
  9. Distinctive:

    Test each hypothesis methodically

    line 56
  10. Distinctive:

    Use binary search approach to isolate the problem

    line 57
  11. Distinctive:

    Add strategic logging or print statements

    line 58
  12. Distinctive:

    Check data flow and transformations step by step

    line 59
  13. Distinctive:

    Verify input data format and validity

    line 62
  14. Distinctive:

    Check for edge cases and boundary conditions

    line 63
  15. Distinctive:

    Test with different data sets to isolate patterns

    line 65
  16. Distinctive:

    Check external dependencies and their versions

    line 68
  17. Distinctive:

    Verify network connectivity and API availability

    line 69
  18. Distinctive:

    Test database connections and query execution

    line 71
  19. Distinctive:

    Check for memory leaks or excessive memory usage

    line 74
  20. Distinctive:

    Check for resource deadlocks or contention

    line 77
  21. Distinctive:

    Look for race conditions in multi-threaded code

    line 80
  22. Distinctive:

    Check synchronization mechanisms and locks

    line 81
  23. Distinctive:

    Test under different load conditions

    line 83
  24. Distinctive:

    Consider if similar issues exist elsewhere

    line 89
  25. Distinctive:

    Consider multiple solution approaches and trade-offs

    line 93
  26. Distinctive:

    Add validation and defensive programming where needed

    line 95
  27. Distinctive:

    Test the fix against the original error case

    line 98
  28. Distinctive:

    Test edge cases and related scenarios

    line 99
  29. Distinctive:

    Run regression tests to ensure no new issues

    line 100
  30. Distinctive:

    Test under various load and stress conditions

    line 101
  31. Distinctive:

    Add appropriate unit and integration tests

    line 104
  32. Distinctive:

    Add input validation and defensive checks

    line 106
  33. Distinctive:

    Update documentation and code comments

    line 107
  34. Distinctive:

    Add metrics and health checks

    line 111
  35. Distinctive:

    Document the error, investigation process, and solution

    line 116
  36. Distinctive:

    Update code comments with context

    line 119
  37. Distinctive:

    Consider improvements to prevent similar issues

    line 124
  38. Distinctive:

    Update coding standards or guidelines if needed

    line 125

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Systematically Debug and Fix Errors

Systematically debug and fix errors.

Instructions

Follow this comprehensive debugging methodology to resolve: $ARGUMENTS

  1. Error Information Gathering
    • Collect the complete error message, stack trace, and error code
    • Note when the error occurs (timing, conditions, frequency)
    • Identify the environment where the error happens (dev, staging, prod)
    • Gather relevant logs from before and after the error
  2. Reproduce the Error
    • Create a minimal test case that reproduces the error consistently
    • Document the exact steps needed to trigger the error
    • Test in different environments if possible
    • Note any patterns or conditions that affect error occurrence
  3. Stack Trace Analysis
    • Read the stack trace from bottom to top to understand the call chain
    • Identify the exact line where the error originates
    • Trace the execution path leading to the error
    • Look for any obvious issues in the failing code
  4. Code Context Investigation
    • Examine the code around the error location
    • Check recent changes that might have introduced the bug
    • Review variable values and state at the time of error
    • Analyze function parameters and return values
  5. Hypothesis Formation
    • Based on evidence, form hypotheses about the root cause
    • Consider common causes:
      • Null pointer/undefined reference
      • Type mismatches
      • Race conditions
      • Resource exhaustion
      • Logic errors
      • External dependency failures
  6. Debugging Tools Setup
    • Set up appropriate debugging tools for the technology stack
    • Use debugger, profiler, or logging as needed
    • Configure breakpoints at strategic locations
    • Set up monitoring and alerting if not already present
  7. Systematic Investigation
    • Test each hypothesis methodically
    • Use binary search approach to isolate the problem
    • Add strategic logging or print statements
    • Check data flow and transformations step by step
  8. Data Validation
    • Verify input data format and validity
    • Check for edge cases and boundary conditions
    • Validate assumptions about data state
    • Test with different data sets to isolate patterns
  9. Dependency Analysis
    • Check external dependencies and their versions
    • Verify network connectivity and API availability
    • Review configuration files and environment variables
    • Test database connections and query execution
  10. Memory and Resource Analysis
    • Check for memory leaks or excessive memory usage
    • Monitor CPU and I/O resource consumption
    • Analyze garbage collection patterns if applicable
    • Check for resource deadlocks or contention
  11. Concurrency Issues Investigation
    • Look for race conditions in multi-threaded code
    • Check synchronization mechanisms and locks
    • Analyze async operations and promise handling
    • Test under different load conditions
  12. Root Cause Identification
    • Once the cause is identified, understand why it happened
    • Determine if it's a logic error, design flaw, or external issue
    • Assess the scope and impact of the problem
    • Consider if similar issues exist elsewhere
  13. Solution Implementation
    • Design a fix that addresses the root cause
    • Consider multiple solution approaches and trade-offs
    • Implement the fix with appropriate error handling
    • Add validation and defensive programming where needed
  14. Testing the Fix
    • Test the fix against the original error case
    • Test edge cases and related scenarios
    • Run regression tests to ensure no new issues
    • Test under various load and stress conditions
  15. Prevention Measures
    • Add appropriate unit and integration tests
    • Improve error handling and logging
    • Add input validation and defensive checks
    • Update documentation and code comments
  16. Monitoring and Alerting
    • Set up monitoring for similar issues
    • Add metrics and health checks
    • Configure alerts for error thresholds
    • Implement better observability
  17. Documentation
    • Document the error, investigation process, and solution
    • Update troubleshooting guides
    • Share learnings with the team
    • Update code comments with context
  18. Post-Resolution Review
    • Analyze why the error wasn't caught earlier
    • Review development and testing processes
    • Consider improvements to prevent similar issues
    • Update coding standards or guidelines if needed

Remember to maintain detailed notes throughout the debugging process and consider the wider implications of both the error and the fix.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.