Skip to content
Skills Library
Programming · Building & coding

test-driven-development

/test-driven-development

Use when implementing any feature or bugfix before implementation changes. Enforces test-first behavior: write a failing test, verify failure, implement minimal code, and prove green.

Repository
ajbm-skills ↗
Licence
MIT
Last repository change
13.05.2026

Assessment and security

100/ 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.
Content35 / 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 13.05.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 when implementing any feature or bugfix before implementation changes. Enforces test-first behavior: write a failing test, verify failure, implement minimal code, and prove green.

Original author description

Use when implementing any feature or bugfix before implementation changes. Enforces test-first behavior: write a failing test, verify failure, implement minimal code, and prove green.

How it works

  1. Purpose
  2. Execution Posture
  3. When To Use
  4. Iron Law
  5. If Code Exists Before RED
  6. Red-Green-Refactor Loop
  7. Test Quality Bar
  8. Anti-Patterns
  9. Reporting Contract (Required)
  10. Completion Gate
Original SKILL.md headings · 141 lines, 524 words
SKILL.md preview
---
name: test-driven-development
description: "Use when implementing any feature or bugfix before implementation changes. Enforces test-first behavior: write a failing test, verify failure, implement minimal code, and prove green."
---

# Test-Driven Development (TDD)

## Purpose

Use TDD to prove behavior changes, prevent regressions, and keep implementation scope tight.

Core principle:

```text
If you did not observe a meaningful failing test first, you do not yet have proof the test validates the change.
```

## Execution Posture

**Execute the TDD cycle. Run tests. Report evidence. Don't stop at advice.**

## When To Use

Default for:
- new features
- bug fixes
- behavior changes
- refactors that may change behavior

Allowed exceptions (confirm with human partner):
- throwaway prototypes
- generated code
- pure configuration/docs changes
- urgent incident mitigation where test-first is temporarily impossible

If exception is used, document why and schedule follow-up tests.

## Iron Law

```text
No behavior-changing production code is complete without a failing test that was observed before the final implementation.
```

## If Code Exists Before RED

If you write behavior-changing implementation code before a failing test:
1. Delete that implementation code.
2. Do not keep it as reference while writing tests.
3. Start from RED with a failing test first.
4. Re-implement minimally to GREEN from the test signal.

Exception only with explicit human partner approval.

## Red-Green-Refactor Loop

### RED: Write One Failing Test

- One behavior per test.
- Test name states observable outcome.
- Prefer real domain behavior; mock only boundaries.

### Verify RED (Mandatory)

Run targeted test command and confirm:
- test fails (not setup error)
- failure reason matches missing behavior

If it passes immediately, the test is not proving the new requirement yet.

### GREEN: Minimal Implementation

- Write the smallest change that satisfies failing test.
- Avoid unrelated refactors and feature expansion.

### Verify GREEN (Mandatory)

Run targeted tests, then broader scope when feasible.

Confirm:
- new test passes
- nearby tests still pass
- no new failures introduced

### REFACTOR

After green:
- remove duplication
- improve naming/structure
- keep behavior unchanged

Re-run tests to prove refactor preserved behavior.

## Test Quality Bar

Each non-trivial change should include:
- happy path
- failure path
- at least one boundary/edge case

For bug fixes:
- mandatory regression test that would have caught the bug

## Anti-Patterns

- writing implementation before defining failing test
- accepting a test that passes immediately without validating requirement gap
- broad refactor during GREEN
- mock-heavy tests that only assert call counts
- claiming completion without execution evidence

## Reporting Contract (Required)

```text
TDD Summary
- Requirement under test:
  - <behavior>
- RED evidence:
  - Command: <command>
  - Failure observed: <yes/no + key message>
- GREEN evidence:
  - Command: <command>
  - Result: <passed/failed>
- Broader verification:
  - <suite command + result> OR "Deferred: <reason>"
- Notes:
  - <exceptions, constraints, or follow-up tests>
```

Required phrases:
- If tests were not run: `I did not run tests.`
- If only partial scope ran: `I ran targeted tests only.`

## Completion Gate

Before marking done:
- failing test observed for changed behavior
- minimal implementation landed
- targeted tests green
- broader verification done or explicitly deferred with reason
- summary includes concrete commands and outcomes

## Bottom Line

TDD is an evidence discipline, not a slogan.

Versions

RepositoryScoreLicence
This page · ajbmachon/ajbm-skills100MIT
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 3427379f17f5 (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.
  • 96ferrox-test-driven-development
    Use when implementing any feature or bugfix, before writing implementation code
  • 100tdd
    Enforces test-driven development: write failing test, write minimal code to pass, refactor. Mandatory for all implementation work. Use when writing any production code, implementing features, fixing bugs, refactoring, or when the user says "write code", "implement", "fix this",…
  • 96sr-test-driven-development
    Use when implementing any feature or bugfix, before writing implementation code
  • 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".
  • 86testing
    Use when implementing any feature or bugfix, before writing implementation code

Feedback and reports

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