debugging-and-error-recovery

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

1|Updated Mar 2, 2025
One-click install
npx skills add https://github.com/marjorg/setup --skill debugging-and-error-recovery-marjorg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debugging-and-error-recovery
Source: https://github.com/marjorg/setup/tree/main/home/.agents/skills/debugging-and-error-recovery
Command: npx skills add https://github.com/marjorg/setup --skill debugging-and-error-recovery-marjorg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When tests fail, builds break, or behavior changes unexpectedly, developers often guess at fixes or patch symptoms instead of causes. This Skill enforces a systematic six-step triage process that finds and fixes the actual root cause before work continues. ## Core Features & Use Cases - Structured Triage Checklist: A six-step workflow covering reproduce, localize, reduce, fix root cause, guard with regression tests, and verify end-to-end. - Error-Specific Decision Trees: Dedicated triage paths for test failures, build failures, and runtime errors, plus guidance for non-reproducible and flaky bugs. - Safe Fallback Patterns: Code patterns for graceful degradation, safe defaults, and instrumentation guidance on when to add or remove logging. - Use Case: A previously passing test suite breaks after a refactor. Use this Skill to reproduce the failure, bisect the offending commit with git bisect, reduce to a minimal case, fix the root cause, and add a regression test. ## Quick Start Use the debugging skill to triage why my test suite started failing after the last commit and find the root cause.

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 after a code change?

Reproduce the failure reliably first, then determine whether the test or the code is wrong. Run the specific failing test in isolation to rule out test pollution, fix the root cause, and add a regression test that fails without the fix.

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

Run git bisect start, mark the current commit as bad and a known working commit as good, then test each midpoint checkout. You can automate it with git bisect run followed by your test command to identify the exact offending commit.

What should I do when a bug is not reproducible?

Classify whether it is timing-dependent, environment-dependent, state-dependent, or truly random. Add timestamps and logging around the suspected area, compare environments and versions, check for leaked shared state, and set up monitoring for the error signature.

Why is fixing symptoms instead of root causes a problem?

Symptom fixes mask the underlying issue, which resurfaces elsewhere and compounds with later changes. Ask why the failure happens until you reach the actual cause, such as fixing a duplicate-producing query rather than deduplicating in the UI.

Should I skip a flaky test to keep working on features?

No. Flaky tests often mask real bugs, and skipping them lets errors compound into later work. Investigate timing issues, order dependence, or external dependencies, and fix the flakiness before resuming feature work.

When should I add or remove debug logging?

Add instrumentation when you cannot localize a failure, the issue is intermittent, or multiple components interact. Remove it once the bug is fixed and guarded by tests, and always remove logs containing sensitive data.