elixir-tdd-enforcement

Enforce Test-Driven Development for Elixir production code in lib/.

10|2|Updated Oct 24, 2025
One-click install
npx skills add https://github.com/mkreyman/bmad-elixir --skill elixir-tdd-enforcement
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elixir-tdd-enforcement
Source: https://github.com/mkreyman/bmad-elixir/tree/main/priv/skills/elixir-tdd-enforcement
Command: npx skills add https://github.com/mkreyman/bmad-elixir --skill elixir-tdd-enforcement

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces Test-Driven Development for any feature or bugfix, ensuring that production code is never introduced without failing tests first.

Core Features & Use Cases

  • RED-GREEN-REFACTOR Cycle: Walks through failing test creation, minimal implementation, and refactoring.
  • Mandatory TDD: Applies to any .ex production changes within lib/.
  • Verification Focus: Guarantees tests drive design decisions.

Quick Start

Write a failing test for the new behavior, run tests to see RED, implement the simplest code to pass (GREEN), then refactor while keeping tests green.

Frequently Asked Questions about elixir-tdd-enforcement

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

FAQPage Schema
How do I write tests first in Elixir before implementing code?

Test-driven development in Elixir starts by writing a failing ExUnit test that describes the desired behavior, running the test to confirm it fails (RED), then writing minimal production code to pass it (GREEN), and finally refactoring while keeping tests green. This cycle ensures tests drive your design.

Can I use TDD with ExUnit for new Elixir features and bug fixes?

Yes. TDD applies to any .ex file changes in lib/, including new functions, bug fixes, feature additions, behavior changes, and refactors. Every production code change requires a failing test first, guaranteeing test coverage from the start.

What's the RED-GREEN-REFACTOR cycle and why does it matter?

RED-GREEN-REFACTOR is a three-phase pattern: write a failing test (RED), implement minimal code to pass it (GREEN), then improve the code without breaking tests (REFACTOR). It prevents over-engineering, keeps code focused, and ensures tests always reflect production behavior.

How do I prevent writing production code without tests in Elixir?

Enforce a mandatory TDD workflow where any lib/ changes require a failing ExUnit test before implementation. This prevents untested production code by making the failing test a gating requirement before you write the actual feature or fix.

Does TDD work for refactoring existing Elixir code?

Yes. Refactoring within the TDD framework means keeping all existing tests green while you improve the code structure. Tests act as a safety net, ensuring behavior remains correct throughout the refactoring process.