What problem does it solve?
Webiny's built-in CMS field types (text, number, boolean, datetime, file, ref, object, richText, longText, json, dynamicZone) cannot cover every storage format or validation rule a project needs. This Skill guides you through creating a custom field type that plugs into the model builder's fluent API with full TypeScript autocomplete.
Core Features & Use Cases
- Custom Field Builder: Extend
DataFieldBuilder<"yourType"> and compose FieldTypeValidator interfaces (required, pattern, unique, minLength, etc.) to expose chainable validator methods.
- DI Registration: Create a
FieldType.Factory implementation and register it in the Webiny DI container via createFeature, so the FieldBuilderRegistry picks it up at construction time.
- TypeScript Autocomplete: Use module augmentation on
"webiny/api/cms/model" so fields.slug() (or your own type) appears in the fields() registry with typed signatures.
- Use Case: You need a
slug field with lowercase pattern validation and uniqueness enforcement. This Skill walks you through building SlugFieldBuilder, its factory, and registering it so any ModelFactory can call fields.slug().required().unique().pattern("^[a-z0-9-]+$").
Quick Start
Ask the AI to create a custom CMS field type (for example a slug field) for Webiny following the DataFieldBuilder and FieldType.Factory pattern, including DI registration and module augmentation.