Test-driven development workflow with Red-Green-Refactor cycle across languages

Apache-2.0Auto-check passedTesting & QA

Install TDD Mastery

skills CLI
$ npx skills add rohitg00/awesome-claude-code-toolkit --skill tdd-mastery -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rohitg00/awesome-claude-code-toolkit tdd-mastery --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rohitg00/awesome-claude-code-toolkit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tdd-mastery .claude/skills/tdd-mastery && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tdd-mastery
GitHub stars
2.7k
Token cost
~1.1k tokens
SKILL.md length
281 words
Files
1
Skills in repo
38
Repo updated
First seen
Licence
Apache-2.0

At a glance

Test-driven development workflow with Red-Green-Refactor cycle across languages

  • Works in 3 steps: Red - Write a failing test that defines… → Green - Write the minimum code to make… → Refactor - Clean up while keeping tests…
  • Tasks that involve Test-driven development
  • SKILL.md covers Core Cycle: Red-Green-Refactor, Test Structure, Jest / Vitest Patterns and pytest Patterns, plus 5 more sections
  • Calls go, vitest and pytest

What it does

TDD Mastery is an agent skill from rohitg00/awesome-claude-code-toolkit. Test-driven development workflow with Red-Green-Refactor cycle across languages

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Test-driven development and Unit testing. It works with pytest. The repository describes itself as: The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills, 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 14 MCP configs, 26 companion apps, 52… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Test-driven development
  • Tasks that involve Unit testing

Example prompts

  • “/tdd-mastery”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Red - Write a failing test that defines the desired behavior
  2. Green - Write the minimum code to make the test pass
  3. Refactor - Clean up while keeping tests green

What it can do on your machine

Read from SKILL.md and the folder at commit ebdf1d5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • go
    • vitest
    • pytest

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

TDD Mastery loads about 1.1k tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 281 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rohitg00/awesome-claude-code-toolkit at commit ebdf1d5, republished under its Apache-2.0 licence (© rohitg00). 281 words, ~1,130 tokens.

Download SKILL.mdSave it as .claude/skills/tdd-mastery/SKILL.md (or your agent's skills folder).
name
tdd-mastery
description
Test-driven development workflow with Red-Green-Refactor cycle across languages

TDD Mastery

Core Cycle: Red-Green-Refactor

  1. Red - Write a failing test that defines the desired behavior
  2. Green - Write the minimum code to make the test pass
  3. Refactor - Clean up while keeping tests green

Never write production code without a failing test first. Each cycle should take 2-10 minutes.

Test Structure

Use the Arrange-Act-Assert pattern consistently:

Arrange: Set up test data and dependencies
Act:     Execute the behavior under test
Assert:  Verify the expected outcome

Name tests as test_<unit>_<scenario>_<expected_result> or it("should <behavior> when <condition>").

Jest / Vitest Patterns

typescript
describe("OrderService", () => {
  it("should apply discount when order exceeds threshold", () => {
    const order = createOrder({ items: [{ price: 150, qty: 1 }] });
    const result = applyDiscount(order, { threshold: 100, percent: 10 });
    expect(result.total).toBe(135);
  });

  it("should throw when applying discount to empty order", () => {
    const order = createOrder({ items: [] });
    expect(() => applyDiscount(order, defaultDiscount)).toThrow(EmptyOrderError);
  });
});

Use vi.fn() / jest.fn() for mocks. Prefer dependency injection over module mocking. Use beforeEach for shared setup, never share mutable state between tests.

pytest Patterns

python
@pytest.fixture
def db_session():
    session = create_test_session()
    yield session
    session.rollback()

def test_create_user_stores_hashed_password(db_session):
    user = UserService(db_session).create(email="a@b.com", password="secret")
    assert user.password_hash != "secret"
    assert verify_password("secret", user.password_hash)

@pytest.mark.parametrize("input,expected", [
    ("", False),
    ("short", False),
    ("ValidPass1!", True),
])
def test_password_validation(input, expected):
    assert validate_password(input) == expected

Use pytest.raises for exceptions. Use conftest.py for shared fixtures. Mark slow tests with @pytest.mark.slow.

Go Testing Patterns

go
func TestParseConfig(t *testing.T) {
    tests := []struct {
        name    string
        input   string
        want    Config
        wantErr bool
    }{
        {"valid yaml", "port: 8080", Config{Port: 8080}, false},
        {"empty input", "", Config{}, true},
        {"invalid port", "port: -1", Config{}, true},
    }
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            got, err := ParseConfig([]byte(tt.input))
            if (err != nil) != tt.wantErr {
                t.Errorf("ParseConfig() error = %v, wantErr %v", err, tt.wantErr)
                return
            }
            if !tt.wantErr && got != tt.want {
                t.Errorf("ParseConfig() = %v, want %v", got, tt.want)
            }
        })
    }
}

