davila7 avatar

Test Driven Development

This is uncompromising TDD enforcement. It walks you through red-green-refactor with zero tolerance for shortcuts: write the test, watch it fail, write minimal code to pass. The philosophy is stark: if you didn't see the test fail, you don't know what it tests. Code written before tests gets deleted, no exceptions. It anticipates every rationalization (I'll test after, I already manually tested it, deleting work is wasteful) and systematically dismantles them. The diagrams and examples are clear, but the real value is in the discipline. Use this when you need someone keeping you honest about actually doing TDD instead of just writing tests after the fact.

skills.sh installs
363
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill test-driven-development --agent claude-code

Installs into .claude/skills of the current project.

Files

Test-Driven Development (TDD)

Overview

Write the test first. Watch it fail. Write minimal code to pass.

Core principle: If you didn't watch the test fail, you don't know if it tests the right thing.

Violating the letter of the rules is violating the spirit of the rules.

When to Use

Always:

  • New features
  • Bug fixes
  • Refactoring
  • Behavior changes

Exceptions (ask the user first):

  • Throwaway prototypes
  • Generated code
  • Configuration files

Thinking "skip TDD just this once"? Stop. That's rationalization.

No test setup in the project? Use the smallest runner the stack already ships (node --test, python -m unittest, go test, cargo test), put the test next to the existing code's conventions, and tell the user you added it. Installing a runner such as pytest is a new dependency: ask first.

The Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Wrote production code in this task before its test? Delete it. Start over.

No exceptions:

  • Don't keep it as "reference"
  • Don't "adapt" it while writing tests
  • Don't look at it
  • Delete means delete

Implement fresh from tests. Period.

Red-Green-Refactor

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Categories
Testing & QA, Documentation
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1davila7 avatarab-test-setupdavila7/claude-code-templatesWhen the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this 356skills.sh installs
2pluginagentmarketplace avatarjava-testing-advancedpluginagentmarketplace/custom-plugin-javaAdvanced testing - Testcontainers, contract testing, mutation testing, property-based331skills.sh installs
3microsoft avatarplaywright-mcp-devmicrosoft/playwrightExplains how to add and debug playwright MCP tools and CLI commands.313skills.sh installs
4cinience avataralicloud-ai-multimodal-qwen-vl-testcinience/alicloud-skillsMinimal image-understanding smoke test for Model Studio Qwen VL.301skills.sh installs
5cinience avataralicloud-ai-video-wan-r2v-testcinience/alicloud-skillsMinimal reference-to-video smoke test for Model Studio Wan R2V.299skills.sh installs
6cinience avataralicloud-ai-entry-modelstudio-matrix-testcinience/alicloud-skillsMinimal matrix test wrapper for alicloud-ai-entry-modelstudio-test.297skills.sh installs