test-driven-development_skill

This skill guides you through test-driven development, ensuring you write a failing test first and implement minimal code to pass.
  • Python

128

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill ed3dai/ed3d-plugins --skill test-driven-development

  • SKILL.md9.5 KB

Overview

This skill codifies a strict Test-Driven Development (TDD) workflow to use when implementing features, fixes, or refactors. It enforces writing a failing test first, watching it fail, writing the minimal code to pass, then refactoring while keeping tests green. The goal is reliable behavior, fewer regressions, and faster, safer iterations.

How this skill works

You start by writing one minimal test that describes the desired behavior and run it to confirm it fails for the expected reason. Then implement the smallest amount of production code necessary to make that test pass, rerun tests to confirm success, and finally refactor code while keeping the test suite green. The process repeats for each distinct behavior or bug fix and treats any code written before a failing test as invalid and to be deleted.

When to use it

  • Implementing any new feature — write tests first
  • Fixing bugs — reproduce bug with a failing test before patching
  • Refactoring — add tests first to preserve behavior
  • Changing behavior or API — lock expected outcomes with tests
  • Never skip for production code; exceptions only with explicit human agreement

Best practices

  • Write one focused test per behavior with a clear name
  • Always run and confirm the test fails (not errors) before coding
  • Implement minimal code to pass a test; avoid premature features
  • After green, refactor while keeping all tests passing and clean
  • Use real code in tests; avoid mocks unless truly necessary

Example use cases

  • Add retry logic: write a test that fails until the operation retries N times
  • Fix validation: create a failing test for empty email, then implement validation
  • Refactor internal API: add tests describing behavior, then refactor safely
  • Bug regression prevention: reproduce a found bug with a failing test before fixing
  • Design API by tests: define the expected usage and behavior in tests first

FAQ

If a new test passes instantly, it likely tests existing behavior or the wrong thing. Fix the test to assert the missing behavior or delete any pre-existing implementation and start the cycle again.

When are mocks acceptable?

Use mocks only when real dependencies are impractical. Prefer testing real code and refactor toward dependency injection when tests require excessive mocking.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational