Test driven development

From ahmadulhoq/agentskel · View interactive version

Test driven development is an AI agent skill from the GitHub repository ahmadulhoq/agentskel. When implementing logic changes during develop-feature or implement-task. Use the Red-Green-Refactor cycle to write a failing test before any production code.

How to use this skill

Skill file

Test-Driven Development Skill

Cycle: RED → GREEN → REFACTOR

Highly recommended during any logic implementation. Do not write production code before a failing test exists.

RED Phase — Write a Failing Test

  1. Identify the smallest unit of behavior to implement next.
  2. Write a test that asserts the expected output or behavior.
  3. Run the test. Confirm it fails.

GREEN Phase — Minimum Code to Pass

  1. Write the minimum production code to make the test pass.
  1. Run the test. Confirm it passes.

REFACTOR Phase — Clean Without Changing Behavior

  1. Refactor implementation if needed (remove duplication, improve names, simplify).
  2. Run the full test suite. All tests must still pass.

Rules

Exemptions

Skip this cycle only for: trivial config/boilerplate, pure UI layout with no logic,

or when the user explicitly opts out. Document the exemption reason.


Gate: Do not write production code for a behavior unit without first having a failing test for that unit.

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.