agentleFS
shuvamkshuvamk/openbench/.claude/skills/tdd-cycle/SKILL.md

tdd-cycle

Skill2 starsChanged 5 months agoApache-2.0View on GitHub

Enforces red→green→refactor for any implementation work. Use before writing or modifying any source file under apps/ or packages/. Refuses to let implementation code be written without a failing test shown first.

4 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

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

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Commit: test: <behavior> (red) — this commit contains ONLY test changes.

    line 18
  2. Very specific:

    Green: Write the *minimal* implementation that passes.

    line 19

“Common” is measured: kept by at least 6 in 10 of the 3 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.

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

tdd-cycle

The TDD contract (CLAUDE.md) is a hard rule: no source file is created or modified without a failing test committed first, in the same or a preceding commit.

The cycle

  1. Red. From the issue's acceptance criteria, write the smallest test that captures the next behavior. Run it: npm run test -w <package> -- --run <file>.
    • It must FAIL, and fail for the right reason — an assertion about missing behavior, not a typo/import error you didn't intend. Read the failure output and say in one line why this is the right failure.
    • Commit: test: <behavior> (red) — this commit contains ONLY test changes.
  2. Green. Write the minimal implementation that passes. Run the test. Run the whole package suite. Commit: feat|fix: <behavior>.
  3. Refactor. With green as a safety net, remove duplication, tighten names/types. Suite stays green. Commit: refactor: … (only if you actually refactored).

Refusals (do not proceed if…)

  • You are about to Write/Edit product source and cannot point to the failing test run output from this session → stop, write the test. (The tdd-guard hook blocks this mechanically; do not bypass it.)
  • The test passes on first run → it isn't testing the new behavior. Fix the test.
  • The test fails for the wrong reason (bad import, syntax) → fix the test until the failure is the behavioral assertion.

Evidence

The PR body must cite the red commit sha and the green commit sha (PR template). The reviewer gate rejects source diffs that ship without test diffs.

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.