test-driven-development

Enforce Test-Driven Development by mandating failing tests before production code.

Updated Jan 9, 2026
One-click install
npx skills add https://github.com/runecalico-ai/second_edition_spellbook --skill test-driven-development-runecalico-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/runecalico-ai/second_edition_spellbook/tree/main/.cursor/skills/test-driven-development
Command: npx skills add https://github.com/runecalico-ai/second_edition_spellbook --skill test-driven-development-runecalico-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enforces a rigorous development process by ensuring that all new code is preceded by a failing test, preventing regressions and improving code quality.

Core Features & Use Cases

  • TDD Enforcement: Mandates writing tests before implementation code.
  • Red-Green-Refactor Cycle: Guides developers through the standard TDD workflow.
  • Use Case: When implementing a new user authentication feature, you would first write a test that asserts a user cannot log in with invalid credentials. Only after this test fails would you write the minimal code to make it pass.

Quick Start

Use the test-driven-development skill to write a failing test for the new feature.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce a test-driven development workflow when writing new code?

The test-driven development workflow is enforced by mandating the creation of failing tests prior to writing any production code. This prevents regressions and improves code quality across new features, bug fixes, and refactoring tasks.

What is the Red-Green-Refactor cycle in TDD?

The Red-Green-Refactor cycle is the standard TDD workflow guiding developers to first write a failing test, implement minimal code to pass it, and then refactor safely. It emphasizes verifying behavior throughout the development process.

How do I write a failing test for a new feature before implementation?

Writing a failing test for a new feature requires asserting expected behavior before implementation exists. For example, write a test asserting a user cannot log in with invalid credentials, verify it fails, then write minimal production code to pass it.

Does test-driven development work for both bug fixes and refactoring existing code?

Test-driven development is applicable to all software development tasks including bug fixes and refactoring. By ensuring failing tests precede code changes, it verifies behavior and prevents regressions across the entire development process.

Why write tests first instead of after writing production code?

Writing tests first enforces a rigorous development process that prevents regressions and improves code quality. It ensures production code is always validated by a failing test initially, confirming the test actually checks the intended behavior.

What's the best way to prevent regressions during agile development?

The best way to prevent regressions during agile development is enforcing the test-driven development methodology. By guiding developers through the Red-Green-Refactor cycle, it ensures every code change is preceded by a failing test to verify behavior.