test-driven-development

test-driven-development is a skill for Claude Code, Codex from FreePeak/ktme. It costs 20 tokens per session (3,203 once invoked), scanned A, original, MIT.

A development method called test-driven development, or TDD, where you write a failing test, add the smallest implementation that passes it, and then clean up the code.

In plain words
What is it for?
Use it when building features, fixing bugs, refactoring code, or creating modules and libraries.
Why use it?
It checks the intended behavior before implementation and helps protect features during bug fixes and refactoring.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building features, fixing bugs, refactoring code, or creating modules and libraries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/freepeak/ktme/test-driven-development
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.

Any agent
npx skills add FreePeak/ktme --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/FreePeak/ktme

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 test-driven-development

README.md
[![agentmods](https://agentmods.dev/badge/skills/freepeak/ktme/test-driven-development/github.svg)](https://agentmods.dev/skills/freepeak/ktme/test-driven-development)
Your own site
<a href="https://agentmods.dev/skills/freepeak/ktme/test-driven-development"><img src="https://agentmods.dev/badge/skills/freepeak/ktme/test-driven-development/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-driven-development

Your own site · 80×15
<a href="https://agentmods.dev/skills/freepeak/ktme/test-driven-development"><img src="https://agentmods.dev/badge/skills/freepeak/ktme/test-driven-development.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,203 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00020 $0.03203
Opus 5.5 $0.00008 $0.01281
Sonnet 5.5 $0.00004 $0.00641
Haiku 4.5 $0.00002 $0.00320

Measured 2mo ago against content hash 5c1a703cb01e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-driven-development 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 2mo 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.

.kilo/skills/test-driven-development/SKILL.md · 597 lines

How it starts

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

Test-Driven Development

A disciplined approach to development where tests drive the design and implementation of code.

When to Use

Use this skill when:

  • Implementing new features
  • Fixing bugs (write test first to capture bug)
  • Refactoring existing code
  • Building new modules or components
  • Writing library code

The TDD Cycle

The Three Laws of TDD

  1. Red: Write a failing test before writing production code
  2. Green: Write the minimal code to make the test pass
  3. Refactor: Clean up the code while keeping tests green

Visual Workflow

┌─────────┐
│   RED   │ ──► Write failing test
└────┬────┘
     │
     ▼
┌─────────┐
│  GREEN  │ ──► Write minimal code to pass
└────┬────┘
     │
     ▼
┌──────────┐
│ REFACTOR │ ──► Improve code quality
└─────┬────┘
      │
      └──► Repeat

Phase 1: RED - Write Failing Test

Goal: Write a test that fails because the feature doesn't exist yet

Steps

  1. Understand the requirement

    • What should the code do?
    • What are the inputs and outputs?
    • What are the edge cases?
  2. Write a minimal test

    • Test one thing only
    • Use descriptive test name
    • Focus on behavior, not implementation
  3. Run the test

    • Verify it fails for the right reason
    • The test should fail, not crash
    • Error message should be informative

Test Template

#[test]
fn test_<behavior_description>() {
    // Arrange - Set up test data
    let input = /* test input */;
    let expected = /* expected output */;
    
    // Act - Execute the behavior
    let result = function_under_test(input);
    
    // Assert - Verify the outcome
    assert_eq!(result, expected);
}

Examples

// ✅ Good: Test behavior with descriptive name
#[test]
fn test_calculate_total_returns_sum_of_item_prices() {
    let items = vec![
        Item { name: "A", price: 10.0 },
        Item { name: "B", price: 20.0 },
    ];
    
    let result = calculate_total(&items);
    
    assert_eq!(result, 30.0);
}

// ✅ Good: Test edge case
#[test]
fn test_calculate_total_returns_zero_for_empty_items() {
    let items = vec![];
    
    let result = calculate_total(&items);
    
    assert_eq!(result, 0.0);
}

// ✅ Good: Test error case
#[test]
fn test_parse_config_returns_error_for_invalid_toml() {
    let invalid_toml = "not valid toml [[[";
    
    let result = parse_config(invalid_toml);
    
    assert!(result.is_err());
    assert!(matches!(result.unwrap_err(), ConfigError::InvalidToml(_)));
}

// ❌ Bad: Testing implementation details
#[test]
fn test_internal_parser_helper() {
    // Don't test private functions directly
}

// ❌ Bad: Multiple assertions in one test
#[test]
fn test_everything() {
    assert_eq!(func1(), 1);
    assert_eq!(func2(), 2);
    assert_eq!(func3(), 3);  // If func2 fails, we don't test func3
}

Read the full file on GitHub · 597 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. 2mo ago First seen · 597 lines · 20 tokens per session scan A 5c1a703cb01e

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository FreePeak/ktme (15 stars, last pushed 8mo ago), licensed MIT. It adds 20 tokens to every session and 3,203 once invoked, about $0.0001 per session on Opus 5.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.

Related

test-driven-development compared with skills from other repositories

test-driven-development next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
test-driven-developmentFreePeak/ktmeSkill158mo agoMITA20Claude Code, Codex
engram-testing-coverageGentleman-Programming/engramSkill7.8kyesterdayMITA25Claude Code, Codex
principle-test-behavior-not-implementationmichael-denyer/pstack-claudeSkill4.1kyesterdayMITA50Claude Code
tddcodewithmukesh/dotnet-claude-kitSkill8052d agoMITA81Claude Code
nw-ddd-eventsourcingnWave-ai/nWaveSkill631yesterdayMITA38Claude Code
nw-fp-clojurenWave-ai/nWaveSkill631yesterdayMITA25Claude Code
nw-leanux-methodologynWave-ai/nWaveSkill631yesterdayMITA37Claude Code