test-and-debug
Skill13 starsChanged 4 months agoMITView on GitHub
Diagnose and repair a failing test, build, or runtime error in a public open-source project using the narrowest reproduction and validation. Use when something is broken and the cause is not yet known. Classifies the failure, isolates a reproduction, applies the smallest fix, and confirms with a targeted check. Does not add features.
In this repository7 other files it gives its agents.
- dependency-reviewSkill
- implementation-integritySkill
- implement-minimalSkill
- oss-bootstrapSkill
- oss-planSkill
- public-code-reviewSkill
- release-deploySkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 7 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
No plan exists for a non-trivial change -> use oss-plan
- Distinctive: line 34
Read the first of these that exists, then follow it:
- Distinctive: line 39
If neither exists, apply this fallback: run one expensive command at a time, prefer the narrowest validation, disable watch mode, reuse …
- Distinctive: line 51
If neither exists, apply this fallback: select files before reading.
- Distinctive: line 83
Run the related test file to check for a regression in the same area
- Distinctive: line 84
If the fix changed public behavior, note the documentation impact
- Distinctive: line 88
Stop after the fix is confirmed
- Distinctive: line 120
Do not run the full suite to find which test fails.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
test-and-debug
Diagnose a failure, isolate the narrowest reproduction, apply the smallest fix, and confirm with a targeted check. Do not add features or refactor unrelated code while using this skill.
Activate when
- A test, build, typecheck, or runtime path is failing
- The cause of a failure is not yet known
- A previously passing check now fails
Do not activate when
- The change is a new feature with no failure yet -> use
implement-minimal - No plan exists for a non-trivial change -> use
oss-plan - The failure is a dependency install or version conflict only ->
use
dependency-review
Required inputs
- The failing command or the observed error
- Access to the repository to reproduce and inspect
- Whether the failure is new or pre-existing, if known
Low-resource policy
Read the first of these that exists, then follow it:
${CLAUDE_PROJECT_DIR}/.claude/shared/LOW_RESOURCE.md$HOME/.claude/shared/LOW_RESOURCE.md
If neither exists, apply this fallback: run one expensive command at a time, prefer the narrowest validation, disable watch mode, reuse existing environments, and run full validation only at a milestone boundary. Do not scan the whole filesystem to locate the policy.
Context-efficiency policy
Read the first of these that exists, then follow it:
${CLAUDE_PROJECT_DIR}/.claude/shared/CONTEXT_EFFICIENCY.md$HOME/.claude/shared/CONTEXT_EFFICIENCY.md
If neither exists, apply this fallback: select files before reading; use targeted searches and bounded ranges; do not preload references; do not reread unchanged files; finish one atomic increment and stop; create a compact handoff before context is exhausted.
Facts that must not be assumed
- The test runner, package manager, or build tool
- That the failure is deterministic
- That the failure is caused by the most recent change
- That an external system the code calls is currently reachable
Preflight
git status --shortandgit diff --statto see uncommitted workgit log --oneline -5to see recent changes that may correlate- Discover the project's test and build commands -> references/test-discovery.md
- Capture the exact failing command and its output
Workflow
- Reproduce the failure with the narrowest command that triggers it -> references/test-discovery.md
- Classify the failure -> references/failure-classification.md
- Isolate: reduce to the single test, input, or code path that fails
- Form one hypothesis about the cause and the smallest evidence to confirm it
- Confirm the cause before editing; do not fix by guessing
- Apply the smallest fix for that cause -> references/recovery-recipes.md
- Re-run the narrow reproduction; confirm it passes
- Run the related test file to check for a regression in the same area
- If the fix changed public behavior, note the documentation impact
- Inspect
git diffand remove debugging scaffolding and stray edits - Produce the report using templates/debug-report.md
- Stop after the fix is confirmed
Failure classification
Classify before fixing; the class determines the recovery -> references/failure-classification.md
- Assertion failure (wrong result)
- Error or exception (crash)
- Build or compile failure
- Type or lint failure
- Flaky or nondeterministic failure
- Environment or dependency failure
- External-system or boundary failure
- Timeout or resource-exhaustion failure
Recovery actions
Match the recovery to the class; apply the smallest one that resolves the confirmed cause -> references/recovery-recipes.md
Validation escalation
narrow reproduction command
single failing test
related test file
changed-file lint or typecheck
full suite only at the milestone that ends the workDo not run the full suite to find which test fails; find it with the narrow command first.
Stop conditions
- The failure cannot be reproduced locally after one focused attempt
- The failure depends on an unavailable external system with no mock
- The fix would require changing a public API or auth path without approval
- The root cause remains unconfirmed after one hypothesis-and-evidence pass
Human review boundaries
- A fix that touches auth, wallet, or user-data handling
- A fix that changes a public API surface
- A fix that can only be validated against an unavailable live system
Final report
Produce the report in the exact section order of templates/debug-report.md, then stop.
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.

