tdd

Guide the Red-Green-Refactor TDD cycle for Svelte v5 components.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/hiraaaken/cha-chat --skill tdd-hiraaaken
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/hiraaaken/cha-chat/tree/main/frontend/web/.claude/skills/tdd
Command: npx skills add https://github.com/hiraaaken/cha-chat --skill tdd-hiraaaken

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the Test-Driven Development (TDD) cycle, guiding you through writing failing tests, implementing minimal code to pass, and refactoring for clean, maintainable code.

Core Features & Use Cases

  • Guided TDD Workflow: Follows the Red-Green-Refactor cycle.
  • Automated Test Execution: Integrates with pnpm test to verify test outcomes.
  • Use Case: When developing a new Svelte component, use this Skill to ensure robust functionality by writing tests before implementation.

Quick Start

Use the tdd skill to implement a new feature for the user authentication component.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement Svelte components using Test-Driven Development?

Test-Driven Development for Svelte components follows the Red-Green-Refactor cycle: write a failing test, implement minimal code to pass it, then refactor. This Skill guides you through each phase using pnpm for automated test execution and verification.

What is the Red-Green-Refactor workflow in TDD?

The Red-Green-Refactor workflow in TDD means writing a failing test first (Red), writing minimal implementation code to make it pass (Green), and then cleaning up the code without changing behavior (Refactor) for maintainable Svelte components.

Can I use this TDD workflow with Svelte v5 Runes API?

Yes, this TDD workflow supports the Svelte v5 Runes API. It guides you through defining test structures and writing minimal code specifically for Svelte components built with the latest Runes reactivity model.

How do I run tests when doing TDD with pnpm?

You run tests during TDD with pnpm by executing the pnpm test command. The workflow integrates automated test execution to verify outcomes after writing failing tests and after implementing minimal code changes.

When should I use TDD for developing new features?

You should use TDD for developing new features when you want to ensure robust functionality and clean, maintainable code. It is particularly effective when building new Svelte components where defining expected behavior upfront prevents regressions.

Does TDD refactoring improve code quality in Svelte applications?

TDD refactoring improves code quality in Svelte applications by encouraging you to clean up and restructure code after tests pass. This ensures the implementation remains maintainable without altering the verified behavior defined by the tests.