elixir-tdd-enforcement

elixir-tdd-enforcement is a skill for Claude Code, Codex from mkreyman/bmad-elixir. It costs 41 tokens per session (1,687 once invoked), scanned A, original, MIT.

A rule set requiring test-driven development for Elixir code. Test-driven development means writing a test that fails before writing the code that should make it pass.

In plain words
What is it for?
Adding or changing Elixir functions, features, bug fixes, behavior, or refactors by following the fail-test, implement, and refactor cycle.
Why use it?
It prevents production changes from being made without a test proving the intended behavior and requires checking that the test fails for the right reason first.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mkreyman/bmad-elixir/elixir-tdd-enforcement
Any agent
npx skills add mkreyman/bmad-elixir --skill elixir-tdd-enforcement
Clone the repo
git clone --depth 1 https://github.com/mkreyman/bmad-elixir

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for elixir-tdd-enforcement

README.md
[![agentmods](https://agentmods.dev/badge/skills/mkreyman/bmad-elixir/elixir-tdd-enforcement.svg)](https://agentmods.dev/skills/mkreyman/bmad-elixir/elixir-tdd-enforcement)
Your own site
<a href="https://agentmods.dev/skills/mkreyman/bmad-elixir/elixir-tdd-enforcement"><img src="https://agentmods.dev/badge/skills/mkreyman/bmad-elixir/elixir-tdd-enforcement.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,687 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.01687
Opus 5 $0.00020 $0.00843
Sonnet 5 $0.00008 $0.00337
Haiku 4.5 $0.00004 $0.00169

Measured 5d ago against content hash 78657707f4b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

elixir-tdd-enforcement scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

priv/skills/elixir-tdd-enforcement/SKILL.md · 257 lines

How it starts

The opening of the file, as written. The whole thing — 257 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Elixir TDD Enforcement: The Iron Law

THE IRON LAW

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Not sometimes. Not usually. ALWAYS.

If you write production code before a failing test, DELETE IT and start over.

WHEN THIS SKILL APPLIES

  • Implementing ANY new function
  • Fixing ANY bug
  • Adding ANY feature
  • Modifying ANY behavior
  • Refactoring ANY code

If you're changing .ex files in lib/, this skill is MANDATORY.

THE RED-GREEN-REFACTOR CYCLE

Phase 1: RED (Write Failing Test)

  1. Write ONE minimal ExUnit test

    test "creates user with valid attrs" do
      attrs = %{name: "Alice", email: "[email protected]"}
      assert {:ok, %User{} = user} = Accounts.create_user(attrs)
      assert user.name == "Alice"
      assert user.email == "[email protected]"
    end
    
  2. Run the test

    mix test test/my_app/accounts_test.exs:42
    
  3. VERIFY IT FAILS FOR THE RIGHT REASON

    • Read the error message
    • Confirm it's failing because functionality doesn't exist
    • NOT because of syntax errors or wrong test setup

CHECKPOINT: If test doesn't fail, delete it and write a different test.

Phase 2: GREEN (Minimal Implementation)

  1. Write SIMPLEST code to pass the test

    def create_user(attrs) do
      %User{}
      |> User.changeset(attrs)
      |> Repo.insert()
    end
    
  2. Run the test again

    mix test test/my_app/accounts_test.exs:42
    
  3. VERIFY IT PASSES

    • Read the actual output
    • See the green dot or "1 test, 0 failures"
    • NOT just assume it works

CHECKPOINT: If test doesn't pass, fix implementation (not test).

Phase 3: REFACTOR (Improve While Green)

  1. Improve code quality

    • Extract functions
    • Improve names
    • Add pattern matching
  2. Run tests after EACH change

    mix test
    
  3. Stay GREEN

    • If tests fail during refactor, undo
    • Only refactor when all tests pass

CHECKPOINT: Tests must stay green throughout refactoring.

Read the full file on GitHub · 257 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 257 lines · 41 tokens per session scan A 78657707f4b2

Subscribe to this mod's changes

elixir-tdd-enforcement is a skill published in the GitHub repository mkreyman/bmad-elixir (10 stars, last pushed 10mo ago), licensed MIT. It adds 41 tokens to every session and 1,687 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.