spec:testing

Drive test-driven development with stub-based contracts and a four-step cycle.

39|4|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/martinffx/atelier --skill spec-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec:testing
Source: https://github.com/martinffx/atelier/tree/main/skills/spec%3Atesting
Command: npx skills add https://github.com/martinffx/atelier --skill spec-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Stub-Driven TDD and layer-boundary testing help teams design software by validating behavior through contracts before implementation, reducing brittle refactors and flaky tests.

Core Features & Use Cases

  • Stub-based interfaces to drive tests
  • Layer-boundary testing across entity, service, router, and repository
  • Clear guidance for incremental implementation and safe refactors

Quick Start

Define the service contracts as stubs, write tests against them, implement to pass the tests, and refactor without changing behavior.

Frequently Asked Questions about spec:testing

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

FAQPage Schema
What is stub-driven TDD and how does it validate software behavior?

Stub-driven TDD validates software behavior by defining service contracts as stubs before implementation. This allows you to test public behavior against expected transformations, ensuring reliable software design and reducing brittle refactors.

How do I start contract-first testing for a new service or order system?

Start contract-first testing by defining service contracts as stubs, writing tests against them, implementing the code to pass the tests, and refactoring safely without changing the validated behavior.

When should I use layer-boundary testing in my architecture?

Use layer-boundary testing when you need to validate behavior across entity, service, router, and repository layers. It ensures tests validate public behavior against defined contracts, reducing flaky tests during incremental implementation.

Does contract-based testing work for end-to-end domain object transformations?

Yes, contract-based testing works for end-to-end development by documenting expected transformations from request to domain objects. It applies to any domain requiring reliable behavior validation through stubbed collaborators.

Why does refactoring often break my tests and how does this approach help?

Refactoring breaks tests when implementation details are tightly coupled to tests. Stub-driven TDD helps by validating public behavior against contracts, allowing you to refactor without changing behavior or introducing flaky tests.

Can I apply the four-step TDD cycle to existing legacy code?

The four-step cycle of stub, test, implement, and refactor supports incremental implementation. It provides clear guidance for safe refactors by validating layer boundaries, making it applicable to existing code needing structural improvements.