debugging-and-error-recovery
Skill1 starsChanged 23 days agoMITView on GitHub
Diagnoses failures by reproducing them, isolating the cause, and fixing the root problem. Use when a test fails, a bug is reported, an error appears in logs, a test is flaky, or a previous fix did not hold.
84 other projects use a version of this.
Adopted by
Most recently taken up by
- dzikrisyairozi/agent-skillstheir own version, first seen Nov 29, 2026
- aakash1552005/universal-agent-skillstheir own version, first seen Nov 29, 2026
- karanmrn/karanagentskillstheir own version, first seen Nov 29, 2026
- karanmrn/kstacktheir own version, first seen Nov 29, 2026
- e-landeros/gauntlettheir own version, first seen Nov 29, 2026
- zhengyanxiong/skillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use accessibility-engineering, observability-and-instrumentation and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
steven123397Skillaccessibility-engineering
Audits existing interfaces for WCAG 2.2 AA conformance and remediates the violations found. Use when auditing a page or component for accessibility, running axe-core or pa11y, triaging a11y violations, or checking screen reader and contrast issues before shipping.
Also in 4 projects that use this
jaydubya818Skillobservability-and-instrumentation
Add or review logs, metrics, traces, and actionable alerts.
Also in 35 projects that use this
jaydubya818Skilldeprecation-and-migration
Retire APIs or migrate consumers and persistent data across releases.
Also in 42 projects that use this
HK-hubSkillsource-driven-development
Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.
Also in 43 projects that use this
seikaikyoSkilldoubt-driven-development
對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。
Also in 39 projects that use this
seikaikyoSkillinterview-me
需求不明時的意圖萃取訪談:一次一題、每題附上自己的猜測、聽出「真正想要 vs 覺得應該要」,直到能預測使用者反應(約 95% 信心)才動工。適用:需求缺少對象 / 動機 / 成功標準 / 約束,或使用者點名「訪談我」「先確認一下」「我們確定嗎」。明確自足的指示、純資訊查詢、機械性操作不適用。
Also in 37 projects that use this
Other versions84 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 84
- addyosmani/agent-skills★ 121ksame name
- ollaya-dev/ollaya★ 1.5ksame name
- shashankswe2020-ux/whoop-mcp★ 181same name
- vinvcn/addyosmani-agent-skills-zh★ 46same name
- jmxt3/gitscape.ai★ 33same name
- sampleXbro/agentsmesh★ 31same name
- jaskirat1616/grok-skills★ 22same name
- ishandutta2007/Awesome-Agent-Skills★ 21same name
- JPeetz/agent-skills★ 21same name
- aboylabs/ai-agent-skills★ 15same name
74 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- code-review-and-qualitySkill
- code-simplificationSkill
- constraint-driven-developmentSkill
- git-workflow-and-versioningSkill
- incremental-implementationSkill
- planning-and-task-breakdownSkill
- shipping-and-launchSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- using-agent-skillsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 14 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 77 edited versions we read keep these.
14
Distinctive
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
- Distinctive: line 28
Use this skill when:
- Distinctive: line 37
Do not use it for:
- Distinctive: line 50
If the system is failing for users, stop the bleeding first: roll back, disable the flag, drain the queue, or fail over.
- Distinctive: line 60
Run it twice. If it only fails sometimes, you have a second problem: the nondeterminism is part of the bug.
- Distinctive: line 63
If you cannot reproduce it, say so and gather more evidence.
- Distinctive: line 67
Remove inputs, configuration, and code until the failure is as small as possible.
- Distinctive: line 73
Keep a short log:
- Distinctive: line 93
Read the code path from input to failure.
- Distinctive: line 94
Add a temporary assertion or log at the boundary.
- Distinctive: line 107
Add the reproduction as a failing test before the fix if it is not already.
- Distinctive: line 109
Run the full relevant suite.
- Distinctive: line 110
Add the check that would have caught it earlier, if one is cheap.
- Distinctive: line 114
After deploying, check the metric or log that revealed the problem.
- Distinctive: line 145
No regression test was added.
“Common” is measured: kept by at least 6 in 10 of the 77 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debugging and Error Recovery
Overview
Debugging is a search, not a guess. The goal is to explain the failure before changing anything. A fix applied to a symptom moves the defect somewhere less visible and makes the next investigation harder.
The loop is: stabilize, reproduce, reduce, hypothesize, test, fix the cause, prove it with a regression test, and watch for recurrence. Skipping the reproduction step is the most common reason a fix does not hold.
An agent is especially prone to pattern-matching a familiar error and editing the first plausible line. Resist that. Evidence first.
When to Use
Use this skill when:
- A test fails, especially one that passed before.
- A bug is reported by a user or a monitor.
- Logs show an error, a timeout, or an unexpected state.
- A test is intermittent or environment-dependent.
- A previous fix did not hold, or the same symptom returned.
- A deployment or migration left the system in a bad state.
Do not use it for:
- A feature that has never worked and is still being built.
- A deliberate failure used to test error handling.
Related: use the test-driven-development skill to turn the reproduction into
a permanent test, and the shipping-and-launch skill if the failure is in
production.
Core Process
1. Stabilize before investigating
If the system is failing for users, stop the bleeding first: roll back, disable the flag, drain the queue, or fail over. Preserve the evidence before restarting anything. A restarted process often destroys the state you need.
Record: timestamp, environment, version or commit, request or trace id, and the exact error.
2. Reproduce deterministically
Find the smallest command, test, or request that produces the failure on demand. Run it twice. If it only fails sometimes, you have a second problem: the nondeterminism is part of the bug.
If you cannot reproduce it, say so and gather more evidence. Do not fix a guess.
3. Reduce to a minimal case
Remove inputs, configuration, and code until the failure is as small as possible. The reduction usually reveals the cause. Keep the reduced case; it becomes the regression test.
4. Write down hypotheses
Keep a short log:
Symptom: splitCents(100, 3) returns [33, 33, 33], one cent lost.
H1: integer division drops the remainder. -> confirmed by reading the code
H2: rounding is applied twice. -> ruled out, one rounding site
H3: the caller discards the last element. -> ruled out, caller iterates all
Cause: the remainder is never distributed.A hypothesis must predict an observable difference. "Something in the cache" is not a hypothesis until it says what changes when the cache is disabled.
5. Test one variable at a time
Change one thing, run the reproduction, record the result. Do not batch changes; if the failure disappears, you will not know which change fixed it.
Useful tools, in rough order of cost:
- Read the code path from input to failure.
- Add a temporary assertion or log at the boundary.
- Disable a dependency or feature flag.
git bisectbetween a known good and known bad commit.- A profiler or trace for performance and concurrency issues.
6. Fix the cause
The fix should explain the symptom completely. If it only hides the symptom, keep looking. Ask why the defect was possible: missing validation, an unclear contract, a test gap, a race, a bad default.
7. Prove it and prevent it
- Add the reproduction as a failing test before the fix if it is not already.
- Confirm the test fails without the fix and passes with it.
- Run the full relevant suite.
- Add the check that would have caught it earlier, if one is cheap.
8. Watch for recurrence
After deploying, check the metric or log that revealed the problem. A fix that is not observed in production is a hypothesis, not a resolution.
Exit condition: the failure is reproduced, the cause is explained, a regression test passes, and the fix is verified in the environment where the failure occurred.
Common Rationalizations
| Rationalization | Why it is wrong | Required action |
| "It is flaky; just rerun it." | Flakiness is a real defect in the test or the system. | Reproduce it, find the nondeterminism, and fix or quarantine it explicitly. |
| "It is probably a race." | "Probably" is not a diagnosis. | Instrument the boundary and prove the ordering. |
| "Restarting fixes it." | Restarting hides state corruption and loses evidence. | Capture state first, then restart, then find the cause. |
| "Add a retry." | Retries mask the failure and multiply load. | Fix the cause; retry only for a proven transient with a bounded policy. |
| "It only happens in production." | That means the environment differs, which is a clue. | Reproduce with production configuration or add targeted observability. |
| "The logs are enough." | Logs show symptoms, not the state that produced them. | Add a trace or assertion at the failing boundary. |
| "I changed the test and it passes." | You may have deleted the only proof of the bug. | Keep the reproduction and prove it fails without the fix. |
| "The error is unrelated to my change." | That is a claim that needs a baseline. | Reproduce on a clean checkout and compare. |
| "I will fix the symptom now and investigate later." | Later rarely comes, and the cause keeps producing symptoms. | Stabilize if needed, then find the cause before closing. |
Red Flags
- The fix was applied before the failure was reproduced.
- The reproduction only works sometimes and that was accepted.
- Several changes were made at once.
- The "fix" adds a retry, a sleep, or a try/except that swallows the error.
- The failing test was edited or deleted.
- The explanation does not account for every observed symptom.
- Production was restarted before evidence was captured.
- The same bug has returned more than once.
- No regression test was added.
- The fix was never observed working in the failing environment.
Verification
- The failure was reproduced deterministically, or the nondeterminism was isolated and explained.
- A minimal reproduction exists.
- Hypotheses were written down and tested one at a time.
- The root cause is stated in one sentence that explains the symptom.
- The fix addresses the cause, not the symptom.
- A regression test was added and observed failing before the fix.
- The regression test passes and fails if the fix is reverted.
- The full relevant suite passes.
- The fix was verified in the environment where the failure occurred.
- A cheap earlier check was added to catch the class of defect.
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
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.

