webiny-new-entry-wizard
Skill này làm gì
Skill này hướng dẫn AI của bạn khi xây dựng một wizard xuất hiện trước trình chỉnh sửa mục trong Webiny headless CMS. Dành cho lập trình viên muốn mục mới bắt đầu với một vài trường đã được thu thập.
Khi nào nên dùng
- ✓Khi bạn muốn một form ngắn xuất hiện trước khi tạo mục CMS mới, như tiêu đề hoặc slug.
- ✓Khi bạn cần các content model cụ thể hiển thị wizard tùy chỉnh khi tạo.
- ✓Khi bạn muốn form mục được điền sẵn từ câu trả lời của wizard.
Liên kết skill
https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/new-entry-wizard/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thêm một wizard vào content model blog của chúng tôi, hỏi tiêu đề, slug và danh mục trước khi mục được mở.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill thiết lập một extension wizard gồm giao diện dùng chung, một tính năng, một presenter giữ form, một view và một bước đăng ký. Câu trả lời của wizard được chuyển cho form mục, và form mở ra với trạng thái có thay đổi chưa lưu.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
New Entry Wizard
TL;DR
A New Entry Wizard intercepts the "create new entry" flow in the Headless CMS and shows a custom form before the full entry editor. The wizard collects initial values (title, slug, category, etc.), then calls formPresenter.newEntry(initialValues) to pre-fill the entry form and transition to the editor. The form is automatically marked as dirty so the user sees unsaved changes.
A wizard extension has five files:
abstractions.ts-- DI token and presenter interface (ALWAYS a standalone file)feature.ts--createFeaturewiring (ALWAYS a standalone file)- Presenter -- owns the wizard form (fields, layout, validation) via
FormModelFactory - View -- renders the wizard UI using
FormViewandFormErrors - Registration -- plugs the wizard into specific content models via
ContentEntryEditorConfig.NewEntryWizard
Registration
// extensions/myWizard/index.tsx
import React from "react";
import { RegisterFeature } from "webiny/admin";
import { ContentEntryEditorConfig } from "webiny/admin/cms/entry/editor";
import { MyWizardFeature } from "./feature.js";
import { MyWizardForm } from "./MyWizardForm.js";
const MyWizardExtension = () => {
return (
<>
<RegisterFeature feature={MyWizardFeature} />
<ContentEntryEditorConfig>
<ContentEntryEditorConfig.NewEntryWizard
element={<MyWizardForm />}
modelIds={["article", "blogPost"]}
/>
</ContentEntryEditorConfig>
</>
);
};
export default MyWizardExtension;
Props
| Prop | Type | Description |
|---|---|---|
element |
React.ReactElement |
The wizard component to render |
modelIds |
string[] |
Content model IDs this wizard applies to. Omit or pass [] to apply to all models. |
Enabling the extension
// webiny.config.tsx
<Admin.Extension src={"@/extensions/myWizard/index.tsx"} />
Abstractions
Abstractions MUST live in a dedicated abstractions.ts file. This file defines the DI token for the presenter. It is imported by both the feature and the view.
// extensions/myWizard/abstractions.ts
import { createAbstraction } from "webiny/admin";
import type { FormModel } from "webiny/admin/form";
export interface MyWizardVM {
form: FormModel.FormVM;
data: Record<string, unknown>;
}
export interface IMyWizardPresenter {
vm: MyWizardVM;
submit(): Promise<Record<string, unknown> | false>;
reset(): void;
}
export const MyWizardPresenter = createAbstraction<IMyWizardPresenter>("MyWizardPresenter");
Feature
The feature MUST live in a dedicated feature.ts file. It wires the presenter implementation to the abstraction and defines how the feature is resolved from the DI container.
// extensions/myWizard/feature.ts
import { createFeature, FormModelFactory } from "webiny/admin";
import { MyWizardPresenter } from "./abstractions.js";
import { MyWizardPresenterImpl } from "./MyWizardPresenter.js";
export const MyWizardFeature = createFeature({
name: "MyWizard",
register(container) {
container.register(
MyWizardPresenter.createImplementation({
implementation: MyWizardPresenterImpl,
dependencies: [FormModelFactory]
})
);
},
resolve(container) {
return { presenter: container.resolve(MyWizardPresenter) };
}
});
Presenter
The presenter owns a FormModel for the wizard's own fields. It is a plain class -- the DI token lives in abstractions.ts and the feature wiring lives in feature.ts.
// extensions/myWizard/MyWizardPresenter.ts
import type { FormModel } from "webiny/admin/form";
import { makeAutoObservable, toJS } from "mobx";
import { FormModelFactory } from "webiny/admin";
import type { IMyWizardPresenter, MyWizardVM } from "./abstractions.js";
export class MyWizardPresenterImpl implements IMyWizardPresenter {
private form: FormModel.Interface;
constructor(formFactory: FormModelFactory.Interface) {
this.form = formFactory.create({
fields: fields => ({
title: fields.text().label("Title").required("Title is required"),
slug: fields.text().label("Slug").required("Slug is required"),
category: f
Câu hỏi thường gặp
Wizard có tự lưu mục cho tôi không?
Không. Wizard điền form mục, rồi người dùng thấy các thay đổi chưa lưu để lưu.
Wizard được gắn vào content model như thế nào?
Nó được đăng ký cho các content model cụ thể thông qua cấu hình trình chỉnh sửa mục.
Wizard cần những file nào?
Skill liệt kê năm phần: abstraction, tính năng, presenter, view và đăng ký.
Chi tiết
Mô tả gốc của tác giả
Building a New Entry Wizard for the Headless CMS. Use this skill when the developer wants to show a custom wizard UI before the entry form when creating new CMS entries -- collecting fields like title, slug, or category upfront, then pre-filling the entry form. Covers ContentEntryEditorConfig.NewEntryWizard, createFeature, FormModelFactory, createReactiveComponent, useContentEntryFormPresenter, and the dirty-flag on setData.
repo: webiny/webiny-js
Độ phổ biến
- Sao GitHub
- 8.1k
- Vị trí xếp hạng
- #12577
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
prd-to-plan
8.1kGiúp agent của bạn biến tài liệu yêu cầu sản phẩm thành kế hoạch theo giai đoạn gồm các lát cắt đầu-cuối nhỏ, lưu thành file Markdown.
webiny-admin-architect
8.1kDạy agent của bạn cách xây dựng màn hình quản trị cho nền tảng Webiny, dùng các tầng logic nghiệp vụ và mẫu presenter.
webiny-admin-permissions
8.1kDạy agent của bạn thêm kiểm soát quyền vào màn hình quản trị Webiny, gồm form quyền tự sinh và kiểm tra ẩn hoặc hiện.
webiny-form-model
8.1kDạy agent của bạn xây dựng form trong Webiny bằng trình tạo trường khai báo, bố cục, kiểm tra hợp lệ và quy tắc có điều kiện.
Skill tương tự
angular-developer
280kGiúp agent của bạn viết code Angular và tư vấn cấu trúc dự án, hữu ích khi bắt đầu dự án mới hoặc cải thiện hiệu suất.
frontend-a11y
280kGiúp agent của bạn làm cho giao diện web dễ tiếp cận với mọi người. Đảm bảo website và ứng dụng hoạt động tốt với trình đọc màn hình và điều hướng bằng bàn phím.
frontend-patterns
280kGiúp agent của bạn áp dụng các mẫu hiện đại trong phát triển frontend. Tối ưu hiệu năng, quản lý trạng thái và tuân theo thực hành tốt nhất với React và Next.js.