webiny-api-cms-content-models
하는 일
이 스킬은 Webiny 프로젝트에서 CMS 콘텐츠 모델을 코드로 만들거나 바꿀 때 AI를 안내합니다. 데이터 구조를 버전 관리되는 코드로 정의하려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓제품이나 블로그 글 같은 콘텐츠 모델을 코드로 만들고 싶을 때.
- ✓필드에 검증이나 다른 모델을 향한 참조가 필요할 때.
- ✓필드 유형마다 관리자에서 어떤 표시 방식을 쓸지 골라야 하는 경우.
스킬 링크
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/content-models/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이름, 가격 필드와 카테고리 모델을 참조하는 필드가 있는 제품 콘텐츠 모델을 코드로 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 연결형 빌더로 필드, 레이아웃, 제목 필드, API 이름을 선언하는 모델 클래스를 보여 줍니다. 모델은 프로젝트의 설정 파일에 등록됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Creating Content Models via Code
TL;DR
Content models are created using the ModelFactory pattern. You define a class implementing ModelFactory.Interface, use the fluent ModelFactory.Builder API to declare fields, validators, layout, and API names, then export with ModelFactory.createImplementation(). Register in webiny.config.tsx as <Api.Extension>.
The ModelFactory Pattern
Every code-based content model follows the same structure:
import { ModelFactory } from "webiny/api/cms/model";
class MyModelImpl implements ModelFactory.Interface {
async execute(builder: ModelFactory.Builder) {
return [
builder
.public({ modelId: "myModel", name: "My Model", group: "ungrouped" })
.description("Description of the model")
.fields(fields => ({
// field definitions here
}))
.layout([/* row definitions */])
.titleFieldId("fieldId")
.singularApiName("MyModel")
.pluralApiName("MyModels")
];
}
}
export default ModelFactory.createImplementation({
implementation: MyModelImpl,
dependencies: []
});
Register in webiny.config.tsx:
<Api.Extension src={"/extensions/MyModel.ts"} />
YOU MUST include the full file path with the .ts extension in the src prop. For example, use src={"/extensions/MyModel.ts"}, NOT src={"/extensions/MyModel"}. Omitting the file extension will cause a build failure.
YOU MUST use export default for the createImplementation() call when the file is targeted directly by an Extension src prop. Using a named export (export const MyModel = ...) will cause a build failure. Named exports are only valid inside files registered via createFeature.
Model Configuration Methods
| Method | Purpose |
|---|---|
.public({ modelId, name, group }) |
Creates a public model (accessible via Read API). modelId is the internal DB identifier. group organizes it in the Admin sidebar. |
.description("...") |
Model description shown in Admin UI |
.fields(fields => ({ ... })) |
Define all fields using the fluent field builder |
.layout([["field1", "field2"], ["field3"]]) |
Arrange fields in rows in the Admin editor. Each inner array is one row. |
.titleFieldId("name") |
Which field to use as the entry's display title |
.descriptionFieldId("message") |
Which field to use as the entry's description |
.singularApiName("Product") |
Singular name for GraphQL queries (e.g., getProduct) |
.pluralApiName("Products") |
Plural name for GraphQL queries (e.g., listProducts) |
.singleEntry() |
Makes the model a singleton (only one entry can exist). Automatically adds |
자주 묻는 질문
모델은 어떻게 등록하나요?
webiny 설정 파일에 API 확장 기능으로 등록하며, .ts 확장자를 포함한 전체 파일 경로를 씁니다.
필드를 중첩할 수 있나요?
네. 객체 필드와 동적 영역 필드 안의 중첩 레이아웃을 다룹니다.
필드 표시 유형을 고르는 방법도 다루나요?
네. 필드 유형마다 어떤 관리자 표시를 써야 하는지 설명합니다.
상세 정보
작성자의 원본 설명
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, b
repo: webiny/webiny-js
인기도
- GitHub 스타
- 8.1k
- 순위
- #12598
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
prd-to-plan
8.1k에이전트가 제품 요구사항 문서를 작고 끝까지 이어지는 조각들로 된 단계별 계획으로 바꿔 Markdown 파일로 저장하도록 돕습니다.
webiny-admin-architect
8.1k에이전트에게 Webiny 플랫폼의 관리자 화면을 비즈니스 로직 계층과 프레젠터 패턴으로 만드는 방법을 가르칩니다.
webiny-admin-permissions
8.1k에이전트에게 Webiny 관리자 화면에 권한 제어를 추가하는 법을 가르칩니다. 스키마에서 권한 양식을 자동 생성하고 표시 여부를 확인합니다.
webiny-form-model
8.1k에이전트에게 선언형 필드 빌더, 레이아웃, 검증, 조건부 규칙으로 Webiny 양식을 만드는 법을 가르칩니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.