dev-tdd

Guides test-first development using red-green-refactor cycles and behavior-driven tests.

Updated Jul 3, 2026
One-click install
npx skills add https://github.com/mnazaal/dotfiles --skill dev-tdd-mnazaal
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dev-tdd
Source: https://github.com/mnazaal/dotfiles/tree/main/.agents/skills/dev-tdd
Command: npx skills add https://github.com/mnazaal/dotfiles --skill dev-tdd-mnazaal

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after large implementation batches leads to weak coverage, vacuous assertions, and regressions that slip through silently. This Skill enforces a disciplined test-first workflow so every behavior is pinned by a failing test before any implementation code exists. ## Core Features & Use Cases - Red-Green-Refactor Workflow: A seven-step loop that picks one behavior, writes one red-capable test, implements the minimum code to pass, and refactors only while green. - Test Quality Rules: Concrete guidance on testing public interfaces, isolating shared fixtures, validating numerics against independent oracles, and handling stochastic and snapshot tests correctly. - ML Test Coverage: Standing test types for ML code including tiny-overfit, synthetic recovery, gradient flow, loss-at-init sanity, and shape/dtype checks with jaxtyping. - Use Case: When adding a new feature to a Python service, use this Skill to write a failing end-to-end test through the real CLI entry point first, then implement the smallest vertical slice that turns it green. ## Quick Start Use the dev-tdd skill to drive my next feature with a failing test through the public interface before writing any implementation code.

Frequently Asked Questions about dev-tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I practice test-driven development on a new feature?▼

Start with the smallest tracer bullet: write one failing test that exercises the behavior through the public interface, implement only enough code to pass, then refactor while green. Repeat with the next behavior rather than batching tests ahead of implementation.

What is the red-green-refactor cycle in TDD?▼

Red-green-refactor is the core TDD loop: write a test that fails for the right reason (red), write minimal code to make it pass (green), then improve the code structure while keeping all tests passing (refactor). Never refactor while tests are failing.

How should I test stochastic or randomized ML code?▼

Assert a distribution over multiple seeds, such as a median recovery metric, rather than a single-seed threshold. A lucky seed can hide seed-dependent failures, so single-run assertions pass vacuously even when the method is broken.

Why do my shared test fixtures cause false passing tests?▼

A fixture written by one test and read by the next passes vacuously when the writer stops running, because the later test asserts against data it never produced. Rebuild or truncate shared fixture state per test case to keep each assertion meaningful.

When should I write a characterization test before refactoring?▼

Pin behavior with a characterization test before changing code where being subtly wrong is silently critical: losses, samplers, custom gradients, numerical kernels, serialization, and public APIs. Code that fails loudly or has no meaningful behavior does not need one.

What are the limits of unit tests for verifying a pipeline?▼

Unit-green alone never proves a pipeline works; primary completion evidence is an end-to-end test through the real entry point such as the CLI or train step. Reserve isolated unit tests for logic tricky enough to earn them.