tdd

Document and enforce TDD guidelines for TypeScript projects using Vitest.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/flesler/dotfiles --skill tdd-flesler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/flesler/dotfiles/tree/main/home/.cursor/skills/tdd
Command: npx skills add https://github.com/flesler/dotfiles --skill tdd-flesler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Consolidates guidelines for Test-Driven Development to improve test quality and consistency across TypeScript projects.

Core Features & Use Cases

  • Philosophy and best practices for writing deterministic, pure tests and co-locating test files with source code.
  • Templates and patterns: test utilities, flat structures, and clear error handling.
  • Application scenarios: using Vitest in TS projects to maintain reliable unit tests and quick iteration.

Quick Start

Describe how to apply TDD rules to a new module and structure its tests according to the guidelines.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I structure unit tests in TypeScript using Vitest?

Structure unit tests in TypeScript using Vitest by co-locating test files with source code and organizing them in a flat single-array test structure. This enforces consistent test quality and clearer module isolation across your project.

What are the best practices for test-driven development in TypeScript?

Test-driven development best practices in TypeScript involve writing deterministic, pure functions and co-locating tests with sources. Following consistent guidelines ensures reliable unit tests and quick iteration cycles during development.

Can I use this TDD approach without co-locating tests with source files?

Co-locating tests with source files is a strict structural requirement for this TDD approach. It ensures reliable unit tests and quick iteration by keeping test logic directly adjacent to the TypeScript modules it validates.

How do I apply TDD rules to a new TypeScript module?

Apply TDD rules to a new TypeScript module by using provided templates and core patterns to structure tests. This involves writing deterministic pure functions and co-locating the test files within your Vitest project.

Does this TDD methodology work for non-pure functions?

This TDD methodology emphasizes writing deterministic, pure functions to maintain reliable unit tests. While it targets pure functions, the structural guidelines and clear error handling patterns can guide testing for complex scenarios.