Skip to content
Back to skills

Tdd

ASecurity

Test-Driven Development (TDD) skill for Red-Green-Refactor cycle. Use when implementing features with tests first, minimal code to pass, then refactor. Isolates test execution from main orchestrator context.

  • 20 stars
  • 0 votes
  • 0 copies
  • 16 views
  • Added February 7, 2026
toolspythonbashapidocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add changoo89/claude-pilot --skill tdd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tdd?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Tdd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/changoo89-tdd/badge)](https://www.skillsdirectory.com/skills/changoo89-tdd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: tdd
description: Test-Driven Development (TDD) skill for Red-Green-Refactor cycle. Use when implementing features with tests first, minimal code to pass, then refactor. Isolates test execution from main orchestrator context.
---

# SKILL: Test-Driven Development (TDD)

> **Purpose**: Execute TDD Red-Green-Refactor cycle for feature implementation
> **Target**: Coder Agent implementing features with test-first methodology
> **⚠️ Subagents Only**: This skill is for coder/tester subagents. Main orchestrator must delegate via Task tool.

---

## Quick Start

### When to Use This Skill
- Implement new feature with test coverage
- Fix bug with regression tests
- Refactor code with test safety net

### Quick Reference
```bash
# Red: pytest tests/test_feature.py -k "SC-1"  # FAIL
# Green: [Implement feature]
# Refactor: [Refactor code]
# Verify: pytest  # ALL PASS
```

## What This Skill Covers

### In Scope
- Red-Green-Refactor cycle execution
- Test-first development methodology
- Minimal implementation for Green phase

### Out of Scope
- Test framework selection → @.claude/skills/tdd/REFERENCE.md
- Coverage thresholds → @.claude/skills/ralph-loop/SKILL.md
- Code quality standards → @.claude/skills/vibe-coding/SKILL.md

## Core Concepts

### The TDD Cycle: Red-Green-Refactor

**Phase 1: Red** - Write Failing Test
```python
def test_add_two_numbers():
    result = calculator.add(2, 3)
    assert result == 5
```
Run test → Confirm it FAILS (❌)

**Phase 2: Green** - Minimal Implementation
```python
def add(a, b):
    return a + b  # Just enough to pass
```
Run test → Confirm it PASSES (✅)

**Phase 3: Refactor** - Improve Quality
```python
def add(a: int, b: int) -> int:
    """Add two integers with type safety."""
    return a + b
```
Run ALL tests → Confirm ALL PASS (✅)

### Why TDD Matters
- **Tests drive design**: API designed from usage perspective
- **Regression safety**: Refactor without fear
- **Living documentation**: Tests show intended behavior
- **Fast feedback**: Catch issues immediately

## Further Reading

**Internal**: @.claude/skills/tdd/REFERENCE.md - Advanced TDD concepts, patterns, and examples | @.claude/skills/ralph-loop/SKILL.md - Autonomous completion loop | @.claude/skills/vibe-coding/SKILL.md - Code quality standards | @.claude/skills/tdd/REFERENCE.md - Test framework detection

**External**: [Test-Driven Development by Kent Beck](https://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530) | [Growing Object-Oriented Software, Guided by Tests](https://www.amazon.com/Growing-Object-Oriented-Software-Guided-Tests/dp/0321503627)

Files in this skill

  • REFERENCE.md7.4 KB
  • SKILL.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.