Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)8.1k · #12574

webiny-admin-architect

Skill này làm gì

Skill này hướng dẫn AI của bạn khi xây dựng tính năng cho giao diện quản trị Webiny. Dành cho lập trình viên viết extension cho nền tảng Webiny.

Khi nào nên dùng

  • ✓Khi bạn xây dựng một tính năng trong bảng quản trị Webiny với logic nghiệp vụ và màn hình.
  • ✓Khi bạn cần tổ chức mã quản trị thành các tính năng, presenter và component.
  • ✓Khi bạn đăng ký một tính năng hoặc thiết lập tham số build quản trị cho một extension Webiny.

Liên kết skill

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/admin-architect/SKILL.md

Sao 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

Hãy dùng skill này để giúp tôi: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/admin/admin-architect/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Xây dựng một trang quản trị mới trong Webiny liệt kê đơn hàng, theo mẫu tính năng và presenter của nền tảng.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill giải thích cấu trúc phân tầng. Logic nghiệp vụ nằm trong các tính năng headless, còn màn hình dùng presenter và hook, và mỗi tính năng cung cấp một hàm resolve để giao diện có thể dùng.

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.

Admin Architecture Patterns

TL;DR

Admin extensions are React components that register headless features (business logic with no UI) and presentation features (MobX presenters, React hooks, components). Headless features live in admin/features/ and follow UseCase → Repository → Gateway layering. Presentation features live in admin/presentation/ and add a Presenter (MobX view model) layer on top. Both use createFeature and createAbstraction from webiny/admin.

All features — both headless and presentation — MUST provide a resolve function in createFeature. This is how the useFeature hook accesses resolved instances from the DI container. Without resolve, the feature cannot be consumed from React.

Working Context

This skill applies to both extension developers (working in extensions/) and core developers (working in packages/). The architecture patterns are identical — only imports differ.

Extensions (extensions/) Core (packages/)
Imports webiny/admin, webiny/admin/ui, webiny/admin/cms/entry/editor @webiny/app, @webiny/admin-ui, @webiny/app-headless-cms/...
Catalog paths Use the Import: path Use the Source: path
MobX wrapper createReactiveComponent from webiny/admin createReactiveComponent from @webiny/app-admin (never import observer from mobx-react-lite directly — the only exception is @webiny/app-admin itself, which is the source of the re-export)
Entry point React component as export default in a file targeted by <Admin.Extension src={...}> React component registered by the package initializer

Detect which context you're in by checking the file path: extensions/ → extension mode, packages/ → core mode.

Admin Directory Structure

admin/
├── Extension.tsx         # Admin entry point (React component)
├── features/             # Headless features (business logic, no UI)
│   └── EnableThing/
│       ├── abstractions.ts
│       ├── EnableThingUseCase.ts
│       ├── EnableThingRepository.ts
│       ├── EnableThingGateway.ts
│       └── feature.ts
└── presentation/         # Presentation layer (hooks, components, presenters)
    └── CurrentThing/
        ├── abstractions.ts   # Presenter + ViewModel interfaces
        ├── CurrentThingPresenter.ts    # MobX-based view model
        ├── useCurrentThing.ts          # React hook for consumers
        ├── feature.ts                  # createFeature registration
        └── components/                 # React UI components

Admin Extension Entry Point

The Admin entry point is a React component that registers features, providers, UI decorators, and config:

// src/admin/Extension.tsx
import React from "react";
import { AdminConfig, RegisterFeature } from "webiny/admin";
import { CurrentThingFeature } from "./presentation/CurrentThing/feature.js";
import { EnableThingFeature } from "./features/EnableThing/index.js";
import { CurrentThingProvider } from "./presentation/CurrentThing/CurrentThingProvider.js";
import { ThingListView } from "./presentation/ThingListView/ThingListView.js";

export const Extension = () => {
  return (
    <>
      {/* Register headless features (use cases, repositories, gateways) */}
      <RegisterFeature feature={EnableThingFeature} />

      
Câu hỏi thường gặp

Mỗi tính năng có cần hàm resolve không?

Có. Skill nói mọi tính năng phải cung cấp một hàm như vậy để giao diện truy cập được.

Khác biệt giữa tính năng headless và tính năng trình bày là gì?

Tính năng headless giữ logic nghiệp vụ không có giao diện, còn tính năng trình bày thêm presenter, hook và component.

Điều này có áp dụng cho extension bên ngoài không?

Có. Mẫu giống nhau cho cả nhà phát triển extension và nhà phát triển lõi, chỉ khác phần import.

Chi tiết

Mô tả gốc của tác giả

Admin-side architecture patterns for Webiny extensions. Use this skill when building frontend features with headless features (UseCase/Repository/Gateway), presentation features (Presenter/ViewModel/hooks/components), MobX-based presenters, RegisterFeature, and Admin BuildParams. Covers the admin/ directory structure for both features/ and presentation/ layers.

repo: webiny/webiny-js

Độ phổ biến

Sao GitHub
8.1k
Vị trí xếp hạng
#12574
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự