agentsclimarketplace

Tdd with llm agents

Skill msewell/agent-stuff/skills/tdd-with-llm-agents

Enforces strict red/green/refactor TDD discipline when writing code. Guides the agent through one-test-at-a-time cycles, prevents test subversion, and ensures minimal implementation. Use when writing code with TDD, doing test-driven development, implementing features test-first, or when the user mentions red/green TDD, failing tests first, or test-driven workflow.From its SKILL.md

Install
npx -y skills add msewell/agent-stuff --skill tdd-with-llm-agents

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

4.2 KB, 848 tokens by cl100k_base, as published. Nobody here has run it

Test-Driven Development with LLM Agents

Session start

Run the full test suite before any new work. Report the baseline (total tests, pass/fail counts). If any tests fail, fix those first.

Workflow: red/green/refactor

Execute one cycle at a time. Never batch.

RED — write one failing test

  1. Write exactly one test for the next behavior.
  2. Use a descriptive, behavior-focused name (should reject emails without @ symbol, not test case 3).
  3. Follow AAA: Arrange, Act, Assert.
  4. Run the test. Confirm it fails. If it passes, the test is wrong — it is not exercising new behavior.
  5. Do NOT write any implementation code in this phase.

GREEN — minimal implementation

  1. Write the minimum code to make the failing test pass.
  2. Do NOT modify, delete, or skip any test. Test files are read-only.
  3. Do NOT add functionality beyond what the current test requires.
  4. Run all tests. All must pass.
  5. If a previously passing test breaks, fix the implementation — never the test.

REFACTOR — clean up under green

  1. Improve structure: remove duplication, improve naming, simplify logic.
  2. Do NOT add new behavior.
  3. Run tests after every change. All must stay green.
  4. Refactor implementation first (tests are the fixed reference), then optionally refactor tests (implementation is the fixed reference). Never both simultaneously.

Repeat

Return to RED with the next behavior. Continue until the feature is complete.

Hard constraints

  • NEVER modify or delete a test to make it pass.
  • NEVER write implementation without a corresponding failing test.
  • NEVER skip the red phase (running the test to see it fail).
  • NEVER add functionality beyond what the current test requires.
  • NEVER proceed to the next test until the current cycle is complete.
  • If you believe a test is wrong, explain why — but do not change it without explicit approval.

Test quality

  • Test the public interface, not implementation details.
  • One behavior per test — single, unambiguous target.
  • Use concrete input/output values, not abstract descriptions.
  • Each test must be independent and self-contained.
  • Start with happy-path behavior, then add edge cases in later cycles.

Generating a TDD plan

For larger features, generate a plan before starting cycles:

  1. Produce a numbered checklist of test descriptions, ordered simplest to most complex. One behavior per item.
  2. Do not write any code yet.
  3. Get approval, then execute one test at a time via red/green/refactor.

Recovering from mistakes

  • Agent wrote implementation before test: Stop. Delete the implementation. Write the failing test first.
  • Agent modified a test to pass: Revert the test change. Fix the implementation instead.
  • Test passes unexpectedly (no red): The test does not exercise new behavior. Rewrite or discard it.
  • Context window getting large: Summarize completed work. Re-run the full test suite to re-anchor.

Reference material

What ships with it: 4 files

26.1 KB alongside SKILL.md

Gives 0 of the 12 instructions most context ai engineering skills give in 848 tokens

Counted across 1,193 of the 1,976 authors here whose files we hold, read 2026-08-07

  • Dispatch a fresh implementer subagent per taskin 48 of 1193, across 19 files
  • Dispatch a final code reviewer after all tasksin 33 of 1193, across 8 files
  • Provide full task text to the subagentin 30 of 1193, across 9 files
  • Review spec compliance before code qualityin 27 of 1193, across 10 files
  • Make the hook script executablein 26 of 1193, across 8 files
  • Re-snapshot after navigation or DOM changesin 25 of 1193, across 19 files
  • Read files before editing themin 22 of 1193, across 11 files
  • Answer subagent questions before proceedingin 22 of 1193, across 7 files
  • Mark task complete in TodoWrite after approvalin 22 of 1193, across 6 files
  • Merge hook into existing settingsin 21 of 1193, across 3 files
  • Ask if installation is global or projectin 20 of 1193, across 2 files
  • Copy the hook script to target locationin 20 of 1193, across 2 files

Said here and by no other author read

  • execute one red green refactor cycle at a time
  • write exactly one test for the next behavior
  • run the test and confirm it fails
  • write the minimum code to make the failing test pass
  • run all tests and ensure all pass
  • refactor implementation first then optionally refactor tests

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 326,758. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.