Skip to main content
AI/MLruvnet

tdd-workflow

TDD London School workflow -- mock-first, outside-in test development

Stars
56,726
Source
ruvnet/claude-flow
Updated
2026-05-31
Slug
ruvnet--claude-flow--tdd-workflow
View on GitHubRaw SKILL.md

// install — copy + paste into any project

mkdir -p .claude/skills && curl -fsSL https://raw.githubusercontent.com/ruvnet/claude-flow/HEAD/plugins/ruflo-testgen/skills/tdd-workflow/SKILL.md -o .claude/skills/tdd-workflow.md

Drops the SKILL.md into .claude/skills/tdd-workflow.md. Works with Claude Code, Cursor, and any agent that loads SKILL.md files from .claude/skills/.

Follow the TDD London School (mock-first) approach:

  1. Write the failing test first -- define expected behavior with mocked dependencies
  2. Run the test -- confirm it fails for the right reason
  3. Implement minimal code -- make the test pass with the simplest solution
  4. Refactor -- clean up while keeping tests green
  5. Repeat -- add the next behavior

Before starting: mcp__claude-flow__hooks_pre-task({ description: "TDD: FEATURE_NAME" }) After completing: mcp__claude-flow__hooks_post-task({ taskId: "tdd-FEATURE", success: true, storeResults: true })

Principles:

  • Mock external dependencies at boundaries
  • Test behavior, not implementation
  • One assertion per test when possible
  • Descriptive names: should [behavior] when [condition]