Write comprehensive failing tests following TDD red phase principles.
[Extended thinking: Generates failing tests that properly define expected behavior using test-automator agent.]
Use this skill when
- Starting the TDD red phase for new behavior
- You need failing tests that capture expected behavior
- You want edge case coverage before implementation
Do not use this skill when
- You are in the green or refactor phase
- You only need performance benchmarks
- Tests must run against production systems
Instructions
- Identify behaviors, constraints, and edge cases.
- Generate failing tests that define expected outcomes.
- Ensure failures are due to missing behavior, not setup errors.
- Document how to run tests and verify failures.
Safety
- Keep test data isolated and avoid production environments.
- Avoid flaky external dependencies in the red phase.
Role
Generate failing tests using Task tool with subagent_type="unit-testing::test-automator".
Prompt Template
"Generate comprehensive FAILING tests for: $ARGUMENTS
Core Requirements
Test Structure
- Framework-appropriate setup (Jest/pytest/JUnit/Go/RSpec)
- Arrange-Act-Assert pattern
- should_X_when_Y naming convention
- Isolated fixtures with no interdependencies
Behavior Coverage
- Happy path scenarios
- Edge cases (empty, null, boundary values)
- Error handling and exceptions
- Concurrent access (if applicable)
Failure Verification
- Tests MUST fail when run
- Failures for RIGHT reasons (not syntax/import errors)
- Meaningful diagnostic error messages
- No cascading failures
Test Categories
- Unit: Isolated component behavior
- Integration: Component interaction
- Contract: API/interface contracts
- Property: Mathematical invariants
Framework Patterns
JavaScript/TypeScript (Jest/Vitest)
- Mock dependencies with
vi.fn() or jest.fn()
- Use
@testing-library for React components
- Property tests with
fast-check
Python (pytest)
- Fixtures with appropriate scopes
- Parametrize for multiple test cases
- Hypothesis for property-based tests
Go
- Table-driven tests with subtests
t.Parallel() for parallel execution
- Use
testify/assert for cleaner assertions
Ruby (RSpec)
let for lazy loading, let! for eager
- Contexts for different scenarios
- Shared examples for common behavior
Quality Checklist
- Readable test names documenting intent
- One behavior per test
- No implementation leakage
- Meaningful test data (not 'foo'/'bar')
- Tests serve as living documentation
Anti-Patterns to Avoid
- Tests passing immediately
- Testing implementation vs behavior
- Complex setup code
- Multiple responsibilities per test
- Brittle tests tied to specifics
Edge Case Categories
- Null/Empty: undefined, null, empty string/array/object
- Boundaries: min/max values, single element, capacity limits
- Special Cases: Unicode, whitespace, special characters
- State: Invalid transitions, concurrent modifications
- Errors: Network failures, timeouts, permissions
Output Requirements
- Complete test files with imports
- Documentation of test purpose
- Commands to run and verify failures
- Metrics: test count, coverage areas
- Next steps for green phase"
Validation
After generation:
- Run tests - confirm they fail
- Verify helpful failure messages
- Check test independence
- Ensure comprehensive coverage
Example (Minimal)
// auth.service.test.ts
describe('AuthService', () => {
let authService: AuthService;
let mockUserRepo: jest.Mocked<UserRepository>;
beforeEach(() => {
mockUserRepo = { findByEmail: jest.fn() } as any;
authService = new AuthService(mockUserRepo);
});
it('should_return_token_when_valid_credentials', async () => {
const user = { id: '1', email: 'test@example.com', passwordHash: 'hashed' };
mockUserRepo.findByEmail.mockResolvedValue(user);
const result = await authService.authenticate('test@example.com', 'pass');
expect(result.success).toBe(true);
expect(result.token).toBeDefined();
});
it('should_fail_when_user_not_found', async () => {
mockUserRepo.findByEmail.mockResolvedValue(null);
const result = await authService.authenticate('none@example.com', 'pass');
expect(result.success).toBe(false);
expect(result.error).toBe('INVALID_CREDENTIALS');
});
});
Test requirements: $ARGUMENTS
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: tdd-workflows-tdd-red3description: "Generate failing tests for the TDD red phase to define expected behavior and edge cases."4version: 1.0.05author:6 name: "sickn33 / Antigravity Community"7 github: sickn338tags: [tdd, workflows, red, testing]9category: testing10platforms: [macos, linux, windows]11license: MIT12metadata:13 hermes:14 source: https://skillmd.com/skills/nous-hermeshub/tdd-workflows-tdd-red15 upstream: "antigravity-awesome-skills"16 risk: "unknown"17 date_added: "2026-02-27"18 original_author: "Antigravity Community"19---2021Write comprehensive failing tests following TDD red phase principles.2223[Extended thinking: Generates failing tests that properly define expected behavior using test-automator agent.]2425## Use this skill when2627- Starting the TDD red phase for new behavior28- You need failing tests that capture expected behavior29- You want edge case coverage before implementation3031## Do not use this skill when3233- You are in the green or refactor phase34- You only need performance benchmarks35- Tests must run against production systems3637## Instructions38391. Identify behaviors, constraints, and edge cases.402. Generate failing tests that define expected outcomes.413. Ensure failures are due to missing behavior, not setup errors.424. Document how to run tests and verify failures.4344## Safety4546- Keep test data isolated and avoid production environments.47- Avoid flaky external dependencies in the red phase.4849## Role5051Generate failing tests using Task tool with subagent_type="unit-testing::test-automator".5253## Prompt Template5455"Generate comprehensive FAILING tests for: $ARGUMENTS5657## Core Requirements58591. **Test Structure**60 - Framework-appropriate setup (Jest/pytest/JUnit/Go/RSpec)61 - Arrange-Act-Assert pattern62 - should_X_when_Y naming convention63 - Isolated fixtures with no interdependencies64652. **Behavior Coverage**66 - Happy path scenarios67 - Edge cases (empty, null, boundary values)68 - Error handling and exceptions69 - Concurrent access (if applicable)70713. **Failure Verification**72 - Tests MUST fail when run73 - Failures for RIGHT reasons (not syntax/import errors)74 - Meaningful diagnostic error messages75 - No cascading failures76774. **Test Categories**78 - Unit: Isolated component behavior79 - Integration: Component interaction80 - Contract: API/interface contracts81 - Property: Mathematical invariants8283## Framework Patterns8485**JavaScript/TypeScript (Jest/Vitest)**86- Mock dependencies with `vi.fn()` or `jest.fn()`87- Use `@testing-library` for React components88- Property tests with `fast-check`8990**Python (pytest)**91- Fixtures with appropriate scopes92- Parametrize for multiple test cases93- Hypothesis for property-based tests9495**Go**96- Table-driven tests with subtests97- `t.Parallel()` for parallel execution98- Use `testify/assert` for cleaner assertions99100**Ruby (RSpec)**101- `let` for lazy loading, `let!` for eager102- Contexts for different scenarios103- Shared examples for common behavior104105## Quality Checklist106107- Readable test names documenting intent108- One behavior per test109- No implementation leakage110- Meaningful test data (not 'foo'/'bar')111- Tests serve as living documentation112113## Anti-Patterns to Avoid114115- Tests passing immediately116- Testing implementation vs behavior117- Complex setup code118- Multiple responsibilities per test119- Brittle tests tied to specifics120121## Edge Case Categories122123- **Null/Empty**: undefined, null, empty string/array/object124- **Boundaries**: min/max values, single element, capacity limits125- **Special Cases**: Unicode, whitespace, special characters126- **State**: Invalid transitions, concurrent modifications127- **Errors**: Network failures, timeouts, permissions128129## Output Requirements130131- Complete test files with imports132- Documentation of test purpose133- Commands to run and verify failures134- Metrics: test count, coverage areas135- Next steps for green phase"136137## Validation138139After generation:1401. Run tests - confirm they fail1412. Verify helpful failure messages1423. Check test independence1434. Ensure comprehensive coverage144145## Example (Minimal)146147```typescript148// auth.service.test.ts149describe('AuthService', () => {150 let authService: AuthService;151 let mockUserRepo: jest.Mocked<UserRepository>;152153 beforeEach(() => {154 mockUserRepo = { findByEmail: jest.fn() } as any;155 authService = new AuthService(mockUserRepo);156 });157158 it('should_return_token_when_valid_credentials', async () => {159 const user = { id: '1', email: 'test@example.com', passwordHash: 'hashed' };160 mockUserRepo.findByEmail.mockResolvedValue(user);161162 const result = await authService.authenticate('test@example.com', 'pass');163164 expect(result.success).toBe(true);165 expect(result.token).toBeDefined();166 });167168 it('should_fail_when_user_not_found', async () => {169 mockUserRepo.findByEmail.mockResolvedValue(null);170171 const result = await authService.authenticate('none@example.com', 'pass');172173 expect(result.success).toBe(false);174 expect(result.error).toBe('INVALID_CREDENTIALS');175 });176});177```178179Test requirements: $ARGUMENTS180181## Limitations182- Use this skill only when the task clearly matches the scope described above.183- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.184- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.