Agent Skills › udecode/plate › plate-ui

plate-ui

GitHub

Plate UI技能,用于编辑注册表组件及UI交互。涵盖组件形状、家族拓扑、基础/实时套件分离、注册表连接及浏览器兼容性验证。遵循开放代码保留原则与Tailwind v4规范。

.agents/skills/plate-ui/SKILL.md udecode/plate

触发场景

编辑 registry components 或 kits 下的文件 处理组件的拖拽、下拉菜单或指示器UI 进行 Plate React 组件的注册表连接工作

安装

npx skills add udecode/plate --skill plate-ui -g -y
更多选项

非标准路径

npx skills add https://github.com/udecode/plate/tree/main/.agents/skills/plate-ui -g -y

不安装直接使用

npx skills use udecode/plate@plate-ui

指定 Agent (Claude Code)

npx skills add udecode/plate --skill plate-ui -a claude-code -g -y

安装 repo 全部 skill

npx skills add udecode/plate --all -g -y

预览 repo 内 skill

npx skills add udecode/plate --list

SKILL.md

Frontmatter
{
    "name": "plate-ui",
    "metadata": {
        "skiller": {
            "source": ".agents\/rules\/plate-ui.mdc"
        }
    },
    "description": "Use before editing any file under the registry components or kits, or a component's drag, drop, handle menu or indicator UI. Implements Plate React component families, copied registry UI and kit wiring with exact browser proof."
}

Plate UI

Use the shadcn skill for CLI, upstream docs, and generic shadcn/ui rules. Use vercel-react-best-practices for selected implementation tactics. VISION.md's Plugins & Components and UI Registry sections set the direction for Plate React components. This skill owns the method that applies it: component shape, family topology, open-code preservation, the base/live kit split, registry wiring and browser proof. Read Component shape for renderer contracts and Shadcn proofing for copied component implementation or review.