Use table-driven tests by default. Use t.Helper() in test utility functions. Use testify/assert only if the team already uses it.

Test Levels

LevelScopeSpeedDependencies
UnitSingle function/class<100msNone (mock all)
IntegrationModule boundaries<5sReal DB, real FS
E2EFull user flow<30sFull stack

Ratio target: 70% unit, 20% integration, 10% e2e.

Coverage Rules

  • Enforce 80% line coverage minimum in CI
  • Track branch coverage, not just line coverage
  • Exclude generated code, type definitions, and config files
  • Never write tests just to hit coverage numbers; test behavior
bash
# Jest/Vitest
vitest run --coverage --coverage.thresholds.lines=80 --coverage.thresholds.branches=75

# pytest
pytest --cov=src --cov-fail-under=80 --cov-branch

# Go
go test -coverprofile=cover.out -coverpkg=./... ./...
go tool cover -func=cover.out

Mocking Guidelines

  • Mock at boundaries: HTTP clients, databases, file systems, clocks
  • Never mock the unit under test
  • Prefer fakes (in-memory implementations) over mocks for repositories
  • Assert on behavior, not on mock call counts
  • Use t.Cleanup / afterEach to reset shared mocks

Anti-Patterns to Avoid

  • Testing implementation details instead of behavior
  • Tests that pass when code is deleted (tautological tests)
  • Shared mutable state between test cases
  • Ignoring flaky tests instead of fixing them
  • Testing private methods directly
  • Giant test setup that obscures intent

© rohitg00, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/tdd-mastery of rohitg00/awesome-claude-code-toolkit.

Open the folder on GitHubat commit ebdf1d5

Compare with similar skills

TDD Mastery next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

TDD Mastery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
TDD Mastery this skillrohitg00/awesome-claude-code-toolkit2.7k—~1.1kAutomated safety check: PassApache-2.0
MoAI TDD Workflowmodu-ai/moai-adk1.2k—~3.1kAutomated safety check: PassApache-2.0
Test-Driven Development Enforcerzereight/gitlab-mcp2k1 repos~904Automated safety check: PassMIT
Python Testingaffaan-m/ECC276k6 repos~4.7kAutomated safety check: PassMIT
Django TDDaffaan-m/ECC276k7 repos~5.3kAutomated safety check: PassMIT
Django TDDaffaan-m/ECC276k3 repos~4.9kAutomated safety check: PassMIT

Similar skills

  • MoAI TDD Workflow

    modu-ai/moai-adk

    Drives test-first development through the RED, GREEN, REFACTOR cycle, with a config switch that selects between TDD and a DDD workflow for existing code.

    1.2k GitHub stars~3.1k tokensUpdated today
    Testing & QAAuto-check passed
  • Enforces strict red-green-refactor, with a failing test first, the minimum code to pass it, then cleanup, and a quick reference for common test runners.

    2k GitHub starsUsed in 1 repo~904 tokens
    Testing & QAAuto-check passed
  • Python Testing

    affaan-m/ECC

    Python testing strategies using pytest, TDD methodology, fixtures, mocking, parametrization, and coverage requirements.

    276k GitHub starsUsed in 6 repos~4.7k tokens
    Testing & QAAuto-check passed
  • Django TDD

    affaan-m/ECC

    Django testing strategies with pytest-django, TDD methodology, factoryboy, mocking, coverage, and testing Django REST Framework APIs.

    276k GitHub starsUsed in 7 repos~5.3k tokens
    Testing & QAAuto-check passed
  • Django TDD

    affaan-m/ECC

    Django 测试策略,包括 pytest-django、TDD 方法、factoryboy、模拟、覆盖率以及测试 Django REST Framework API。

    276k GitHub starsUsed in 3 repos~4.9k tokens
    Testing & QAAuto-check passed
  • Python Testing

    affaan-m/ECC

    使用pytest的Python测试策略,包括TDD方法、夹具、模拟、参数化和覆盖率要求. An agent skill from affaan-m/ECC.

    276k GitHub starsUsed in 3 repos~4.2k tokens
    Testing & QAAuto-check passed

