Tdd workflow

From ashermahonin/agentic-skills · View interactive version

Tdd workflow is an AI agent skill from the GitHub repository ashermahonin/agentic-skills. Define changed behavior with a failing test, verify the failure reason, hand a bounded implementation contract to the code owner, then prove the fix with the affected suite and a boundary or failure case. Use for features, bug fixes, and behavior-preserving refactors where an automated test can prov

How to use this skill

Skill file

TDD Workflow

Purpose

Turn an acceptance criterion into executable evidence before production code changes. This skill owns the test contract and proof; service-implementation owns production edits.

When a route also includes service-implementation, this skill owns the test contract, red evidence, anti-overfit criteria, and reproduction commands. service-implementation owns the production code change under that contract. When this skill is used alone, it may execute the full red/green/refactor loop itself.

Change context

  1. Read references/tdd-loop.md.
  2. State the changed behavior and the acceptance criterion it satisfies.
  3. Choose the lowest test level that can prove the behavior without mocking away the risk.
  4. Confirm the repository's test command and current framework behavior before writing the test.

Change method

  1. Write one test for one observable behavior and run it before changing production code.
  2. Confirm that it fails because the behavior is missing or wrong, not because the test setup is broken.
  3. Hand service-implementation the expected behavior, owned files, prohibited shortcuts, and exact verification command.
  4. After implementation, run the new test and the affected suite. Do not weaken assertions to obtain a pass.
  5. Add one meaningful boundary, invalid-input, or failure-path case that the first test did not cover.
  6. Refactor only while the affected suite remains green; use engineering-quality when structure or maintainability is part of the change.
  7. Map each covered acceptance criterion to a test file and list anything still unproved.

Engineering constraints

Evidence

Ready when

Handoff

Hand off test files, commands, failure-to-pass evidence, covered criteria, and remaining test debt to qa-eval.

References

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.