debugging-root-cause
Skill1 starsChanged 32 days agoMITView on GitHub
Systematically find the root cause of a bug, failing test or production error through reproduction, hypotheses and evidence before changing code. Use when something fails and the cause is not yet proven.
In this repository105 other files it gives its agents.
- AGENTS.mdAGENTS.md
- instructions/AGENTS.mdAGENTS.md
- accessibility-reviewSkill
- agent-evaluationSkill
- agent-guardrailsSkill
- agenthub-routerSkill
- ai-red-teamingSkill
- ansible-reviewSkill
- api-designSkill
- api-integrationSkill
- architecture-decisionSkill
- backup-restoreSkill
- caching-strategySkill
- chaos-engineeringSkill
- ci-cd-pipeline-designSkill
- cloud-cost-optimizationSkill
- cloud-iam-least-privilegeSkill
- code-reviewSkill
- container-image-optimizationSkill
- cyber-resilience-actSkill
- database-migrationsSkill
- data-pipeline-reviewSkill
- data-privacySkill
- data-quality-checksSkill
- dependency-auditSkill
- dependency-upgradeSkill
- disaster-recovery-drillSkill
- docker-hardeningSkill
- documentationSkill
- dora-readinessSkill
- dpiaSkill
- email-deliverabilitySkill
- embedding-model-selectionSkill
- error-handling-reviewSkill
- eu-ai-act-readinessSkill
- eu-data-sovereigntySkill
- european-accessibility-actSkill
- event-driven-architectureSkill
- feature-flagsSkill
- frontend-reviewSkill
- gdpr-dsar-handlingSkill
- github-actionsSkill
- gitlab-ciSkill
- git-workflowSkill
- go-developmentSkill
- graphql-api-reviewSkill
- helm-chart-reviewSkill
- i18n-localizationSkill
- incident-responseSkill
- java-spring-reviewSkill
- kubernetes-reviewSkill
- linux-server-hardeningSkill
- llm-cost-analysisSkill
- llm-gateway-routingSkill
- llm-observabilitySkill
- llm-output-evaluationSkill
- llm-structured-extractionSkill
- load-testingSkill
- local-llm-servingSkill
- log-analysisSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
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 17
Reproduce: Write down the smallest command, request or test that shows the failure.
- Distinctive: line 21
Narrow down: Add targeted logging or assertions, shrink the input, isolate components.
- Distinctive: line 23
Fix and protect: Add a regression test that fails without the fix.
- Distinctive: line 24
Clean up: Remove temporary logging, and document the cause in the commit or PR description.
- Distinctive: line 29
Only reproducible in production → collect read-only evidence.
- Distinctive: line 53
No unrelated changes are included.
- Distinctive: line 59
Do not run destructive commands, alter production data or disable security controls to "see if it helps".
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debugging to Root Cause
Goal
Fix the cause, not the symptom. Every fix is backed by a reproduction that failed before and passes after.
Inputs
- Exact error text, stack trace, logs, failing command or test, and when it started.
- Environment: versions, configuration, data shape, recent changes (commits, deploys, dependency updates).
Procedure
- Reproduce. Write down the smallest command, request or test that shows the failure. If it is intermittent, measure the failure rate (for example 7 of 50 runs). No reproduction means the next step is collecting evidence, not editing code.
- Read the evidence completely. The whole stack trace, the first error rather than the last, logs around the timestamp. Note what is observed separately from what is assumed.
- Find what changed. Compare a working and a failing state:
git logandgit bisect, dependency lock diffs, configuration and environment differences, input data. - Hypothesise. List 2–4 candidate causes, each with a test that would confirm or eliminate it. Test the cheapest discriminating one first.
- Narrow down. Add targeted logging or assertions, shrink the input, isolate components. Change one variable at a time and record results.
- Confirm the root cause. You can explain the full chain from trigger to symptom, and a deliberate change to the suspected cause toggles the failure.
- Fix and protect. Add a regression test that fails without the fix. Make the minimal change, then run the related test suites. Search for the same pattern elsewhere.
- Clean up. Remove temporary logging, and document the cause in the commit or PR description.
Decision points
- Three failed fix attempts → stop patching; return to step 2 and question the architecture or assumptions.
- The cause is in a dependency → pin or work around locally, and report upstream with the minimal reproduction.
- Only reproducible in production → collect read-only evidence; do not experiment on production without authorization.
Anti-patterns
Changing several things at once; catching and ignoring the exception; adding retries or sleeps to hide races; "works on my machine" without an environment diff; declaring success without rerunning the original reproduction.
Example fixture
Symptom: test_invoice_total fails on CI only, passes locally.
Hypotheses: (1) timezone differs (CI=UTC) (2) locale decimal separator (3) test order dependency.
Discriminator: run locally with TZ=UTC → fails → hypothesis 1 confirmed; date boundary at 23:30 local time.Common rationalizations
| Rationalization | Reality |
| I know what it is, let me just fix it. | Fixing without a reproduction means you cannot prove the fix. Write the failing reproduction first; it takes minutes. |
| Adding a retry or sleep makes it pass. | That hides a race or dependency failure and makes it rarer, not gone. Find the mechanism. |
| It only fails on CI, so CI is broken. | CI differs in a specific, discoverable way (timezone, parallelism, versions). Diff the environments. |
| Three attempts failed, one more tweak will do it. | Repeated failed patches mean the mental model is wrong. Return to the evidence and question assumptions. |
Acceptance checks
- A reproduction exists and its before/after result is reported exactly.
- The root cause statement explains the mechanism, not only the location.
- A regression test fails without the fix (shown or stated as NOT RUN with a reason).
- No unrelated changes are included.
Output
Reproduction, evidence log, root cause, fix, regression test, and any remaining risk.
Safety
Do not run destructive commands, alter production data or disable security controls to "see if it helps". Redact secrets from logs before sharing them.
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.

