test-driven-development

Enforce a test-first workflow with failing tests before production code.

6|Updated Mar 24, 2019
One-click install
npx skills add https://github.com/rafifos/dotfiles --skill test-driven-development-rafifos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/rafifos/dotfiles/tree/main/dot_agents/skills/test-driven-development
Command: npx skills add https://github.com/rafifos/dotfiles --skill test-driven-development-rafifos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development helps teams prevent defects by requiring tests before implementation, turning requirements into verifiable expectations.

Core Features & Use Cases

  • Define behavior with tests before coding to guide implementation.
  • Use the red-green-refactor cycle to keep code maintainable and regression-free.
  • Apply throughout feature work, bug fixes, and refactoring to protect software quality.

Quick Start

Write a failing test that expresses the desired behavior, then implement the minimal code to pass the test.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development improve software quality?

Test-driven development improves quality by requiring tests before implementation, turning requirements into verifiable expectations and preventing defects through a disciplined test-first workflow.

How do I start writing unit tests using the red-green-refactor cycle?

To start the red-green-refactor cycle, write a failing unit test that expresses desired behavior, implement minimal code to pass the test, then safely refactor while maintaining green tests.

Can I apply TDD to bug fixes and refactoring existing code?

Yes, TDD applies to bug fixes and refactoring existing code by enforcing a test-first workflow to ensure behavior stays correct and regression-free as the codebase evolves.

What is the best way to define behavior with tests before coding?

The best way to define behavior with tests before coding is to craft a failing test expressing the desired outcome, which then guides the minimal implementation needed to satisfy requirements.

Do I need any specific testing frameworks to enforce a test-first workflow?

No specific testing frameworks are required. This approach focuses on the disciplined workflow of crafting failing tests before production code and maintaining green tests across any framework.