tdd-workflow

tdd-workflow is a skill for Claude Code from VersoXBT/claude-initial-setup. It costs 60 tokens per session (1,751 once invoked), scanned A, original, MIT.

A test-first development method called TDD: write a failing test, make it pass with the smallest change, then improve the code.

In plain words
What is it for?
Use it when building features, fixing bugs, improving test coverage, or deciding how to structure a test suite.
Why use it?
It gives each feature or bug fix a concrete expected behaviour and helps prevent regressions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-initial-setup plugin — 75 skills, 15 commands, 14 agents, 2 hooks shipped together

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/versoxbt/claude-initial-setup/tdd-workflow
Any agent
npx skills add VersoXBT/claude-initial-setup --skill tdd-workflow
Clone the repo
git clone --depth 1 https://github.com/VersoXBT/claude-initial-setup

Made for: Claude Code.

Or install claude-initial-setup, the plugin that ships this one along with the rest of its 75 skills, 15 commands, 14 agents, 2 hooks.

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-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/tdd-workflow.svg)](https://agentmods.dev/skills/versoxbt/claude-initial-setup/tdd-workflow)
Your own site
<a href="https://agentmods.dev/skills/versoxbt/claude-initial-setup/tdd-workflow"><img src="https://agentmods.dev/badge/skills/versoxbt/claude-initial-setup/tdd-workflow.svg" alt="Measured on agentmods" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,751 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.00060 $0.01751
Opus 5 $0.00030 $0.00875
Sonnet 5 $0.00012 $0.00350
Haiku 4.5 $0.00006 $0.00175

Measured 2d ago against content hash 230088b36244, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

tdd-workflow 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 2d 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.

skills/testing/tdd-workflow/SKILL.md · 238 lines

How it starts

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

TDD Workflow

Test-Driven Development means writing a failing test before writing implementation code. This ensures every feature has coverage and drives cleaner design through the red-green-refactor cycle.

When to Use

  • User is implementing a new feature (push for test-first)
  • User is fixing a bug (write a test that reproduces the bug first)
  • User asks about TDD or test-driven development
  • User asks how to structure tests
  • Coverage is below 80% and needs improvement

Core Patterns

The Red-Green-Refactor Cycle

  RED: Write a failing test
   |
   v
  GREEN: Write minimal code to pass
   |
   v
  REFACTOR: Clean up without changing behavior
   |
   v
  (repeat)

Step 1: RED — Write a Failing Test

Write the test first. It must fail because the implementation does not exist yet:

// src/utils/slug.test.ts
import { describe, it, expect } from 'vitest'
import { createSlug } from './slug'

describe('createSlug', () => {
  it('converts a title to a URL-safe slug', () => {
    expect(createSlug('Hello World')).toBe('hello-world')
  })

  it('removes special characters', () => {
    expect(createSlug('Hello & World!')).toBe('hello-world')
  })

  it('collapses multiple hyphens', () => {
    expect(createSlug('Hello   World')).toBe('hello-world')
  })

  it('trims leading and trailing hyphens', () => {
    expect(createSlug(' Hello World ')).toBe('hello-world')
  })
})

Run the test — it must FAIL:

npx vitest run src/utils/slug.test.ts
# FAIL: Cannot find module './slug'

Step 2: GREEN — Minimal Implementation

Write the minimum code to make all tests pass:

// src/utils/slug.ts
export function createSlug(title: string): string {
  return title
    .toLowerCase()
    .replace(/[^a-z0-9\s-]/g, '')
    .replace(/\s+/g, '-')
    .replace(/-+/g, '-')
    .replace(/^-|-$/g, '')
}

Run the test — it must PASS:

npx vitest run src/utils/slug.test.ts
# PASS: All 4 tests passed

Step 3: REFACTOR — Improve Without Changing Behavior

Read the full file on GitHub · 238 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. 2d ago First seen · 238 lines · 60 tokens per session scan A 230088b36244

Subscribe to this mod's changes

tdd-workflow is a skill published in the GitHub repository VersoXBT/claude-initial-setup (4 stars, last pushed 3mo ago), licensed MIT. It adds 60 tokens to every session and 1,751 once invoked, about $0.0003 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-09-03.