Test first development

From charlieviettq/awesome-agent-skill · View interactive version

Test first development is an AI agent skill from the GitHub repository charlieviettq/awesome-agent-skill. Apply test-first discipline for behavior changes and bugfixes: define expected behavior, add or run a failing test, then implement minimally. Use when fixing bugs, changing logic, or adding features that need regression protection.

How to use this skill

Skill file

Test-first development

When to use (default)

When to relax (document why)

Workflow (RED-GREEN-REFACTOR)

  1. Define expected behavior in one sentence.
  2. RED: Add or identify a test that fails for the right reason (missing behavior, not typo). Run it and confirm failure.
  3. GREEN: Minimal code to pass. Run the same test and confirm pass.
  4. REFACTOR: Only after green; keep tests passing.
  5. Verify: Run targeted tests, then broader suite if scope warrants.

For bugfixes: if production code was written before the failing test, treat as process violation—add the test, confirm fail, then fix.

Good tests

Checklist before done

Testing anti-patterns

Related

systematic-debugging, test-failure-triage, verify-before-done

TDD discipline inspired by obra/superpowers (MIT).

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.