debugging-and-error-recovery

Diagnose test failures, build errors, and runtime bugs through structured root-cause triage.

1|Updated Sep 4, 2026
One-click install
npx skills add https://github.com/SanHsien/agent-skills --skill debugging-and-error-recovery-sanhsien
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debugging-and-error-recovery
Source: https://github.com/SanHsien/agent-skills/tree/main/skills/debugging-and-error-recovery
Command: npx skills add https://github.com/SanHsien/agent-skills --skill debugging-and-error-recovery-sanhsien

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When tests fail, builds break, or runtime behavior goes wrong, developers often guess at fixes or patch symptoms instead of root causes. This Skill enforces a systematic six-step triage process—reproduce, localize, reduce, fix, guard, verify—so bugs are actually understood and stay fixed. ## Core Features & Use Cases - Structured Triage Checklist: Walks through reproduction, localization (including git bisect for regressions), minimal-case reduction, root-cause fixing, regression test creation, and end-to-end verification. - Error-Specific Decision Trees: Provides targeted triage flows for test failures, build failures, and runtime errors, plus strategies for non-reproducible bugs (timing, environment, or state dependent). - Safe Fallback Patterns: Supplies defensive coding patterns like safe defaults and graceful degradation for use under time pressure. - Use Case: A previously passing test suite breaks after a refactor. The Skill guides you to reproduce the failure in isolation, bisect to the offending commit, reduce to a minimal case, fix the actual cause, and add a regression test before resuming feature work. ## Quick Start Ask the agent to debug the failing test or broken build using the systematic triage checklist and add a regression test once the root cause is fixed.

Frequently Asked Questions about debugging-and-error-recovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a failing test systematically?

Reproduce the failure reliably first, then localize which layer is failing, reduce to a minimal failing case, and fix the root cause rather than the symptom. Finish by adding a regression test that fails without the fix and running the full suite to check for regressions.

How to find which commit introduced a bug with git bisect?

Run git bisect start, mark the current commit bad and a known-working commit good, then let git checkout midpoint commits while you run the failing test at each step. You can automate it with git bisect run followed by your focused test command.

What should I do when a bug is not reproducible?

Classify it as timing-dependent, environment-dependent, state-dependent, or truly random, then apply the matching strategy: add timestamps and artificial delays for races, compare environments and data, check for leaked shared state, or add defensive logging and alerting.

Should I skip a flaky or failing test to keep working?

No. Flaky tests often mask real bugs, and skipping failures lets errors compound into later work. Stop adding features, diagnose whether the test or the code is wrong, fix the root cause, and only resume after verification passes.

Why is fixing symptoms instead of root causes a problem?

Symptom fixes, like deduplicating data in the UI when the API query produces duplicates, leave the underlying defect in place to resurface elsewhere. Ask why the failure happens repeatedly until you reach the actual cause, then fix that layer.