Home / Market / tdd workflows tdd red

tdd workflows tdd red

Generate failing tests for the TDD red phase to define expected behavior and edge cases.

skill★ 508380 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: tdd-workflows-tdd-red description: "Generate failing tests for the TDD red phase to define expected behavior and edge cases." risk: critical source: community date_added: "2026-02-27"

---

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

Do not use this skill when

Instructions

  1. Identify behaviors, constraints, and edge cases.
  2. Generate failing tests that define expected outcomes.
  3. Ensure failures are due to missing behavior, not setup errors.
  4. Document how to run tests and verify failures.

Safety

Role

Generate failing tests using Task tool with subagent_type="unit-testing::test-automator".

Prompt Template

"Generate comprehensive FAILING tests for: $ARGUMENTS

Core Requirements

  1. Test Structure
  1. Behavior Coverage
  1. Failure Verification
  1. Test Categories

Framework Patterns

JavaScript/TypeScript (Jest/Vitest)

Python (pytest)

Go

Ruby (RSpec)

Quality Checklist

Anti-Patterns to Avoid

Edge Case Categories

Output Requirements

Validation

After generation:

  1. Run tests - confirm they fail
  2. Verify helpful failure messages
  3. Check test independence
  4. 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