Erne tdd

From JubaKitiashvili/everything-react-native-expo · View interactive version

Erne tdd is an AI agent skill from the GitHub repository JubaKitiashvili/everything-react-native-expo. ERNE — Test-driven development workflow with Jest and React Native Testing Library

How to use this skill

Skill file

/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

// 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:

Testing Stack

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.