mdx-to-lexical
OfficialSeamlessly transform MDX to Lexical JSON for rich text.
AuthorComparePower
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Migrating rich text content from MDX (especially with custom components) to a structured editor format like Payload's Lexical JSON is a complex, manual, and error-prone process. This skill automates the entire conversion, preserving content structure and component functionality.
Core Features & Use Cases
- Full MDX to Lexical Conversion: Parses MDX, converts Markdown AST to Lexical nodes, extracts inline components, and resolves data instance references to Payload IDs.
- Component Mapping & Resolution: Intelligently maps custom MDX components to Payload inline blocks and links them to
RichTextDataInstancesin the database. - Use Case: You're migrating a blog from Astro/Keystatic (using MDX with custom components like
<FourChangePhoneNumber />) to Payload CMS. Use this skill to convert all MDX content into valid Lexical JSON, ensuring dynamic components function correctly in the new system.
Quick Start
Convert the MDX file 'src/content/articles/my-post.mdx' to Lexical JSON format and save it as 'output/my-post.json'.
Dependency Matrix
Required Modules
unifiedremark-parseremark-mdxpnpm
Components
scripts
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: mdx-to-lexical Download link: https://github.com/ComparePower/payload-cms-cloudflare-baseline/archive/main.zip#mdx-to-lexical Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.