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.zipInstalls 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 LibraryKey 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
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
- User describes the feature to implement
- Write test(s) for the first behavior
- Run test — verify it fails
- Implement minimum code
- Run test — verify it passes
- Refactor if needed
- Repeat for next behavior
- 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.mdfor 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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| tdd (this skill) | 0 | 4mo | No flags | Intermediate |
| vitest | 41 | 6mo | No flags | Intermediate |
| write-unit-tests | 5 | 3mo | Review | Intermediate |
| javascript-testing-patterns | 3 | 4mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by JubaKitiashvili
View all by JubaKitiashvili →You might also like
vitest
antfu
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.
write-unit-tests
tldraw
Writing unit and integration tests for the tldraw SDK. Use when creating new tests, adding test coverage, or fixing failing tests in packages/editor or packages/tldraw. Covers Vitest patterns, TestEditor usage, and test file organization.
javascript-testing-patterns
wshobson
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.
testing-patterns
davila7
Jest testing patterns, factory functions, mocking strategies, and TDD workflow. Use when writing unit tests, creating test factories, or following TDD red-green-refactor cycle.
unit-testing-test-generate
sickn33
Generate comprehensive, maintainable unit tests across languages with strong coverage and edge case focus.
designing-tests
CloudAI-X
Designs and implements testing strategies for any codebase. Use when adding tests, improving coverage, setting up testing infrastructure, debugging test failures, or when asked about unit tests, integration tests, or E2E testing.