agentleFS
viknesh20-20viknesh20-20/claude-code-tool-kit/.claude/skills/tdd/SKILL.md

tdd

Skill7 starsChanged 7 months agoMITView on GitHub

Implements features using strict test-driven development — red-green-refactor cycle. Writes a failing test first, then minimal code to pass, then refactors. Use when building features that need high reliability.

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use make-bot-ui, Poteto Mode and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • eryzerzSkill

    make-bot-ui

    Use when building a custom UI (page, dashboard, buttons) that should wake a Grok Bot over a webhook, when the user must provide a webhook sender key, or when exposing that UI on Tailscale.

    Also in 8 projects that use this

  • jtarorehSkill

    Poteto Mode

    poteto's agent style for concise, detailed responses, deliberate subagents, unslopped prose, simple code, and verified work. Use for poteto, /poteto-mode, or requests to work in this style.

    Also in 5 projects that use this

  • risadamsSkill

    which-skill

    Router over this pack's skills and flows. Ask it "which skill fits X" when you don't remember what's available.

    Also in 7 projects that use this

  • TheOnlyFusionCubeSkill

    principle-attack-the-premise

    Inventory who actually owns or exhibits the imbalance, then challenge the shared premise before writing another patch. Use when two or more fixes that share one premise have failed the same gate.

    Also in 11 projects that use this

  • TheOnlyFusionCubeSkill

    principle-test-behavior-not-implementation

    Call the system the way its consumer does and assert meaningful observable output; avoid mocks or assertions that only mirror internal calls. Use when when writing or evaluating tests.

    Also in 11 projects that use this

  • shreyT19Skill

    principle-laziness-protocol

    Apply when refactoring, evaluating diff size, or tempted to add abstractions, layers, or signal threading. Bias toward deletion and the smallest change that solves the problem.

    Also in 22 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 177 edited versions we read keep these.

  • 14

    Distinctive

    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:

    Write the smallest possible test that describes the next piece of behavior

    line 21
  2. Distinctive:

    Run the test — it MUST fail

    line 23
  3. Distinctive:

    Verify the failure message is meaningful (not just a compilation error)

    line 24
  4. Distinctive:

    Write the absolute minimum code to make the test pass

    line 27
  5. Distinctive:

    Don't add functionality the test doesn't require

    line 29
  6. Distinctive:

    Run the test — it MUST pass

    line 30
  7. Distinctive:

    Run all related tests — nothing else should break

    line 31
  8. Distinctive:

    Remove duplication in both production and test code

    line 34
  9. Distinctive:

    Run tests after every refactoring step — they must stay green

    line 36
  10. Distinctive:

    Stop when the code is clean

    line 37
  11. Distinctive:

    Start simple, add complexity gradually:

    line 40
  12. Distinctive:

    NEVER write implementation before a failing test

    line 54
  13. Distinctive:

    NEVER skip the refactor step

    line 55
  14. Distinctive:

    If the test framework isn't set up, set it up first

    line 57

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

Test-Driven Development

Detect Test Environment

!ls package.json pytest.ini pyproject.toml go.mod Cargo.toml *.csproj Gemfile mix.exs 2>/dev/null !find . -type f \( -name "*.test.*" -o -name "*.spec.*" -o -name "test_*" -o -name "*_test.*" \) -not -path "*/node_modules/*" -not -path "*/.git/*" 2>/dev/null | head -5


The TDD Cycle

For the requested feature, repeat this cycle until complete:

RED — Write a Failing Test

  1. Write the smallest possible test that describes the next piece of behavior
  2. The test must import/reference the function or module (even if it doesn't exist yet)
  3. Run the test — it MUST fail
  4. Verify the failure message is meaningful (not just a compilation error)

GREEN — Make It Pass

  1. Write the absolute minimum code to make the test pass
  2. Hardcoding is acceptable at this stage — it will be cleaned up in refactor
  3. Don't add functionality the test doesn't require
  4. Run the test — it MUST pass
  5. Run all related tests — nothing else should break

REFACTOR — Clean Up

  1. Remove duplication in both production and test code
  2. Improve naming, extract methods, simplify logic
  3. Run tests after every refactoring step — they must stay green
  4. Stop when the code is clean

Test Progression

Start simple, add complexity gradually:

  1. Null/empty/zero case
  2. Single item / simplest valid input
  3. Multiple items / typical case
  4. Edge cases / boundary values
  5. Error cases / invalid input
  6. Async / concurrent behavior (if applicable)

Output

  • Show each cycle clearly: RED (test code + failure), GREEN (impl + pass), REFACTOR
  • Display test runner output at each step
  • Final summary: all tests, coverage of the feature

Rules

  • NEVER write implementation before a failing test
  • NEVER skip the refactor step
  • One behavior per cycle — don't batch multiple features
  • If the test framework isn't set up, set it up first

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.