Skip to content
Skills Library
Programming · Testing

tdd

/tdd

Test-driven development with RED-GREEN-REFACTOR cycle. Use when building features or fixing bugs test-first. Load BEFORE writing implementation code. Enforces failing test before any production code.

Licence
MIT
Last repository change
31.10.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 31.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

Test-driven development with RED-GREEN-REFACTOR cycle. Use when building features or fixing bugs test-first. Load BEFORE writing implementation code. Enforces failing test before any production code.

Original author description

Test-driven development with RED-GREEN-REFACTOR cycle. Use when building features or fixing bugs test-first. Load BEFORE writing implementation code. Enforces failing test before any production code.

How it works

  1. What a good test is
  2. Seams — where tests go
  3. Anti-Patterns
  4. Rules of the Loop
  5. Workspace Integration
Original SKILL.md headings · 41 lines, 318 words
SKILL.md preview
---
name: tdd
description: Test-driven development with RED-GREEN-REFACTOR cycle. Use when building features or fixing bugs test-first. Load BEFORE writing implementation code. Enforces failing test before any production code.
license: MIT
compatibility: opencode
---

# Test-Driven Development

TDD is the red → green loop. Every section applies on every cycle. Consult them before and during the loop, not after.

## What a good test is

Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification and survives refactors because it doesn't care about internal structure.

## Seams — where tests go

A **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.

**Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam.

Ask: "What's the public interface, and which seams should we test?"

## Anti-Patterns

- **Implementation-coupled** — mocks internal collaborators, tests private methods. The tell: the test breaks when you refactor but behavior hasn't changed.
- **Tautological** — assertion recomputes the expected value the way the code does, so it passes by construction. Expected values must come from an independent source.
- **Horizontal slicing** — writing all tests first, then all implementation. Work in **vertical slices**: one test → one implementation → repeat.

## Rules of the Loop

- **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.
- **One slice at a time.** One seam, one test, one minimal implementation per cycle.
- **Refactoring is not part of the loop.** It belongs to the review stage.

## Workspace Integration

**Related rules:** `.opencode/rules/testing.md` (quality gates), `.opencode/rules/coding.md`
**Related workflow:** `.opencode/workflows/feature.md` (Stage 2: Test Planning)
**Related agents:** `@developer`, `@tester`
**Related skills:** `verify-completion`, `code-review`

**Quality Gates (`.opencode/rules/testing.md`):**
- Each test cycle must satisfy Gate 2: Tests pass
- Each implementation must satisfy Gate 3: Code Quality
- Full suite must pass before merging (Gate 2)

Versions

RepositoryScoreLicence
This page · nasac0x/code-orchestrator100MIT
kdlbs/kandev100AGPL-3.0
sentimony/skills100MIT
sentimony/skills100MIT
TerminalSkills/skills100Apache-2.0
duronext/jig100MIT
xoai/sage100MIT
rolemodel/skills100MIT
matteocodogno/wellforge100MIT

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

Downloads in the last 30 days: 2 · ranking

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

Similar skills

  • 90tdd-cycle
    Red-Green-Refactor TDD loop with mandatory false-positive check. Use when: test, TDD, red-green, failing test, write test first, test-driven.
  • 100test-driven-development
    Use when implementing any feature or bugfix, before writing implementation code. Enforces RED-GREEN-REFACTOR cycle with test-first approach.
  • 90tdd-workflow
    Standardized Test-Driven Development (TDD) cycle (RED-GREEN-REFACTOR-VERIFY). Use when user asks to write tests, do TDD, implement test-first, or ensure code quality with high test coverage and regression prevention.
  • 100tdd-workflow
    TDD red-green-refactor workflow. Use when implementing a feature or bug fix test-first.
  • 100tdd-cycle
    Strict red-green-refactor discipline with observed failures. Read when running /tdd, /sparc refinement, or whenever implementing behavior test-first, or when a test passes suspiciously on its first run.
  • 100test-driven-development
    Enforces the red-green-refactor TDD cycle. No production code without a failing test first. Use when implementing features, fixing bugs, or writing production code.

Feedback and reports

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