test-driven-development

Guide developers through the TDD cycle with npm test feedback.

9|2|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/iclinic/afyapowers --skill test-driven-development-iclinic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/iclinic/afyapowers/tree/main/src/skills/test-driven-development
Command: npx skills add https://github.com/iclinic/afyapowers --skill test-driven-development-iclinic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Historically, development often produced code without verified behavior, leading to defects and regression risk. Test-driven development (TDD) fixes this by turning tests into the guiding contract before writing production code, ensuring code works as intended from the start.

Core Features & Use Cases

  • Red-Green-Refactor workflow: write a failing test, implement the minimal code to pass, and clean up without changing behavior.
  • Improves design and maintainability: tests act as living documentation and guardrails during refactors and feature changes.
  • Use Case: when adding a new feature or fixing a bug, write tests first to define expected behavior and then implement to meet those expectations.

Quick Start

Write a failing test first, then implement the minimal code to pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development is a test-first practice where you write a failing test, implement minimal code to pass it, and then refactor safely. This cycle ensures code behavior is verified from the start and acts as living documentation.

How do I write unit tests before production code to prevent regressions?

Write a failing unit test first to define expected behavior, then implement the minimal production code required to pass it. This discipline provides rapid feedback via npm test and establishes strong guardrails against future regressions.

When should I use test-first practice for bug fixes and feature development?

Use test-first practice whenever adding new features or fixing bugs to drive design decisions and implementation. Writing tests before production code defines the expected behavior clearly and ensures safe refactoring without breaking existing functionality.

Does test-driven development work without external testing dependencies?

Yes, test-driven development requires no external dependencies. It relies on a clear testing discipline using your existing environment's rapid feedback loop, such as npm test, to guide implementation and maintain consistent test naming.

What's the best way to guarantee reliable code and maintain quality assurance during refactoring?

The best way to guarantee reliable code is adopting a test-first workflow. By writing tests before implementation, you create guardrails that ensure safe refactoring and maintain quality assurance without changing underlying behavior.