test-driven-development

Enforce test-first development for JavaScript and TypeScript projects using Jest.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/1J6K21/build4good --skill test-driven-development-1j6k21
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/1J6K21/build4good/tree/main/.gemini/skills/test-driven-development
Command: npx skills add https://github.com/1J6K21/build4good --skill test-driven-development-1j6k21

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Many codebases lack reliable tests, leading to bugs, regressions, and wasted time. This Skill enforces a disciplined test‑first workflow that catches defects early and ensures behavior stays verified as the project evolves.

Core Features & Use Cases

  • TDD Cycle: Guides you through Red (failing test), Green (make it pass), Refactor (clean code) steps.
  • Prove‑It Pattern: Turns bug reports into failing tests before fixing, preventing regressions.
  • Test Pyramid Guidance: Helps balance unit, integration, and end‑to‑end tests for fast, comprehensive coverage.
  • Best‑Practice Tips: Provides advice on test size, DAMP over DRY, real implementations vs mocks, and writing clear assertions.

Quick Start

Create a failing unit test for the new feature, then write the minimal code to make it 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 start test-driven development in a JavaScript project?

To start test-driven development in JavaScript, write a failing unit test for your new feature, then implement the minimal code required to make it pass, and finally refactor the code while keeping the test green.

What is the Prove-It pattern for fixing bugs in TypeScript?

The Prove-It pattern in TypeScript turns a bug report into a failing automated test before you write the fix, ensuring the bug is reproducible and preventing future regressions once the test passes.

Can I use Jest for test-first development and refactoring?

Yes, you can use Jest for test-first development to write, run, and evaluate automated tests across the Red, Green, and Refactor stages, ensuring your JavaScript or TypeScript code stays verified without regressions.

What's the best way to balance unit and integration tests in TDD?

The best way to balance tests in TDD is following Test Pyramid guidance, which helps you distribute unit, integration, and end-to-end tests to achieve fast feedback and comprehensive code coverage.

When should I use mocks versus real implementations in automated tests?

You should choose between real implementations and mocks based on best-practice tips for test size and clarity, favoring DAMP over DRY principles to maintain readable and maintainable test assertions.