agent-tdd-london-swarm

Implements London School TDD with mock-driven behavior verification inside coordinated agent swarms.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill agent-tdd-london-swarm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-tdd-london-swarm
Source: https://github.com/ruvnet/claude-flow/tree/main/.agents/skills/agent-tdd-london-swarm
Command: npx skills add https://github.com/ruvnet/claude-flow --skill agent-tdd-london-swarm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing unit tests that verify object collaboration rather than internal state is difficult to do consistently, especially when multiple agents or team members must share mock contracts and coordinate test execution across a codebase.

Core Features & Use Cases

  • Outside-In TDD Workflow: Drives development from acceptance tests down to implementation using mock-first design with Jest-style mocks.
  • Behavior Verification: Focuses tests on interactions and call sequences between collaborators instead of internal state assertions.
  • Swarm Test Coordination: Shares mock contracts, synchronizes test execution, and aggregates coverage results across multiple testing agents.
  • Use Case: When building a user registration service, define repository and notifier mocks first, verify the exact collaboration sequence, and share those contracts with integration-test agents for end-to-end validation.

Quick Start

Invoke the agent with $agent-tdd-london-swarm and ask it to write London School mock-driven tests for your service class and its collaborators.

Frequently Asked Questions about agent-tdd-london-swarm

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

FAQPage Schema
How do I write London School TDD tests with mocks?

Start with an acceptance test at the outer layer, then define collaborator mocks with jest.fn() before implementing the unit under test. Verify behavior by asserting on mock call sequences and arguments rather than internal state.

What is the difference between London School and classic TDD?

London School (mockist) TDD verifies interactions between objects using mocks and drives design outside-in, while classic TDD verifies state and uses real collaborators where possible. This skill follows the mockist approach exclusively.

How do I verify object collaboration order in Jest?

Capture mock calls with jest.getAllMockCalls() or compare invocation order across mocks, then assert the expected sequence such as inventory reserve before payment charge. The skill demonstrates inline snapshot patterns for call ordering.

Can this skill coordinate tests across multiple agents?

Yes, it defines swarm coordination patterns where agents share mock contracts, signal test start and completion, and aggregate coverage reports. Contracts are published so integration agents can verify the same interfaces end-to-end.

When should I avoid over-mocking in unit tests?

Avoid mocking internal implementation details or value objects, since that couples tests to implementation and makes refactoring brittle. Mock only true collaborators at system boundaries and keep contracts minimal and cohesive.