sp-tdd

Enforce test-driven development with failing tests before production code.

23|2|Updated Mar 1, 2026
One-click install
npx skills add https://github.com/tta-lab/ttal-cli --skill sp-tdd-tta-lab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sp-tdd
Source: https://github.com/tta-lab/ttal-cli/tree/main/skills/sp-tdd
Command: npx skills add https://github.com/tta-lab/ttal-cli --skill sp-tdd-tta-lab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Test-Driven Development (TDD) prevents shipping incorrect code by forcing you to define expected behavior up front, then verify it repeatedly as you implement and refactor.

Core Features & Use Cases

  • Failing-test-first workflow: Write a minimal test that demonstrates the missing behavior, then confirm it fails before any production code is written.
  • Red-Green-Refactor discipline: Implement the smallest change to make the test pass, re-run the full test suite, then refactor without adding new behavior.
  • Anti-rationalization guardrails: Detect and correct common shortcuts like writing tests after everything works, testing mock behavior, or skipping the “watch it fail” step.

Use case example: You’re adding a new API behavior—“reject empty email.” You start by writing a test that fails because the feature doesn’t exist yet, implement the smallest validation logic to make it pass, and only then refactor for clarity while ensuring the suite remains green.

Quick Start

Use sp-tdd when starting a new feature or bugfix so you can write a failing test first, then implement only enough code to make it pass.

Frequently Asked Questions about sp-tdd

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

FAQPage Schema
How do I enforce test-driven development for a new feature?

To enforce test-driven development, write a minimal failing test first that demonstrates missing behavior, then implement the smallest change to make it pass, and finally refactor without adding new behavior. This red-green-refactor cycle prevents shipping incorrect code.

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

The red-green-refactor cycle in TDD requires writing a failing test, implementing minimal production code to make it pass, and then refactoring for clarity while ensuring the test suite remains green. This discipline prevents regressions and validates correctness.

Can I write production code before writing a failing test?

No, you cannot write production code before writing a failing test. TDD anti-rationalization guardrails prohibit writing production code without failing tests, ensuring you watch the test fail first to confirm it accurately measures the expected behavior.

How do I fix bugs using a test-first workflow?

To fix bugs using a test-first workflow, write a test that reproduces the bug and confirms it fails against the current code. Implement the minimal bugfix to make the test pass, verifying regression prevention through the full test suite before refactoring.

Why do my tests pass without testing real behavior in TDD?

Tests may pass without testing real behavior if you are testing mock behavior or skipping the watch it fail step. TDD guardrails detect and correct these common shortcuts to ensure your tests validate actual production code behavior rather than mock interactions.