Selective Reading Rule
Start with:
references/senior-master-standard.md
references/usage-routing.md
references/quality-checklist.md
Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.
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: ALWAYS use this when the request matches TDD Workflows TDD RED: Generate failing tests for the TDD red phase to define expected behavior and edge cases.4---56## Selective Reading Rule78Start with:910- `references/senior-master-standard.md`11- `references/usage-routing.md`12- `references/quality-checklist.md`1314Then load only the inherited docs, scripts, assets, or examples that match the user's actual task.1516Write comprehensive failing tests following TDD red phase principles.1718[Extended thinking: Generates failing tests that properly define expected behavior using test-automator agent.]1920## Use this skill when2122- Starting the TDD red phase for new behavior23- You need failing tests that capture expected behavior24- You want edge case coverage before implementation2526## Do not use this skill when2728- You are in the green or refactor phase29- You only need performance benchmarks30- Tests must run against production systems3132## Instructions33341. Identify behaviors, constraints, and edge cases.352. Generate failing tests that define expected outcomes.363. Ensure failures are due to missing behavior, not setup errors.374. Document how to run tests and verify failures.3839## Safety4041- Keep test data isolated and avoid production environments.42- Avoid flaky external dependencies in the red phase.4344## Role4546Generate failing tests using Task tool with subagent_type="unit-testing::test-automator".4748## Prompt Template4950"Generate comprehensive FAILING tests for: $ARGUMENTS5152## Core Requirements53541. **Test Structure**55 - Framework-appropriate setup (Jest/pytest/JUnit/Go/RSpec)56 - Arrange-Act-Assert pattern57 - should_X_when_Y naming convention58 - Isolated fixtures with no interdependencies59602. **Behavior Coverage**61 - Happy path scenarios62 - Edge cases (empty, null, boundary values)63 - Error handling and exceptions64 - Concurrent access (if applicable)65663. **Failure Verification**67 - Tests MUST fail when run68 - Failures for RIGHT reasons (not syntax/import errors)69 - Meaningful diagnostic error messages70 - No cascading failures71724. **Test Categories**73 - Unit: Isolated component behavior74 - Integration: Component interaction75 - Contract: API/interface contracts76 - Property: Mathematical invariants7778## Framework Patterns7980**JavaScript/TypeScript (Jest/Vitest)**81- Mock dependencies with `vi.fn()` or `jest.fn()`82- Use `@testing-library` for React components83- Property tests with `fast-check`8485**Python (pytest)**86- Fixtures with appropriate scopes87- Parametrize for multiple test cases88- Hypothesis for property-based tests8990**Go**91- Table-driven tests with subtests92- `t.Parallel()` for parallel execution93- Use `testify/assert` for cleaner assertions9495**Ruby (RSpec)**96- `let` for lazy loading, `let!` for eager97- Contexts for different scenarios98- Shared examples for common behavior99100## Quality Checklist101102- Readable test names documenting intent103- One behavior per test104- No implementation leakage105- Meaningful test data (not 'foo'/'bar')106- Tests serve as living documentation107108## Anti-Patterns to Avoid109110- Tests passing immediately111- Testing implementation vs behavior112- Complex setup code113- Multiple responsibilities per test114- Brittle tests tied to specifics115116## Edge Case Categories117118- **Null/Empty**: undefined, null, empty string/array/object119- **Boundaries**: min/max values, single element, capacity limits120- **Special Cases**: Unicode, whitespace, special characters121- **State**: Invalid transitions, concurrent modifications122- **Errors**: Network failures, timeouts, permissions123124## Output Requirements125126- Complete test files with imports127- Documentation of test purpose128- Commands to run and verify failures129- Metrics: test count, coverage areas130- Next steps for green phase"131132## Validation133134After generation:1351. Run tests - confirm they fail1362. Verify helpful failure messages1373. Check test independence1384. Ensure comprehensive coverage139140## Example (Minimal)141142```typescript143// auth.service.test.ts144describe('AuthService', () => {145 let authService: AuthService;146 let mockUserRepo: jest.Mocked<UserRepository>;147148 beforeEach(() => {149 mockUserRepo = { findByEmail: jest.fn() } as any;150 authService = new AuthService(mockUserRepo);151 });152153 it('should_return_token_when_valid_credentials', async () => {154 const user = { id: '1', email: 'test@example.com', passwordHash: 'hashed' };155 mockUserRepo.findByEmail.mockResolvedValue(user);156157 const result = await authService.authenticate('test@example.com', 'pass');158159 expect(result.success).toBe(true);160 expect(result.token).toBeDefined();161 });162163 it('should_fail_when_user_not_found', async () => {164 mockUserRepo.findByEmail.mockResolvedValue(null);165166 const result = await authService.authenticate('none@example.com', 'pass');167168 expect(result.success).toBe(false);169 expect(result.error).toBe('INVALID_CREDENTIALS');170 });171});172```173174Test requirements: $ARGUMENTS175176## Limitations177- Use this skill only when the task clearly matches the scope described above.178- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.179- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.