Diagnose root cause
Diagnose software failures through reproduction, boundary localization, competing hypotheses, and discriminating experiments. Use when Codex is asked to investigate a bug, flaky test, crash, incorrect result, performance regression, production symptom, or unexplained behavior and should determine the cause before implementing a fix. Produce an evidence-backed causal explanation and verification plan; do not patch unless the user also asks for a fix.From its SKILL.md
npx -y skills add contextosai/skills --skill diagnose-root-causeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.8 KB, 463 tokens by cl100k_base, as published. Nobody here has run it
Root Cause Diagnosis
Find the earliest incorrect transition that explains the observed symptom.
Protocol
- Preserve the original evidence: exact command/request, input, environment, versions, timestamps, complete error, and frequency. Redact secrets.
- Reproduce with the narrowest faithful path. If reproduction is unsafe or unavailable, use existing logs/tests and label the conclusion accordingly.
- Write the expected and observed behavior in falsifiable terms. Separate the primary symptom from secondary errors produced during recovery or cleanup.
- Map the path from input to symptom. At each boundary, identify the expected invariant and the observed value/state.
- Maintain 2–5 competing hypotheses. For each, record supporting evidence, contradicting evidence, and one experiment whose outcomes distinguish it from the others.
- Run the cheapest high-information experiment first. Prefer observation or a temporary diagnostic over production mutation. Change one variable at a time.
- Localize the earliest divergence. Then explain the causal chain from that divergence to the user-visible symptom.
- Search sibling paths and history only after localization. Use them to find blast radius and regression origin, not to replace causal evidence.
- Propose the smallest fix boundary and a regression test that fails before the fix and passes after it. Do not implement unless requested.
Guardrails
- Do not treat correlation, the last stack frame, or a recently changed line as root cause without a mechanism.
- Do not "debug" by making several speculative edits and seeing whether tests turn green.
- Do not overfit to one example; check the input partition around the failure.
- If evidence cannot distinguish causes, report the remaining hypotheses and the exact observation needed. Use confidence calibrated to evidence.
- For flaky/concurrent failures, model ordering, shared state, time, retries, and resource exhaustion explicitly.
- For performance failures, decompose wall time and resource consumption before optimizing code that merely appears hot.
Output
Use references/diagnosis-report.md. Lead with the proven or most likely cause,
then the causal chain and decisive evidence. Keep exploration history only when
it helps another engineer verify the conclusion.
What ships with it: 2 files
1.3 KB alongside SKILL.md
agents/
- openai.yaml235 B
references/
- diagnosis-report.md1.1 KB
Gives 0 of the 12 instructions most test skills give in 463 tokens
Counted across 1,201 of the 2,096 authors here whose files we hold, read 2026-09-06
- Write a failing test before writing codein 43 of 1201, across 36 files
- Run the full test suitein 36 of 1201, across 35 files
- Test only one variable per experimentin 34 of 1201, across 17 files
- Read product marketing context before asking questionsin 34 of 1201, across 14 files
- Mock external dependenciesin 34 of 1201, across 30 files
- Define primary, secondary, and guardrail metricsin 33 of 1201, across 16 files
- Pre-determine sample size before startingin 31 of 1201, across 14 files
- Test behavior rather than implementationin 31 of 1201, across 29 files
- Formulate a hypothesis before designing a testin 30 of 1201, across 13 files
- Document every test hypothesis, variant, and resultin 29 of 1201, across 11 files
- Use descriptive test function namesin 25 of 1201, across 21 files
- Commit to the methodology without stopping earlyin 24 of 1201, across 8 files
Said here and by no other author read
- Preserve original evidence and redact secrets
- Reproduce failure with narrowest faithful path
- Define expected and observed behavior in falsifiable terms
- Identify expected invariant at each boundary
- Maintain two to five competing hypotheses
- Run cheapest high-information experiment first
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.