test-driven-development

Enforce test-first workflows by writing failing tests before production code.

Updated Dec 19, 2025
One-click install
npx skills add https://github.com/juanjaragavi/topfinanzas-us-next --skill test-driven-development-juanjaragavi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/juanjaragavi/topfinanzas-us-next/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/juanjaragavi/topfinanzas-us-next --skill test-driven-development-juanjaragavi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enforces test-first development practices to reduce regression risk by requiring a failing test before implementing production code.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, ensure it fails, then implement minimal code to pass, and refactor.
  • Guardrails for common workflows: feature development, bug fixes, and safe refactoring with tests as the primary contract.
  • Use Case: A developer adds a new feature, writes a failing unit test first, then implements code to satisfy the test.

Quick Start

Run the failing test, write the minimal production code to pass, and repeat until all tests pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development in a TypeScript project?

Test-driven development in TypeScript is practiced by writing a failing unit test first, running it to ensure failure, then implementing minimal production code to pass, and finally refactoring. This enforces a strict test-first workflow to guard against regressions.

What is the red-green-refactor cycle for software testing?

The red-green-refactor cycle in software testing involves writing a failing test (red), writing the minimal code required to make that test pass (green), and then cleaning up the code without changing its behavior (refactor).

Do I need Jest to enforce a test-first workflow?

You need a test framework like Jest to enforce a test-first workflow. The practice requires running failing tests before implementing production code, so an environment capable of executing JavaScript or TypeScript test suites is necessary.

Can I use test-driven development for bug fixes and refactoring?

Test-driven development is highly effective for bug fixes and refactoring. You write a failing test that reproduces the bug or verifies the refactored behavior, then implement the code changes until all tests pass, ensuring safe modifications.

What's the best way to start writing failing tests before production code?

The best way to start writing failing tests before production code is to define a clear test-first workflow. Run the failing test to confirm it fails for the expected reason, implement the minimal logic to satisfy it, and repeat until all tests pass.