Agent Skill

Test-Driven Development
Disciplined TDD methodology enforcing write-test-first workflow with red-green-refactor cycle for all features and bugfixes
What is Test-Driven Development?
This skill enforces a rigorous test-driven development methodology where agents must write failing tests before any implementation code. The skill mandates a strict red-green-refactor cycle: write a test that fails, write minimal code to make it pass, refactor while keeping tests green, then repeat. It covers writing unit tests that verify specific behaviors, watching tests fail to confirm they test the right thing, implementing only enough code to pass the current test, refactoring with confidence due to comprehensive test coverage, and integrating TDD into the broader development workflow. The agent learns that violating the letter of TDD rules violates the spirit—no shortcuts, no implementation before tests, no assuming tests work without seeing them fail. The skill establishes boundaries around what constitutes a proper test versus a sanity check, when to write integration tests versus unit tests, and how to handle external dependencies through mocking or test doubles. Trade-offs include the upfront time investment in writing tests against the long-term benefits of maintainability and bug prevention, choosing granularity of tests to balance coverage with test suite execution time, and deciding when to refactor tests themselves as the codebase evolves. The skill emphasizes that TDD is a discipline that builds better software through enforced verification.
