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.
- Author
- nasac0x ↗
- Repository
- code-orchestrator ↗
- Licence
- MIT
- Last repository change
- 31.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 31.10.2026, without references to retired models or APIs.
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
- What a good test is
- Seams — where tests go
- Anti-Patterns
- Rules of the Loop
- Workspace Integration
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
| Repository | Score | Licence |
|---|---|---|
| This page · nasac0x/code-orchestrator | 100 | MIT |
| kdlbs/kandev | 100 | AGPL-3.0 |
| sentimony/skills | 100 | MIT |
| sentimony/skills | 100 | MIT |
| TerminalSkills/skills | 100 | Apache-2.0 |
| duronext/jig | 100 | MIT |
| xoai/sage | 100 | MIT |
| rolemodel/skills | 100 | MIT |
| matteocodogno/wellforge | 100 | MIT |
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.