The contract at a glance
Site configuration
.aci.yaml identifies the framework, source directories, contract registries, and CMS-managed route.Component contracts
Zod schemas define stable component IDs and the props content may supply.
Layout contracts
Layouts define the regions a page can fill and optional fragment defaults.
Runtime registry
The registry pairs each component contract with the Astro or React component that renders it.
Configure the site
The.aci.yaml file lives at the project root. A generated Astro project starts with this shape:
Define a component contract
A component contract gives a content block a stable ID and validates its props. Keep the schema in a contract file that does not import your runtime component.home_hero directly, so renaming the ID is a content migration rather than a cosmetic code change.
Export the contract from the component contract registry:
Keep contracts and runtime code separate
Contract extraction runs without loading your application runtime. That makes validation predictable across local development, preview, and publish.
This separation does not duplicate your prop model. Export the inferred TypeScript type from the contract and use it in the runtime component.
Register the runtime component
The runtime registry pairs each contract with its implementation:src/cms/contracts/components/index.tsexposes schemas for compilation and validation.src/cms/registry.tstells the framework which component to render after content has passed validation.
Define a layout contract
Layouts name the regions available to a page. Mark a slot as required by passingtrue as the second argument to slot.
main region. If a page does not provide header or footer, ACI uses the named fragments as defaults.
Author content against the contract
A page names the layout, then places registered component blocks in its regions:- the layout exists;
- region names match layout slots;
- required regions are present;
- component IDs exist in the contract registry;
- props satisfy the component’s Zod schema; and
- referenced fragments and assets can be resolved.
Evolve a contract safely
Adding an optional prop is usually backward compatible. Making a field required, narrowing allowed values, or renaming a component ID can invalidate existing content. For a breaking change:- Update the contract and runtime component together.
- Update every affected page, fragment, and overlay.
- Compile the full content tree.
- Run the project’s type and conformance checks.
- Preview the change before it is approved and published.
Next: Framework guides →