Repo Surfaces

  • apps/www/src/registry/ui — copied editor UI and its live and static node components
  • apps/www/src/registry/components/editor — editor composition and kits, including plugins/*-kit.tsx
  • apps/www/src/registry/registry-*.ts — registry metadata and dependencies
  • packages/* — upstream semantic owners; package edits route to plate-plugins

Routing Gate

Ownership follows the Domain owners table in AGENTS.md.

Continue here whenever a Plate package or registry task makes a React, component, hook, provider, store, primitive, or composition decision. Package implementation and proof still route to plate-plugins; plugin builders, schema law, and application typing remain outside this skill.

Principles

  1. Preserve open code. A shadcn-derived component should still look like source code a user can own, read, diff, and tweak.
  2. Registry wiring is part of authorship. A component is not done until kits, examples, and style deps are coherent.
  3. Examples teach the install shape. Do not remove an explicit feature plugin, kit, renderer binding, or dependency merely because an aggregate application editor installed by the editor-kit registry item also includes it. Deliberate repetition can make copied code and feature ownership transparent.

Registry

Registry Wiring → registry.md

  • Update registry-ui.ts, registry-kits.ts, registry-components.ts and registry-examples.ts together.

Registry Changelog

  • User-visible registry UI, kit, example, metadata, style dependency, copied-code install shape, or generated registry changelog changes need a registry changelog entry or a concrete N/A reason.
  • changeset's registry reference owns the schema, scaffold, generation and verification. Do not duplicate the entry contract here.

Styling And Vercel Tactics

Use stable kebab-case data-slot for component identity and data-state for interaction and visual state. Keep Tailwind v4 syntax canonical: slash opacity, parenthesized CSS variables, suffix !, and canonical utilities.

vercel-react-best-practices provides selected implementation tactics. It does not decide Plate public APIs, extraction, file ownership, or provider visibility.

  • Load exact rule files for the problem; never import the whole catalog as doctrine.
  • rerender-split-combined-hooks may justify splitting internal calculations or effects. It never requires multiple public hooks or files.
  • Context-interface, lifted-state, compound-component, and provider patterns need real independent composition. They do not automatically earn a public provider or store.
  • Performance advice may optimize an accepted Plate shape; it cannot replace this skill's component law.

Key Patterns

// Good: simple component owns its own renderer behavior directly.
function ImageElement(props: PlateElementProps<TImageElement>) {
  const selected = useSelected();

  return <PlateElement {...props} data-selected={selected || undefined} />;
}

// Good: copied suggestion UI reads its owning plugin's API.
const suggestionApi = editor.getApi(SuggestionPlugin).suggestion;

// Good: base/live split stays explicit.
export const BaseFootnoteKit = [
  BaseFootnoteReferencePlugin.withComponent(FootnoteReferenceElementStatic),
  BaseFootnoteDefinitionPlugin.withComponent(FootnoteDefinitionElementStatic),
];

export const FootnoteKit = [
  FootnoteInputPlugin.withComponent(FootnoteInputElement),
  FootnoteReferencePlugin.withComponent(FootnoteReferenceElement),
  FootnoteDefinitionPlugin.withComponent(FootnoteDefinitionElement),
];

// Good: runtime-neutral policy is shared by both editor presets.
export const MarkdownKit = [
  MarkdownPlugin.configure({ options: { remarkPlugins: [remarkGfm] } }),
];

// Bad: package hook exists only to feed one shadcn component's local UI.
const state = useSingleComponentOnlyState();
return <Popover open={state.open}>...</Popover>;

// Bad: React-only package hook that mainly returns renderer glue.
const { dialogTitle, menuItems, onOpenChange, popoverOpen } =
  useToolbarMenuState();

Workflow

  1. Start with the shadcn skill. Run the normal shadcn docs/search workflow first.
  2. Search Plate for the closest analog in apps/www/src/registry/ui, apps/www/src/registry/components/editor and the relevant packages/*.
  3. Decide ownership before writing code: package ownership requires a durable contract independent of the renderer.
  4. Decide the three layers before coding:
    • semantic core
    • platform adapter
    • local open-code UI
  5. Choose the component-family shape before writing state/effects:
    • direct component by default
    • one terminal use<Family> only for a real semantic controller
    • one private context only when sibling coordination needs it
  6. Apply the React checks before writing state/effects:
    • can this be derived during render?
    • should this stay in an event handler?
    • am I subscribing to more editor state than the UI actually renders?
  7. Build the component as open code first.
  8. When plugin wiring changes, audit the affected field and its registry peers for local structural mirrors, state Pick aliases, callback return annotations, and casts that replace package ownership or contextual inference. Fix the canonical package contract instead of preserving a local adapter.
  9. Extract only the boundaries that pass that ownership test.
  10. Share runtime-neutral kits; wire base/live renderer kits and registry deps only where the renderer ownership actually differs.

Audit References

版本历史

  • c673d03 当前 2026-10-20 06:55

    更新上游文档引用,增加 Routing Gate 说明,细化 Styling 与 Vercel 战术规则,移除旧版跨平台分层等过时原则。

  • af5e430 2026-08-20 19:27

同 Skill 集合

.agents/skills/adversarial-document-reviewer/SKILL.md
.agents/skills/agent-browser-issue/SKILL.md
.agents/skills/agent-native-reviewer/SKILL.md
.agents/skills/architecture-strategist/SKILL.md
.agents/skills/autoclosure/SKILL.md
.agents/skills/autogoal/SKILL.md
.agents/skills/autoreview/SKILL.md
.agents/skills/benchmark/SKILL.md
.agents/skills/best-api/SKILL.md
.agents/skills/best-practices-researcher/SKILL.md
.agents/skills/changeset/SKILL.md
.agents/skills/chips/SKILL.md
.agents/skills/clawpatch/SKILL.md
.agents/skills/clawsweeper/SKILL.md
.agents/skills/cleanup/SKILL.md
.agents/skills/code-simplicity-reviewer/SKILL.md
.agents/skills/coherence-reviewer/SKILL.md
.agents/skills/components/SKILL.md
.agents/skills/continue/SKILL.md
.agents/skills/correctness-reviewer/SKILL.md
.agents/skills/dev-browser/SKILL.md
.agents/skills/diagnosing-bugs/SKILL.md
.agents/skills/docs-creator/SKILL.md
.agents/skills/editor-harvest-plan/SKILL.md
.agents/skills/editor-test-harvester/SKILL.md
.agents/skills/feasibility-reviewer/SKILL.md
.agents/skills/framework-docs-researcher/SKILL.md
.agents/skills/frontend-design/SKILL.md
.agents/skills/git-history-analyzer/SKILL.md
.agents/skills/gpt-pro/SKILL.md
.agents/skills/grill-me/SKILL.md
.agents/skills/hard-cut/SKILL.md
.agents/skills/issue-harvester/SKILL.md
.agents/skills/issue-intelligence-analyst/SKILL.md
.agents/skills/learnings-researcher/SKILL.md
.agents/skills/maintainability-reviewer/SKILL.md
.agents/skills/maintainer/SKILL.md
.agents/skills/major-task/SKILL.md
.agents/skills/north-star/SKILL.md
.agents/skills/orchestrator/SKILL.md
.agents/skills/pattern-recognition-specialist/SKILL.md
.agents/skills/performance-oracle/SKILL.md
.agents/skills/performance/SKILL.md
.agents/skills/plate-docs/SKILL.md
.agents/skills/plate-next/SKILL.md
.agents/skills/plate-plan/SKILL.md
.agents/skills/plate-plugin-creator/SKILL.md
.agents/skills/plate-plugins/SKILL.md
.agents/skills/potion-yjs-dev-browser-test/SKILL.md

元信息

文件数
0
版本
c673d03
Hash
f2922869
收录时间
2026-08-20 19:27

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-02 05:32
浙ICP备14020137号-1