本文へスキップ
Kitbay
掲載依頼
スキル

tdd-red-green-refactor

Apache-2.02026年11月6日 更新28,818GitHubスター

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

スキルの内容

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.

できること

  • 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