Skip to content
CommandImported

tdd-red

Write comprehensive failing tests following TDD red phase principles

Imported description, not reviewed yet

This item came from its original repository and was only scanned automatically; no editor has written an Arabic description for it yet. Read its content yourself before you rely on it. This page is not indexed by search engines until it is reviewed.

Download

Files: 1 · Size: 4.2 KB

Download the ZIP

The file carries the license of the original source.

Install

After downloading, run the command in a terminal. unzip asks before it replaces any file that is there.

  • For this project

    It goes in: .claude/commands/

    mkdir -p .claude/commands && unzip ~/Downloads/tdd-workflows-tdd-red.zip -d .claude/commands

  • For your account on the whole machine

    It goes in: ~/.claude/commands/

    mkdir -p ~/.claude/commands && unzip ~/Downloads/tdd-workflows-tdd-red.zip -d ~/.claude/commands

Instructions

TDD Red Phase

CRITICAL BEHAVIORAL RULES

You MUST follow these rules exactly. Violating any of them is a failure.

  1. Write tests only — no production code. Do NOT implement any production code during this phase.
  2. Verify tests fail. All generated tests MUST fail when run. If any test passes, investigate and fix.
  3. Halt on error. If test generation fails (syntax errors, import issues), STOP and present the error to the user.
  4. Use only local agents. All subagent_type references use agents bundled with this plugin or general-purpose. No cross-plugin dependencies.
  5. Never enter plan mode autonomously. Do NOT use EnterPlanMode. Execute directly.

Test Generation Process

Use the Task tool to generate failing tests:

Task:
  subagent_type: "general-purpose"
  description: "Generate comprehensive failing tests for TDD red phase"
  prompt: |
    You are a test automation expert specializing in TDD red phase test generation.

    Generate comprehensive FAILING tests for: $ARGUMENTS

    ## Core Requirements

    1. **Test Structure**
       - Framework-appropriate setup (Jest/pytest/JUnit/Go/RSpec — match project conventions)
       - Arrange-Act-Assert pattern
       - should_X_when_Y naming convention
       - Isolated fixtures with no interdependencies

    2. **Behavior Coverage**
       - Happy path scenarios
       - Edge cases (empty, null, boundary values)
       - Error handling and exceptions
       - Concurrent access (if applicable)

    3. **Failure Verification**
       - Tests MUST fail when run
       - Failures for RIGHT reasons (not syntax/import errors)
       - Meaningful diagnostic error messages
       - No cascading failures

    4. **Test Categories**
       - Unit: Isolated component behavior
       - Integration: Component interaction
       - Contract: API/interface contracts
       - Property: Mathematical invariants (if applicable)

    ## 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

    ## 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:

  1. Run tests — confirm they fail
  2. Verify helpful failure messages
  3. Check test independence
  4. Ensure comprehensive coverage

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

Files

  • LICENSE1 KB
  • tdd-red.md3.2 KB

Comments (0)

No comments yet. Be the first.

Sign in to comment. Commenting comes at level 1 (Member).

Report

Similar items

  • CommandImported

    add-mutation-testing

    Setup comprehensive mutation testing with framework selection and CI integration

    MITFiles: 1

  • CommandImported

    add-property-based-testing

    Implement property-based testing with framework selection and invariant identification

    MITFiles: 1

  • CommandImported

    ai-review

    Run an AI-assisted code review that combines static analysis tools with AI review of security, performance, and architecture

    MITFiles: 1

  • CommandImported

    code-permutation-tester

    Test multiple code variations through simulation before implementation with quality gates and performance prediction.

    MITFiles: 1

  • CommandImported

    create-feature

    Scaffold new feature with boilerplate code, tests, and documentation

    MITFiles: 1

  • CommandImported

    decision-quality-analyzer

    Analyze team decision quality with bias detection, scenario testing, and process improvement recommendations

    MITFiles: 1