Test-Driven Development

Automate test-driven development by writing tests before coding and refactoring after tests pass.

Updated Jun 6, 2026
One-click install
npx skills add https://github.com/guille-gallo/auth-kit --skill test-driven-development-guille-gallo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Test-Driven Development
Source: https://github.com/guille-gallo/auth-kit/tree/main/agent/skills/tdd
Command: npx skills add https://github.com/guille-gallo/auth-kit --skill test-driven-development-guille-gallo

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill unit helps developers to write tests before coding, which improves code quality, maintainability, and reduces bugs.

Core Features & Use Cases

  • Red-Green-Refactoring: Guides developers in the process of writing a failing test (RED), making it pass (GREEN), and then refactoring the code (Refactor).
  • Vertical Slicing: Encourages writing tests for a specific feature, not the entire codebase at once.
  • Integration-Style Tests: Promotes tests that exercise real code paths through public APIs.
  • Use Case: When developing a new feature or fixing a bug, the developer uses this Skill unit to ensure the feature is implemented as intended and the codebase remains robust.

Quick Start

Run the 'start_test' script with the following command: npm run start_test -- --feature=checkout

Frequently Asked Questions about Test-Driven Development

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

FAQPage Schema
How do I implement test-driven development for a new software feature?

Test-driven development is implemented by automating the red-green-refactoring cycle: writing a failing test first, making it pass with functional code, and then refactoring. This ensures features are built with behavior validated through public interfaces.

What is vertical slicing in integration testing and when should I use it?

Vertical slicing in integration testing means writing tests for one specific feature at a time rather than the entire codebase. Use this approach to exercise real code paths through public APIs and maintain software quality during new development.

Does test-driven development require an existing codebase with testing support?

Yes, test-driven development requires a codebase that already supports testing and follows good testing practices. The process focuses on writing tests first for new features or bug fixes, so the underlying infrastructure must be in place.

How do I start an automated test cycle for a specific feature like checkout?

Start an automated test cycle by running the start_test script with the feature parameter, for example: npm run start_test -- --feature=checkout. This initiates the test-first workflow for the specified functionality.

Why should I write integration-style tests through public APIs instead of testing everything at once?

Integration-style tests through public APIs promote robust software quality by exercising real code paths. Writing tests for specific features vertically, rather than the entire codebase at once, reduces bugs and improves maintainability.

When should I not use the red-green-refactoring approach for bug fixing?

Avoid red-green-refactoring when the codebase lacks testing support or does not follow good testing practices. This approach requires infrastructure that can validate behavior through public interfaces to successfully automate the test-first cycle.