Skip to content

Structured debugging for failing experiment code, with error categorization, targeted fixes, and reflection to prevent repeats.

CCM score
43 of 100
skills.sh installs
1.7K
GitHub stars
483
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers a six-stage error workflow: categorize the error, analyze the root cause, apply a fix strategy, then reflect and prevent recurrence
  • Classifies failures into SyntaxError, ImportError, RuntimeError, TimeoutError, OutputError, and LogicError, each with a severity rating
  • Enforces minimal targeted edits, a cap of 4 to 5 fix attempts before changing approach, and truncation of error output to the last 1500 characters
  • Designed for debugging experiment code that crashes or produces incorrect results, with links to experiment-code, paper-to-code, and data-analysis

Install

$ npx -y skills add lingzhi227/agent-research-skills --skill code-debugging -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Code Debugging

Systematically debug experiment code with structured error categorization and fix strategies.

Input

  • $0 — Error message, stderr output, or code file with issues
  • $1 — Optional: the code that produced the error

References

  • Debug patterns and state machine: ~/.claude/skills/code-debugging/references/debug-patterns.md

Workflow

Step 1: Categorize the Error

CategoryExamplesSeverity
SyntaxErrorInvalid syntax, indentationLow
ImportErrorMissing module, wrong nameLow
RuntimeErrorDivision by zero, shape mismatchMedium
TimeoutErrorInfinite loop, too slowMedium
OutputErrorMissing files, wrong formatMedium
LogicErrorWrong results, 0% accuracyHigh

Step 2: Analyze Root Cause

  1. Read the error traceback (last 1500 chars if truncated)
  2. Identify the exact line and variable causing the error
  3. Check for common patterns:
    • Device mismatch (CPU vs GPU tensors)
    • Shape mismatch in matrix operations
    • Missing data normalization
    • Off-by-one errors in indexing
    • Incorrect loss function for task type

Step 3: Apply Fix Strategy

Details

Repository
github.com/lingzhi227/agent-research-skills
Categories
Debugging, AI Agents & LLM Apps
First seen
Jun 3, 2026

More from lingzhi227/agent-research-skills

All 31

Similar to Code Debugging

More Debugging