Agent skill

Test-Driven Development Enforcer

by zereight in zereight/gitlab-mcp

Enforces strict red-green-refactor, with a failing test first, the minimum code to pass it, then cleanup, and a quick reference for common test runners.

MITAuto-check passedTesting & QA

Install Test-Driven Development Enforcer

skills CLI
$ npx skills add zereight/gitlab-mcp --skill tdd -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zereight/gitlab-mcp tdd --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zereight/gitlab-mcp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/tdd .claude/skills/tdd && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tdd
GitHub stars
2k
Used in
1 other repo
Token cost
~904 tokens
SKILL.md length
340 words
Files
1
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Enforces strict red-green-refactor, with a failing test first, the minimum code to pass it, then cleanup, and a quick reference for common test runners.

  • Works in 3 steps: RED Phase → GREEN Phase → REFACTOR Phase
  • Implementing a feature strictly test-first
  • SKILL.md covers The Red-Green-Refactor Cycle, Step-by-Step Protocol, TDD Gate — When to Stop and Naming Tests as Specifications, plus 3 more sections
  • Calls npx, pytest and cargo

What it does

The skill states one iron law: write the failing test first. In the red phase the agent picks the smallest next behavior, writes a named test, runs it and confirms it fails for the right reason rather than a syntax error. In the green phase it writes only enough code to pass, with no extras, and runs all tests. In the refactor phase it cleans up without changing behavior, runs the tests after every change and undoes anything that breaks them.

A gate table says what to do when the rules slip: delete production code written before its test, fix a test that passes on its first run, split a test that covers several behaviors, and go back if refactoring was skipped. Tests are named as complete sentences so they read as specifications. A quick reference gives the failing assertion and the single-test command for Vitest, Jest, pytest and cargo test. The excerpt is cut off after that table.

When your agent uses it

  • Implementing a feature strictly test-first
  • Fixing a bug by writing a reproducing test before touching code
  • Checking that new tests fail for the right reason before implementing

Example prompts

  • “Add an email validator to the signup module using strict TDD.”
  • “Write the failing test for the empty-cart discount first, then the smallest code that passes.”
  • “Refactor the parser, running the tests after every change.”

Requirements

  • A test runner such as Vitest, Jest, pytest or cargo test

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. RED Phase
  2. GREEN Phase
  3. REFACTOR Phase

What it can do on your machine

Read from SKILL.md and the folder at commit 0109168. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx
    • pytest
    • cargo
    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test-Driven Development Enforcer loads about 904 tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 340 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~904

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from zereight/gitlab-mcp at commit 0109168, republished under its MIT licence (© zereight). 340 words, ~904 tokens.

Download SKILL.mdSave it as .claude/skills/tdd/SKILL.md (or your agent's skills folder).
name
tdd
description
Test-Driven Development enforcement skill. Activates full TDD mode. Activate when: TDD, test-driven, test first, red-green-refactor, write tests first.
argument-hint
[feature or function to implement with TDD]

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)
typescript
// 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
typescript
// 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

SituationAction
Code written before testSTOP. 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 testSTOP. One test, one behavior.
Skipping refactor to go fasterGo back. Clean up before next feature.

Naming Tests as Specifications

Tests are executable documentation. Name them as complete sentences:

typescript
// 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', ...)

Framework Quick Reference

FrameworkFailing assertionRun single test
Vitestexpect(x).toBe(y)npx vitest run -t "test name"
Jestexpect(x).toBe(y)npx jest -t "test name"
pytestassert x == ypytest -k "test_name"
cargo testassert_eq!(x, y)cargo test test_name
go testt.Errorf(...)go test -run TestName

Common TDD Pitfalls

PitfallFix
Testing implementation detailsTest behavior (outputs), not internals (private methods)
One test for 10 behaviorsSplit into atomic test cases
Mock everything (over-mocking)Mock at system boundaries only (DB, HTTP, filesystem)
No triangulationWrite 2-3 tests that force the correct implementation to emerge
Untriangulated constantsreturn 42 passes one test — add a second test to force real logic

See Also

  • @test-engineer — test strategy, framework detection, coverage gap analysis
  • /ultraqa — QA cycling: test, verify, fix, repeat
  • /verify — evidence-based completion verification

© zereight, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/tdd of zereight/gitlab-mcp.

