TDD

Red-green-refactor cycle for test-driven development

43 starsTesting & QA

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add 0xranx/agentbrief --skill tdd
Manual install
git clone --depth 1 https://github.com/0xranx/agentbrief.git /tmp/agentbrief
mkdir -p ~/.claude/skills
cp -r /tmp/agentbrief/briefs/nextjs-developer/skills/tdd ~/.claude/skills/tdd

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

> Methodology from [obra/superpowers](https://github.com/obra/superpowers) (MIT)

# Test-Driven Development (TDD)

Iron law: **no production code without a preceding failing test.**

## The RED-GREEN-REFACTOR Cycle

### RED -- Write a Failing Test

1. Identify the next smallest behavior to implement.
2. Write a test that asserts that behavior.
3. Run the test suite. Confirm the new test **fails** for the right reason.
4. If it passes already, your test is not testing new behavior -- rewrite it.

### GREEN -- Make It Pass

1. Write the **minimum** production code to make the failing test pass.
2. Do not add extra logic, handle future cases, or optimize.
3. Run the test suite. All tests must be green.
4. If other tests broke, fix them before moving on.

### REFACTOR -- Clean Up

1. Look at the code you just wrote. Remove duplication, improve naming, simplify.
2. Run the test suite after every refactor step. Stay green.
3. Do not add new behavior during refactor -- that requires a new RED step.

## Practical Rules

- One assertion per test when possible. Focused tests give clearer failure messages.
- Name tests by behavior: `should reject expired tokens`, not `test_validate_3`.
- Keep the cycle short: aim for minutes per iteration, not hours.
- If you are stuck making a test pass, the step is too big. Write a simpler test first.
- Commit after each GREEN or REFACTOR step. Small commits are cheap insurance.

## When to Apply TDD

- New features: always.
Read the full skill on GitHub

Details

Skill name
tdd
Path
briefs/nextjs-developer/skills/tdd/SKILL.md
License
MIT
Repo updated
28 March 2026

FAQ

What does the TDD skill do?

Red-green-refactor cycle for test-driven development

How do I install the TDD skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add 0xranx/agentbrief --skill tdd. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is TDD popular?

It lives in 0xranx/agentbrief, which has 43 GitHub stars and 0 forks.

Related skills

Typescript Advanced Types

43

0xranx/agentbrief

Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when implementing complex type logic, creating reusable type utilities, or ensuring compile-time type safety in TypeScript projects.

Software Development

Analytics Setup

43

0xranx/agentbrief

When the user needs to set up product analytics, event tracking, or says 'set up analytics,' 'add tracking,' 'GA4,' 'Mixpanel,' 'PostHog,' 'Amplitude,' 'what events should we track,' 'conversion tracking,' 'funnel tracking,' or is launching a product and needs to instrument it for data collection.

Data & Analytics

API Documentation

43

0xranx/agentbrief

Create comprehensive API documentation for developers. Use when documenting REST APIs, GraphQL schemas, or SDK methods. Handles OpenAPI/Swagger, interactive docs, examples, and API reference guides.

Software Development

Visual Proof

48

frankxai/claude-skills-library

Capture before/after screenshot evidence of a web page at real breakpoints (375, 768, 1440) in both light and dark themes, using Playwright against a local dev server or a deployed URL. Use before starting any visual change to capture the current state, and again after to prove the delta. Also use when asked to "show me what it looks like", check responsive behavior, verify dark mode, or confirm a layout does not break on mobile. Reports honestly when a browser or server is unavailable rather than describing a page it never rendered.

Testing & QA

Regression Testing

43

0xranx/agentbrief

When the user wants to prevent regressions, improve test coverage, or says 'add tests,' 'improve coverage,' 'we keep breaking this,' 'write regression tests,' 'characterization tests,' or after fixing a production bug to ensure it never recurs.

Testing & QA

Add Puzzle Type

45

pjt222/agent-almanac

Scaffold a new puzzle type across all 10+ pipeline integration points in jigsawR. Creates the core puzzle module, wires it into the unified pipeline (generation, positioning, rendering, adjacency), adds ggpuzzle geom/stat layers, updates DESCRIPTION and config.yml, extends the Shiny app, and creates a comprehensive test suite. Use when adding a completely new puzzle type to the package or following the 10-point integration checklist to ensure nothing is missed end-to-end.

Testing & QAIn 1 list

Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.