Command Palette

Search for a command to run...

YepAPI
Free · All Tools

TDD Agent Skill

Test-first, red-green-refactor, integration over unit tests.

testingtddintegrationvitest

The Skill

Full content, every format. Copy it, download it, or install with one command.

SKILL.md
---
description: Test-first, red-green-refactor, integration over unit tests.
homepage: https://yepapi.com/skills/tdd
metadata:
  tags: [testing, tdd, integration, vitest]
---

# Test-Driven Development

## Rules

- Write the test FIRST, then the implementation
- Red → Green → Refactor cycle: failing test → minimal passing code → clean up
- Integration tests over unit tests for vibe-coded apps — test behavior, not implementation
- Test file next to source: `feature.ts` + `feature.test.ts`
- Descriptive test names: `"should return 404 when user not found"` not `"test1"`
- One assertion per test when possible — multiple assertions obscure failures
- Mock external dependencies (APIs, databases) — never mock internal functions
- Run tests before committing — CI should reject failing tests

Install

Why Use the TDD Skill?

Without this skill, your AI guesses at tdd patterns. It might hallucinate deprecated APIs, use outdated conventions, or miss best practices entirely. With it, your AI follows a proven ruleset — every suggestion aligns with current standards.

Drop this skill into your project and your AI instantly knows the rules. Better code suggestions, fewer errors, faster shipping.

Try These Prompts

These prompts work better with the TDD skill installed. Your AI knows the context and writes code that fits.

"Write tests first for this feature using the red-green-refactor TDD cycle"

"Create integration tests with Vitest that cover the critical user flows"

"Build a test suite with proper mocking, fixtures, and CI integration"

TDD skill — FAQ

It enforces test-first development with the red-green-refactor cycle, preferring integration tests over unit tests. Your AI writes tests before implementation and keeps them focused on behavior.

Run `npx skills add YepAPI/skills --skill tdd` in your project root. This copies the skill file into your repo where your AI coding tool can read it automatically.

The skill prioritizes integration tests that cover user flows over isolated unit tests. The testing trophy pattern: many integration tests, fewer unit tests, and a few end-to-end tests.

Want more skills?

Browse all 110 free skills for builders.

See All Skills