TDD Prompt Pattern for Claude Code
Demonstrates breaking down TDD requirements into specific, testable criteria for Claude Code with clear success metrics
Write unit tests for a UserService class that:
1. Creates users with valid email/password
2. Rejects invalid emails (test@, @example, etc.)
3. Enforces password minimum length of 8 characters
4. Handles duplicate email errors
5. Uses Jest with proper mocking of the database
Then implement the UserService to make all tests pass.