Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
oakoss avatar

Test Driven Development

  • 56 installs
  • 14 repo stars
  • Updated March 2, 2026
  • oakoss/agent-skills

Helps with testing & qa tasks during AI-assisted development.

About

test-driven-development is a Claude Code skill for testing & qa. It helps solo builders move faster with AI-assisted coding.

  • test-driven-development
  • Testing & QA
  • AI-coding skill

Test Driven Development by the numbers

  • 56 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #1,185 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oakoss/agent-skills --skill test-driven-development

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs56
repo stars14
Last updatedMarch 2, 2026
Repositoryoakoss/agent-skills

What it does

Helps with testing & qa tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Test-Driven Development

Write one failing test that describes the next behavior, write the minimal code to pass it, then refactor while green. Every production change starts with a test that proves the need exists. This is the discipline within each vertical slice — not framework syntax, but when and why to write tests.

Skip for exploratory prototyping, config-only changes (environment variables, feature flags), visual/CSS-only tweaks, and one-off scripts that won't be maintained.

Quick Reference — TDD Cycle

PhaseActionRule
REDWrite one test that fails for the right reasonNo production code without a failing test
GREENWrite the simplest code that makes the test passResist the urge to generalize prematurely
REFACTORImprove structure while all tests stay greenNever change behavior and structure at once

Quick Reference — Principles

PrinciplePractice
One test at a timeComplete the full red-green-refactor cycle before writing the next test
Behavior over implementationTest what code does, not how it does it; assert outputs and side effects
Vertical slicesTDD one end-to-end behavior at a time, not one layer at a time
Mock at boundariesMock I/O, network, filesystem, clock. Never mock internal collaborators
Deep modulesDesign small interfaces with rich internals; fewer tests cover more behavior
Refactor only when greenAll tests pass before touching structure; refactoring under red hides new bugs
Design through testsThe first test IS the API design decision; awkward tests signal awkward interfaces
Failing test for every bugReproduce the bug as a failing test before writing the fix

Planning Before Coding

StepActionOutput
1Identify behaviorsList of observable behaviors the feature must exhibit
2Order by dependencySequence where each test builds on prior passing tests
3Design the interfaceFunction signatures, parameter types, return types
4Identify mock boundariesExternal dependencies that need test doubles

Common Mistakes

MistakeCorrect Pattern
Writing all tests firstOne test at a time. Complete the cycle before starting the next
Testing private methodsTest through the public interface; private methods are implementation detail
Mocking internal collaboratorsOnly mock at I/O boundaries; trust your own code
Writing code before a failing testRED first. The failing test proves the behavior is missing
Refactoring while tests are redGet to GREEN first, then refactor with confidence
Tests coupled to call sequencesAssert on outputs and state, not on which internal methods were called
Skipping the refactor phaseGREEN is not done. Clean up duplication and naming before moving on
Hardcoding expected valuesUse triangulation: add a second test case to force the general solution
One giant test per featureOne test per behavior — small, focused, independently meaningful

Delegation

  • Slice decomposition: If the tracer-bullets skill is available, use it to decompose features into vertical slices before applying TDD within each slice
  • Test framework syntax: Delegate framework-specific patterns to vitest-testing, e2e-testing, or api-testing skills
  • Feature planning: If the plan-first-development skill is available, use it for upfront planning before entering the TDD cycle
  • Individual TDD cycles: Delegate each red-green-refactor cycle to a Task subagent to keep context focused

References

  • Test Quality — good vs bad tests, what to test, naming, triangulation, refactoring signals
  • Mocking Boundaries — boundary rule, test doubles, dependency injection, anti-patterns
  • Design for Testability — deep modules, interface-first design, pure functions, computation vs I/O

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.