diagnosis
Use when diagnosing a hard bug, intermittent/flaky failure, or performance regression and you need the evidence bar for the diagnosis itself — a repeatable feedback loop, ranked falsifiable hypotheses before instrumentation, tagged debug logging that gets cleaned up, and a regression test at the correct seam. Complements process skills like systematic-debugging: this is the bar for what counts as a verified root cause, not a debugging walkthrough.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- diagnosis
- metadata
- { "owner": "tze", "status": "active", "authors": [ "tze", "Claude Fable 5" ], "last_reviewed": "2026-06-12" }
- description
- Use when diagnosing a hard bug, intermittent/flaky failure, or performance regression and you need the evidence bar for the diagnosis itself — a repeatable feedback loop, ranked falsifiable hypotheses before instrumentation, tagged debug logging that gets cleaned up, and a regression test at the correct seam. Complements process skills like systematic-debugging: this is the bar for what counts as a verified root cause, not a debugging walkthrough.
02 资源文件 1
- 参考文档agents/openai.yaml82 B
03 SKILL.md 正文
Diagnosis
A diagnosis claims cause; an unverified causal claim ships the wrong fix. This subskill grades the evidence produced while debugging: how the failure is reproduced, how hypotheses are eliminated, what proof a root-cause story must carry before a fix is trusted.
Use This Skill When
- A bug resists the first obvious fix, or its root-cause story is hand-wavy
- A failure is intermittent, flaky, or environment-dependent
- A performance regression needs locating, not lamenting
- Reviewing a fix whose explanation is "this seems to make it go away"
Do Not Use This Skill For
- The step-by-step debugging walkthrough —
/systematic-debugging(process); this subskill grades the evidence that process produces - Judging the test suite itself — test-rigor
- Pipeline-wide slowness (CI got slower, PRs queue) — ci-discipline
- The post-fix definition of done — engineering-bar
Core Rule
Diagnose with a loop, not a stare. Every hypothesis gets a cheap, repeatable experiment; the fix is proven by the same loop that reproduced the failure. "I read the code and I'm fairly sure" is a hypothesis, not a diagnosis.
The Bar
Cite the item violated, with the run/log evidence:
- A feedback loop exists before theorizing — Build the cheapest repeatable failure signal first, escalating only as needed: failing test → direct invocation (curl, CLI one-liner) → throwaway harness script → headless browser / trace replay → property fuzzing → commit bisection → differential run (working vs. broken environment) → human-in-the-loop script. Loop quality is speed, signal sharpness, determinism — improving the loop is diagnostic progress, not a detour.
- Non-deterministic failures get rate-raised, not retried — A 1% flake is not debuggable; drive reproduction toward ≥50% with parallel runs, stress injection, and seed/timing manipulation before hypothesizing. Retry-until-green is evidence destruction (test-rigor bar 6).
- Hypotheses are ranked and falsifiable before instrumentation — Write 3–5 candidate causes, ordered by likelihood × cost-to-test, each with the observation that kills it. Instrument to discriminate between hypotheses, never to "see what's happening".
- Instrumentation is tagged and temporary — Prefix every debug log with
a unique investigation tag (e.g.
[DEBUG-x7q2]); grep the tag before commit — a surviving debug print is cruft (cruft-cleanup). A genuine observability gap found en route gets promoted into deliberate, structured logging (engineering-bar bias 3), not left as a print. - The fix is proven by the loop — Red before, green after, same loop. "I can no longer reproduce it" without a recorded loop run is not evidence; neither is a passing suite that never reproduced the failure.
- A regression test lands at the correct seam — The test exercises the layer where the cause is observable, not three mocks away. If no such seam exists, say so: that is an architectural finding (dependency-hygiene), and the fix is incomplete without at least naming it. test-rigor bar 2 requires the regression test; this names where it belongs.
- Performance regressions are measured before blamed — Establish a baseline number, then bisect (commits, configs, or inputs) against it. A perf fix claim carries before/after measurements under the same conditions, never "feels faster".
- Close with the prevention question — "What would have prevented this bug?" and route the answer: missing coverage → test-rigor; missing seam or boundary → dependency-hygiene; silent fallback or unlogged failure path → engineering-bar biases 3 and 6. An answered prevention question that changes nothing is a finding in itself.
Workflow
- Loop (bar 1) — build the cheapest repeatable signal; if flaky, rate-raise first (bar 2).
- Rank (bar 3) — list 3–5 falsifiable hypotheses with kill conditions.
- Discriminate (bar 4) — add tagged instrumentation separating the top hypotheses; run the loop; cross off what the evidence kills.
- Fix and prove (bar 5) — apply the fix; show the loop red→green.
- Pin (bar 6) — write the regression test at the correct seam; verify it fails on pre-fix code.
- Clean (bar 4) — grep the investigation tag; delete or deliberately promote every hit.
- Prevent (bar 8) — answer the prevention question and route it.
Trigger Sanity Check
- Should trigger: "diagnose this", "this test fails one run in twenty", "p99 latency doubled since last week — find out why", "is this root-cause analysis actually verified?"
- Should not trigger: "walk me through debugging basics"
(
/systematic-debugging) or "review this test suite" (test-rigor).
04 同仓库更多 Skills
user-run
Use when a step needs privileges this session lacks (docker, sudo, another user's checkout or secrets, host access) and the owner must run it as tze. Writes a reviewable /home/orca/.tmp/<slug>/run.sh that impersonates tze (USER_TO_IMPERSONATE overrides), tees timestamped logs plus latest.log and collects artifacts there; Claude presents it with a risk and time brief, then continues from the logs. Triggers: "I'll run it for you", "permission denied on docker.sock", "needs sudo", "sudo: a password is required", "run as tze", "/user-run".
requesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
receiving-code-review
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
finishing-a-development-branch
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
executing-plans
Use when you have a written implementation plan to execute in a separate session with review checkpoints
dispatching-parallel-agents
Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies