senior-debugging
Skill2 starsChanged 15 days agoApache-2.0View on GitHub
Use when a test, build or runtime behavior fails, a feature regressed, behavior is flaky, or a previous fix did not hold. Not for explaining code that works or reviewing a change without a reported failure.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- senior-code-reviewSkill
- senior-engineeringSkill
- senior-finishSkill
- senior-project-intelligenceSkill
- senior-skill-authoringSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Core rule: no fix until the cause is backed by evidence you observed.
- Distinctive: line 27
When something used to work, inspect the working-tree changes, recent commits on the failing path, dependency/lockfile changes, migrations, …
- Distinctive: line 33
After three fixes that did not hold, stop patching.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Debugging
Core rule: no fix until the cause is backed by evidence you observed.
Process
- Define the failure — exact symptom, expected behavior, environment.
- Reproduce — the smallest reliable reproduction you can get. If it does not reproduce, gather more data instead of guessing.
- Collect evidence — full error output and stack trace, failing test, logs, recent diff.
- Trace the path — follow the execution or data path back to where the bad value or state originates; fix there, not where it surfaces. Reproduce through the real entry points the data goes through (import, sign-up, API), not only the function the report names: a report describes a symptom, and the same cause usually breaks other paths.
- Rank hypotheses — two or three falsifiable explanations, most likely first.
- Test one hypothesis at a time — targeted inspection or temporary instrumentation; change one variable per experiment.
- State the root cause — separate the confirmed cause from contributing factors.
- Fix minimally, at the cause — no opportunistic refactoring. When the cause is in another module than the one reported, fix it there in this change; that is the bug, not extra scope. Ask first only before rewriting data already stored, or another destructive step; say which records stay wrong until then.
- Prove the fix catches the bug — a regression test that fails without the fix and passes with it. With the
seniorCLI, runsenior prove --regression --test "<command for that test>" --expect-failure "<text of the original failure>"(add--base <ref>once the fix is committed): it reverts only the fix, watches the test fail, restores the fix byte-for-byte and re-runs. Without the CLI, do it in one shell command, not one step per turn: run the test with the fix stashed, then restored (for examplegit stash push -- <fixed files> && <test>; git stash pop && <test>), and read the full output rather than a filtered one. - Re-run the original reproduction and the relevant suite.
In systems with several components (CI → build → deploy, API → service → database), log what enters and leaves each boundary once before theorizing; it shows which layer breaks.
Regression check
When something used to work, inspect the working-tree changes, recent commits on the failing path, dependency/lockfile changes, migrations, configuration and environment differences. Do not assume the newest commit is guilty without evidence.
Once a commit is implicated, read its whole diff (git show <sha>), not only the lines the failing test points at. List every behavior it changed (defaults, error handling, validation, header or case handling, return values) and decide for each one whether the change was intended. A failing test usually exposes one regression out of several in the same commit; restore every unintended change and cover each with a test. When the commit message says a change was intended (a new threshold, a renamed field), keep it and update the stale test instead.
When fixes keep failing
After three fixes that did not hold, stop patching. Repeated failures in different places usually mean the design or an assumption is wrong. Summarize what each attempt showed and discuss the structure with the user before a fourth attempt.
Red flags
| If you notice yourself thinking… | Do this instead |
| "I know what this is, I've seen it before" | Reproduce it first; similar symptoms often have different causes |
| "Adding a retry/timeout will make it go away" | Find out why the operation fails |
| "I'll change these few things together to save time" | One change per experiment, or you won't know which one worked |
| "The test is wrong, I'll relax the assertion" | Prove the test is wrong from the requirements before touching it |
| "The failing test passes now, so the regression is fixed" | Re-read the guilty commit's full diff for other unintended changes |
| "The report says fix this function, so the cause elsewhere is out of scope" | Fix the cause; ask only before rewriting data already stored |
| "The error is gone, so it's fixed" | Re-run the original reproduction and the regression test |
| "Production is down, there's no time to investigate" | Mitigate visibly (rollback, flag) if needed, then find the cause |
Exit criteria
Close debugging only when the root cause is explained with evidence, the original failure no longer reproduces, the regression test has been seen failing and passing, relevant verification passes, and remaining uncertainty is stated.
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.

