fix-and-test
Skill4 starsChanged 8 months agoMITView on GitHub
This skill should be used when the user asks to 'fix the tests', 'make tests pass', 'tests are failing', 'fix and test', 'green the tests', or wants to iteratively fix failing tests until they pass.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- concord-microtask-routerSkill
- deploy-checkSkill
- flow-validateSkill
- qa-auditSkill
- refactorSkill
- tddSkill
- write-flowSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Run a fix-test loop: identify failing tests, fix them, re-run tests, repeat until green.
- Very specific: line 14
Use this when the codebase is already in a failing state and the goal is recovery.
- Very specific: line 15
Do not use this for greenfield feature delivery (use tdd) or structural cleanup of already-green code (use refactor).
- Very specific: line 19
If the user provided an argument, use it as the test command (for example npm test -- auth).
- Distinctive: line 20
Run the command and triage existing failures.
- Distinctive: line 44
If you cannot fix a test after 5 attempts, explain what you tried and why it's failing.
≈ “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
Fix and Test
Run a fix-test loop: identify failing tests, fix them, re-run tests, repeat until green.
Use this when the codebase is already in a failing state and the goal is recovery.
Do not use this for greenfield feature delivery (use tdd) or structural cleanup of already-green code (use refactor).
What to do
- If the user provided an argument, use it as the test command (for example
npm test -- auth). Otherwise usenpm test. - Run the command and triage existing failures.
- Fix production code first; only edit tests when they are demonstrably wrong.
- Re-run the same command and iterate until green (max 5 passes).
- Once scoped tests are green, run full
npm testbefore declaring done.
Flow
flow:
retry max 5
run: npm test
if command_failed
prompt: Analyze the test failures above and fix the underlying code. Do not modify tests unless they are genuinely wrong.
end
end
done when:
tests_passRules
- Focus on fixing the source code, not the tests, unless the tests themselves are incorrect.
- During active triage you may run a scoped test command, but finish with the full suite.
- If you cannot fix a test after 5 attempts, explain what you tried and why it's failing.
Examples
For ecosystem-specific command patterns, see examples/multi-ecosystem.md.
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.

