Skip to content
Skills Library
Programming · Building & coding

test-driven-development

/test-driven-development

Use when adding or changing production behavior, fixing a bug, or refactoring, even if the user never mentions tests. Applies RED → GREEN → REFACTOR, with characterization coverage before behavior-preserving refactors. Not for documentation or comments.

Repository
refract ↗
Licence
MIT
Last repository change
13.11.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.11.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 adding or changing production behavior, fixing a bug, or refactoring, even if the user never mentions tests. Applies RED → GREEN → REFACTOR, with characterization coverage before behavior-preserving refactors. Not for documentation or comments.

Original author description

Use when adding or changing production behavior, fixing a bug, or refactoring, even if the user never mentions tests. Applies RED → GREEN → REFACTOR, with characterization coverage before behavior-preserving refactors. Not for documentation or comments.

How it works

  1. Role
  2. Iron Law
  3. Cycle
  4. Edge Cases
  5. Rules
  6. Evidence Record
Original SKILL.md headings · 61 lines, 329 words
SKILL.md preview
---
name: test-driven-development
description: "Use when adding or changing production behavior, fixing a bug, or refactoring, even if the user never mentions tests. Applies RED → GREEN → REFACTOR, with characterization coverage before behavior-preserving refactors. Not for documentation or comments."
---

# Test-Driven Development

## Role

This skill owns implementation test order. `systematic-debugging` owns bug
cause; `verifying-before-completion` owns final evidence claims.

## Iron Law

Change behavior only after a test fails for that behavior, and refactor only
under passing characterization coverage. Without them, nothing shows the
change did what it claims.

## Cycle

1. **RED.** Add one focused behavior test and run it. Quote the failure line.
   RED counts only when the failure names the intended missing behavior; an
   import error, typo, or missing fixture is not RED.
2. **GREEN.** Make the smallest production change that passes the focused test
   and the tests covering every module you touched.
3. **REFACTOR.** Improve structure only, running tests after each step. Stay
   green.
4. Repeat for the next behavior.

For a bug, RED reproduces the diagnosed defect. For a behavior-preserving
refactor, establish passing characterization tests first and keep them green.

## Edge Cases

- **RED passes already.** Strengthen the test. If the behavior truly exists,
  report that and write no production code.
- **No test harness.** Ask the user whether to add one or waive TDD for this
  change.
- **Flaky RED.** Run it three times. A test that does not fail every time is
  not RED; stabilize it first.
- **Hard boundary.** Network, clock, filesystem, or hardware: mock only that
  boundary and keep real behavior everywhere else.

## Rules

- Production behavior you wrote before its test is discarded and redone
  test-first. Pre-existing code is characterized, not discarded.
- Fix production code to meet the assertion. Change an assertion only when it
  contradicts the specification, and say so.
- Exceptions require user approval: generated code, pure configuration, or a
  throwaway prototype.

## Evidence Record

Record in the phase `notes.md` under Test evidence, or in the final report for
direct work:

```text
RED:   <command> -> <failing test>: <failure line>
GREEN: <command> -> <N> passed, 0 failed
```

Changed behavior without credible RED → GREEN evidence fails specification
review unless the user waived TDD.

Versions

RepositoryScoreLicence
This page · sitien173/refract100MIT
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 705be3b257e5 (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

  • 100tdd
    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
  • 100tdd
    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
  • 100tdd
    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
  • 100tdd
    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
  • 100tdd
    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
  • 100tdd
    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

Feedback and reports

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