grey-haven-tdd-typescript

Guide TypeScript TDD with Vitest and React testing templates.

29|4|Updated Aug 10, 2025
One-click install
npx skills add https://github.com/greyhaven-ai/claude-code-config --skill grey-haven-tdd-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grey-haven-tdd-typescript
Source: https://github.com/greyhaven-ai/claude-code-config/tree/main/grey-haven-plugins/core/skills/tdd-typescript
Command: npx skills add https://github.com/greyhaven-ai/claude-code-config --skill grey-haven-tdd-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and templates (resource) components.

What problem does it solve?

This Skill eliminates the uncertainty and manual verification in TypeScript development by enforcing strict test-driven development practices, ensuring your code works perfectly every time.

Core Features & Use Cases

  • Red-Green-Refactor Workflow: Implement features by writing failing tests first, then minimal code to pass, then refactoring for quality.

Core Features & Use Cases

  • Comprehensive Testing: Complete Vitest patterns for React components, hooks, and utilities.
  • Quality Assurance: 100+ item checklist covering test structure, coverage, and performance.
  • Real-World Examples: Complete TDD cycles for API routes, React components, and utility functions.
  • Use Case: When you're building a new user profile component, use this Skill to write failing tests first, then implement the component incrementally.

Quick Start

I'm implementing a new user registration feature. Help me write the first failing test for a createUser API route that validates email format and handles duplicate entries.

Quick Start

Write a failing test for a UserProfile component that should display a loading state while fetching data.

Frequently Asked Questions about grey-haven-tdd-typescript

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

FAQPage Schema
How do I implement test-driven development with TypeScript and Vitest?

Test-driven development with TypeScript and Vitest involves writing failing tests first, then minimal code to pass them, then refactoring. This Skill provides red-green-refactor workflows, complete Vitest patterns for React components and utilities, and real-world TDD cycles to guide your process from test conception through implementation.

Can I use TDD for React components, hooks, and API routes?

Yes. This Skill covers comprehensive TDD patterns across React components, custom hooks, utility functions, and API routes. Each includes complete example cycles showing how to write failing tests first, implement minimal functionality, and refactor systematically for quality and maintainability.

What should I include in TypeScript test structure and coverage?

This Skill provides a 100+ item checklist covering test structure, mocking patterns, coverage standards, and performance best practices. It specifies collocated templates and reference material for organizing tests alongside your code, ensuring consistent quality across components, hooks, utilities, and routes.

How do I write a failing test first for a new feature?

Start by defining what your component, hook, or function should do, then write a test that fails because the code doesn't exist yet. This Skill provides templates and real-world examples—like testing a UserProfile loading state or createUser validation—showing how to structure failing tests before any implementation.

What's the difference between TDD and writing tests after code?

TDD writes tests first, driving design and ensuring every line of code has a purpose; tests written after code often miss edge cases and rarely catch design flaws. This Skill enforces test-first workflows with systematic red-green-refactor cycles, checklists, and patterns that eliminate uncertainty in TypeScript development.