test-driven-development

Enforces test-first development using the red-green-refactor cycle for features and bugfixes.

Updated Jun 9, 2026
One-click install
npx skills add https://github.com/gyc-12/Archipelago --skill test-driven-development-gyc-12
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/gyc-12/Archipelago/tree/main/modules/collaboration-runtime/src-tauri/experts/skills/test-driven-development
Command: npx skills add https://github.com/gyc-12/Archipelago --skill test-driven-development-gyc-12

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested production code by requiring a failing test before any implementation, eliminating the false confidence of tests written after the fact. ## Core Features & Use Cases - Red-Green-Refactor Workflow: Guides writing a failing test, verifying the failure, implementing minimal code, and refactoring while keeping tests green. - Anti-Rationalization Rules: Counters common excuses like "test after" or "too simple to test" with concrete rebuttals and red-flag checklists. - Testing Anti-Patterns Reference: Covers mock behavior testing, test-only production methods, incomplete mocks, and over-mocking with gate functions. - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection error, watch it fail, implement the validation, and confirm all tests pass. ## Quick Start Ask the AI to implement a new feature or bugfix using strict test-driven development with a failing test written first.

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 on a new feature?

Write one minimal failing test describing the desired behavior, run it to confirm it fails for the right reason, then write the simplest code to pass. Refactor only after all tests are green, then repeat for the next behavior.

How do I write a failing test for a bug fix?

Write a test that reproduces the bug, such as asserting that an empty email returns an error, and run it to watch it fail. Then implement the minimal fix and verify the test passes along with the rest of the suite.

Why should tests be written before implementation code?

Tests written after code pass immediately, which proves nothing about whether they test the right behavior. Watching a test fail first confirms it actually exercises the missing feature rather than existing behavior or mocks.

When is it acceptable to skip test-driven development?

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Rationalizations like "just this once" are treated as red flags requiring a restart with TDD.

What are common mocking mistakes in unit tests?

Common mistakes include asserting on mock elements instead of real behavior, adding test-only methods to production classes, mocking without understanding side effects, and creating incomplete mocks missing fields downstream code uses.