diagnose
Use when told to fix a bug or that X should do Y but does Z, something broken or a test failing unexpectedly, even if rushed or trivial; reproduce it red, then find the root cause before fixing it. Do NOT use for a vague request (use `grill`) or an approved task (use `build`).
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-09
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- diagnose
- description
- Use when told to fix a bug or that X should do Y but does Z, something broken or a test failing unexpectedly, even if rushed or trivial; reproduce it red, then find the root cause before fixing it. Do NOT use for a vague request (use `grill`) or an approved task (use `build`).
03 SKILL.md 正文
Diagnose
Overview
Finds a failure's root cause from a loop that shows it on demand. In anneal mode diagnose the preconditions hook refuses source edits until a red reproduction is recorded.
- You MUST record a failing reproduction with
anneal repro record --id <bug> -- <command>before changing source; exit 3 means it passed and reproduces nothing. - You MUST tag every temporary probe
[DEBUG-<id>]and runanneal repro leftoversuntil it exits 0. - You MUST run
anneal task done <bug> -- <command>before reporting a fix, the reproduction as<command>if no test is wanted; thecompletenesshook blocks a fixed claim without it. - You MUST NOT route around a
preconditionsdenial (writing source through Bash, say); record the reproduction instead.
When to use
- A test fails, a command errors or a behaviour is wrong, and the cause is not yet known.
Process
- Build the loop. Find the fastest command that shows the failure, ideally a test you keep. If none can run here (the fix is already in, a tool is blocked), say so, fix nothing and go to step 8. It's working if two runs fail the same way, or you said why none can.
- Record it red. Run
anneal mode diagnose, thenanneal repro record --id <bug> -- <command>. It's working if it exits 0 withdata.recordedtrue. - Read the evidence. Read the whole error, the trace and recent changes (
git log,git diff); compare a working case. It's working if you can say where the paths part. - Rank hypotheses. List three to five causes, most likely first. It's working if each names the observation that would rule it out.
- Test one at a time. Change one thing or add a tagged probe, run the loop, drop what it refutes. It's working if every run removes or confirms a hypothesis.
- Fix the cause. One change at the cause, not the symptom; after three failed fixes, ask the human about the design. It's working if the loop and the suite are green.
- Clean up. Remove tagged lines; keep the reproduction as a test. It's working if
anneal repro leftoversexits 0. - Report. With a fix, run
anneal task done <bug> -- <command>, then lead with the reproduction (red before the edit, green after), then the cause, ruled-out hypotheses and fix. With no loop, report the ranked hypotheses, each with the check that would rule it out, and no fix. It's working if the report opens with the reproduction or the list.
Rationalizations
| Excuse | Reality |
|---|---|
| "I can see the bug, I'll just fix it" | Without a red loop, nothing shows the fix worked. |
| "It's too hard to reproduce" | Try a narrower loop; if none runs, rank hypotheses instead of guessing. |
| "One more fix will do it" | Repeated failed fixes mean your model is wrong. |
| "The debug prints are harmless" | Untagged prints ship. |
| "It passes now, so it was flaky" | A failure that vanished unexplained comes back. |
| "The lead said skip the tests" | The reproduction is the test. Run task done with it. |
Red flags
- Editing source before
anneal repro recordhas exited 0. - Changing several things in one run.
- A fix that hides the symptom: a catch, a retry, a skipped test.
Verification
anneal ledger query --type repro_redshows the reproduction, with this worktree.- The reproduction passes and stays in the suite.
04 同仓库更多 Skills
write-skill
Use to write or change a skill test-first, even if the change looks like a wording fix; watch a case fail with no guidance, then pass Tiers 0 to 3 before merge. Do NOT use for turning a correction into a check (use `correct`) or building code (use `build`).
verify
Use when asked "is it fixed?", "tested?" or "can we close it?", or to check a claim, and before calling work done or fixed, even if told to skip tests; prove it fresh, failing before the fix and passing after, and doubt it. Do NOT use for an unknown failure (use `diagnose`) or the PR (use `ship`).
spec
Use when requirements are agreed, even if the spec seems obvious; write the spec or its acceptance criteria (EARS, SHALL), Out of Scope and the constitution check of its gates. Do NOT use for a new or vague request (use `grill`) or splitting a spec into tasks (use `plan`).
ship
Use when a change needs a pull request, review verdict or depth, merge, schema migration, rollout, canary or rollback, even if it looks safe; decide GO or NO-GO only with a rollback ready. Do NOT use for proving work done or passing (use `verify`) or a failure with an unknown cause (use `diagnose`).
plan
Use when a spec is ready, even if the work seems obvious; split it into tasks, each with its files, one test command and which tasks block it, then get the plan approved. Do NOT use for writing the spec (use `spec`), a new or vague request (use `grill`) or building an approved task (use `build`).
orchestrate
Use to run an approved plan's ready tickets across subagents, even when fanning out looks obvious; park one-way calls in weigh-in and rule on the rest. Do NOT use for one task (use `build`) or splitting work into tickets (use `plan`).