본문으로 건너뛰기
cccskills
무료GitHub에 공개

rich-text-editor-expert

Expert guide for rich text editor integration (Tiptap, Lexical, ProseMirror), collaborative editing, and custom extensions / Panduan ahli integrasi editor rich text (Tiptap, Lexical, ProseMirror), editing kolaboratif, dan ekstensi kustom.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug스타 114(GitHub 114 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md9.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Rich Text Editor Expert (2026 Edition)

English | Bahasa Indonesia


<a name="english"></a>

English

Orchestration & Integration

  • design-system-architect: Provides accessible toolbar primitives, floating bubble menus, and surface token styling.
  • ui-ux-pro-max: Typography scale, optical letter-spacing, and readable editorial prose width (max-w-prose).
  • anti-slop: Prevents empty paragraph bloat, unstyled placeholder flashes, and dead formatting buttons.
  • realtime-collaboration-expert: Yjs/Automerge CRDTs for collaborative editing.
  • form-validation-expert: Form integration patterns for editor content.
  • headless-cms-expert: CMS schema integration for rich text fields.
  • file-upload-media-expert: Image/video embedding within editor content.
  • senior-frontend: React component patterns for editor wrappers.

Description

Expert guide for integrating production-quality rich text editors into web applications. Covers Tiptap v2 (ProseMirror-based, extensible), Lexical (Meta's framework, high-performance), and ProseMirror (low-level, maximum control). Includes custom node/mark creation, collaborative editing with Yjs, slash commands, mention systems, image/video embedding, Portable Text output, and accessibility compliance.

Trigger Conditions

  • Adding a WYSIWYG or rich text editor to an application.
  • Building collaborative document editing features.
  • Creating custom editor extensions (mentions, slash commands, embeds).
  • Choosing between Tiptap, Lexical, or ProseMirror.
  • Implementing content serialization (HTML, JSON, Markdown, Portable Text).

Editor Selection Guide

CriteriaTiptap v2Lexical (Meta)ProseMirror
Abstraction LevelHighMediumLow
FrameworkReact, Vue, vanillaReact (primary)Vanilla JS
Extension Ecosystem★★★★★ (50+ extensions)★★★ (growing)★★★★ (community)
CollaborationYjs built-inYjs pluginYjs via prosemirror-collab
Performance★★★★★★★★★★★★★
Learning CurveLow-MediumMedium-HighHigh
Best ForMost apps, CMSHigh-scale, messagingCustom editors

Recommendation: Use Tiptap v2 for 90% of use cases. Use Lexical for high-performance messaging apps. Use ProseMirror only when you need full low-level control.

Core Patterns

1. Tiptap v2 Setup (React)

import { useEditor, EditorContent } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';
import Placeholder from '@tiptap/extension-placeholder';
import Image from '@tiptap/extension-image';
import Link from '@tiptap/extension-link';
import Collaboration from '@tiptap/extension-collaboration';
import * as Y from 'yjs';

const ydoc = new Y.Doc();

function RichEditor({ onUpdate }: { onUpdate: (json: object) => void }) {
  const editor = useEditor({
    extensions: [
      StarterKit.configure({ history: false }), // Disable history for collab
      Placeholder.configure({ placeholder: 'Start writing...' }),
      Image.configure({ inline: true, allowBase64: false }),
      Link.configure({ openOnClick: false, autolink: true }),
      Collaboration.configure({ document: ydoc }),
    ],
    onUpdate: ({ editor }) => onUpdate(editor.getJSON()),
  });

  return (
    <div className="editor-wrapper">
      <MenuBar editor={editor} />
      <EditorContent editor={editor} className="prose max-w-none" />
    </div>
  );
}

2. Custom Slash Command Extension (Tiptap)

import { Extension } from '@tiptap/core';
import Suggestion from '@tiptap/suggestion';

export const SlashCommands = Extension.create({
  name: 'slashCommands',
  addOptions() {
    return {
      suggestion: {
        char: '/',
        items: ({ query }) => [
          { title: 'Heading 1', command: ({ editor }) => editor.chain().focus().toggleHeading({ level: 1 }).run() },
          { title: 'Bullet List', command: ({ editor }) => editor.chain().focus().toggleBulletList().run() },
          { title: 'Code Block', command: ({ editor }) => editor.chain().focus().toggleCodeBlock().run() },
          { title: 'Image', command: ({ editor }) => { /* open upload dialog */ } },
        ].filter((item) => item.title.toLowerCase().includes(query.toLowerCase())),
      },
    };
  },
  addProseMirrorPlugins() {
    return [Suggestion({ editor: this.editor, ...this.options.suggestion })];
  },
});

3. Lexical Setup (React)

import { LexicalComposer } from '@lexical/react/LexicalComposer';
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
import { AutoFocusPlugin } from '@lexical/react/LexicalAutoFocusPlugin';
import { HeadingNode, QuoteNode } from '@lexical/rich-text';
import { ListNode, ListItemNode } from '@lexical/list';
import { CodeNode } from '@lexical/code';

const editorConfig = {
  namespace: 'MyEditor',
  nodes: [HeadingNode, QuoteNode, ListNode, ListItemNode, CodeNode],
  onError: (error: Error) => console.error(error),
  theme: { /* custom theme classes */ },
};

function LexicalEditor() {
  return (
    <LexicalComposer initialConfig={editorConfig}>
      <RichTextPlugin
        contentEditable={<ContentEditable className="prose" />}
        placeholder={<div className="text-gray-400">Start writing...</div>}
        ErrorBoundary={LexicalErrorBoundary}
      />
      <HistoryPlugin />
      <AutoFocusPlugin />
    </LexicalComposer>
  );
}

4. Content Serialization Patterns

  • JSON (Tiptap/Lexical): Store editor state as JSON for exact restoration.
  • HTML: Use editor.getHTML() for rendering in non-editor contexts.
  • Markdown: Convert with @tiptap/extension-markdown for developer-facing content.
  • Portable Text (Sanity): Map Tiptap nodes to Portable Text blocks for CMS storage.

Production Checklist

  • Content sanitization (DOMPurify) before rendering user HTML.
  • Image upload with presigned URLs (not base64 in content).
  • Keyboard shortcuts documented and accessible.
  • Mobile-responsive toolbar (sticky or floating).
  • Autosave with debounce (500ms) and conflict resolution.
  • Max content length validation.

<a name="bahasa-indonesia"></a>

Bahasa Indonesia

Integrasi Orkestrasi

  • design-system-architect: Menyediakan primitif toolbar yang aksesibel, menu bubble melayang, dan token permukaan.
  • ui-ux-pro-max: Skala tipografi, tracking huruf optik, dan lebar kolom editorial yang nyaman dibaca (max-w-prose).
  • anti-slop: Mencegah penumpukan paragraf kosong, kedipan placeholder tak bergaya, dan tombol format tanpa fungsi nyata.
  • realtime-collaboration-expert: CRDT Yjs/Automerge untuk editing dokumen kolaboratif real-time.
  • form-validation-expert: Pola integrasi formulir untuk konten rich text (Zod + React Hook Form).
  • headless-cms-expert: Integrasi skema CMS untuk field rich text dan Portable Text.
  • file-upload-media-expert: Upload gambar/video dengan presigned URL ke dalam konten editor.

Deskripsi

Panduan ahli untuk mengintegrasikan editor rich text berkualitas produksi ke dalam aplikasi web. Mencakup Tiptap v2 (berbasis ProseMirror, modular), Lexical (framework berperforma tinggi dari Meta), dan ProseMirror murni. Termasuk pembuatan ekstensi kustom (slash commands, mention, blockquote kustom), kolaborasi real-time dengan Yjs, sanitasi DOMPurify, dan output JSON/HTML.

Kondisi Pemicu

  • Menambahkan editor WYSIWYG atau rich text ke aplikasi SaaS.
  • Membangun fitur kolaborasi pengeditan dokumen langsung antar banyak pengguna.
  • Membuat ekstensi kustom seperti slash commands (/), tag mention (@), atau embedding media.

Implementasi Pola Kunci (TypeScript & React)

1. Konfigurasi Editor Tiptap v2 dengan Ekstensi Lengkap

import { useEditor, EditorContent } from '@tiptap/react';
import StarterKit from '@tiptap/starter-kit';
import Placeholder from '@tiptap/extension-placeholder';
import Image from '@tiptap/extension-image';
import Link from '@tiptap/extension-link';

export function EditorDokumen({ onPerubahan }: { onPerubahan: (json: object) => void }) {
  const editor = useEditor({
    extensions: [
      StarterKit,
      Placeholder.configure({ placeholder: 'Ketik "/" untuk perintah...' }),
      Image.configure({ inline: true, allowBase64: false }),
      Link.configure({ openOnClick: false, autolink: true }),
    ],
    onUpdate: ({ editor }) => onPerubahan(editor.getJSON()),
  });

  return (
    <div className="border border-slate-200 dark:border-slate-800 rounded-lg p-4 bg-white dark:bg-slate-900">
      <EditorContent editor={editor} className="prose dark:prose-invert max-w-none focus:outline-none" />
    </div>
  );
}

2. Sanitasi Output HTML Mencegah XSS (DOMPurify)

import DOMPurify from 'isomorphic-dompurify';

export function bersihkanHtmlKonten(htmlMentah: string): string {
  return DOMPurify.sanitize(htmlMentah, {
    ALLOWED_TAGS: ['p', 'b', 'i', 'h1', 'h2', 'h3', 'ul', 'ol', 'li', 'a', 'img', 'pre', 'code'],
    ALLOWED_ATTR: ['href', 'src', 'alt', 'title', 'target'],
  });
}

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

A2A agent protocol interoperability, Agent Cards, and MCP bridging / Protokol agen A2A, Agent Cards, dan integrasi MCP.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1142026년 10월 27일 업데이트

Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1142026년 10월 27일 업데이트

Web accessibility testing with axe-core, Playwright, and WCAG 2.2 / Pengujian aksesibilitas web axe-core, Playwright, dan WCAG 2.2.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1142026년 10월 27일 업데이트

Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1142026년 10월 27일 업데이트

Model cascading & complexity-scored routing (Grok, Gemini, Claude) / Routing kaskade model & scoring kompleksitas (Grok, Gemini, Claude).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1142026년 10월 27일 업데이트

Affective computing, emotion AI, and multimodal sentiment analysis / Komputasi afektif, AI emosional, dan analisis sentimen multimodal.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

roedyrustam/vibes-plug1142026년 10월 27일 업데이트

roedyrustam의 스킬 모두 보기

이 스킬의 문제 신고