Rich Text Editor Agent Skill
Tiptap/Plate editor setup, slash commands, toolbar, collaborative editing, and markdown export.
The Skill
Full content, every format. Copy it, download it, or install with one command.
---
description: Tiptap/Plate editor setup, slash commands, toolbar, collaborative editing, and markdown export.
homepage: https://yepapi.com/skills/rich-text-editor
metadata:
tags: [editor, tiptap, richtext, wysiwyg]
---
# Rich Text Editor
## Rules
- Tiptap for most projects — built on ProseMirror, headless, fully customizable, React-friendly
- Plate as alternative — opinionated component library built on Slate, faster to set up with pre-built UI
- Extensions: start with `StarterKit` (bold, italic, headings, lists, code blocks, blockquote, horizontal rule)
- Slash commands: register a `/` trigger extension — show a dropdown menu of block types to insert
- Toolbar: floating or fixed, show active state for formatting buttons, group related actions
- Content storage: store as JSON (Tiptap's native format) for editing, render to HTML for display
- Markdown export: use `@tiptap/extension-markdown` or serialize JSON to markdown with a custom serializer
- Collaborative editing: Yjs integration via `@tiptap/extension-collaboration` + WebSocket provider
- Image uploads in editor: drag-and-drop or paste, upload to storage, insert as image node
## Patterns
```tsx
// Tiptap setup
import { useEditor, EditorContent } from "@tiptap/react";
import StarterKit from "@tiptap/starter-kit";
import Placeholder from "@tiptap/extension-placeholder";
function Editor({ content, onChange }: { content: string; onChange: (json: JSONContent) => void }) {
const editor = useEditor({
extensions: [
StarterKit,
Placeholder.configure({ placeholder: "Start writing..." }),
],
content,
onUpdate: ({ editor }) => onChange(editor.getJSON()),
});
return (
<div className="border rounded-lg">
<Toolbar editor={editor} />
<EditorContent editor={editor} className="prose max-w-none p-4" />
</div>
);
}
```
```tsx
// Toolbar component
function Toolbar({ editor }: { editor: Editor | null }) {
if (!editor) return null;
return (
<div className="flex gap-1 border-b p-2">
<button onClick={() => editor.chain().focus().toggleBold().run()}
className={editor.isActive("bold") ? "bg-muted" : ""}>B</button>
<button onClick={() => editor.chain().focus().toggleItalic().run()}
className={editor.isActive("italic") ? "bg-muted" : ""}>I</button>
<button onClick={() => editor.chain().focus().toggleHeading({ level: 2 }).run()}
className={editor.isActive("heading", { level: 2 }) ? "bg-muted" : ""}>H2</button>
</div>
);
}
```
## Avoid
- Storing content as raw HTML — use Tiptap JSON for editing, render HTML only for display
- Building a custom editor from scratch — use Tiptap or Plate; ProseMirror/Slate are low-level
- Missing placeholder text — empty editors look broken without guidance
- Forgetting to sanitize HTML output — always sanitize before rendering user-generated contentInstall
Why Use the Rich Text Editor Skill?
Without this skill, your AI guesses at rich text editor patterns. It might hallucinate deprecated APIs, use outdated conventions, or miss best practices entirely. With it, your AI follows a proven ruleset — every suggestion aligns with current standards.
Drop this skill into your project and your AI instantly knows the rules. Better code suggestions, fewer errors, faster shipping.
Try These Prompts
These prompts work better with the Rich Text Editor skill installed. Your AI knows the context and writes code that fits.
"Build a Tiptap rich text editor with slash commands, toolbar, and markdown export"
"Create a collaborative editor with real-time syncing, mentions, and image uploads"
"Add a content editor with custom blocks, drag-to-reorder, and JSON serialization"
Works Great With
Rich Text Editor skill — FAQ
It provides Tiptap and Plate editor patterns with slash commands, toolbars, and collaborative editing. Your AI builds rich text editors with proper serialization and keyboard shortcuts.
Run `npx skills add YepAPI/skills --skill rich-text-editor` in your project root. This copies the skill file into your repo where your AI coding tool can read it automatically.
It primarily covers Tiptap (built on ProseMirror) for its extensibility and React integration. Tiptap supports slash commands, collaborative editing, and custom node types out of the box.