engineering-quality-tdd

Enforces test-driven development with red-green-refactor cycles before writing production code.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/scanady/nexus-skills --skill engineering-quality-tdd-scanady
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: engineering-quality-tdd
Source: https://github.com/scanady/nexus-skills/tree/main/skills/engineering-quality-tdd
Command: npx skills add https://github.com/scanady/nexus-skills --skill engineering-quality-tdd-scanady

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers often write production code first and add tests afterward, which produces tests that pass immediately and prove nothing about correctness. This Skill enforces a strict test-first workflow so every feature and bugfix is backed by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the agent through writing a failing test, verifying the failure, writing minimal passing code, and refactoring while staying green. - Rationalization Detection: Lists common excuses for skipping TDD (sunk cost, manual testing, tests-after) with counterarguments and red flags that trigger a restart. - Testing Anti-Pattern Reference: Ships a companion reference covering mock-behavior testing, test-only production methods, incomplete mocks, and over-mocking, with gate functions to catch violations. - Use Case: When asked to fix a bug where empty emails are accepted, the agent first writes a failing test asserting the rejection error, watches it fail, then implements the minimal validation to make it pass. ## Quick Start Ask the agent to implement a new feature or bugfix using test-driven development with a failing test written first.

Frequently Asked Questions about engineering-quality-tdd

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 that passes. Refactor only while tests stay green, then repeat the cycle for the next behavior.

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

Write a test that reproduces the bug by asserting the correct expected behavior, then run it to watch it fail. Implement the minimal fix until the test passes, which both proves the fix and prevents regression.

Why should tests be written before implementation code?▼

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

When is it acceptable to skip TDD?▼

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Rationalizations like 'too simple to test' or 'I will test after' are treated as red flags requiring a restart.

What are common mocking anti-patterns in unit tests?▼

Common anti-patterns include asserting on mock existence 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. Test real behavior and mock minimally at the right level.