Open the folder on GitHubat commit 0109168

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in zereight/gitlab-mcp, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Test-Driven Development Enforcer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test-Driven Development Enforcer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test-Driven Development Enforcer this skillzereight/gitlab-mcp2k1 repos~904Automated safety check: PassMIT
MoAI TDD Workflowmodu-ai/moai-adk1.2k—~3.1kAutomated safety check: PassApache-2.0
TDD Guidealirezarezvani/claude-skills28k—~3.4kAutomated safety check: PassMIT
TDD GuideLeoYeAI/openclaw-master-skills2.2k—~1.4kAutomated safety check: PassMIT
TDD Guideborghei/Claude-Skills874—~1.7kAutomated safety check: PassMIT
TDD GuideaAAaqwq/AGI-Super-Team1052 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • MoAI TDD Workflow

    modu-ai/moai-adk

    Drives test-first development through the RED, GREEN, REFACTOR cycle, with a config switch that selects between TDD and a DDD workflow for existing code.

    1.2k GitHub stars~3.1k tokensUpdated today
    Testing & QAAuto-check passed
  • TDD Guide

    alirezarezvani/claude-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    28k GitHub stars~3.4k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • TDD Guide

    LeoYeAI/openclaw-master-skills

    Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and…

    2.2k GitHub stars~1.4k tokensUpdated 2 mo ago
    Testing & QAAuto-check passed
  • TDD Guide

    borghei/Claude-Skills

    Guide red-green-refactor TDD with test generation, coverage-gap analysis, and multi- framework support.

    874 GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • TDD Guide

    aAAaqwq/AGI-Super-Team

    Test-driven development workflow with test generation, coverage analysis, and multi-framework support

    105 GitHub starsUsed in 2 repos~1.1k tokens
    Testing & QAAuto-check passed
  • TDD

    glebis/claude-skills

    This skill should be used when the user wants to implement features or fix bugs using test-driven development.

    388 GitHub stars~8.4k tokensUpdated 11 days ago
    Testing & QAAuto-check passed

More from zereight/gitlab-mcp

All 24 skills in this repo
  • OMG Mode Canceller

    zereight/gitlab-mcp

    Detects which autonomous OMG mode is currently active - Autopilot, Ralph, Ultrawork, UltraQA, Team or Self-Improve - and shuts it down cleanly.

    2k GitHub starsUsed in 1 repo~690 tokens
    Auto-check passed
  • CCG Tri-Model Orchestration

    zereight/gitlab-mcp

    Runs a task through Codex and Gemini CLIs in parallel alongside Claude, then synthesizes the three outputs into one answer with agreements and conflicts called out.

    2k GitHub starsUsed in 1 repo~657 tokens
    Auto-check passed
  • Shared reference for naming, function size, complexity and error handling rules that reviewer agents apply across TypeScript, Python, Go, Rust, Java, C# and Swift.

    2k GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Remember Project Knowledge

    zereight/gitlab-mcp

    Sorts what you learned in a session into the right memory surface, filtering out ephemeral notes and duplicates before anything is stored.

    2k GitHub starsUsed in 1 repo~846 tokens
    Auto-check passed
  • Pre-Commit Security Scan

    zereight/gitlab-mcp

    Runs a fast security sweep of recent code changes before a commit or PR, checking for leaked secrets, vulnerable dependencies, unsafe input handling and auth gaps.

    2k GitHub starsUsed in 1 repo~859 tokens
    Auto-check: notes
  • Skill Inventory Stocktake

    zereight/gitlab-mcp

    Audits a project's skill directories for broken frontmatter, missing template sync and quality gaps, then produces a health report of what needs fixing.

    2k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed

Questions about Test-Driven Development Enforcer

What does Test-Driven Development Enforcer do?

Enforces strict red-green-refactor, with a failing test first, the minimum code to pass it, then cleanup, and a quick reference for common test runners. The skill states one iron law: write the failing test first. In the red phase the agent picks the smallest next behavior, writes a named test, runs it and confirms it fails for the right reason rather than a syntax error.

When should I use Test-Driven Development Enforcer?

Test-Driven Development Enforcer fits situations like: implementing a feature strictly test-first; fixing a bug by writing a reproducing test before touching code; checking that new tests fail for the right reason before implementing.

How do I install Test-Driven Development Enforcer in Claude Code?

Run `npx skills add zereight/gitlab-mcp --skill tdd -a claude-code`. Or copy the skill folder (.github/skills/tdd in zereight/gitlab-mcp) into .claude/skills/tdd in your project. Claude Code loads it when a task matches its description.

How do I install Test-Driven Development Enforcer in Codex?

Run `npx skills add zereight/gitlab-mcp --skill tdd -a codex`. Or copy the skill folder (.github/skills/tdd in zereight/gitlab-mcp) into .agents/skills/tdd in your project. Codex loads it when a task matches its description.

Can I use Test-Driven Development Enforcer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zereight/gitlab-mcp --skill tdd -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdd, .gemini/skills/tdd, .github/skills/tdd and .opencode/skills/tdd in your project.

What does Test-Driven Development Enforcer need to run?

Going by SKILL.md and its folder, Test-Driven Development Enforcer needs the command-line tools its instructions call (npx, pytest, cargo and go). Our summary lists: A test runner such as Vitest, Jest, pytest or cargo test.

Does Test-Driven Development Enforcer access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Test-Driven Development Enforcer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test-Driven Development Enforcer use?

Test-Driven Development Enforcer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test-Driven Development Enforcer use?

About 904 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test-Driven Development Enforcer?

Skills that share tags, products or a category with Test-Driven Development Enforcer: MoAI TDD Workflow (modu-ai/moai-adk, 1.2k stars), TDD Guide (alirezarezvani/claude-skills, 28k stars), TDD Guide (LeoYeAI/openclaw-master-skills, 2.2k stars) and TDD Guide (borghei/Claude-Skills, 874 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test-Driven Development Enforcer?

zereight (a GitHub user) maintains it in zereight/gitlab-mcp, which has 2,027 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 6, 2026.

Source: zereight/gitlab-mcp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.