CONCEPT Cited by 2 sources
Contract-first design¶
Definition¶
Contract-first design = defining the API contract (endpoints, request/response shapes, error codes, auth) before any implementation, typically in a machine-readable schema language such as OpenAPI / GraphQL SDL / Smithy / Protobuf. Generators produce server stubs, client SDKs, mock servers, and documentation from the contract; both sides code against the same frozen surface.
Why agentic development needs it¶
Named by the 2026-03-26 AWS Architecture Blog post as a precondition for end-to-end validation by an AI agent while sibling services are still being built:
"When combined with contract-first design — where APIs are defined upfront using OpenAPI specifications — agents can validate integrations even before all services are implemented."
The property the agent exploits: the contract is executable enough that a mock server can answer from it. The agent writes a client, points it at the contract-generated mock, validates request shape and parses responses — all without waiting for the real dependency to ship.
Canonical artefacts¶
- OpenAPI — REST, the most common choice; AWS post names it specifically.
- GraphQL SDL — schema-first GraphQL.
- Smithy — AWS's service-modeling IDL (code-gen for SDKs, server stubs, docs).
- Protobuf + gRPC — RPC contract-first default.
Pairs with¶
- patterns/ephemeral-preview-environments — preview environments hosting contract-generated mock servers so agents can integration- test before all services are deployed.
- patterns/tests-as-executable-specifications — contract tests verify each side honors the agreed surface.
Seen in¶
-
sources/2026-03-26-aws-architecting-for-agentic-ai-development-on-aws — contract-first design named as complementary to preview environments for AI-agent integration validation.
-
sources/2024-09-16-lyft-protocol-buffer-design-principles-and-practices — Lyft Media's 2024-09-16 post is a design-practices deep-dive for the Protobuf + gRPC variant of contract-first. The
.protofile is the contract; codegen produces typed clients / servers / validators across Python / Swift / Kotlin. Post canonicalises two principles ( clarity + extensibility) and five practices for writing schemas that cross-team implementers can consume without ambiguity. Complements the OpenAPI-framed AWS post on the wiki — same discipline, different IDL.
Related¶
- concepts/schema-registry — runtime counterpart at the event-bus tier (EventBridge / Kafka).