ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
Extensible text editor framework by Meta. Use when building a rich text editor on Lexical — editor setup, custom nodes, commands, transforms, and serialization.
$ npx -y skills add agents-inc/skills --skill web-editor-lexical --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/web-editor-lexicalContext preview
The summary Claude sees to decide when to auto-load this skill.
Extensible text editor framework by Meta. Use when building a rich text editor on Lexical — editor setup, custom nodes, commands, transforms, and serialization.
name: web-editor-lexical description: Extensible text editor framework by Meta. Use when building a rich text editor on Lexical — editor setup, custom nodes, commands, transforms, and serialization.
> **Quick Guide:** Lexical is an editor framework rather than an editor: the core gives you a node > tree, a selection model, a reconciler, a command bus and an update lifecycle, and everything else > is a plugin. EditorState is immutable, so every read and every mutation happens inside an > `editor.update()` or `editor.read()` closure, and the `$`-prefixed functions are the ones that > require that context. Extend the tree through `ElementNode`, `TextNode` or `DecoratorNode`, and > react to content through transforms rather than listeners. **Current: v0.42.x, pre-1.0 — APIs > still move between minors.**
**Detailed Resources:**
---
reaching it through `useLexicalComposerContext()`. Start at [examples/core.md](examples/core.md).
the same node classes for search indexing, email rendering and content transforms. Register the same nodes as the client. See [examples/serialization.md](examples/serialization.md).
matters is which base node it extends. See the decision framework below and [examples/custom-nodes.md](examples/custom-nodes.md).
---
<critical_requirements>
**Call `$`-prefixed functions inside an `editor.update()` or `editor.read()` closure.** `$getRoot`, `$getSelection`, `$createTextNode` and their siblings read the active editor state from a context that only exists inside those closures; outside one they throw at runtime, and nothing catches it at compile time.
**Register every custom node in `initialConfig.nodes`.** An unregistered node throws or silently drops content the moment the editor meets it, including on deserialization of previously saved documents.
**Return the unsubscribe function from the `useEffect` that registers a command, transform or listener.** Every `register*` method hands one back, and dropping it leaks a listener per render.
**Open every transform with a precondition that the mutation makes false.** A transform that mutates its target unconditionally marks the node dirty, which re-triggers the transform and freezes the editor.
</critical_requirements>
---
**Auto-detection:** Lexical, `@lexical/react`, `@lexical/rich-text`, `@lexical/list`, `@lexical/code`, `@lexical/link`, `@lexical/html`, `@lexical/headless`, LexicalComposer, EditorState, LexicalNode, ElementNode, TextNode, DecoratorNode, createCommand, dispatchCommand, registerCommand, COMMAND_PRIORITY, `$getRoot`, `$getSelection`, `$createParagraphNode`, `$createTextNode`, RichTextPlugin, OnChangePlugin, HistoryPlugin, useLexicalComposerContext, editor.update, editor.read, registerNodeTransform, exportJSON, importJSON, exportDOM, importDOM, NodeState, createState
**Applies to:**
**Handled elsewhere:**
contain is settled by whatever owns styling
not its concern
a separate concern
---
<philosophy>
Lexical ships a core and no editor. The tree, selection, reconciler, command bus and update lifecycle are the product; toolbars, lists, links, embeds and formatting are all plugins, including the ones Meta writes.
**EditorState is immutable.** The editor holds a frozen snapshot. `editor.update()` clones it, applies the closure's changes, and reconciles the difference to the DOM — which is why a stale read outside a closure has no state to read and throws.
**A plugin is a React component.** It renders as a child of `<LexicalComposer>`, reaches the editor through `useLexicalComposerContext()`, and registers its commands, transforms and listeners in a `useEffect` that returns their unsubscribes. Many plugins render `null`.
**Commands are the bus.** Typed commands with priority-ordered listeners let one plugin intercept or augment another's behaviour without either knowing about the other.
**Content is typed nodes.** A new kind of content is a new node class, not a new attribute.
Lexical is pre-1.0, so a project that needs a frozen API surface should weigh that before adopting it. Weigh the node model too: a `DecoratorNode` is a real node in the tree, so it serializes and moves with the content around it. An editor whose requirement is a purely visual overlay — highlights or annotations that must never enter the saved document — is asking for something Lexical's decorators do not do.
</philosophy>
---
The official skills marketplace for Agents Inc. 150+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Repo: agents-inc/skills
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking, virtual keys, and production…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client patterns
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning, deployments, and training
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling, embeddings, image generation,…