What Is a Data Contract?
TL;DR: A data contract is a rigid specification defining exactly what data a backend sends and what a frontend expects to receive. It stops AI coding agents from spontaneously changing your API responses to fix a frontend bug.
When an AI agent has access to your entire full-stack codebase, it gets lazy.
Imagine your frontend expects an API to return { "user": { "name": "John" } }. The AI is building a new dashboard component and accidentally writes frontend code that looks for { "fullName": "John" }.
Instead of fixing the frontend component, an unconstrained AI will often just rewrite the backend API to return fullName because it's the path of least resistance. Now, every other component relying on that API is broken.
A data contract (often mapped out during Pre-Build Planning) puts a hard boundary between the client and the server. It forces the agent to respect the agreed-upon payload structure, isolating bugs and preventing the Vibe Coding Doom Loop.
Zalcro defines explicit API payload structures and component boundaries in the Architecture Design Document, giving agents a data contract to build against.