erne-tdd

ERNE — Test-driven development workflow with Jest and React Native Testing Library

28 stars
Complexity: easy

About this skill

This AI agent skill, `/erne-tdd`, provides a structured guide for implementing features in a Test-Driven Development (TDD) manner. It explicitly directs the AI agent to follow the classic Red-Green-Refactor cycle: first writing a failing test, then implementing the minimum code to make that test pass, and finally refactoring for code quality and readability without breaking tests. The skill outlines explicit steps, workflow, and rules, ensuring a disciplined test-first approach is maintained. The primary use case involves developing new features for React Native or Expo applications, ensuring each piece of functionality is covered by automated tests. By enforcing a TDD workflow, this skill helps the AI agent produce robust, reliable code with high test coverage, reducing the likelihood of bugs and improving maintainability. It serves as a comprehensive instruction set for the AI to emulate a disciplined human developer's TDD process, leveraging Jest and React Native Testing Library for unit and component tests.

Best use case

The primary use case is for AI agents assisting human developers in building new features for React Native/Expo applications, strictly following a TDD approach. It's ideal for developers who want to leverage AI for coding tasks while maintaining high code quality, comprehensive test coverage, and a disciplined development process, particularly for critical application logic or UI components.

ERNE — Test-driven development workflow with Jest and React Native Testing Library

The user should expect well-tested, maintainable React Native code for new features, developed rigorously following the Red-Green-Refactor cycle.

Practical example

Example input

Use `/erne-tdd` to implement a new user authentication flow: a secure login form that validates email and password, shows a loading state, and redirects on successful login.

Example output

Okay, I'll start by writing a failing test for the email validation in the login form. 

```tsx
// src/components/LoginForm/LoginForm.test.tsx
import { render, screen, fireEvent } from '@testing-library/react-native';
import LoginForm from './LoginForm';

test('LoginForm displays error for invalid email', () => {
  render(<LoginForm onSubmit={jest.fn()} />);
  fireEvent.changeText(screen.getByPlaceholderText('Email'), 'invalid-email');
  fireEvent.press(screen.getByRole('button', { name: 'Login' }));
  expect(screen.getByText('Invalid email format')).toBeVisible();
});
```
This test should fail initially. Then I will write the minimum code to make it pass, following the Red-Green-Refactor cycle for each behavior.

When to use this skill

  • When implementing new features or functionality in a React Native or Expo project.
  • To ensure high test coverage and robust code quality for new development.
  • When a disciplined, test-first development approach is required.
  • For developing components or logic where reliability and maintainability are paramount.

When not to use this skill

  • For quick bug fixes in existing code that do not involve new features or behavioral changes.
  • When rapid prototyping without immediate test coverage is prioritized.
  • If the project does not utilize Jest or React Native Testing Library for testing.
  • For purely exploratory coding or significant refactoring that doesn't add new behavior.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/erne-tdd/SKILL.md --create-dirs "https://raw.githubusercontent.com/JubaKitiashvili/everything-react-native-expo/main/.claude/skills/erne-tdd/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/erne-tdd/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How erne-tdd Compares

Feature / Agenterne-tddStandard Approach
Platform SupportClaudeLimited / Varies
Context Awareness High Baseline
Installation ComplexityeasyN/A

Frequently Asked Questions

What does this skill do?

ERNE — Test-driven development workflow with Jest and React Native Testing Library

Which AI agents support this skill?

This skill is designed for Claude.

How difficult is it to install?

The installation complexity is rated as easy. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# /erne-tdd — Test-Driven Development

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

## Red-Green-Refactor Cycle

### 1. RED — Write Failing Test First
```tsx
// 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

Related Skills

ai-pair

169
from axtonliu/ai-pair

AI Pair Collaboration Skill. Coordinate multiple AI models to work together: one creates (Author/Developer), two others review (Codex + Gemini). Works for code, articles, video scripts, and any creative task. Trigger: /ai-pair, ai pair, dev-team, content-team, team-stop

Workflow & ProductivityClaude

review

167
from ArtemXTech/claude-code-obsidian-starter

Daily and weekly review workflows. USE WHEN user says "morning routine", "evening routine", "weekly review", "start my day", "end of day".

Workflow & ProductivityClaude

Beads Issue Tracking Skill

164
from maslennikov-ig/claude-code-orchestrator-kit

> **Attribution**: [Beads](https://github.com/steveyegge/beads) by [Steve Yegge](https://github.com/steveyegge)

Workflow & ProductivityClaude

prd

160
from react-native-vibe-code/react-native-vibe-code-sdk

Generate a Product Requirements Document (PRD) for a new feature. Use when planning a feature, starting a new project, or when asked to create a PRD. Triggers on: create a prd, write prd for, plan this feature, requirements for, spec out.

Workflow & ProductivityClaude

Skill: Runs

154
from ai-analyst-lab/ai-analyst

## Purpose

Workflow & ProductivityClaude

Claude-Zeroclaw SKILL

109
from Crestdrasnip/Claude-Zeroclaw

## Overview

Workflow & ProductivityClaude

reprompter

97
from AytuncYildizli/reprompter

Transform messy prompts into structured, effective prompts — single, multi-agent, or reverse-engineered from great outputs. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags, "reprompter teams", "repromptverse", "run with quality", "smart run", "smart agents", "campaign swarm", "engineering swarm", "ops swarm", "research swarm", multi-agent tasks, audits, parallel work, "reverse reprompt", "reprompt from example", "learn from this", "extract prompt from", "prompt dna", "prompt genome", reverse-engineering prompts from exemplar outputs. Don't use for simple Q&A, pure chat, or immediate execution-only tasks (see "Don't Use When" section). Outputs: structured XML/Markdown prompt, before/after quality score, optional team brief + per-agent sub-prompts, Agent Cards, Extraction Card (reverse mode). Target quality score: Single ≥ 7/10; Repromptverse per-agent ≥ 8/10; Reverse ≥ 7/10.

Workflow & ProductivityClaudeCodex

session-pack

89
from ten-builder/ten-builder

세션 종료 시 Memory, Handoff를 자동 정리. /pack

Workflow & ProductivityClaude

execute

51
from vinzenz/prd-breakdown-execute

Main entry point for hierarchical task execution. Orchestrates layer-by-layer implementation of PRD tasks with parallel worktree execution.

Workflow & ProductivityClaude

textum

43
from snakeying/Textum

Textum PRD→Scaffold→Story workflow for Codex with low-noise outputs and gate checks.

Workflow & ProductivityClaude

sdd

40
from SpillwaveSolutions/agent_rulez

This skill should be used when users want guidance on Spec-Driven Development methodology using GitHub's Spec-Kit. Guide users through executable specification workflows for both new projects (greenfield) and existing codebases (brownfield). After any SDD command generates artifacts, automatically provide structured 10-point summaries with feature status tracking, enabling natural language feature management and keeping users engaged throughout the process.

Workflow & ProductivityClaude

nonstop

40
from andylizf/nonstop

Enables an autonomous work mode for AI agents, allowing continuous operation without user interruption. It includes a pre-flight risk assessment and intelligent blocker handling to maximize productivity.

Workflow & ProductivityClaude