agentleFS
45ck45ck/prompt-language/skills/fix-and-test/SKILL.md

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.

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
  1. Distinctive:

    Run a fix-test loop: identify failing tests, fix them, re-run tests, repeat until green.

    line 12
  2. Very specific:

    Use this when the codebase is already in a failing state and the goal is recovery.

    line 14
  3. Very specific:

    Do not use this for greenfield feature delivery (use tdd) or structural cleanup of already-green code (use refactor).

    line 15
  4. Very specific:

    If the user provided an argument, use it as the test command (for example npm test -- auth).

    line 19
  5. Distinctive:

    Run the command and triage existing failures.

    line 20
  6. Distinctive:

    If you cannot fix a test after 5 attempts, explain what you tried and why it's failing.

    line 44

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. If the user provided an argument, use it as the test command (for example npm test -- auth). Otherwise use npm test.
  2. Run the command and triage existing failures.
  3. Fix production code first; only edit tests when they are demonstrably wrong.
  4. Re-run the same command and iterate until green (max 5 passes).
  5. Once scoped tests are green, run full npm test before 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_pass

Rules

  • 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.