agentleFS
emiliodominguezemiliodominguez/flow-skills/skills/flow-test/SKILL.md

flow-test

Skill1 starsChanged 47 days agoMITView on GitHub

Behavior-focused tests. Use when adding coverage, writing a regression test first, or fixing flaky tests that fail randomly or intermittently. Hands off to `flow-work` for implementation or `flow-verify` for an acceptance gate.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test at the lowest level that exercises the real failure mode.

    line 10
  2. Distinctive:

    Read the requirement, changed code, test config, fixtures and repository commands.

    line 15
  3. Distinctive:

    No fixed pyramid or E2E quota.

    line 19
  4. Distinctive:

    Run the targeted tests and confirm discovery.

    line 25

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Test

Test at the lowest level that exercises the real failure mode. A useful test rejects a wrong observable result and survives a valid rewrite.

Process

  1. Read the requirement, changed code, test config, fixtures and repository commands. Identify the contract, risk and observation boundary before choosing a framework.
  2. Unit tests for pure logic, integration for real module/protocol boundaries, end-to-end for critical user flows, browser component tests when DOM, layout or interaction is the risk. No fixed pyramid or E2E quota.
  3. For an unclear contract, write a characterization test labeled with the behavior it preserves. Pin before you change, but do not freeze a known bug as intended behavior.
  4. One reason to fail per test. Assert outputs, accessible behavior, effects or public contracts. Mock external boundaries deliberately, never the code under test. Realistic fixtures, no credentials or production data.
  5. Run the targeted tests and confirm discovery. For a regression, show the failure before the fix (or a safe negative control) and check why it fails; a broken import proves nothing. Then run required gates and affected integration checks.
  6. Report commands, environment, discovered tests, results and gaps. Coverage shows unexercised code, not correct assertions.

Flakiness

Reproduce and isolate the nondeterminism: shared state, clock/timezone, randomness, ordering, network, concurrency, resource cleanup. Control clocks and seeds, wait on observable readiness, reset per-test state, and repeat enough to test the suspected cause. Never add a blind retry. A quarantine needs an owner and reason and stays visible as missing coverage. In UI tests, prefer semantic locators over sleeps; stabilize viewport, fonts and data before visual diffs and still inspect meaningful differences.

Red flags

  • "I'll write the test after the fix": then you never saw it fail for the right reason.
  • "It passes, so it works": check it would fail if the behavior broke.
  • "Just add a retry": find the nondeterminism first, and say so when a retry is requested.
  • "I need green today": a quarantine with an owner and visible missing coverage beats a retry that hides the bug.
  • "Mock it to make it pass": mocking the unit under test proves nothing.

For pure logic with wide input ranges, consider property-based tests; to check that assertions bite, mutate the code under test and confirm a test fails.

Anti-patterns

  • Snapshotting huge output without a contract or diff review.
  • Asserting a heading or implementation string exists instead of behavior.
  • Claiming a pass without running the real runner and checking discovery.
  • Adding a dependency, retry policy or global coverage target without demonstrated need.

Done when

  • Tests exercise the identified contract and fail for meaningful violations.
  • Actual runner results are recorded, including skipped or unavailable checks.
  • Remaining flakiness or coverage gaps have a consequence and next action.

Continue with flow-work for implementation, or flow-verify when evidence must pass a separate gate.

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.