reflection-contract-tests

Use reflection-based tests to lock an API contract before the implementation lands.

6 stars

Best use case

reflection-contract-tests is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use reflection-based tests to lock an API contract before the implementation lands.

Teams using reflection-contract-tests should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/reflection-contract-tests/SKILL.md --create-dirs "https://raw.githubusercontent.com/cwoodruff/morespeakers-com/main/.squad/skills/reflection-contract-tests/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/reflection-contract-tests/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How reflection-contract-tests Compares

Feature / Agentreflection-contract-testsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use reflection-based tests to lock an API contract before the implementation lands.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

## Context
Use this when a team wants tests merged ahead of an additive implementation. The goal is to keep the test project compiling while still failing loudly if required public types or members are missing.

## Patterns
- Load the target assembly from an existing known type instead of referencing the new contract directly.
- Assert on public type names, namespace, shape, factory methods, operators, and property values through reflection.
- Fail with explicit messages that name the missing type or member so the implementer gets a clean failure story.

## Examples
- `src/MoreSpeakers.Domain.Tests\ResultFoundationTests.cs` validates the future `MoreSpeakers.Domain.Result`, `MoreSpeakers.Domain.Result<T>`, and `MoreSpeakers.Domain.Error` contract before those types exist.

## Anti-Patterns
- Do not use reflection when the implementation already exists and compile-time assertions are simpler.
- Do not make reflection tests so vague that multiple incompatible APIs would pass.