work-tdd

Executes the red-green-refactor TDD cycle with verified failing tests before writing production code.

3|3|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/philipobenito/elelem --skill work-tdd-philipobenito
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: work-tdd
Source: https://github.com/philipobenito/elelem/tree/main/skills/work-tdd
Command: npx skills add https://github.com/philipobenito/elelem --skill work-tdd-philipobenito

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested or over-engineered code by enforcing strict test-driven development: no production code is written until a failing test has been watched failing for the right reason. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides each cycle step—write a failing test, verify it fails correctly, write minimal passing code, then refactor while green. - Anti-Rationalisation Guards: Provides red-flag triggers and recovery steps when code is written before tests or tests pass immediately. - Testing Anti-Patterns Reference: Ships a companion reference covering mock misuse, test-only production methods, and incomplete mocks. - Use Case: When fixing a bug like an empty email being accepted, write the failing assertion first, watch it fail, implement the minimal validation, and confirm the full suite stays green. ## Quick Start Use the work-tdd skill to implement this feature using strict test-driven development, starting with a failing test.

Frequently Asked Questions about work-tdd

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

FAQPage Schema
How do I practice test-driven development step by step?

Write one failing test describing the desired behaviour, run it to confirm it fails for the right reason, write the minimal code to pass it, then refactor while all tests stay green. Repeat the cycle for each new piece of behaviour.

What is the red-green-refactor cycle in TDD?

Red means writing a failing test, green means writing the simplest code that makes it pass, and refactor means cleaning up duplication and names while every test remains passing. No new behaviour is added during refactoring.

What should I do if a new test passes immediately?

A test passing on its first run means it exercises behaviour that already exists or tests nothing real. Fix the test so it genuinely fails, or stash existing production code and watch the failure before restoring it.

When is it acceptable to use mocks in unit tests?

Mocks belong only at true system boundaries. Before mocking, identify the real method's side effects, check whether the test depends on them, and mock at a lower level that preserves required behaviour.

Why should test-only methods not be added to production classes?

Methods used only by tests pollute the production API and hide design problems. Move cleanup or setup logic into dedicated test utilities instead of extending production classes.