Agent skill · software engineering · aiskillstore
tdd-enforcer
Use when implementing new features. Enforces TDD workflow - write tests FIRST, then implementation. Ensures AAA pattern, proper coverage, and quality test design.
Why this skill is useful
Adds specific TDD workflow guidelines and test structure patterns that the AI wouldn't reliably generate on its own.
What it needs
About 6k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
TDD Workflow Enforcer When to Use Implementing new features Adding functionality Fixing bugs Refactoring code TDD Process (MANDATORY) 1. Write Tests FIRST (RED Phase) Define behavior through tests Use AAA pattern (Arrange, Act, Assert) Tests MUST fail initially Clear test names describe expected behavior 2. Verify Tests Fail (Confirmation) Run tests: npm test Confirm failure for the RIGHT reason Test should fail because feature doesn't exist, not because of syntax error 3. Write Implementation (GREEN Phase) Write minimal code to pass tests No gold plating or extra features Focus solely on making tests pass 4. Verify Tests Pass (Validation) Run tests: npm test All new tests must be green All existing tests must still pass 5. Refactor (REFACTOR Phase) Improve code quality Remove duplication Enhance readability Tests stay green throughout Coverage Requirements Overall: 75%+ Business Logic (src/services/): 90%+ Utilities (src/utils/): 90%+ UI Components: 60%+ E2E tests for critical user flows AAA Pattern (Arrange, Act, Assert) Test Structure Describe Blocks Test Names Testing Different Layers Unit Tests (Business Logic) Integration Tests (API Routes) Component Tests (UI) E2E Tests (Critical Flows) Test Quality Requirements ✅ DO: Test behavior, not implementation ✅ DO: Test edge cases ✅ DO: Test error conditions ✅ DO: Use test data builders Coverage Verification Common TDD Mistakes ❌ DON'T: Write implementation first ✅ DO: Write tests first ❌ DON'T: Test implementation details ❌ DON'T: Write one giant test Checklist Before Committing [ ] All new features have tests written FIRST [ ] Tests failed initially (RED) [ ] Implementation makes tests pass (GREEN) [ ] Code refactored for quality (REFACTOR) [ ] Coverage thresholds met (75%+ overall, 90%+ business logic) [ ] All tests use AAA pattern [ ] Test names are descriptive [ ] Edge cases tested [ ] Error conditions tested [ ] E2E tests for critical user flows
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/tdd-enforcer