Zum Inhalt springen
Kitbay
Einreichen
Skill

tdd-red-green-refactor

Apache-2.0Aktualisiert am 6. Nov. 202628.818GitHub-Sterne

A test-driven development skill kept in Google Labs' design.md repository and written for TypeScript and Node.js.

Was der Skill vermittelt

A test-driven development skill kept in Google Labs' design.md repository and written for TypeScript and Node.js. The agent writes one test, for example in Vitest or Jest, runs it and checks that it fails because the logic is missing rather than because of a setup error, writes the simplest code that passes, then refactors while rerunning the suite and undoing any change that turns it red. It forbids writing a batch of tests at once and editing an existing test to make failing code pass unless the requirement changed, and uses strict typing as a check against guessed solutions. A worked Vitest example is included.

Funktionen

  • Write one failing test at a time
  • Check that failures come from missing logic, not setup
  • Refactor while keeping the suite green
  • Forbid weakening tests to pass failing code