Skip to content
Skills Library
Programming · Testing

test-driven-development

/test-driven-development

Use whenever you add or change observable behavior. Enforces RED-GREEN-REFACTOR with real test runs, forbids production code written before a failing test, and requires tests that actually fail when the implementation breaks.

Licence
MIT
Last repository change
27.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use whenever you add or change observable behavior. Enforces RED-GREEN-REFACTOR with real test runs, forbids production code written before a failing test, and requires tests that actually fail when the implementation breaks.

Original author description

Use whenever you add or change observable behavior. Enforces RED-GREEN-REFACTOR with real test runs, forbids production code written before a failing test, and requires tests that actually fail when the implementation breaks.

How it works

  1. The rule
  2. The cycle
  3. Test quality rules
  4. Running tests in Freebuff
  5. When TDD does not fit
Original SKILL.md headings · 70 lines, 483 words
SKILL.md preview
---
name: test-driven-development
description: Use whenever you add or change observable behavior. Enforces RED-GREEN-REFACTOR with real test runs, forbids production code written before a failing test, and requires tests that actually fail when the implementation breaks.
license: MIT
metadata:
  category: testing
  pack: freebuff-superpowers
---

# Test-Driven Development

## The rule

No production code without a failing test for it. If you already wrote the code, delete
it or park it, write the test, and let the failure drive the implementation back.

This is not a style preference. A test you never saw fail is a test you do not know can
fail.

## The cycle

### RED

Write the smallest test that expresses one behavior, through the interface a user of the
code will actually use. Run it.

- Confirm it fails **for the intended reason**. A syntax error, an import error, or a typo
  is not a red test; fix it and run again.
- Read the failure message. It should describe the missing behavior, not the broken test.

### GREEN

Write the minimal implementation that makes it pass. Run the test.

- Then run the surrounding suite, not just the new case.
- Resist generalizing. Duplication in the second case is cheaper than the wrong
  abstraction in the first.

### REFACTOR

With tests green, remove duplication and improve names. Re-run after each refactor step.
Never refactor and change behavior in the same step.

## Test quality rules

- **Behavior, not implementation.** Assert on returned values, rendered output, HTTP
  responses, observable side effects. A test that breaks when you rename a private
  function is a liability.
- **One behavior per test**, with a name that states the behavior.
- **No weakened assertions to get green.** No `toBeTruthy` where `toEqual` belongs, no
  widened types, no `any`, no skipped tests, no `assert` deleted to make a suite pass.
- **Prove the test can fail.** Temporarily break the implementation (or reason precisely
  about it) and confirm the test catches it. If it does not, the test is decoration.
- **Deterministic.** No sleeps for timing; no dependence on network, clock, or test order.
  If you must control time or a random source, inject it.

## Running tests in Freebuff

- Use the project's real command from `package.json`, `Makefile`, `pyproject.toml`, or CI
  config. Do not invent one.
- Keep the exit status. If you pipe output through `head`, `tail`, or `grep`, use
  `set -o pipefail` so a failure cannot be masked by a successful pipe.
- Read the failure output yourself. A red suite you did not read is not information.
- Re-run the affected tests after every edit. An earlier green run does not cover a later
  change.

## When TDD does not fit

Visual layout, exploratory spikes, generated code, and one-off config are legitimate
exceptions. Say so explicitly, and substitute a concrete check:

- UI: assert on DOM structure, accessible roles, and text through a test, not a
  screenshot you did not look at.
- Spike: time-box it, throw it away, then write the real change test-first.
- Config: validate by parsing it and asserting the resulting behavior.

"The test would be annoying to write" is not an exception.

Versions

RepositoryScoreLicence
This page · slayyyyer/freebuff-superpowers90MIT
GanyuanRan/Aegis100MIT
lucasouzadev/agent-kit-skill100MIT
zeative/satgas100AGPL-3.0
nikospavlopoulos/devops-mutant-powers100MIT
JohnStrunk/CommonCast100LGPL
Sanit-mann/The-Insectoids100MIT
mastro993/fstack100MIT
jelvodev/yaap100MIT

Database snapshot: 13.11.2026 · package version 86d1a0318301 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95community-test-driven-development
    Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle with test-first approach.
  • 100tdd
    Enforces strict RED-GREEN-REFACTOR test-driven development — one failing test at a time, minimal code to pass, then refactor against an inline quality checklist and a test-provenance check (`provenance` runs it alone). Triggers on "tdd", "write tests", "test driven", "red green refactor", "/tdd".
  • 100tdd
    Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
  • 100tdd
    Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
  • 100tdd
    Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
  • 100tdd
    Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.