← ClaudeAtlas

characterize-with-contractslisted

Use to discover or reconstruct a service's API contract and produce characterization (golden-master) tests that lock in its CURRENT behavior — including existing bugs — as a safety net before refactoring a brownfield service. Delegates stack detection and Microcks wiring to contract-testing-roster and mocking-strategy-roster; adds nothing new to the toolchain, only the characterization intent. Activate on 'characterize this API', 'lock in current behavior', 'build a contract-based safety net'.
SebastienDegodez/skraft-plugin · ★ 4 · Testing & QA · score 60
Install: claude install-skill SebastienDegodez/skraft-plugin
# Characterize With Contracts Uses the SAME roster/adapter machinery `contract-testing-roster` and `mocking-strategy-roster` already resolve for DELIVER-phase TDD — but with the opposite intent. TDD tests encode what the code SHOULD do and change as requirements evolve. Characterization tests encode what the code ACTUALLY does, right now, on purpose, so a refactor can be verified not to change behavior. A bug captured here is a documented bug, not a failing test to fix. **Boundary.** Never "fixes" a bug found during characterization — that is a decision for later, made deliberately, not accidentally introduced by a refactor. Never re-derives stack/Microcks wiring — always delegates to the roster skills. ## Procedure ### 1. Establish the contract (FACT-first, S7) - Search for an existing OpenAPI/AsyncAPI spec (`*.yaml`/`*.json` matching `openapi:`/`asyncapi:`) or a Swashbuckle/NSwag-generated spec route. If found, use it as the base contract. - If none found: **reconstruct** — enumerate controllers/minimal-API routes, read request/response DTOs, and generate a contract from what the code actually exposes (never from what it "should" expose). Prefer generating the spec via the framework's own tooling (`dotnet swagger tofile` or equivalent) over hand-transcribing routes — a tool-generated contract is a fact, a hand-typed one is an inference. ### 2. Resolve the harness (delegate, do not reinvent) 1. Load `contract-testing-roster` to resolve the stack adapter (cur