From tdd-workflows
Generates comprehensive failing tests for a feature following TDD red phase rules. Verifies all tests fail correctly, provides run commands, coverage metrics, and green phase next steps.
How this command is triggered — by the user, by Claude, or both
Slash command
/tdd-workflows:tdd-red <feature or component to write tests for>The summary Claude sees in its command listing — used to decide when to auto-load this command
# 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....
You MUST follow these rules exactly. Violating any of them is a failure.
subagent_type references use agents bundled with this plugin or general-purpose. No cross-plugin dependencies.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
After generation:
npx claudepluginhub sumeet138/qwen-code-agents --plugin tdd-workflows/tdd-redGenerates comprehensive failing tests for a feature following TDD red phase rules. Verifies all tests fail correctly, provides run commands, coverage metrics, and green phase next steps.
/phase-2Writes failing test scaffolding (TDD RED phase) from Phase 1 requirements, verifies all tests fail, generates test-to-requirement mapping and remaining phase estimations.
/tddGuides an interactive TDD cycle for a feature: Red (write failing test), Green (minimal passing code), Refactor (cleanup), repeat for next behavior.
/vcsdd-tddGenerates failing test cases for all VCSDD feature spec requirements (Red phase), runs to verify failures and regression baseline passes, records evidence log.
/tdd-redExecutes the TDD Red phase by creating failing test cases based on requirements and task notes. Validates tests fail before proceeding, then records results and updates documentation.