tdd

Implement logic, utility, and repository layers using a TDD workflow with Vitest and pnpm.

Updated Dec 28, 2023
One-click install
npx skills add https://github.com/daisuke-tanabe/daisuke-tanabe --skill tdd-daisuke-tanabe
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/daisuke-tanabe/daisuke-tanabe/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/daisuke-tanabe/daisuke-tanabe --skill tdd-daisuke-tanabe

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the implementation of logic, utilities, and repository layers by ensuring quality through a robust Test-Driven Development (TDD) workflow.

Core Features & Use Cases

  • TDD Implementation: Guides the user through the complete TDD cycle (Red, Green, Refactor).
  • Quality Assurance: Ensures code quality and correctness via comprehensive testing.
  • Use Case: Implement a new date formatting utility function, ensuring all edge cases and expected outputs are covered by tests before and during implementation.

Quick Start

Use the tdd skill to implement a function that calculates the factorial of a number.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement utility functions with Test-Driven Development using Vitest?

Test-Driven Development using Vitest guides you through the complete Red, Green, Refactor cycle to implement logic and utility functions. It analyzes requirements, designs tests, writes failing tests, and then writes passing code.

What is the best way to ensure code quality when refactoring repository layers?

The best way to ensure code quality during repository layer refactoring is using a TDD workflow. It enforces writing comprehensive tests first to cover all edge cases before implementation, guaranteeing correctness.

Can I use this TDD workflow with pnpm for testing and linting?

Yes, this TDD workflow fully adheres to Vitest framework conventions and pnpm package management. It integrates pnpm for running tests, linting, and type checking throughout the development cycle.

How do I write a failing test before implementing a new feature?

To write a failing test, you first analyze the feature design and test requirements. The TDD workflow guides you through creating a failing test case in Vitest that defines expected outputs before writing any functional code.

Does this TDD process cover logic and repository layers only?

This TDD process focuses specifically on logic, utility, and repository layers where quality assurance through testing is critical. It targets these foundational layers to ensure robust code quality and correctness.