diagnose
Skill0 starsChanged 27 days agoMITView on GitHub
Find the cause of a defect before changing anything: one command run red on the exact symptom, the case shrunk until each remaining part is needed for the red, three to five ranked hypotheses that each name the result that would falsify them, one change per probe tied to one hypothesis, the fix with a test run red without it where the failure costs something, and the cause written where it is kept. Run by a person, it waits for the reply to the hypotheses before the first probe. Run unattended in a plan's loop, it runs in a fresh agent, probes on a scratch copy, leaves the step's worktree unchanged and hands the fix over by where the defect was found. It leaves behind the diagnosis record. Triggers on: diagnose, diagnose this, debug this, this is broken, find the cause of, why does this fail, why is this slow, this got slower, this test is flaky, fails only sometimes, the cause is not known, diagnose the finding, find the cause a step's text asks for.
- Reads credentials
193 other projects use a version of this.
Adopted by
Most recently taken up by
- agent-services-at/pluginstheir own version, first seen Nov 8, 2026
- Eclipter/agentstheir own version, first seen Nov 8, 2026
- venhdev/skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Claude-Skillstheir own version, first seen Nov 8, 2026
- DeevsDeevs/agent-systemtheir own version, first seen Nov 8, 2026
- pedrohcgs/claude-code-my-workflowtheir own version, first seen Nov 8, 2026
Used with
Projects with it also use zoom-out, to-prd and 10 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.
victorgarciaesgiSkillzoom-out
Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.
Also in 61 projects that use this
GoogleSkillto-prd
Turn the current conversation into a PRD and publish it to the project issue tracker — no interview, just synthesis of what you've already discussed.
Also in 56 projects that use this
GoogleSkillto-issues
Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.
Also in 53 projects that use this
simo97Skilledit-article
The user will invoke this skill to help them edit an article.
Also in 17 projects that use this
simo97Skillwrite-a-skill
Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
Also in 44 projects that use this
AnasX7Skillsetup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
Also in 27 projects that use this
- +4 more from simo97
Other versions193 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 193
- github/awesome-copilot★ 41ksame name
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
- CherryHQ/cherry-studio-app★ 4.1ksame name
- pedrohcgs/claude-code-my-workflow★ 1.7ksame name
- formancehq/ledger★ 1.5ksame name
- getagentseal/founder-playbook★ 745same name
- victorgarciaesgi/regle★ 508same name
- amazingloft999-droid/mattpocock-skills★ 422same name
- openvetta/open-vetta★ 302same name
183 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 repository16 other files it gives its agents.
- skills/repo-setup/templates/CLAUDE.mdCLAUDE.md
- code-commentsSkill
- grillSkill
- landSkill
- ordo-helpSkill
- ordo-initSkill
- paperSkill
- plan-orchestrationSkill
- plan-retroSkill
- planSkill
- refuteSkill
- repo-setupSkill
- roadmapSkill
- session-retroSkill
- specSkill
- writingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
40 rules. 0 are common, 32 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 174 edited versions we read keep these.
32
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 42
No such folder is a refusal ("Stops").
- Distinctive: line 58
No such report or finding is a refusal ("Stops").
- Distinctive: line 75
Write into the record's "Where the probes run" section what the choice names.
- Very specific: line 102
Before the copy of a reviewer's finding is made, the output of git status --short and of git diff --binary <base> | shasum, run from inside …
- Distinctive: line 114
When the code produces the part on that path, the red command is changed to assert it where it happens.
- Distinctive: line 128
Run by a person, that ends in the stop "No red command" ("Stops").
- Very specific: line 132
Run by a person outside a /spec run, the false premise is also written into the step's Step 0 and committed, as the premise bullets of …
- Distinctive: line 145
When the shrink and the code leave fewer than three causes standing, the list holds those, with the reason no other is live, and is never …
- Distinctive: line 148
Run by a person, the skill shows them to the user.
- Distinctive: line 152
Run by a person, wait for the user's reply before the first probe ("Stops").
- Very specific: line 163
Every line of logging a probe adds carries one tag unique to the diagnosis, DIAG- and four hexadecimal digits.
- Distinctive: line 168
Run the red command after the probe.
- Distinctive: line 174
When every hypothesis is falsified, form a second list from what the probes showed.
- Distinctive: line 176
Run by a person, the skill waits for the reply and re-ranks as Steps 9 and 10 say before the first probe of the second list.
- Distinctive: line 186
When more than one hypothesis is left standing, the cause is the one that names what the operation gets wrong for every form of its input.
- Distinctive: line 197
Search the code the red command drives and the code that feeds it.
- Distinctive: line 198
Read forward from every source where a value of the kind the rule is about is read or assembled to every operation that uses it.
- Distinctive: line 199
Every source counts: each environment variable, configuration entry and default that supplies such a value.
- Distinctive: line 200
When the cause's rule is about the values a container holds, an operation that breaks only a rule of the container, such as how a list is …
- Distinctive: line 201
When the cause's rule is the container's own rule, every operation that breaks it is a place of the defect.
- Distinctive: line 214
Run it on the tree without the fix and on the tree with the change of the probe that shows the cause.
- Distinctive: line 217
Put each other input in one of three classes, named in the record as written here:
- Distinctive: line 219
not part of the defect: right on the tree without the fix.
- Distinctive: line 231
Write the operation, the rule stated at the kind of value, each place of the defect, the list, each right result and each result into the …
- Distinctive: line 244
After a cause not found the skill goes to Steps 21 and 22, then inside a plan to Steps 23.
- Very specific: line 245
After a cause not found outside a plan, Steps 23 and 24 are not run, so the record stays in $TMPDIR and its path is shown.
- Distinctive: line 246
Run by a person, a cause not found ends in a stop after Steps 22 ("Stops").
- Distinctive: line 257
Run the test on the tree without the fix and quote its failure for each test case.
- Distinctive: line 269
Every input not part of the defect gives its right result, as it did on the tree without the fix.
- Distinctive: line 272
When the change of the probe leaves an input that is part of the defect wrong, or makes an input that was right wrong, the fix is changed …
- Distinctive: line 278
After the second change, every input not part of the defect still gives its right result.
- Distinctive: line 286
Run the test, the red command, the original, unshrunk case and the red command on every other input listed.
- Distinctive: line 311
Run by a person, show the record whole to the user, before the cleanup.
- Distinctive: line 317
Run by a person outside a plan, done also when the red command run again on the original case is green.
- Distinctive: line 318
Write where the cause is kept.
- Very specific: line 363
After the refusal "No dispatch entry" for a finding of a reviewer's report, the step is prepared with /spec, then /diagnose runs again.
- Very specific: line 364
After the refusal "No dispatch entry" for a red line, /diagnose runs again once /land has taken the step back out of main and before /spec …
- Very specific: line 365
After /spec has prepared a red line's step again, /diagnose <symptom> runs with the failure in the step's Step 0 as the symptom.
- Very specific: line 366
After the refusal "No dispatch entry" for a step already landed, /diagnose <symptom> runs with the finding's failure scenario as the …
- Distinctive: line 385
Run by a person, the skill stays in the person's session.
“Common” is measured: kept by at least 6 in 10 of the 174 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
Diagnose a defect
/diagnose finds the cause of a symptom with a command that is red on it, before any theory. It leaves behind the cause, stated with the probe that shows it, the fix with its test, and the diagnosis record, which holds every command and result of the run.
Quick start
/diagnose <symptom> find the cause of a symptom, given in the user's words, in the checkout the skill is run in
/diagnose <entry> <step> <finding> find the cause of a finding of a plan's step, written as the refuter report names it
/diagnose <entry> <step> red line find the cause of a red line at the step's landing whose cause is not known
/diagnose <entry> <step> brief check <n> find the cause of finding <n> of the step's brief check
/diagnose <entry> <step> premise find the cause a step's text asks to have found, before the step's brief is writtenUse instead
| When | Use |
| A built step is to be reviewed | /refute <entry> <step> |
| The cause is known and a step is to be prepared | /spec <entry> <step> |
| Where a plan stands and which command comes next | /ordo-help <entry> |
What it reads
- The symptom, quoted exactly.
- For
/diagnose <symptom>, the user's words. - For a finding, the failure scenario in the report that holds it.
- For
premise, what the step's text says happens, in each part of the text that asks for a cause to be found.- The words of such a part vary, as in "find why X happens and end it" and "find the cause of X and fix it".
- The step's text is its line in
plan.md's step list, the rulings its tags name and its Step 0.
- For
- The rules file and the standards
.agents/plan.yamlnames,docs/glossary.mdand the ADRs in force as thespecskill's "What it reads" 5 says, each when the repository has it.- With no rules file, "Rules" states the rules this skill needs.
- Inside a plan, the ledger folder and
orchestrator-state.md.<entry>resolves to its folder as thespecskill's "What it reads" 2 says.- No such folder is a refusal ("Stops").
- For a finding of a reviewer's report and for a red line, the dispatch entry for the step names the worktree and the base.
- For a red line, the entry reads
landing: backed-out: a red line the landing could not fix on main has taken the step back out of main, as thelandskill's Steps 6 says. - For a reviewer's finding or a red line, no dispatch entry for the step, or one that reads
landing: preparing, is a refusal ("Stops"). - For a red line, an entry that does not read
landing: backed-outis a refusal too. - A brief-check finding is diagnosed while the step's dispatch entry reads
landing: preparing, and no dispatch entry is read for it. - For
premise,plan.mdholds the step's text (item 1).- The rulings its tags name are resolved as the
specskill's "What it reads" 4 resolves them,(self-rule)endings included.
- The rulings its tags name are resolved as the
premiseruns while the step's dispatch entry readslanding: preparing, and reads no dispatch entry and no brief, since the step is not prepared yet.- For
premise, a step that is not in the step list is the refusal "No part to investigate" ("Stops").
- Inside a plan, for every form but
premise, the step's briefagents/briefs/<step>.md. - Inside a plan, for every form but
premise, the report the finding is in.- For a finding written as a heading and a number, the refuter report
agents/reviews/<step>-refuter.md: the finding of that name in the first run, before any heading "Repair round<n>, refuted". - For a finding written
round <n>and a heading and a number, the finding of that name under the heading "Repair round<n>, refuted" of the same report. - For
brief check <n>, the brief check's reportagents/reviews/<step>-brief-check.md, read as it stands on disk. - For
red line, the failure the step's landing recorded under the step's Step 0 inplan.md, and the open item in the state file when the landing booked one, whichlandSteps 6 does only when what to do is a decision for the user. - No such report or finding is a refusal ("Stops").
- For a finding written as a heading and a number, the refuter report
Steps
- Inside a plan, refuse when "What it reads" 3 or 5 finds an input missing.
- For
premise, refuse also when the step's text holds no part that asks for a cause to be found, before the record is opened. - Done when every input inside a plan exists, or the refusal names the missing one, or for
premisethe step and its text.
- For
- Open the diagnosis record with the symptom quoted in its Symptom section.
- Outside a plan, the record is a copy of
templates/diagnosis.mdin$TMPDIR, filled as the steps below run. - Inside a plan, the record is
agents/reviews/<step>-diagnosis.mdbeside the state file, a copy oftemplates/diagnosis.mdfilled as the steps below run. - A diagnosis agent fills a copy of
templates/diagnosis.mdin$TMPDIR, and the session saves that record at the path above from the agent's final message ("Rules"). - A later diagnosis of the same step is appended to that file under its own heading at the level of the record's title,
# Diagnosis: <the symptom in a few words>, which names its finding or quotes its part. - For
premise, each part of the step's text that asks for a cause to be found gets a diagnosis of its own, in the order of the step's text, the first filling the record as opened. - Inside a plan, the record is written to disk in the main checkout and not committed on its own, except as Steps 20 says for
premise.- The next resume-point commit of its own plan carries it, as
plan-orchestration's "Resuming, and handing the plan over" says.
- The next resume-point commit of its own plan carries it, as
- Done when the record exists and its Symptom section holds the symptom as "What it reads" 1 gives it, word for word.
- Outside a plan, the record is a copy of
- Choose where the probes run.
- Write into the record's "Where the probes run" section what the choice names.
- Outside a plan, the probes run in the user's checkout or worktree.
- Outside a plan, a defect that is not on the checkout (an older commit, with or without a patch) gets a scratch copy built as the next bullets say, run by a person too.
<commit>is that commit.- The patch, read from where the user names it, is applied with the last line of the block.
- Inside a plan, the probes run on a scratch copy under
$TMPDIRthat shares no file with the step's worktree. $tmpis made bymktemp -d "${TMPDIR:-/tmp}/diagnose.XXXXXX".- The copy is a detached worktree made from the main checkout.
- The commands for each source of the defect are these.
tmp=$(mktemp -d "${TMPDIR:-/tmp}/diagnose.XXXXXX") git worktree add --detach "$tmp/tree" <commit> # from the main checkout git diff --binary <base> # a reviewer's finding: from inside the step's worktree, saved to "$tmp/step.diff" git apply --allow-empty "$tmp/step.diff" # a reviewer's finding: from inside "$tmp/tree" git status --porcelain --untracked-files=all # a reviewer's finding: from inside the step's worktree, listing the files to copy git diff --binary <base> <branch> # a red line: from the main checkout, saved to "$tmp/step.diff" git apply --3way --allow-empty "$tmp/step.diff" # a red line: from inside "$tmp/tree" git apply --3way --allow-empty <patch> # outside a plan, a defect at an older commit with a patch: from inside "$tmp/tree" - For a finding of a reviewer's report:
<commit>is the dispatch entry's base.- The step's diff is taken from inside the step's worktree.
- Each file listed with
??is copied to the same path in the copy.
- For a red line,
<commit>isHEADand the step's whole range is taken from the branch of the kept worktree, which is named after the worktree's folder as thelandskill's "Removing a step's worktree" says. --allow-emptylets a step whose only changes are new files, with an empty tracked diff, be copied.- For a brief-check finding,
<commit>isHEADand nothing is applied, since the brief and its report are read as they stand on disk. - For
premise,<commit>isHEADand nothing is applied, since the step has no worktree and no diff. - Before the copy of a reviewer's finding is made, the output of
git status --shortand ofgit diff --binary <base> | shasum, run from inside the step's worktree, is written into the record. - A red command that would touch the user's real home, the installed skills or the pinned checkout runs with the variables that name those folders set to folders under
$TMPDIR. - Done when the probes have a place to run and the record's section names it, and for a reviewer's finding the record holds the two outputs.
- Build the red command: one command that drives the code path of the symptom and goes red on the exact symptom.
- A hypothesis formed, or code read to form one, before the command has been run red is an Anti-patterns row.
- Code read for a part the red command does not catch, as the bullets below say, forms no hypothesis and is not that row.
- The red command asserts every part of the exact symptom, both halves of a two-part symptom included, so that the shrink keeps what either part needs.
- Its output shows the result of each part: a suite that stops at its first failed assertion is run as one command per part, joined so that every one runs, so a cut that changes one part is seen.
- The record's Red command section lists each part of the reported symptom with whether the red command catches it.
- A part is caught when its assertion is red on the red command's runs.
- A part with no assertion, or with an assertion that is green on those runs, is not caught.
- Once the red command is red on the parts it catches, read the code that would produce each part it does not catch, along the path it drives.
- When the code produces the part on that path, the red command is changed to assert it where it happens.
- The assertion is on an output line, an intermediate state or a check before the run ends, since the end state can be unchanged when the run undoes its own change.
- The part is then red and asserted like the others.
- A part is called not reproduced, in the record or the session's final message, only when the code read along that path does not produce it.
- A part written as not reproduced carries the lines read and why they do not produce it.
- A red command that asserts only that something ran is an Anti-patterns row.
- The ways to build one are in "Ways to build a red command", in the order to try them.
- A red command of the first way, a failing test of the code where the symptom occurs, may be the test of Steps 16, and the record says so.
- Each of the three runs starts from the same state: the red command sets its state up itself, or each run gets a fresh scratch folder.
- A symptom seen only sometimes gets a failure rate measured over a stated number of runs, raised by more runs, parallel runs or narrower timing until it is high enough to probe against.
- A slow symptom gets a baseline first: the known-good version or the requirement measured over repeated runs with the mean and the spread, and red is a threshold stated from them.
- A defect in text (a skill, a page, a rule or a brief whose instructions led to the wrong behaviour) has as its red the quoted text beside the line of a run or transcript that shows the wrong behaviour it led to.
- A credential the red command needs is taken from the environment, never from a file into its command line or the record.
- When no red command can be built by any of the ways, or the scratch copy cannot reproduce because the symptom needs the real environment or a credential the environment lacks, the skill writes each way tried, with what it gave, into the record's "No red command" section.
- Run by a person, that ends in the stop "No red command" ("Stops").
- With no person present, that is the cause not found (Steps 15).
- For
premise, a red command that is green on main's head shows a false premise: the step's text says a behaviour happens that does not happen.- The false premise goes to
/spec, which handles it as its Steps 2 handles a false premise. - Run by a person outside a
/specrun, the false premise is also written into the step's Step 0 and committed, as thepremisebullets of Steps 20 say. - The diagnosis of that part ends there, after Steps 21 and 22.
- The false premise goes to
- Done when the "No red command" section is written, or for
premisethe false premise is handed to/spec, or the command, as changed for a part it did not catch, has been run and its output quoted in the record, with the same result on three runs in a row or the measured failure rate for a symptom seen only sometimes, and the record lists each part of the symptom with whether the command catches it and the lines read for each part it does not catch.
- Tighten the red command.
- It gets a faster setup, a sharper assertion on the symptom, pinned time, fixed random seeds, the file system isolated under
$TMPDIRand the network cut, as far as the symptom allows. - Done when it runs unattended in seconds where the symptom allows, and its runs after the tightening are quoted.
- It gets a faster setup, a sharper assertion on the symptom, pinned time, fixed random seeds, the file system isolated under
- Shrink the case: cut each part of it (an input, a caller, a configuration value, a piece of data, a stage of the run) one at a time, running the red command after each cut and putting back a cut that turns it green.
- Done when removing any remaining part turns the red command green, and the record's Shrunk case section lists each cut with its result.
- Form three to five ranked hypotheses, each written as "If
<cause>, then<change>turns the red command green" and naming the result that would falsify it.- Where it helps, a hypothesis adds "
<another change>makes it worse". - A hypothesis whose falsifying result cannot be named is sharpened or dropped.
- A hypothesis the shrink has already falsified is not one of the three to five.
- The rank is by how much of the evidence (the red output, the shrunk case, the code read) each hypothesis explains, then by how cheap its probe is.
- When the shrink and the code leave fewer than three causes standing, the list holds those, with the reason no other is live, and is never filled with one already falsified.
- Done when the record's Hypotheses section holds three to five hypotheses in rank order, or fewer with the reason, each with its falsifying result.
- Where it helps, a hypothesis adds "
- Show the red command, its output, the shrunk case and the hypotheses.
- Run by a person, the skill shows them to the user.
- With no person present, the skill writes the hypotheses into the record and goes on to Steps 11.
- With no person present, Steps 9 and 10 are not run.
- Done when the user has been shown them, or with no person present when the record holds them.
- Run by a person, wait for the user's reply before the first probe ("Stops").
- Done when the user's reply is in.
- Rank, drop or add hypotheses as the reply says.
- Done when the record's Hypotheses section holds the list the reply leaves, with the reply quoted.
- Make the one change of a probe: pick the next hypothesis in rank order and change one thing.
- Two changes in one probe is an Anti-patterns row.
- A probe tied to no hypothesis is an Anti-patterns row.
- A debugger or an interactive session is used where the language has one, and otherwise logging at the boundaries that separate the hypotheses.
- A hypothesis a debugger or logging probe leaves standing gets one more probe, the change the hypothesis names, so that Steps 15 has the red command green with it and red without it.
- For a slow symptom, a probe is a measurement: a timing harness or a profiler at the boundaries, compared with the baseline of Steps 4, or
git bisect runbetween two known states.- A log line does not measure time.
- Every line of logging a probe adds carries one tag unique to the diagnosis,
DIAG-and four hexadecimal digits. - Logging without that tag is an Anti-patterns row.
- Logging everything to search afterwards is an Anti-patterns row.
- Steps 11 to 13 repeat for each hypothesis until each has a result.
- Done when the tree differs from what it was before the probe by that one change.
- Run the red command after the probe.
- Record the probe: the record's Probes section holds the hypothesis's rank, the one change as a diff, the run and the result, falsified or still standing.
- A probe that breaks an other input, as Steps 15 says, leaves its hypothesis still standing, and the row names that input.
- Done when the row is written.
- Undo the change of the probe, the one that turned the red command green included.
- Done when the tree is as it was before the probe, and the change stands in the record as a diff.
- When every hypothesis is falsified, form a second list from what the probes showed.
- Show the second list as Steps 8 says.
- Run by a person, the skill waits for the reply and re-ranks as Steps 9 and 10 say before the first probe of the second list.
- Done when the record holds the second list with its falsifying results, Steps 9 and 10 have run over it when run by a person, and Steps 11 to 13 have run over it.
- State the cause: the hypothesis the probes left standing, with the probe that shows it, the red command green with the change and red without it.
- The cause is stated at the operation that goes wrong: the comparison, the lookup, the write or the parse that gives the wrong result.
- The operation is given with its place (the file and line, or the section of a text) and the rule it breaks.
- The rule is stated at the kind of value the operation reads: how a value of that kind must be read or treated.
- For a path, the rule reads "a path is read as the folder it names, whatever its spelling".
- A rule that states only what the one operation does, such as "two spellings compare equal", is restated at the kind of value.
- A cause stated as a property of the reported input, such as "the path has two trailing slashes", is not stated at the operation.
- It is restated at the operation that treats that input wrongly.
- When more than one hypothesis is left standing, the cause is the one that names what the operation gets wrong for every form of its input.
- A hypothesis that names how the operation treats one form of a value, such as one spelling, is set aside for the cause.
- A hypothesis whose probe broke an other input is not falsified by that input.
- The probe broke the input when, with the probe's change, the red command went wrong on that input or stopped at it in its setup before the reported input was reached.
- The broken input is recorded as an other input, in the probe's row of the Probes section.
- The hypothesis gets one more probe in the form of Steps 12: its change made at the operation so that it also gives that input its right result.
- That probe's change is undone as Steps 13 says.
- With the cause stated, find every place of the defect.
- A place is any operation that reads a value of the kind the rule is about and breaks the rule, whether a comparison, a derivation, a lookup, a write or a parse.
- The operation the cause names is the first place.
- The record names each further place with its file and line, or its section for a defect in text, and how it breaks the rule.
- Search the code the red command drives and the code that feeds it.
- Read forward from every source where a value of the kind the rule is about is read or assembled to every operation that uses it.
- Every source counts: each environment variable, configuration entry and default that supplies such a value.
- When the cause's rule is about the values a container holds, an operation that breaks only a rule of the container, such as how a list is divided into values, is not a place of the defect.
- When the cause's rule is the container's own rule, every operation that breaks it is a place of the defect.
- With the places found, list each other input that reaches a place of the defect:
- another spelling of the same value: repeated or trailing separators,
.parts, letter case, an encoding; - another name for the same thing: a link, an alias;
- a value not yet there: a path not yet made, an empty value;
- each other input the code that feeds a place of the defect admits.
- another spelling of the same value: repeated or trailing separators,
- Find them by reading the code or text that produces the inputs of each place of the defect, from the shrunk case back to where the inputs come from.
- The list holds the inputs the code admits.
- The reported input is not on the list.
- Each other input's right result is written in the record before its runs.
- The right result is the one the cause's rule gives, at whichever place of the defect the input is read.
- For a defect in code, run each other input through the red command, with that input in place of the reported one and the assertion set to that input's right result.
- The run observes the input's result at each place of the defect it reaches.
- Run it on the tree without the fix and on the tree with the change of the probe that shows the cause.
- Undo that change as Steps 13 says.
- Record each result, right or wrong against the input's right result.
- Put each other input in one of three classes, named in the record as written here:
- part of the defect: wrong on the tree without the fix at a place of the defect;
- not part of the defect: right on the tree without the fix;
- another defect: wrong on the tree without the fix only at an operation that breaks another rule.
- An input wrong at a place of the defect and at an operation of another rule is part of the defect.
- The record names that input's wrongness at the other operation as another defect.
- An input that is part of the defect is wrong at a place of the defect, so its failure costs something whenever the reported input's failure does.
- An input of another defect is written in the record with its result.
- An input of another defect is left for a diagnosis of its own.
- For a defect in text, the operation is the instruction that led to the wrong behaviour.
- For a defect in text, the kind of value is the kind of situation the instruction governs.
- For a defect in text, a further place is another instruction of the same text that governs a situation of that kind against the same rule.
- For a defect in text, the other inputs are the other situations that the instruction and each further place govern.
- Each is read against the text in place of a run, and put in the same three classes.
- Write the operation, the rule stated at the kind of value, each place of the defect, the list, each right result and each result into the record's "Operation and other inputs" section.
- State the cause in the record's Cause section with that rule and each place of the defect.
- The cause is not found when the second list is falsified too, when no probe can separate the hypotheses left, or, with no person present, when no red command can be built or the redacted output is not enough to diagnose.
- For a cause not found, the record says so in its Cause section, with every probe or, when no red command could be built, a pointer to its "No red command" section, which lists every way tried.
- Inside a plan, for every form but
premise, a cause not found is raised to the user as an open item, the oneplan-orchestration's "Stops" row "A finding that is the user's" leaves. - That open item quotes the hypotheses and every probe, or every way tried from the record's "No red command" section, and names the record's path.
- A cause not found is never sent to the builder.
- For
premise, when the step's text has no other part, the open item is raised as thespecstop "A cause not found" ("Stops") shows it. - For
premise, when the step's text has another part, the open item is raised asplan-orchestration's "Stops" row "A finding that is the user's" leaves it. - For
premise, the open item quotes the hypotheses and every probe, or every way tried, and names the record's path, as for every other form. - For
premise, that open item is the one open item for the part, andspec's Steps 2 raises no second one. - For
premiserun by a person outside a/specrun, the cause not found is also written into the step's Step 0 and committed, as thepremisebullets of Steps 20 say. - With no person present outside a plan, a cause not found is stated in the session's final message with the record's path.
- After a cause not found the skill goes to Steps 21 and 22, then inside a plan to Steps 23.
- After a cause not found outside a plan, Steps 23 and 24 are not run, so the record stays in
$TMPDIRand its path is shown. - Run by a person, a cause not found ends in a stop after Steps 22 ("Stops").
- Done when the record's Cause section names the cause at its operation with the rule stated at the kind of value, each place of the defect and its probe, and the "Operation and other inputs" section holds each place and each other input with its class and its results before the fix, or the Cause section says "cause not found".
- For a defect in code whose failure costs something, write a test that reproduces the shrunk case and reaches each place of the defect.
- The test has one test case for the shrunk case and one for each other input that is part of the defect.
- One of those test cases reaches each place of the defect and asserts the right result there.
- Each test case asserts its input's right result, whether or not the change of the probe already gave it, so a later fix that narrows again goes red.
- The rules file's rule that a test exists only for behaviour whose failure costs something decides whether the failure costs something, and with no rules file "Rules" decides it.
- A defect in code whose failure costs nothing gets no test, and the record says so.
- A place of the defect no test can reach is written in the record under "No test reaches it", with the reason.
- A defect in text is fixed by reading, with the text quoted before and after and no test.
- Done when the test is written with its test cases, each place of the defect reached by one, or the record holds the reason no test is written.
- Run the test on the tree without the fix and quote its failure for each test case.
- The tree is the one Steps 13 left, with every probe's change undone.
- A test written after the fix is an Anti-patterns row.
- Done when the record quotes, for each test case, a failure that shows the symptom, or, for a defect in text, quotes the text before.
- Make the fix at the places of the defect, starting from the change of the probe that shows the cause.
- The fix covers the operation the cause names and each further place.
- Where the places can share one change, the fix is that change: a helper every place calls, or one written form made at every source the values come from.
- Otherwise the fix is one change at each place.
- The fix covers every source a value of the kind the rule is about comes from.
- The fix at a place is one change, right for the reported input and for every other input that is part of the defect there.
- The fix is never one change per spelling.
- A fix that leaves a place of the defect giving a wrong result is not done, apart from a place written as not fixed.
- Every input not part of the defect gives its right result, as it did on the tree without the fix.
- An input of another defect is left out of the result.
- The fix is not widened to make an input of another defect right.
- When the change of the probe leaves an input that is part of the defect wrong, or makes an input that was right wrong, the fix is changed once more.
- A place found only after the fix is made goes back through Steps 15 to 17.
- On the way back, the runs of Steps 15 and 17 are on the tree as the first change left it.
- The undoing of Steps 13 does not apply to the fix.
- The failure of the new place's test case on that tree is quoted in the record.
- The second change may widen the fix to that place.
- After the second change, every input not part of the defect still gives its right result.
- An input that is part of the defect and still wrong after that second change is written in the record as not fixed, with its result.
- A place of the defect still giving a wrong result after the second change is written in the record as not fixed, with each input wrong there and its result.
- The test case of an input not fixed is taken out of the test, so the test asserts no known defect.
- The failing run of that test case is quoted in the record.
- The Cause section and the session's final message name each input not fixed and each place not fixed.
- A guard for a fix is an Anti-patterns row.
- Done when the fix is in the tree the probes ran in and no place of the defect gives a wrong result, apart from a place written as not fixed, and the record quotes the fix, with each input and each place not fixed written in the record, or for a defect in text quotes the text after.
- Run the test, the red command, the original, unshrunk case and the red command on every other input listed.
- Each input that is part of the defect gives its right result at each place where it was wrong, except an input written as not fixed.
- Each input not part of the defect gives its right result, as it did on the tree without the fix.
- Each input of another defect is left out of the result.
- For a defect in text, each place and each other situation is read again against the text after the fix and quoted in place of a run.
- Done when the test is green, the red command is green, the original case is green and each other input gives the result its class requires at every place of the defect, each quoted in the record, with an input written as not fixed quoted with its result.
- Inside a plan, hand the fix over by where the defect was found.
- For a finding and a red line, the step's worktree is left unchanged, as "Rules" says.
- A finding of the reviewer's first run of a full step: its fix and its test are the ruling of the next repair round, as
plan-orchestration's Steps 8 sends a round.- The ruling quotes the hypotheses with their results, the cause, the fix, both runs of the test and the record's path.
- The red command is the round's check.
- A finding of a small text step's review is never sent to the builder, as the
refuteskill's "Finding dispositions" says.- Its fix is made at landing on main when it is small and inside the brief, and otherwise raised to the user as an open item.
- A finding of the run over the last repair round: its fix is made at landing on main when it is small and inside the brief, and otherwise raised to the user as an open item, as the
refuteskill's "Over a repair round" 7 says, and it is never sent to the builder. - A red line: the step is already out of main (
landing: backed-out), so the cause, the fix and the record's path are written in the step's Step 0 inplan.md, for/specto carry into the step's new brief.- The fix is never made on main outside a landing, and never sent to the builder.
- A brief-check finding: its fix goes into the brief, as the
specskill's "Steps / The brief check" 4 closes a finding. premise: the cause, the fix, the red command and the record's path are written in the step's Step 0 inplan.md, for/specto carry into the brief.- The fix is never made on main, since the step's builder makes it from the brief.
- Run by a person outside a
/specrun, every ending of apremisediagnosis writes its result into the step's Step 0: the cause and its fix, the cause not found with its open item, or the false premise with the red command's green output. - The session then commits the record,
plan.mdand, for a cause not found, the state file at once, as a resume point. - It stages them with
git add -- <path> ..., since the record is a new file, then commits them withgit commit -q -m "<message>" -- <path> .... - A
/specin another session then finds no uncommitted change onplan.mdor the state file, which its Steps 1 would refuse. - Under
/specthe record and Step 0 are the session's own records, whichspec's preparation commit carries.
- Done when the fix and its test stand in the place the defect's source names, and for a reviewer's finding
git status --shortandgit diff --binary <base> | shasumfrom inside the step's worktree print what the record holds, and forpremiseStep 0 holds the result of the ending, as thepremisebullets above say.
- Run by a person, show the record whole to the user, before the cleanup.
- With no person present outside a plan, the record's path is named in the session's final message instead.
- With no person present outside a plan, Steps 24 is not run, so the record stays for whoever reads the run.
- Done when the user has been shown the record, or the final message names its path.
- Clean up, keeping the record.
- Done when the grep of the tag over the tree the probes ran in prints nothing, and the scratch copy, removed with
git worktree remove --force "$tmp/tree"from the main checkout, and every throwaway file are gone, a credential or.envfile copied into$TMPDIRamong them. - Run by a person outside a plan, done also when the red command run again on the original case is green.
- Done when the grep of the tag over the tree the probes ran in prints nothing, and the scratch copy, removed with
- Write where the cause is kept.
- Outside a plan, the session drafts the last bullet of the commit message, which states the cause, the red command and the fix's test, and names "No test reaches it" with its reason when the record holds one.
- Outside a plan, the session commits only as the repository's commit rule allows, naming the paths the fix changed in the form Steps 20 states, and otherwise shows the bullet to the user.
- Inside a plan, the orchestrator books the record at the step's landing, as the
landskill's Steps 9 says. - Done when the bullet is drafted and shown or committed, or, inside a plan, when the record's path and the cause are written for the landing's booking.
- Outside a plan, run by a person, remove the copy of the record in
$TMPDIRonce it has been shown.- Done when the copy is gone.
Ways to build a red command
- A failing test at the level that reaches the defect.
- A command-line run on a fixture, its output compared with the expected output.
- An HTTP request against a running server.
- A headless-browser script that drives the view and asserts on what it shows.
- Scratch files or a scratch repository under
$TMPDIRthat reproduce the state. - A replay of a captured input.
- A small harness that calls the code path directly.
- A loop over generated inputs, for a symptom that is sometimes wrong.
git bisect runon a scratch clone, when the defect appeared between two known states.- The same input through two versions, with the outputs compared.
- For a symptom only a person can trigger, a list of actions for the user to take, which is the stop "A red command a person drives".
- The session writes the list into the record, one action per line, each with what to look at after it, and shows it to the user.
- The user takes the actions in order and answers each with one line that says what they observed, and a longer output the user saves to a file that the line names.
- The record states which observation is the red before the user takes the actions.
- Each run of the red command that the steps ask for is one pass through the list.
- The session quotes each run's actions with the user's observations whole in the record's "Red command" section before the cleanup of Steps 22, a secret in them written
<REDACTED>.- The observations are the red command's own output, not a captured artifact, which "Rules" quotes only in the lines that carry the symptom.
Stops
The first five rows are stops. The cause not found, inside a plan, is a decision for the user and leaves an open item, and the other stops leave none. The last five rows are refusals.
| Stop | When | What it shows | What resumes it |
| The hypotheses | Run by a person, once Steps 7 has formed them, or Steps 14 a second list (Steps 9 and 10) | The red command with its output, the shrunk case and the ranked hypotheses with their falsifying results | The user's reply, then the probes with the ranking the reply gives |
| No red command | Run by a person, when the record's "No red command" section is written | Every way tried with what it gave, and a request for access to where the symptom occurs, a captured artifact (redacted, with only the lines that carry the symptom), leave to add temporary instrumentation, or the credential set in the environment | What the request names, then Steps 4 again |
| A red command a person drives | Run by a person, when only a person can trigger the symptom | The list of actions, one per line, each with what to look at after it | The user's observation after each action, one line each |
| Not enough output after redaction | Run by a person, when the output with each secret written <REDACTED> cannot show the cause; with no person present, Steps 15 gives it as a cause not found | That the redacted output is not enough, and what else the diagnosis needs | The user's answer, then the step that was running again |
| The cause not found | One of the conditions Steps 15 gives | The record with every probe, or every way tried from its "No red command" section, and inside a plan the open item | Inside a plan, the user's ruling on the open item or, under self_rule: on, the choice plan-orchestration's references/self-rule.md, "Closing an open item", books; run by a person, the user's next direction |
| No ledger folder | Inside a plan, no folder holds a plan.md that opens with # Plan: <entry> | A refusal that names /plan | /plan, then /diagnose again |
| No dispatch entry | Inside a plan, for a finding of a reviewer's report or a red line, the state file has no dispatch entry for the step or one that reads landing: preparing, or for a red line one that does not read landing: backed-out | A refusal that names the step and its landing state | What the bullets below give for the kind of input: a finding, a red line or a step already landed |
| No report | Inside a plan, for a finding, the report the finding is in is not on disk | The path where the report is read | The report written, then /diagnose again |
| No finding | Inside a plan, for a finding, the report holds no finding under the name given | A refusal that names the finding and lists the findings the report has | /diagnose again with a name the report holds |
| No part to investigate | Inside a plan, for premise, the step is not in the step list or its text holds no part that asks for a cause to be found | The step, and its text quoted | /spec <entry> <step>, which writes the brief with no investigation |
- After the refusal "No dispatch entry" for a finding of a reviewer's report, the step is prepared with
/spec, then/diagnoseruns again. - After the refusal "No dispatch entry" for a red line,
/diagnoseruns again once/landhas taken the step back out of main and before/specprepares it again. - After
/spechas prepared a red line's step again,/diagnose <symptom>runs with the failure in the step's Step 0 as the symptom. - After the refusal "No dispatch entry" for a step already landed,
/diagnose <symptom>runs with the finding's failure scenario as the symptom.
Anti-patterns
| Anti-pattern | Why it fails | Do instead |
| A hypothesis, or code read to form one, before the red command has been run red | The theory anchors on the first plausible cause while nothing shows the symptom | Build the red command first, as Steps 4 says, which also says what code may be read once it is red |
| A red command that asserts only that something ran | It goes green on a nearby failure, and the fix is then judged against another defect | Assert the error text or the wrong output of the symptom, as Steps 4 says |
| Two changes in one probe | The result cannot say which change moved it | One change per probe, as Steps 11 says |
| A probe tied to no hypothesis | Its result falsifies nothing, so it narrows nothing | Name the rank of the hypothesis it tests, as Steps 12 says |
| A test written after the fix | It has never failed, so nothing shows it catches the defect | Write the test and run it red on the tree without the fix, as Steps 17 says |
| A guard for a fix | A null check, an early return or a fallback silences the symptom while the cause stays, as the rules file's rule that a guard is not a fix says | Change the code at the cause Steps 15 states |
| Untagged logging | It survives the cleanup and reaches the commit | Tag every line with the diagnosis's one tag, as Steps 11 says |
| Logging everything and searching afterwards | The output does not separate the hypotheses, and the search finds what the reader already expects | Log at the boundaries that separate the hypotheses, as Steps 11 says |
Rules
- Who is present decides the waits: a person running the skill, by hand or inside a plan they run step by step, gets the waits of "Stops", and a session with no person present, a diagnosis agent or one running
/diagnose <symptom>on its own, gets none. - Inside a plan with no person present, the skill runs in a fresh agent, the diagnosis agent, for every form:
<finding>andround <n>,red line,brief check <n>andpremise.- Run by a person, the skill stays in the person's session.
- The session that holds the skill, the orchestrator or the
/specsession, starts the diagnosis agent.- It starts the agent as the effort agent
ordo-<reviewer_effort>on the model the configuration block'sreviewer:names, and checks it as therefuteskill's Steps 1 checks its reviewer:- The runner lists the effort agent.
CLAUDE_CODE_EFFORT_LEVELis unset.- The session reads the agent's id and served model right after the start.
- A served model that is not the configured one is the stop "A model other than the configured one".
- The agent is stopped.
- Nothing it wrote is used.
- It starts the agent as the effort agent
- The session makes the refusals of Steps 1 before it starts the diagnosis agent.
- The diagnosis agent changes no file of the main checkout or of the step's worktree.
- The diagnosis agent starts no agent and invokes no skill other than reading this skill's text. Every read and every probe of the diagnosis runs in the diagnosis agent's own session.
- The diagnosis agent's probes run on the scratch copy of Steps 3.
- The diagnosis agent's final message is the diagnosis record whole, which the session saves at
agents/reviews/<step>-diagnosis.md, under its own heading below an earlier diagnosis of the step. - The session, not the diagnosis agent, raises a cause not found as Steps 15 says.
- The session, not the diagnosis agent, writes what Steps 20 says into the step's Step 0 for
red lineandpremise. - Right after the diagnosis agent's start, the session writes the agent's numbered item into
plan.md's Agents section.- The item reads
<n>. <agent id>: diagnosis of step <k>, <served model>. - It stands under the heading "Agents in no role the cost script prices:", which the session makes when the section has none.
- An agent stopped for another model is written
<n>. <agent id>: diagnosis of step <k>, <served model>, stopped.
- The item reads
- The record's head holds the agent's id, its served model, and its tokens, tool uses and time from its completion notice, which the session fills.
- Inside a plan, the step's worktree, when the step has one, is never changed and every probe runs on the scratch copy of Steps 3, so
plan-orchestration's rule that a finding whose cause is not known is diagnosed read-only holds. - The skill runs against the user's real home, the installed skills or the pinned checkout only with the user's leave.
- A red command that would touch the user's real home, the installed skills or the pinned checkout runs with those paths redirected, as Steps 3 says.
- Every quoted command output carries
<REDACTED>in place of the value of a secret in it (a password, an API key, an access token, a private key, a session cookie, a credential inside a URL or a connection string), and keeps the rest of the line as printed, as the rules file's rule on secrets in quoted command output says. - A captured artifact is quoted only in the lines that carry the symptom.
- A statement about what the code does, such as "the cache is cleared only on restart", goes in the record and the final message only with the lines it rests on, read in this run.
- With no rules file, a defect in code whose failure costs something (lost work, a broken installation, a wrong configuration accepted) begins with a test that fails on the tree as it is.
- With no rules file, a guard is not a fix: a null check, an early return or a fallback does not close a defect.
- With no rules file, the fix reaches the code that lacks the thing it needs.
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.

