Tdd

From farooqarahim/Grove · View interactive version

Tdd is an AI agent skill from the GitHub repository farooqarahim/Grove. Test-Driven Development workflow for the Builder agent. Ensures code is written test-first with proper red-green-refactor cycles.

How to use this skill

Skill file

Test-Driven Development

Follow this cycle for every piece of new functionality:

The Red-Green-Refactor Cycle

1. Red — Write a Failing Test First

Before writing any implementation:

2. Green — Write Minimal Code to Pass

3. Refactor — Clean Up

Rules

  1. Never write implementation before the test — the test defines the contract
  2. One behavior per test — test names should read like specifications
  3. Test error paths too — invalid input, missing data, network failures
  4. Tests must be independent — no shared mutable state between tests
  5. Tests must be fast — mock external services, use in-memory databases

Test Structure

// Arrange — set up preconditions
// Act — call the function under test
// Assert — verify the result

When to Skip TDD

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.