test-driven-development

Guides test-first development using the RED-GREEN-REFACTOR cycle for any language or framework.

Updated May 5, 2026
One-click install
npx skills add https://github.com/nikegeorgian-stack/otgruzka-tovara --skill test-driven-development-nikegeorgian-stack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/nikegeorgian-stack/otgruzka-tovara/tree/main/.cursor/skills/test-driven-development
Command: npx skills add https://github.com/nikegeorgian-stack/otgruzka-tovara --skill test-driven-development-nikegeorgian-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes without tests ship unverified behavior, and bug fixes without reproduction tests leave regressions unguarded. This Skill enforces a disciplined write-the-failing-test-first workflow so every behavior change is proven by an executable test. ## Core Features & Use Cases - RED-GREEN-REFACTOR Cycle: Write a failing test, implement the minimal code to pass it, then refactor with tests green. - Prove-It Pattern for Bugs: Reproduce any reported bug with a failing test before attempting a fix, then verify the fix and run the full suite. - Test Quality Guidance: Covers the test pyramid, state-over-interaction assertions, DAMP test style, real implementations over mocks, and anti-patterns to avoid. - Use Case: A bug report says completing a task does not set its timestamp. Write a failing test asserting completedAt is set, confirm it fails, implement the fix, and watch the test pass with no regressions. ## Quick Start Ask the agent to implement a new feature or fix a bug using test-driven development, writing a failing test first and verifying it passes after the change.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development when fixing a bug?▼

Write a test that reproduces the bug first and confirm it fails, then implement the fix and confirm the test passes. Finally run the full test suite to check for regressions. This Prove-It Pattern guarantees the bug existed and is now fixed.

What is the RED-GREEN-REFACTOR cycle in TDD?▼

RED means writing a failing test for the desired behavior, GREEN means writing the minimal code to make it pass, and REFACTOR means cleaning up the implementation while keeping tests green. The cycle repeats for each new behavior.

Should tests use mocks or real implementations?▼

Prefer real implementations first, then fakes, stubs, and mocks last. Mock only when the real dependency is too slow, non-deterministic, or has uncontrollable side effects like external APIs. Over-mocking produces tests that pass while production breaks.

Does TDD apply to languages other than JavaScript and TypeScript?▼

Yes, the TDD cycle is universal across languages. Discover the repository's own tooling through files like package.json, pom.xml, pyproject.toml, go.mod, or Cargo.toml, and use its focused and full-suite test commands for every step.

When should I not write tests first?▼

Skip TDD for pure configuration changes, documentation updates, or static content with no behavioral impact. Any change that alters logic, fixes a bug, or could break existing behavior should start with a failing test.

Why do my tests break every time I refactor code?▼

Tests that assert on internal method calls or implementation details break during refactoring even when behavior is unchanged. Assert on inputs and outputs (state) instead of interactions, so tests verify what the code does rather than how it does it.