When your experiment code breaks, this walks through a structured debugging process: categorize the error (syntax vs runtime vs logic), analyze the root cause from tracebacks, apply targeted fixes with retry logic, then reflect on what went wrong to prevent it next time. It's built around a state machine that escalates from minimal edits to full rewrites after repeated failures. The workflow handles common ML debugging scenarios like device mismatches, shape errors, and the dreaded 0% accuracy bug. Honestly, the real value is in forcing you to slow down and categorize instead of randomly tweaking code until something works.

skills.sh installs
1.7K
GitHub stars
459
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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

Sponsors

Details

Repository
github.com/lingzhi227/agent-research-skills
Categories
AI & Agent Building, Data Science & ML, Debugging
First seen
Jun 3, 2026

More from lingzhi227/agent-research-skills

All 31
1github avatargtm-0-to-1-launchgithub/awesome-copilotLaunch new products from idea to first customers. Use when launching products, finding early adopters, building launch week playbooks, diagnosing why adoption s1.7Kskills.sh installs
2github avatargdpr-compliantgithub/awesome-copilotApply GDPR-compliant engineering practices across your codebase. Use this skill whenever you are designing APIs, writing data models, building authentication fl1.7Kskills.sh installs
3lingzhi227 avatarrelated-work-writinglingzhi227/agent-research-skillsWrite Related Work sections that compare and contrast prior work with your approach. Organize by theme, cite broadly, and explain how your work differs. Use whe1.7Kskills.sh installs
4github avatarsandbox-npm-installgithub/awesome-copilotInstall npm packages in a Docker sandbox environment. Use this skill whenever you need to install, reinstall, or update node_modules inside a container where th1.7Kskills.sh installs
5paulrberg avatarmd-docspaulrberg/agent-skillsUse ONLY to update or initialize README.md, CLAUDE.md, or AGENTS.md. Do not trigger for other Markdown files.1.7Kskills.sh installs
6simonwong avatarcode-simplifiersimonwong/agent-skillscode simplifier1.7Kskills.sh installs