lfe-tdd

lfe-tdd is a skill for Claude Code, Codex from StChiotis/Library-First-Engineering. It costs 32 tokens per session (1,162 once invoked), scanned A, original, MIT.

A test-driven development check for code just written by another coding step. It follows the red-green-refactor cycle: write a failing test, make it pass, then improve the code.

In plain words
What is it for?
Use it to add integration-style tests through public APIs, implement changes one small behavior at a time, and save a test report for the rest of the workflow.
Why use it?
It helps catch behavior problems while the implementation is still fresh. Tests focus on what users can observe, so refactoring internal code is less likely to break them unnecessarily.

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/stchiotis/library-first-engineering/lfe-tdd
Any agent
npx skills add StChiotis/Library-First-Engineering --skill lfe-tdd
Clone the repo
git clone --depth 1 https://github.com/StChiotis/Library-First-Engineering

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 lfe-tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/stchiotis/library-first-engineering/lfe-tdd.svg)](https://agentmods.dev/skills/stchiotis/library-first-engineering/lfe-tdd)
Your own site
<a href="https://agentmods.dev/skills/stchiotis/library-first-engineering/lfe-tdd"><img src="https://agentmods.dev/badge/skills/stchiotis/library-first-engineering/lfe-tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,162 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 $0.00032 $0.01162
Opus 5 $0.00016 $0.00581
Sonnet 5 $0.00006 $0.00232
Haiku 4.5 $0.00003 $0.00116

Measured 5d ago against content hash 49205e883f71, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

lfe-tdd 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.

.agents/skills/lfe-tdd/SKILL.md · 143 lines

How it starts

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

LFE TDD

Position in Pipeline

  • Phase: 2 (Builder sub-pipeline, Step 2)
  • Persona: Builder
  • Input: active_plan.md + .plans/builder_done.md (resume marker — confirms implementation phase completed) + code written by lfe-builder
  • Output: .plans/tdd_report.md

Philosophy

Core principle: Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't.

Good tests are integration-style: they exercise real code paths through public APIs. They describe what the system does, not how. A good test reads like a specification.

Bad tests are coupled to implementation. They mock internal collaborators, test private methods, or verify through external means. Warning sign: your test breaks when you refactor, but behavior hasn't changed.

See tests.md, mocking.md for examples.

Anti-Pattern: Horizontal Slices

Write incrementally — one test, then its implementation — rather than all tests up front. Writing all tests first is "horizontal slicing."

Correct approach: Vertical slices via tracer bullets. One test → one implementation → repeat.

WRONG (horizontal):
  RED:   test1, test2, test3, test4, test5
  GREEN: impl1, impl2, impl3, impl4, impl5

RIGHT (vertical):
  RED→GREEN: test1→impl1
  RED→GREEN: test2→impl2
  RED→GREEN: test3→impl3

Workflow

1. Review

Read active_plan.md and review what the Builder implemented. Identify behaviors that need test coverage. Use the project's domain glossary for test names.

Confirm with the human which behaviors to prioritize for testing. Testing everything is impossible — prioritize.

2. Tracer Bullet

Write ONE test that confirms ONE thing:

RED:   Write test for first behavior → test fails
GREEN: Write minimal code to pass → test passes

3. Incremental Loop

For each remaining behavior:

RED:   Write next test → fails
GREEN: Minimal code to pass → passes

Rules:

  • One test at a time
  • Only enough code to pass current test
  • Write only for the current test, not anticipated future ones
  • Keep tests focused on observable behavior

Read the full file on GitHub · 143 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 143 lines · 32 tokens per session scan A 49205e883f71

Subscribe to this mod's changes

lfe-tdd is a skill published in the GitHub repository StChiotis/Library-First-Engineering (43 stars, last pushed 1mo ago), licensed MIT. It adds 32 tokens to every session and 1,162 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-30.