Skip to content
Back to skills

Test Driven Development

ASecurity

TDD workflow: enforce RED-GREEN-REFACTOR, tests before code.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 14, 2026
ai-agentsgotestingrefactoringgit

Works with

  • claude code
  • cli

Security analysis

A100/100

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

Scanned October 14, 2026

npx -y skills add ctaxnagomi/agent-kd-skill --skill test-driven-development --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Driven Development?

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

Security grade badge for Test Driven Development
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ctaxnagomi-test-driven-development/badge)](https://www.skillsdirectory.com/skills/ctaxnagomi-test-driven-development)

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: test-driven-development
description: "TDD workflow: enforce RED-GREEN-REFACTOR, tests before code."
version: 1.0.0
author: Hermes Agent
license: MIT
platforms: [linux, macos, windows]
metadata:
  hermes:
    tags: [tdd, testing, quality, refactoring]
---

# Test-Driven Development

Classic TDD workflow: write a failing test first, make it pass with minimal code, then refactor. Enforces discipline and produces well-tested, clean code.

## When to Use

- Starting a new feature or module
- Fixing a bug (write a test that fails first)
- Refactoring existing code
- Any time you want confidence in your code

## Procedure

### RED Phase

1. Write a test for the next small behavior
2. Run the test, confirm it fails
3. Check the error message makes sense

### GREEN Phase

1. Write the simplest code that makes the test pass
2. Run the test, confirm it passes
3. Do not add anything the test does not require

### REFACTOR Phase

1. Improve the code while keeping tests green
2. Remove duplication
3. Clarify naming
4. Run tests again to confirm nothing broke

## Cycle

Repeat RED-GREEN-REFACTOR in small increments. Each cycle should take 2-10 minutes. If it takes longer, the step is too big.

## Pitfalls

- Writing multiple tests before making any pass
- Skipping the refactor phase
- Writing tests after the code
- Making the Green phase too elaborate

## Verification

- All tests pass
- Each test covers one specific behavior
- Code is free of duplication
- You can delete any test and see it fail

---

## How to use?

### 1. Download
Go to the [AGENT KD SKILL gallery](https://ctaxnagomi.github.io/agent-kd-skill/) and find this skill card. Click **Download** to save the SKILL.md file.

### 2. Install
Copy the downloaded SKILL.md into your agent's skills directory:

| Agent | Path |
|-------|------|
| **Hermes** | ~/.hermes/skills/hermes/test-driven-development/SKILL.md |
| **opencode** | ~/.config/opencode/skills/test-driven-development/SKILL.md |
| **Claude Code** | ~/.claude/skills/test-driven-development/SKILL.md |

### 3. Use
Restart your agent session. The skill will auto-load when implementing features.

### 4. Verify
Ask your agent to implement something using TDD. If it writes tests first, you're all set.

Files in this skill

  • SKILL.md2.2 KB
  • assembly.json268 B
  • skill.json642 B

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.

Comments

Loading comments…

Newsletter

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