test-driven-development

Write failing tests before implementing functionality using Red-Green-Refactor.

18|1|Updated Jan 3, 2026
One-click install
npx skills add https://github.com/nexus-substrate/nexus-agents --skill test-driven-development-nexus-substrate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/nexus-substrate/nexus-agents/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/nexus-substrate/nexus-agents --skill test-driven-development-nexus-substrate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development prevents regressions by forcing a clear, executable specification through failing tests before implementation.

Core Features & Use Cases

  • Red-Green-Refactor: Build the smallest change that makes the new test pass, then improve structure while keeping the test suite green.
  • Prove-It Pattern for bug fixes: Reproduce the bug with a minimal failing test, verify it fails on main, fix the root cause, then confirm the test and full suite pass.
  • Test-quality discipline: Favor behavior-focused, refactoring-resistant assertions with an appropriate test pyramid and strong naming conventions.

Quick Start

Write a failing unit or integration test for the new behavior you want, then ask the AI to implement only the minimum code to make that test pass and finally refactor without breaking the suite.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I write failing tests before implementing new features?

Write failing tests before implementation by creating an executable specification for the desired behavior. You write a failing unit or integration test, implement the minimum code to make it pass, then refactor without breaking the suite.

What is the best way to fix bugs using regression testing?

Use the Prove-It Pattern for regression testing by writing a minimal failing test that reproduces the bug. Verify it fails on main, fix the root cause, then confirm the test and full suite pass.

How does the red-green-refactor cycle work in unit testing?

The red-green-refactor cycle in unit testing starts with a failing test, builds the smallest change to make it pass, then improves code structure while keeping the test suite green.

Do I need specific test naming conventions for behavior-based assertions?

Yes, behavior-based assertions require strong test naming conventions. This discipline favors refactoring-resistant assertions focused on behavior over implementation details across unit, integration, and end-to-end coverage.

What are the completion criteria for a test-driven development workflow?

Completion criteria for a test-driven development workflow require the full test suite to pass, such as pnpm test succeeding, and regression coverage must be added for any bug fixes.

When should I not use end-to-end tests in the test pyramid?

You should limit end-to-end tests in the test pyramid by applying them selectively. Favor behavior-focused unit and integration tests to maintain a refactoring-resistant suite without excessive end-to-end coverage.