create_spec
Create or overwrite a design spec (component, page, or dataviz) in the registry with Zod validation. Returns confirmation or error details.
Instructions
Create or overwrite a spec in the registry (Zod-validated). Same-name specs are silently overwritten — check get_specs first.
Returns: Spec "<name>" saved (<type>).
Errors: isError with Zod details on schema/JSON/type failures.
Schemas — component: name, type, atomicLevel ("atom"|"molecule"|"organism"|"template"), purpose, props[], variants[], composesSpecs[] (atoms must be []), codeConnect{}; page: name, type, purpose, sections[]; dataviz: name, type, chartType, dataShape.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spec | Yes | JSON string of the full spec object. Must include a 'type' field ('component', 'page', or 'dataviz') and all required fields for that spec type. Zod validation errors are returned as structured error messages if the shape is invalid. |