More from rohitg00/awesome-claude-code-toolkit

All 38 skills in this repo
  • Accessibility Wcag

    rohitg00/awesome-claude-code-toolkit

    Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

    2.7k GitHub stars~1.4k tokensUpdated 5 mo ago
    Auto-check passed
  • Agentkit SEO

    rohitg00/awesome-claude-code-toolkit

    Route broad or ambiguous AgentKit SEO work to the right module while keeping context scoped.

    2.7k GitHub stars~879 tokensUpdated 5 mo ago
    Auto-check passed
  • API Design Patterns

    rohitg00/awesome-claude-code-toolkit

    REST API design with resource naming, pagination, versioning, and OpenAPI spec generation

    2.7k GitHub stars~1.2k tokensUpdated 5 mo ago
    Auto-check passed
  • Authentication Patterns

    rohitg00/awesome-claude-code-toolkit

    Authentication and authorization patterns including OAuth2, JWT, RBAC, session management, and PKCE flows

    2.7k GitHub stars~1.4k tokensUpdated 5 mo ago
    Auto-check passed
  • AWS Cloud Patterns

    rohitg00/awesome-claude-code-toolkit

    AWS cloud patterns for Lambda, ECS, S3, DynamoDB, and Infrastructure as Code with CDK/Terraform

    2.7k GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • CI CD Pipelines

    rohitg00/awesome-claude-code-toolkit

    CI/CD pipeline patterns for GitHub Actions, GitLab CI, testing strategies, and deployment automation

    2.7k GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed

Works with

Categories

Questions about TDD Mastery

What does TDD Mastery do?

Test-driven development workflow with Red-Green-Refactor cycle across languages. TDD Mastery is an agent skill from rohitg00/awesome-claude-code-toolkit.

When should I use TDD Mastery?

TDD Mastery fits situations like: tasks that involve Test-driven development; tasks that involve Unit testing.

How do I install TDD Mastery in Claude Code?

Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill tdd-mastery -a claude-code`. Or copy the skill folder (skills/tdd-mastery in rohitg00/awesome-claude-code-toolkit) into .claude/skills/tdd-mastery in your project. Claude Code loads it when a task matches its description.

How do I install TDD Mastery in Codex?

Run `npx skills add rohitg00/awesome-claude-code-toolkit --skill tdd-mastery -a codex`. Or copy the skill folder (skills/tdd-mastery in rohitg00/awesome-claude-code-toolkit) into .agents/skills/tdd-mastery in your project. Codex loads it when a task matches its description.

Can I use TDD Mastery in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rohitg00/awesome-claude-code-toolkit --skill tdd-mastery -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tdd-mastery, .gemini/skills/tdd-mastery, .github/skills/tdd-mastery and .opencode/skills/tdd-mastery in your project.

What does TDD Mastery need to run?

Going by SKILL.md and its folder, TDD Mastery needs the command-line tools its instructions call (go, vitest and pytest). Our summary lists: Python 3.

Does TDD Mastery access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is TDD Mastery safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does TDD Mastery use?

TDD Mastery is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does TDD Mastery use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to TDD Mastery?

Skills that share tags, products or a category with TDD Mastery: MoAI TDD Workflow (modu-ai/moai-adk, 1.2k stars), Test-Driven Development Enforcer (zereight/gitlab-mcp, 2k stars), Python Testing (affaan-m/ECC, 276k stars) and Django TDD (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains TDD Mastery?

rohitg00 (a GitHub user) maintains it in rohitg00/awesome-claude-code-toolkit, which has 2,685 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on May 12, 2026.

Source: rohitg00/awesome-claude-code-toolkit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.