SKILL

test-driven-development

You MUST use this before writing or changing any production code, including one-line fixes and when the user is in a hurry: a new feature, a bug fix, a refactor, a behavior change. Write the failing test first, run it and watch it fail for the right reason, write the minimal code that passes, then run the whole test suite before saying it is done. Skip it only for throwaway prototypes, generated code or configuration-only changes, and only with the user's OK.

Target: Software development & testing. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Test-Driven Development (TDD)
  • Overview
  • When to Use
  • The Iron Law
  • Red-Green-Refactor
  • RED - Write Failing Test
  • Verify RED - Watch It Fail
  • GREEN - Minimal Code

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. 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. 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. Write one minimal test showing what should happen. Clear name, tests real behavior, one thing Vague name, tests mock not code Requirements: One behavior Clear name Real code (no mocks unless unavoidable) MANDATORY. Never skip. npm test h

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
davila7/claude-code-templates
Source file
cli-tool/components/skills/development/test-driven-development/SKILL.md
Fixed revision
21be197f100a12b8d0dd9a211cc244c8179f84d3
Read the complete original documentation ↗

Requirements

  • Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.

A small first task

先阅读原作者说明,再决定是否在自己的 AI 工具中使用。

Instructions for your AI tool

Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: davila7/claude-code-templates · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:44.841Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.