fix-failing-tests
Skill4 starsChanged 5 months agoMITView on GitHub
Run the test suite, identify failing tests, diagnose the root cause in the source code, fix the bugs, and verify all tests pass.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- Integralist/agent-skillstheir own version, first seen Nov 1, 2026
- googleapis/mcp-toolboxtheir own version, first seen Oct 8, 2026
- googleapis/genai-toolboxtheir own version, first seen Oct 8, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- googleapis/mcp-toolbox★ 17ksame name
- googleapis/genai-toolbox★ 17ksame name
- Integralist/agent-skills★ 23same name
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 repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- commit-push-prSkill
- review-diffSkill
- validate-configSkill
- write-release-notesSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
9
Distinctive
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
- Distinctive: line 16
Use when the user asks to fix failing tests, debug broken code, or make tests pass.
- Very specific: line 40
If pytest is not available, try:
- Distinctive: line 56
Read the source file containing the function(s) that failed.
- Distinctive: line 74
If tests still fail, go back to Step 2 with the new failure information.
- Distinctive: line 78
All of these must be true:
- Distinctive: line 80
All test failures were diagnosed by reading both test and source code
- Distinctive: line 87
If no test files are found, inform the user and stop
- Distinctive: line 88
If the test runner itself fails to start (import errors, missing deps), report the error and stop
- Distinctive: line 89
If a test appears to be testing the wrong behavior (asserting something incorrect), explain your reasoning to the user and ask before …
- Distinctive: line 90
If you cannot determine the root cause after 3 attempts, stop and explain what you tried
“Common” is measured: kept by at least 6 in 10 of the 3 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
What I do
Run the project's test suite, identify which tests fail, read the failing test code to understand what is expected, find and fix the bugs in the source code (NOT in the tests), and re-run the tests until all pass. You execute this as an autonomous loop without asking the user for permission between steps.
When to use me
Use when the user asks to fix failing tests, debug broken code, or make tests pass. Trigger on phrases like:
- "fix the failing tests"
- "the tests are broken, make them pass"
- "debug the test failures"
- "something's wrong with the code, the tests fail"
IMPORTANT: Do NOT modify test files
The test files define the correct behavior. You must fix the source code to match the tests, never the other way around. If you believe a test is genuinely wrong, explain why to the user and ask before changing it.
IMPORTANT: Autonomous execution
Execute all steps below in sequence WITHOUT asking the user for confirmation. Do NOT ask "should I run the tests?" or "should I fix this?". Just do it.
Steps
Execute these steps in order. Repeat the loop until all tests pass.
Step 1: Run the test suite
python -m pytest -v 2>&1If pytest is not available, try:
python -m unittest discover -v 2>&1Capture all output. Identify which tests failed and what the failure messages say.
Step 2: Read the failing test code
For each failing test, read the test file to understand:
- What function is being tested
- What input is provided
- What output is expected
Step 3: Read the source code
Read the source file containing the function(s) that failed. Compare the implementation against what the tests expect.
Step 4: Fix the source code
Edit the source file to fix the bug(s). Common bug patterns:
- Off-by-one errors in ranges or indexing
- Wrong comparison operator (
>vs>=,<vs<=) - Missing or wrong case normalization (
.lower(),.upper()) - Incorrect accumulation (wrong initial value, wrong operator)
- Missing edge case handling (empty input, zero, None)
- Wrong return value or missing return
Step 5: Re-run the tests
python -m pytest -v 2>&1If tests still fail, go back to Step 2 with the new failure information. If all tests pass, report success.
Definition of done
All of these must be true:
- The test suite was run at least once
- All test failures were diagnosed by reading both test and source code
- Source code was edited to fix the bugs (tests were NOT modified)
- The test suite passes with zero failures when re-run
- A summary of what was fixed is reported to the user
Error handling
- If no test files are found, inform the user and stop
- If the test runner itself fails to start (import errors, missing deps), report the error and stop
- If a test appears to be testing the wrong behavior (asserting something incorrect), explain your reasoning to the user and ask before modifying the test
- If you cannot determine the root cause after 3 attempts, stop and explain what you tried
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.

