Creating Headless CMS content models via code using the ModelFactory pattern. Use this skill when the developer wants to create, modify, or understand content model definitions, define fields and validators, set up reference fields between models, configure field layouts (including nested layouts inside object or dynamicZone fields), pick the correct Admin UI renderer for a field type (textInput/textInputs, lexicalEditor/lexicalEditors, file/files, objectAccordionSingle/objectAccordionMultiple, etc.), or work with the ModelFactory builder API. Also covers field types (text, longText, number, boolean, datetime, file, ref, object, richText, dynamicZone), list (array) fields via .list() and the singular-vs-plural renderer rule, validation (required, unique, email, pattern, minLength, maxLength, gte, predefinedValues), single-entry (singleton) models via .singleEntry(), and model/field tags via .tags(). Includes the correct fields projection syntax when querying entries via the SDK: ref fields use double-values. nesting (e.g. values.author.values.name) because they resolve to another entry, while object and dynamicZone sub-fields are inline and use a single values. (e.g. values.author.name) — getting this wrong silently returns null.
$npx -y skills add webiny/webiny-js --skill content-modelsInstalls into the current project.
Run `npx skills use "https://github.com/webiny/webiny-js" --skill "webiny/webiny-js/content-models"` and follow the generated skill instructions now. Read its complete output, redirecting it to a temporary file first if necessary. Resolve relative paths from the supporting-files directory it provides.
Use the skills in "https://github.com/webiny/webiny-js" that are relevant to the current task. Run `npx skills add "https://github.com/webiny/webiny-js"` and select the relevant skills, then follow their instructions.