tdd

tdd is a skill for Claude Code, Codex from zereight/gitlab-mcp. It costs 38 tokens per session (915 once invoked), scanned A, original, MIT.

A coding workflow that requires writing a failing test before writing the code, then making it pass and cleaning up the result. TDD means Test-Driven Development.

In plain words
What is it for?
Use it when adding or changing behavior and you want to follow the red-green-refactor cycle: failing test, minimal implementation, then cleanup.
Why use it?
It prevents untested behavior and keeps each change tied to a clear expected result.

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/zereight/gitlab-mcp/tdd
Any agent
npx skills add zereight/gitlab-mcp --skill tdd
Clone the repo
git clone --depth 1 https://github.com/zereight/gitlab-mcp

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 tdd

README.md
[![agentmods](https://agentmods.dev/badge/skills/zereight/gitlab-mcp/tdd.svg)](https://agentmods.dev/skills/zereight/gitlab-mcp/tdd)
Your own site
<a href="https://agentmods.dev/skills/zereight/gitlab-mcp/tdd"><img src="https://agentmods.dev/badge/skills/zereight/gitlab-mcp/tdd.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 915 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.00038 $0.00915
Opus 5 $0.00019 $0.00458
Sonnet 5 $0.00008 $0.00183
Haiku 4.5 $0.00004 $0.00092

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

Security

Grade A, and why

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 3d 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.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

  • tdd — 100% identical, 0 lines differ
  • tdd — 100% identical, 0 lines differ
.github/skills/tdd/SKILL.md · 104 lines

How it starts

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

TDD — Test-Driven Development

THE IRON LAW: Write the failing test FIRST. Always.

The Red-Green-Refactor Cycle

RED   → Write a failing test for the NEXT behavior
GREEN → Write ONLY enough code to make it pass (no extras)
REFACTOR → Clean up code quality (tests must stay green after every change)
REPEAT

Step-by-Step Protocol

1. RED Phase

  1. Identify the smallest next behavior to implement
  2. Write a test that describes that behavior as a named it() / test() / def test_
  3. Run the test — it MUST FAIL. If it passes, the test is wrong.
  4. Confirm the failure message is the RIGHT failure (not a syntax error)
// Example: RED — test fails because function doesn't exist yet
it('returns an empty array for an empty input', () => {
  const result = parseItems([]);
  expect(result).toEqual([]);  // FAILS: parseItems is not defined
});

2. GREEN Phase

  1. Write the MINIMUM code to make the test pass
  2. Do not add extra logic, default parameters, or "nice-to-haves"
  3. Run ALL tests — the new test must pass; existing tests must not break
// Example: GREEN — just enough to pass
function parseItems(input: string[]): string[] {
  return [];  // only enough for the current test
}

3. REFACTOR Phase

  1. Look at the code — can it be cleaner without changing behavior?
  2. Apply simplification patterns (see /ai-slop-cleaner and /coding-standards)
  3. Run tests after EVERY change. If tests break, undo immediately.

TDD Gate — When to Stop

Situation Action
Code written before test STOP. Delete production code. Write test first.
Test passes on first run (no prior code) The test is wrong — fix it to fail first.
Multiple behaviors in one test STOP. One test, one behavior.
Skipping refactor to go faster Go back. Clean up before next feature.

Naming Tests as Specifications

Tests are executable documentation. Name them as complete sentences:

// BAD
it('test1', ...)
it('works with empty', ...)

// GOOD
it('returns empty array when input is empty', ...)
it('throws ValidationError when email is missing @', ...)
it('sends exactly one email when user registers', ...)

Read the full file on GitHub · 104 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. 3d ago First seen · 104 lines · 38 tokens per session scan A 74d5bd64f8c3

Subscribe to this mod's changes

tdd is a skill published in the GitHub repository zereight/gitlab-mcp (1,939 stars, last pushed yesterday), licensed MIT. It adds 38 tokens to every session and 915 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.