red-phase

Generate failing Python tests from REQ-* requirements and BR-* business rules.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/foolishimp/ai_sdlc_method --skill red-phase
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: red-phase
Source: https://github.com/foolishimp/ai_sdlc_method/tree/main/plugins/code-skills/skills/tdd/red-phase
Command: npx skills add https://github.com/foolishimp/ai_sdlc_method --skill red-phase

SYSTEM DOCUMENTATION & REQUIREMENTS

πŸ’‘ This Skill requires pytest.

What problem does it solve?

In Test-Driven Development (TDD), the crucial first step is to write tests that fail because the desired functionality doesn't exist yet, ensuring tests truly validate new behavior.

Core Features & Use Cases

  • Failing Test Generation: Creates test files and functions that explicitly fail, serving as executable specifications for new features.
  • Requirement-Driven Testing: Designs test cases directly from REQ-* requirements and BR-* business rules, ensuring comprehensive coverage.
  • TDD Workflow Integration: The foundational "RED" step in the RED β†’ GREEN β†’ REFACTOR cycle, setting the stage for implementation.
  • Use Case: To begin implementing a "User Login" feature (REQ-ID 'UserLogin'), invoke this skill to generate tests for valid credentials, invalid email, and account lockout, which will fail until the login logic is written.

Quick Start

Generate failing Python tests for REQ-ID 'UserLogin' in 'tests/auth/test_login.py', covering email validation (BR-001) and password length (BR-002).

Frequently Asked Questions about red-phase

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write failing tests first in TDD?β–Ό

Write failing tests that specify desired behavior before implementing code. Red-phase testing creates test stubs and executable specifications that fail because functionality doesn't exist yet, establishing clear contracts for what the code must do.

How do I generate test files from requirements and business rules?β–Ό

Design test cases directly from REQ-* requirements and BR-* business rules to ensure comprehensive coverage. Generate test functions covering happy paths, edge cases, and rule-driven validation that fail until the feature is implemented.

What does the RED phase of TDD accomplish?β–Ό

The RED phase writes failing tests that expose unimplemented functionality, serving as the first step in the RED β†’ GREEN β†’ REFACTOR cycle. It anchors development to explicit requirements and ensures tests validate new behavior rather than existing code.

Can I use this with pytest for automated test generation?β–Ό

Yes. This skill generates failing Python tests compatible with pytest, creating test files and functions that fail by design until the corresponding functionality is written.

How do I structure tests for new features in TDD workflow?β–Ό

Organize test files by feature area, generate test cases for valid inputs, invalid cases, and boundary conditions, and include documentation templates. Tests are placed according to project conventions and cover requirement-driven test design before implementation begins.