Skip to content
Back to skills

Tdd

ASecurity

Test-driven development with the red-green-refactor loop. Use when building a feature or fixing a bug test-first, when the user mentions "red-green-refactor" or "test first", or when a bug fix needs a reproducing test before the fix.

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 19, 2026
ai-agentsexpress

Security analysis

A100/100

Scanned September 19, 2026

npx -y skills add konstantinos-malavazos/claude-code-playbook --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/konstantinos-malavazos-tdd/badge)](https://www.skillsdirectory.com/skills/konstantinos-malavazos-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 with the red-green-refactor loop. Use when building a feature
  or fixing a bug test-first, when the user mentions "red-green-refactor" or "test
  first", or when a bug fix needs a reproducing test before the fix.
---

# TDD — red / green / refactor

## The loop
1. **Red** — write a test that expresses the desired behaviour and **fails** for the
   right reason. Run it. Confirm it fails.
2. **Green** — write the **minimum** code to make it pass. No more.
3. **Refactor** — clean up with the test as a safety net. Re-run. Stay green.

## For bug fixes specifically
- First write a test that **reproduces the bug** (fails on current code). This proves you
  understand the bug and prevents regression.
- Then make it pass with the smallest change.
- "Fix the bug" → "write a failing test that reproduces it, then make it pass."

## Rules
- Test **behaviour through public interfaces**, not private internals. Tests shouldn't
  break when you refactor without changing behaviour.
- One behaviour per test; a clear name that states the expectation.
- Don't test the framework, generated code, or impossible states.
- Keep the arrange/act/assert structure obvious.

## When NOT to force it
Exploratory spikes and throwaway prototypes don't need TDD, but the moment code is
meant to survive, back it with tests.

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.