tdd-enforcerlisted
Install: claude install-skill aiskillstore/marketplace
# 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)
```typescript
describe('AuthService', () => {
describe('register', () => {
it('should create user with hashed password', async () => {
// ARRANGE: Setup test data
const userData = {
email: 'test@example.com',
password: 'Pass123!',
}
// ACT: Execute the behavior
const result = await authService.register(use