One-click install
npx skills add https://github.com/MichaelSolati/mkai --skill tdd-michaelsolati
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/MichaelSolati/mkai/tree/main/profiles/engineering/skills/tdd
Command: npx skills add https://github.com/MichaelSolati/mkai --skill tdd-michaelsolati

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common issue of writing fragile, implementation-coupled tests that break during code refactors, and inconsistent adoption of test-driven development practices that lead to lower code quality and higher bug rates.

Core Features & Use Cases

  • Full TDD Workflow Guidance: Step-by-step instructions for the red-green-refactor cycle, including planning, tracer bullet implementation, incremental test writing, and safe refactoring.
  • Anti-Pattern Avoidance: Explicit guidance to avoid common TDD mistakes like horizontal slicing (writing all tests before any implementation) that lead to low-value, fragile tests.
  • Supporting Best Practices: Reference materials for writing behavior-focused integration tests, designing testable interfaces, applying appropriate mocking at system boundaries, and identifying deep module opportunities.
  • Use Case: A developer building a new user authentication feature can use this Skill to write a single tracer bullet test for the login flow first, implement minimal code to pass the test, then iterate through additional behaviors like password reset and rate limiting without writing tests that break when internal code structure changes.

Quick Start

Use the tdd skill to implement the new shopping cart checkout feature following the red-green-refactor workflow with behavior-focused integration tests.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I write integration tests that don't break during code refactoring?

To write integration tests that survive refactoring, focus on behavior rather than implementation. Test-driven development practices guide you to design testable interfaces and write behavior-focused integration tests that validate outcomes without coupling to internal code structure.

What is the red-green-refactor cycle in test-driven development?

The red-green-refactor cycle is a test-driven development workflow where you write a failing test first, implement minimal code to pass it, then safely refactor. This incremental process ensures reliable code and eliminates implementation-coupled tests.

How do I avoid horizontal slicing when writing tests for new features?

Avoid horizontal slicing anti-patterns by not writing all tests before implementation. Use a tracer bullet approach: write a single test for a core flow, implement minimal code to pass, then iterate through additional behaviors incrementally to prevent low-value tests.

When should I apply mocking in test-driven development?

Apply mocking exclusively at system boundaries during test-driven development. Mock external dependencies and third-party services rather than internal modules to keep behavior-focused tests from breaking when internal code structure changes during refactoring.

Can I use test-driven development for bug fixes and codebase improvements?

Yes, test-driven development applies to bug fixes and codebase improvements. Write a test reproducing the bug, implement the fix to pass it, then refactor safely. This ensures consistent TDD adoption for both new features and existing code maintenance.