Implements features using a strict test-first development approach.

Install

mkdir -p .claude/skills/tdd-jubakitiashvili && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/11914" && unzip -o skill.zip -d .claude/skills/tdd-jubakitiashvili && rm skill.zip

Installs to .claude/skills/tdd-jubakitiashvili

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Test-driven development workflow with Jest and React Native Testing Library
75 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Guide through the Red-Green-Refactor TDD cycle
  • Write failing tests before implementation
  • Implement minimum code to pass tests
  • Refactor code while keeping tests green
  • Utilize Jest and React Native Testing Library for testing
  • Develop new React Native components test-first

How it works

The skill guides the user through the Test-Driven Development workflow, emphasizing writing failing tests first, then implementing minimal code to pass them, and finally refactoring.

Inputs & outputs

You give it
User description of a feature to implement
You get back
Implemented feature with complete test coverage following TDD principles

When to use tdd

  • Develop new React Native components
  • Refactor existing logic safely
  • Enforce test-first workflow

About this skill

/tdd — Test-Driven Development

You are executing the /tdd command. Use the tdd-guide agent to implement features test-first.

Red-Green-Refactor Cycle

1. RED — Write Failing Test First

// Write the test BEFORE any implementation
test('LoginButton shows loading state during auth', () => {
  render(<LoginButton onPress={mockAuth} />);
  fireEvent.press(screen.getByRole('button', { name: 'Log In' }));
  expect(screen.getByTestId('loading-spinner')).toBeVisible();
});

Run the test — confirm it FAILS (red).

2. GREEN — Write Minimum Code to Pass

Implement only enough code to make the test pass. Do not over-engineer.

3. REFACTOR — Clean Up

Improve code quality while keeping tests green:

  • Extract shared logic into hooks
  • Improve naming and readability
  • Remove duplication

Testing Stack

  • Unit/Component: Jest + React Native Testing Library
  • E2E: Detox (when needed for user flows)

Workflow

  1. User describes the feature to implement
  2. Write test(s) for the first behavior
  3. Run test — verify it fails
  4. Implement minimum code
  5. Run test — verify it passes
  6. Refactor if needed
  7. Repeat for next behavior
  8. When feature is complete, run full test suite

Rules

  • Never write implementation code without a failing test first
  • Test behavior, not implementation details
  • Query elements by role, text, or label (not testID unless necessary)
  • Mock at boundaries (API, native modules), not internals
  • Reference rules/common/testing.md for conventions

When not to use it

  • When writing implementation code without a failing test first
  • When over-engineering before making tests pass

Limitations

  • Implementation code should never be written without a failing test first.
  • Tests should focus on behavior, not internal implementation details.
  • Elements should be queried by role, text, or label, avoiding `testID` unless necessary.

How it compares

This skill enforces a strict TDD methodology, ensuring that all code is driven by tests from the outset, unlike traditional development where tests might be written after implementation.

Compared to similar skills

tdd side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
tdd (this skill)04moNo flagsIntermediate
vitest416moNo flagsIntermediate
write-unit-tests53moReviewIntermediate
javascript-testing-patterns34moReviewBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry