test-contract

Create and run contract tests validating implementations against a protocol contract.

Updated Mar 15, 2026
One-click install
npx skills add https://github.com/jtvaris/sunday-night-dynasty --skill test-contract-jtvaris
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-contract
Source: https://github.com/jtvaris/sunday-night-dynasty/tree/main/.agents/skills/testing/test-contract
Command: npx skills add https://github.com/jtvaris/sunday-night-dynasty --skill test-contract-jtvaris

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Define a reusable protocol contract and a shared test suite that validates all implementations conform to the same behavior.

Core Features & Use Cases

  • Defines behavioral contracts for protocols and ensures implementations conform.
  • Supports multiple implementations (real, mock, in-memory) and safe swapping.
  • Provides templates and guidance for building contract tests and suites.

Quick Start

Create your protocol contract, then run the contract test suite against every implementation to verify conformance.

Frequently Asked Questions about test-contract

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

FAQPage Schema
How do I write contract tests to enforce protocol conformance in Swift?

Contract tests validate that all implementations conform to a single protocol contract in Swift. You define a reusable protocol contract and run a shared test suite against every implementation to verify they exhibit the same behaviors for common CRUD-like operations.

When do I need contract tests for multiple data store implementations?

You need contract tests when safely swapping multiple data store implementations, such as real, mock, or in-memory versions. They ensure every implementation conforms to the same protocol contract and exhibits identical behaviors for common operations.

How do I create a shared test suite for protocol implementations?

Create your protocol contract, then apply the provided templates to build a contract test suite. Run this shared suite against every implementation to automatically validate conformance and ensure safe exchange of components.

Can I use contract tests to validate both mock and real Swift implementations?

Yes, contract tests support multiple implementations including real, mock, and in-memory Swift data stores. This allows you to safely exchange implementations while ensuring they all conform to the specified protocol behaviors.

What is the best way to automate protocol conformance validation across different implementations?

Automating protocol conformance validation involves defining a reusable protocol contract and generating per-implementation test suites. This automatically verifies that all implementations conform to the same behavioral contract for common operations.

Do I need external testing frameworks to run Swift contract tests?

No external testing frameworks are required as dependencies. The skill provides built-in templates and guidance for building contract test suites that validate protocol conformance directly within your Swift environment.