/tdd-red
[DEPRECATED] Write failing tests that define expected behavior. Use when saying \"TDD red\", \"write failing tests\", or \"test first\".
$ npx -y skills add anton-abyzov/specweave --skill tdd-red --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/tdd-red
Context preview
The summary Claude sees to decide when to auto-load this skill.
[DEPRECATED] Write failing tests that define expected behavior. Use when saying \"TDD red\", \"write failing tests\", or \"test first\".
SKILL.md
tdd-red.SKILL.mddescription: "[DEPRECATED] Write failing tests that define expected behavior. Use when saying \"TDD red\", \"write failing tests\", or \"test first\"."
version: 1.0.0
deprecated: true
> ⚠️ DEPRECATED: Use `sw:tdd-cycle --phase red` instead. This skill will be removed in v1.3.0.
Migration
This skill has been deprecated as part of the Opus 4.7 framework alignment (increment 0669).
- **Use instead**: `sw:tdd-cycle --phase red` runs only the RED phase (write failing tests)
- **Removal**: Scheduled for v1.3.0 (2 minor releases after v1.1.0)
- **Why**: The three TDD phase skills (tdd-red, tdd-green, tdd-refactor) were consolidated into `sw:tdd-cycle` with a `--phase` flag. Alias routing in `marketplace.json` redirects `/sw:tdd-red` → `/sw:tdd-cycle --phase red` automatically.
For the migration policy, see `.specweave/docs/internal/specs/skill-deprecation-policy.md`.
---
TDD Red Phase - Write Failing Tests
Project Overrides
**Skill Memories**: If `.specweave/skill-memories/tdd-red.md` exists, read and apply its learnings.
Write comprehensive failing tests following TDD red phase principles.
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**: Framework-appropriate setup, Arrange-Act-Assert, should_X_when_Y naming, isolated fixtures 2. **Behavior Coverage**: Happy path, edge cases (empty/null/boundary), error handling, concurrent access 3. **Failure Verification**: Tests MUST fail when run, for RIGHT reasons (not syntax/import errors), meaningful diagnostics 4. **Test Categories**: Unit (isolated), Integration (interaction), Contract (API/interface), Property (invariants)
CLI Integration Test Patterns
**Temp Home Isolation** (prevents touching real ~/.specweave/):
import { withIsolatedHome, getIsolatedEnv } from '../test-utils/temp-home.js';
it('should run CLI command in isolated environment', async () => {
const { homePath, restore } = await withIsolatedHome('my-test');
try {
const { stdout } = await execAsync('node bin/cli.js --version', {
env: getIsolatedEnv(homePath),
});
expect(normalizeOutput(stdout)).toMatch(/^\d+\.\d+\.\d+$/);
} finally {
await restore();
}
});**Hook Execution Testing**:
import { HookTestHarness } from '../test-utils/hook-test-harness.js';
import { extractJson } from '../test-utils/normalize-output.js';
it('should return approve decision from hook', async () => {
const harness = new HookTestHarness(testDir, hookPath);
const result = await harness.execute({ CI: 'true' });
const json = extractJson<{ decision: string }>(result.stdout);
expect(json?.decision).toBe('approve');
});**Process Spawning**: Use `getCleanEnv()`/`getIsolatedEnv()` to strip NODE_OPTIONS. Set `{ timeout: 30000 }`. Use `normalizeOutput()` and `extractJson()`.
Validation
After generation: 1. Run tests — confirm they fail 2. Verify helpful failure messages 3. Check test independence 4. Ensure comprehensive coverage"
Test requirements: $ARGUMENTS
Resources
- [Official Documentation](https://verified-skill.com/docs/reference/skills#tdd-red)
Read more
description: "[DEPRECATED] Write failing tests that define expected behavior. Use when saying \"TDD red\", \"write failing tests\", or \"test first\"." version: 1.0.0 deprecated: true
> ⚠️ DEPRECATED: Use `sw:tdd-cycle --phase red` instead. This skill will be removed in v1.3.0.
Migration
This skill has been deprecated as part of the Opus 4.7 framework alignment (increment 0669).
- **Use instead**: `sw:tdd-cycle --phase red` runs only the RED phase (write failing tests)
- **Removal**: Scheduled for v1.3.0 (2 minor releases after v1.1.0)
- **Why**: The three TDD phase skills (tdd-red, tdd-green, tdd-refactor) were consolidated into `sw:tdd-cycle` with a `--phase` flag. Alias routing in `marketplace.json` redirects `/sw:tdd-red` → `/sw:tdd-cycle --phase red` automatically.
For the migration policy, see `.specweave/docs/internal/specs/skill-deprecation-policy.md`.
---
TDD Red Phase - Write Failing Tests
Project Overrides
**Skill Memories**: If `.specweave/skill-memories/tdd-red.md` exists, read and apply its learnings.
Write comprehensive failing tests following TDD red phase principles.
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**: Framework-appropriate setup, Arrange-Act-Assert, should_X_when_Y naming, isolated fixtures 2. **Behavior Coverage**: Happy path, edge cases (empty/null/boundary), error handling, concurrent access 3. **Failure Verification**: Tests MUST fail when run, for RIGHT reasons (not syntax/import errors), meaningful diagnostics 4. **Test Categories**: Unit (isolated), Integration (interaction), Contract (API/interface), Property (invariants)
CLI Integration Test Patterns
**Temp Home Isolation** (prevents touching real ~/.specweave/):
import { withIsolatedHome, getIsolatedEnv } from '../test-utils/temp-home.js';
it('should run CLI command in isolated environment', async () => {
const { homePath, restore } = await withIsolatedHome('my-test');
try {
const { stdout } = await execAsync('node bin/cli.js --version', {
env: getIsolatedEnv(homePath),
});
expect(normalizeOutput(stdout)).toMatch(/^\d+\.\d+\.\d+$/);
} finally {
await restore();
}
});**Hook Execution Testing**:
import { HookTestHarness } from '../test-utils/hook-test-harness.js';
import { extractJson } from '../test-utils/normalize-output.js';
it('should return approve decision from hook', async () => {
const harness = new HookTestHarness(testDir, hookPath);
const result = await harness.execute({ CI: 'true' });
const json = extractJson<{ decision: string }>(result.stdout);
expect(json?.decision).toBe('approve');
});**Process Spawning**: Use `getCleanEnv()`/`getIsolatedEnv()` to strip NODE_OPTIONS. Set `{ timeout: 30000 }`. Use `normalizeOutput()` and `extractJson()`.
Validation
After generation: 1. Run tests — confirm they fail 2. Verify helpful failure messages 3. Check test independence 4. Ensure comprehensive coverage"
Test requirements: $ARGUMENTS
Resources
- [Official Documentation](https://verified-skill.com/docs/reference/skills#tdd-red)
Spec-first AI development: describe a feature → AI creates spec + plan + tasks, builds autonomously, syncs to GitHub/JIRA. Domain-expert skills for PM, Architect, Frontend, QA learn your patterns permanently. Claude Code, Codex, Cursor, Copilot & more.
Repo: anton-abyzov/specweave
Other skills on specweave.
- /ado-mapper
Bidirectional conversion between SpecWeave increments and Azure DevOps work items. Use when exporting increments to ADO epics, importing ADO epics as increments, or resolving sync conflicts. Handles Epic/Feature/User Story/Task hierarchy mapping.
Open skill - /ado-multi-project
[DEPRECATED] Use `sw:multi-project --tool ado` instead. Organizes specs and tasks across multiple Azure DevOps projects. This skill will be removed in SpecWeave v1.3.0.
Open skill - /ado-resource-validator
Validates Azure DevOps projects, area paths, and teams exist with auto-creation of missing resources. Use when setting up ADO integration, configuring .env variables, or troubleshooting missing project errors. Supports project-per-team, area-path-based, and team-based strategies.
Open skill - /ado-sync
[DEPRECATED] Help and guidance for Azure DevOps synchronization with SpecWeave increments. Use when asking how to set up ADO sync, configure credentials, or troubleshoot integration issues. For actual syncing, use sw-ado:push or sw-ado:pull command.
Open skill - /analytics
Analytics and metrics for SpecWeave usage — token consumption, cache efficiency, agent spawn counts.
Open skill - /architect
System architect for scalable technical designs and ADRs. Use for system architecture, microservices, database design, trade-off analysis, component diagrams, tech selection.
Open skill

