test-and-fix
Skill1 starsChanged 5 months agoMITView on GitHub
Run tests and auto-fix failures. Standalone test runner that diagnoses and repairs failing tests without manual intervention.
We split this skill into the rules it gives an agent
17 rules. 0 are common, 11 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
Run the test suite and automatically fix any failures.
- Distinctive: line 11
After making code changes
- Distinctive: line 13
When tests are red and you want them green fast
- Distinctive: line 30
If approaching budget, stop fixing and report what remains
- Very specific: line 34
Check the project root to determine the test command.
- Very specific: line 53
If --file was provided: $TEST_CMD [file] 2>&1
- Very specific: line 61
All pass? Report SUCCESS: All tests passing and exit.
- Very specific: line 75
If --no-fix: skip to Step 6.
- Distinctive: line 79
Read the failing test file AND the source file it tests
- Distinctive: line 83
If still failing, try ONE different approach
- Distinctive: line 84
If still failing after 2 attempts, flag for manual review and move to next failure
- Very specific: line 90
After all individual fixes, run the full suite: $TEST_CMD
- Distinctive: line 92
If fixes introduced NEW failures:
- Distinctive: line 114
Never delete tests to make them pass
- Distinctive: line 115
Prefer fixing source over changing test expectations (unless the test is genuinely wrong)
- Distinctive: line 116
If a fix changes public API behavior, warn the user before applying
- Very specific: line 118
If no test runner detected and user doesn't provide one, exit with BLOCKED: No test runner found
“Common” is measured: kept by at least 6 in 10 of the 5 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
Test and Fix (/test-and-fix)
Run the test suite and automatically fix any failures.
When to Use
- After making code changes
- Before committing
- When tests are red and you want them green fast
- As a standalone alternative to the fix loop in
/ship
Arguments
Parse $ARGUMENTS for these flags:
| Arg | Effect |
--file "path" | Run only specific test file |
--no-fix | Report failures without fixing |
| (bare path) | Treat as --file |
Time Budget
- Total: 10 minutes max
- Per-failure fix: 2 minutes max
- If approaching budget, stop fixing and report what remains
Step 1: Detect Test Runner
Check the project root to determine the test command. Do NOT assume bun test.
| Signal | Runner |
bun.lockb or bunfig.toml | bun test |
package.json with "test" script | bun run test (or npm test if no bun lockfile) |
pytest.ini, pyproject.toml [tool.pytest], or conftest.py | python -m pytest |
Gemfile with rspec | bundle exec rspec |
Makefile with test target | make test |
| None found | Ask user for test command, then proceed |
Store the detected command as $TEST_CMD for all subsequent steps.
Step 2: Run Tests
$TEST_CMD 2>&1If --file was provided: $TEST_CMD [file] 2>&1
Capture: pass/fail counts, error messages, stack traces, file locations.
If tests hang (no output for 60s): Kill the process, report timeout, ask user.
Step 3: Triage Failures
All pass? Report SUCCESS: All tests passing and exit.
Categorize each failure:
| Category | Example | Action |
| Type error | Property missing, wrong arg | Fix the type |
| Logic error | Wrong assertion value | Fix the implementation |
| Test drift | Test expectations outdated | Update the test |
| Missing mock | Unresolved dependency | Add mock/stub |
| Env/config | Missing env var, wrong DB URL | Fix config, don't touch code |
Step 4: Fix Loop
If --no-fix: skip to Step 6.
For each failing test (max 5 fix iterations total, max 2 attempts per failure):
- Read the failing test file AND the source file it tests
- Determine fix location: source code, test code, or mock/fixture
- Apply the fix using Edit tool
- Re-run just that test file:
$TEST_CMD [file] - If still failing, try ONE different approach
- If still failing after 2 attempts, flag for manual review and move to next failure
Never retry the exact same fix. Change approach or escalate.
Step 5: Full Suite Verification
After all individual fixes, run the full suite: $TEST_CMD
If fixes introduced NEW failures:
- Identify which fix caused it (check git diff)
- Revert that specific fix:
git checkout -- [file] - Report the conflict — don't attempt to resolve cascading failures
Step 6: Report
## Test Results
### Fixed
- `file:line` -- description of fix
### Still Failing (needs manual review)
- `file:line` -- why auto-fix didn't work
### Summary
- N tests total, N passing, N fixed this run, N need manual attentionSafety Rails
- Never delete tests to make them pass
- Prefer fixing source over changing test expectations (unless the test is genuinely wrong)
- If a fix changes public API behavior, warn the user before applying
- Max 5 fix iterations total, max 2 attempts per individual failure
- If no test runner detected and user doesn't provide one, exit with
BLOCKED: No test runner found
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- rayketcham-lab/qn-claude-web★ 2same name
- yu-iskw/skill-inspector★ 2same name
- renatorozas/claude-code-config★ 1same name
- yu-iskw/coding-agent-fabric★ 1same name
- prasadmogulothu/agent-skills★ 0same 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 repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/deep-recon/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adversarial-researchSkill
- algorithmic-artSkill
- api-integrationSkill
- breakdownSkill
- c4-architectSkill
- canvas-designSkill
- coding-agentsSkill
- compound-engineeringSkill
- context-budgetSkill
- counterfactualSkill
- critiqueSkill
- d3js-visualizationSkill
- data-analyst-agentSkill
- database-migrationsSkill
- deep-reconSkill
- design-tasteSkill
- doc-coauthoringSkill
- e2b-sandboxSkill
- ecosystem-auditSkill
- excalidraw-diagramSkill
- executing-plansSkill
- frontend-designSkill
- fullstack-agentSkill
- grillSkill
- kickoffSkill
- mcp-builderSkill
- model-migrationSkill
- naming-the-machineSkill
- full-output-enforcementSkill
- package-researchSkill
- pdf-generationSkill
- pp2pSkill
- pp3pSkill
- prompt-engineerSkill
- prompt-groundingSkill
- redesignSkill
- requesting-code-reviewSkill
- reverse-engineer-to-learnSkill
- review-changesSkill
- scratchpadSkill
- shipSkill
- slack-gif-creatorSkill
- sprint-architectSkill
- techdebtSkill
- threat-modelSkill
- verification-before-completionSkill
- visual-verdictSkill
- webapp-testingSkill
- web-asset-generatorSkill
- whatdidimissSkill
- writing-plansSkill
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.

