๐Ÿงช
QualityPython

Test-Driven Development

by majiayu000

Test-Driven Development is a Quality skill for Claude Code, published by majiayu000 in spellbook.

265 stars26 forkson majiayu000/spellbookAdded 2026/09/02+1% in starsRepository updated 2026/08/31
agent-skillsai-agent-skillsai-agentsai-coding-assistantautomationclaudeclaude-codeclaude-code-skillscode-reviewcodexcodex-skillscross-runtimedeveloper-toolsmulti-agentproductivityprompt-engineeringskill-librarysoftware-developmentspellbookworkflows
Install in seconds
Install Test-Driven Development
Copy Test-Driven Development into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/majiayu000/spellbook/tree/main/skills ~/.claude/skills/skills

Requires Node.js. Downloads this skill only โ€” not the rest of the repository โ€” into your Claude Code skills folder.

Without Node.js

git clone https://github.com/majiayu000/spellbook.git

Clones the whole repository, then copy the skillโ€™s own directory into your skills folder yourself.

In this catalog

Source file
skills/test-driven-development.SKILL.md in majiayu000/spellbook
Installs to
~/.claude/skills/skills
Collection
One of 25 skills cataloged from this repository
Category
Quality โ€” 1418 skills

What Test-Driven Development does

Test-Driven Development enforces writing a failing test before implementation, then using the red-green-refactor cycle to build and change code safely. Use it for new features, bug fixes, and refactors.

Test-Driven Development is cataloged under Quality on DirSkills. Test-Driven Development comes from a repository tagged agent-skills, ai-agent-skills, ai-agents, ai-coding-assistant and automation.

Documentation

README

Test-Driven Development (TDD)

From obra/superpowers

Core Principle

Write tests before implementation. Watch them fail. Write minimal code to pass.

THE IRON LAW: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

When to Apply TDD

  • New features
  • Bug fixes
  • Refactoring
  • Any behavior changes

The Red-Green-Refactor Cycle

RED: Write a Failing Test

  1. Write ONE minimal test demonstrating desired behavior
  2. Use clear, descriptive test names
  3. Use real code, avoid unnecessary mocks
  4. Test should fail for the RIGHT reason
# Verify RED
- Run the test
- Confirm it fails
- Confirm failure is NOT due to syntax errors
- Confirm you're not testing existing functionality

GREEN: Make It Pass

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Test-Driven Development

  • What else does majiayu000 publish alongside Test-Driven Development?

    Test-Driven Development is one of 25 skills that DirSkills catalogs from majiayu000/spellbook, the repository it ships in. Its siblings there include AGENTS.md Scaffold, API Design and Agents Md Optimize. Each one is a separate skill with its own page in this directory, installs the same way Test-Driven Development does, and is maintained by majiayu000 in that same repository. The rest of the collection is listed on the majiayu000/spellbook page.

  • How does Test-Driven Development compare to other Quality skills?

    Test-Driven Development ranks #1272 by stars among the 1418 Quality skills in this catalog. The most-starred ones next to it are Benchmark, Benchmark Optimization Loop and API Design Patterns. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Test-Driven Development against them. Open each page to compare what they document and how they install.

More from majiayu000/spellbook

Test-Driven Development is one of 25 skills cataloged on DirSkills from majiayu000/spellbook.

See all 25 skills โ†’
๐Ÿงญ
1h ago

AGENTS.md Scaffold

AGENTS.md Scaffold generates or updates repository-specific AGENTS.md files from repo evidence. It is used when a repo needs scoped agent instructions, validation commands, or directory-specific rules.
Automation
26526
๐Ÿ”Œ
1h ago

API Design

API Design covers REST, GraphQL, and gRPC best practices for defining contracts, versioning, pagination, errors, and idempotency. Use it when designing public or internal APIs and their schemas.
AI Engineering
26526
๐Ÿ› ๏ธ
1h ago

Agents Md Optimize

Agents Md Optimize audits a CLAUDE.md or AGENTS.md file, scores common instruction patterns, and applies approved fixes in place. Use it when you want to improve an agent instruction file, not just review it.
AI Engineering
26526
๐Ÿงช
1h ago

App User Story QA

App User Story QA turns a broad request to test an app into a tracked loop of feature inventory, code-backed expected behavior, and user-story tests. Use it to audit every surface, classify failures, and retest documented defects after fixes.
Quality
26526
๐Ÿ—๏ธ
1h ago

Architecture Foundation

Architecture Foundation turns architecture discussions into explicit boundaries, contracts, validation gates, and a small execution plan. Use it when designing or refactoring system structure, choosing module or service boundaries, or writing a spec before coding.
AI Engineering
26526
๐Ÿ—๏ธ
1h ago

Architecture Research

Architecture Research helps analyze real systems from source, docs, and runtime evidence before choosing a technical direction. Use it for architecture studies, system archaeology, build-vs-buy decisions, and reassessing earlier choices.
AI Engineering
26526