Agent Skills › udecode/plate › plate-plugins

plate-plugins

GitHub

用于构建和开发 Plate 编辑器插件,规范语义层、文件拓扑、React 适配及包边界管理,确保插件具备正确的所有权推断和发布流程。

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

触发场景

创建新的 Plate 插件 重构现有插件结构 修改插件的字段或选项 涉及跨包特性的功能变更

安装

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

非标准路径

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

不安装直接使用

npx skills use udecode/plate@plate-plugins

指定 Agent (Claude Code)

npx skills add udecode/plate --skill plate-plugins -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-plugins",
    "metadata": {
        "skiller": {
            "source": ".agents\/rules\/plate-plugins.mdc"
        }
    },
    "description": "Use before adding or changing a plugin's fields or options, and for a feature that spans Slate, Plate, the registry and docs. Builds Plate plugins and packages with semantic ownership, inference and package proof, and delivers a feature across its package, UI, docs and release. Use it also when a change touches a plugin's Markdown or HTML encode or decode mapping or its preserve claims."
}

Plate Plugins

Build Plate plugins that do not need a later plate-next cleanup.

This skill owns plugin authoring mechanics: semantic layer, durable source owners, file topology, contextual typing, initial state, option stores, extendApi and extendTransforms, React families, and package-local proof. VISION.md's Plugins & Components and Slate Boundary sections set the plugin direction; read them instead of a copy here.

Required Reads

Before authoring or refactoring a plugin, read:

  1. creation-flow.md for semantic and file ownership;
  2. typing.md for inference and public contracts.

Plate foundation builders in packages/core/src/lib/plugin and packages/core/src/react/plugin, and their type tests, outrank precedent.

Semantic Layer

Semantic base first, Plate second.

  • If behavior matters without React, author it in src/lib with createSlatePlugin or createTSlatePlugin according to the current inferred contract.
  • Lift an existing semantic base with toPlatePlugin or toTPlatePlugin only in its live React adapter; do not re-author it with createPlatePlugin.
  • Use createPlatePlugin directly only for a real React/Plate-native plugin.
  • Keep a plugin base-only when no React layer has an independent job.

Named direct-Plate exceptions:

  1. React render behavior with no useful semantic base;
  2. DOM/editor-surface plugins with no useful semantic base;
  3. React node-prop or component behavior that has no non-React meaning.

Owner-First Topology

Colocation is the default.

  • Put behavior with exactly one production owner inline in that plugin's create*Plugin / .extend() chain. This includes one-use with*, decorate*, normalizers, parsers, commands, corrections, matchers, state, APIs, and transforms.

For copied app/registry source, stop here and follow plate-ui; this skill does not own copied-item colocation, dependency metadata, or browser proof.

React And Test Ownership

  • plate-ui owns component, hook, context, provider, primitive, and React 19 shape. This skill only implements that accepted shape inside the package and proves package behavior.
  • React tests live beside the component family or its single semantic controller owner. verify's testing reference owns spec families, fixtures and inline test construction.

Package Boundaries

Inspect package.json exports, peers, dependencies and consumers before changing a package boundary. Keep an always-required implementation library in dependencies. Use a peer only when the consumer must share the runtime instance or the library powers an opt-in capability, and mark it optional only when the package stays usable without that capability. Optional peers are not a dumping ground for normal dependencies. Import a CommonJS dependency through its default import unless its named exports are proven under native Node ESM; Bun and bundlers accept named imports that Node rejects. Prove headless imports without React and React imports with their actual peers. Create a new package with pnpm gen:package, and run pnpm test:manifests after changing package dependencies.

Feature Delivery → manifest.md

Read this reference when one feature must reach registry consumers across its package, React adapter, copied UI, docs and release. The Plan playbook copies the template into the plan, appends Benchmark's performance-observability pack when the Scale proof row is yes, and the Build playbook closes it with node tooling/scripts/check-plate-feature.mjs <plan>.

  • Headless and registry-only flows are first-class modes, not incomplete full flows. Skip a manifest row only as no with a concrete N/A reason.

Workflow

  1. Read VISION.md and the current plugin builders.
  2. Decide the semantic layer and durable production, React-family, and test owners before creating files.
  3. Search current Plate foundation builders/type tests and the closest clean package analog. Do not copy a stale file graph. A plugin that wraps a native Slate factory, as HistoryPlugin and YjsPlugin do, copies every registration of its closest wrapped analog, found by grepping that analog's name across tooling/ and the lint configuration.
  4. Route reusable public forks to best-api; otherwise keep the inferred plugin chain inline.
  5. Define initial state, option stores, extendApi and extendTransforms methods, relationships and React behavior in their durable owners. Read the current extendApi, extendTransforms, overrideEditor, node, handlers, inject and input-rule signatures before configuring them, and reuse KEYS from packages/utils/src/lib/plate-keys.ts where the API needs a shared key.
  6. Delete superseded helper/component/hook/spec files and regenerate barrels with pnpm brl.
  7. Prove the smallest honest surface:
    • package typecheck and behavior tests;
    • Plate foundation type tests when builder/public inference changes;
    • React tests when React behavior changes;
    • pnpm --filter platejs build when a plugin wraps a native factory, because the declaration build reports TS4094 errors the typecheck skips;
  8. Audit for stale helper names, root option helpers, nested updates, explicit plugin annotations, empty config aliases, top-level plugin config, parameter-threaded editor / api / tf helpers, and one-use file taxonomies.

References

版本历史

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

同 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-ui/SKILL.md
.agents/skills/potion-yjs-dev-browser-test/SKILL.md

元信息

文件数
0
版本
c673d03
Hash
044c4a45
收录时间
2026-10-20 06:55

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-06 01:29
浙ICP备14020137号-1