diagnosing-bugs
Diagnose hard bugs and performance regressions by building a feedback loop with tests or scripts.
MAmattpocock/skills338k5,008 new stars in the last 7 days
Fix a reproduced REA defect at its owning boundary; use when a tool, contract, recovery, lifecycle, or result is wrong, not for new features or suite-wide CI audits.
Fix the cause once, where the fact is produced, and remove what the fix makes
redundant. Follow the checkout's AGENTS.md, the
tool design guide and the
testing guide.
Start from what the agent or user actually sees, then follow the call inward until you reach the code that decides the wrong fact. Common boundaries, in the order a call crosses them:
tools/list, not the
canonical contract).Decide where the fix belongs. A shared boundary owns how facts are carried, formatted and enforced; the producer owns facts only it knows, such as a lifecycle outcome, a measured limit, a current revision or the next tool. A downstream repair cannot restore a fact the producer never recorded.
Search for the same decision made elsewhere: duplicated factories, hand-built copies of shared text, per-client or per-tool name branches, and parallel checks that can disagree. Group confirmed instances under one root cause and fix them together. Similar wording alone does not establish another instance; reproduce it.
Write the regression first and show it fails on the base revision for the reported reason. Take expected values from independent facts, such as a literal, a fake's observed calls, or the served schema, never from the production function under test. Assert the key fact the bug broke (identity, linkage, coverage, retry semantics, recovery, what was written or released), not only that an error occurred. Prefer a public CLI/MCP workflow, then a production-boundary test. When an existing test asserts the buggy value, update it with the fix instead of keeping both.
Delete the copies, fallbacks, aliases, wrappers and tests the new owner replaces, after checking their consumers. Keep malformed-input, cancellation, cleanup, permission, capacity and target-identity coverage.
Make the smallest change that removes the observed problem. Do not add a new mechanism, setting or abstraction for a theoretical or client-dependent gain; if one seems needed, state the concrete failure mode, likelihood and cost and get agreement first. Mark output or input changes that break a previously valid call as breaking, with migration.
Report the root cause, the structural fix, the sibling paths checked, the validation you ran, and anything left for later.
Diagnose hard bugs and performance regressions by building a feedback loop with tests or scripts.
MAmattpocock/skills338k5,008 new stars in the last 7 days
MAmattpocock/skills338k5,008 new stars in the last 7 days
MAmattpocock/skills338k5,008 new stars in the last 7 days
MAmattpocock/skills338k5,008 new stars in the last 7 days
MAmattpocock/skills338k5,008 new stars in the last 7 days
MAmattpocock/skills338k5,008 new stars in the last 7 days