tdd-bdd-typescript

Guide TypeScript projects through TDD/BDD cycles with Vitest/Jest.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/fyuuki0jp/rise --skill tdd-bdd-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-bdd-typescript
Source: https://github.com/fyuuki0jp/rise/tree/main/.opencode/skills/tdd
Command: npx skills add https://github.com/fyuuki0jp/rise --skill tdd-bdd-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams produce reliable TypeScript applications by applying TDD (Test-Driven Development) and BDD (Behavior-Driven Development) practices, guiding test-first design, red-green-refactor cycles, and legacy-code improvements.

Core Features & Use Cases

  • Structured testing discipline: Learn and apply TDD/BDD workflows (Red-Green-Refactor, Given-When-Then) to TypeScript projects.
  • Real-world guidance: Covers how to improve legacy code, write behavior-focused tests, and maintainable test architectures using Vitest/Jest.
  • Use Case: A frontend feature or API module can be implemented with test-driven cycles to ensure changes remain safe during refactors.

Quick Start

Start by enabling a basic TDD loop in your TypeScript project: write a failing test, implement just enough code to pass, and refactor while keeping tests green.

Frequently Asked Questions about tdd-bdd-typescript

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

FAQPage Schema
How do I apply TDD red-green-refactor cycles in a TypeScript project?

To apply TDD in TypeScript, you write a failing test, implement just enough code to pass, and refactor while keeping tests green. This cycle ensures reliable code by enforcing test-first development and clean separation of concerns.

What is the best way to write behavior-focused tests for legacy TypeScript code?

The best way to test legacy TypeScript code is using seams and the humble object pattern to isolate dependencies. This approach allows you to write behavior-focused Given-When-Then tests without requiring a full rewrite of the existing logic.

Does Vitest work well for BDD Given-When-Then testing in TypeScript?

Yes, Vitest works well for BDD in TypeScript by supporting structured Given-When-Then test blocks. It enables deterministic tests and helps maintain a clean separation of concerns during both frontend and backend development.

When do I need to use the humble object pattern in TypeScript testing?

You need the humble object pattern when improving legacy TypeScript code that lacks testability. It extracts logic into testable components by separating concerns through seams, allowing you to safely refactor while keeping tests green.

Can I use Jest instead of Vitest for TDD workflows in TypeScript?

Yes, you can use Jest instead of Vitest for TDD workflows in TypeScript. Both frameworks support the red-green-refactor cycle and Given-Then-When behavior-focused tests for building reliable frontend and backend applications.