agentleFS
Harshvardhan86Harshvardhan86/claude-wave-plugin/skills/red-tests/SKILL.md

red-tests

Skill14 starsChanged 16 days agoMITView on GitHub

Use after DR and before any production code is written. Writes failing tests that encode the AC and DR visual assertions, then proves they fail by running them. RED phase of TDD — strict, no exceptions.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. myICOR/myPKA★ 319same 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 repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

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

    When implementation and tests are written together, the agent silently shapes the test to match what was easy to build.

    line 12
  2. Very specific:

    Place tests where the project conventions dictate (tests/, e2e/, __tests__/, *.spec.ts).

    line 44
  3. Distinctive:

    Run the test suite. The new tests must fail.

    line 50
  4. Distinctive:

    If a new test passes accidentally:

    line 52
  5. Distinctive:

    Test runner command for GREEN to use later

    line 61
  6. Distinctive:

    If any new test passes at this stage, you do not hand off until you understand why and either delete the test or rewrite it.

    line 70

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

RED Tests

You write tests first, watch them fail, then hand off. No production code. No exceptions. The point of RED is to prove the test will catch the failure before any implementation rationalises around it.

Why this skill exists

When implementation and tests are written together, the agent silently shapes the test to match what was easy to build. The feature ends with passing tests and broken behaviour. RED breaks that loop: you commit to the failure mode before knowing the implementation.

Inputs

  • .wave/ac.md
  • .wave/dr.md (especially the visual ACs section)

Procedure

1. Map ACs to tests

For each AC, write at least one test. For visual ACs from DR, the test must use:

  • getComputedStyle() for color, font, spacing, border, transform values
  • boundingBox() for size and position assertions
  • Real browser (Playwright preferred) — not jsdom, not happy-dom — for any visual claim
  • Effective CSS bytes comparison if the AC includes "the page is styled"

2. Banned assertion patterns (when used alone)

These pass on broken UIs and are forbidden as the only assertion in a visual test:

  • toBeVisible() — passes on 0×0 elements
  • customElements.get(X) !== undefined — registration ≠ rendering
  • not.toBeEmpty() — passes with whitespace
  • getAttribute('data-theme') === 'dark' — attribute set ≠ visible dark UI
  • toHaveCount(n) on children without asserting their styles

Each must be paired with a computed-style or bounding-box check.

3. Write the tests

Place tests where the project conventions dictate (tests/, e2e/, __tests__/, *.spec.ts). If there is no test infra, set it up minimally — Playwright + a single config — and document the choice in .wave/red.md.

For non-UI ACs (API responses, persistence), use the project's existing test runner. Same rule: assertion must encode the AC, not the implementation.

4. Prove they fail

Run the test suite. The new tests must fail. Capture the failure output.

If a new test passes accidentally:

  • The implementation already exists somewhere (great — strengthen the test until it fails meaningfully)
  • Or the test is asserting a tautology (rewrite — your test is broken)

5. Document the RED state

Write .wave/red.md with:

  • List of new test files
  • For each test: AC reference, assertion type, terminal output of the failure (paste it)
  • Test runner command for GREEN to use later

6. Hand off

Return to orchestrator with:

  • Path to .wave/red.md
  • Count of new tests
  • Confirmation: "RED verified — N tests failing as expected."

If any new test passes at this stage, you do not hand off until you understand why and either delete the test or rewrite it.

Anti-patterns

  • Writing tests that assert what the code does (tautology) instead of what the AC demands
  • Using mocks at the boundary the AC cares about. If the AC is about a real DB write, the test hits a real DB.
  • Skipping RED because "I can see the code passes". You can't. Run the tests.
  • Treating type errors or compile errors as "the test failed". Tests fail when they execute and the assertion is rejected — not when the runner can't start.
  • Asserting on framework internals that may change (e.g. specific React reconciler messages).

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.