Tiptap — Agent skill
Guidance for coding agents working with the Tiptap rich text stack in this repository.
When to apply
Use this skill when:
- Editing or extending the shared rich text editor under
packages/ui/components/shadcn/rich-text-editor/
- Adding or upgrading
@tiptap/* packages
- Integrating Tiptap with Next.js App Router (SSR, client boundaries, hydration)
- Implementing collaboration, comments, tracked changes, conversion, Content AI, or Pro features
Do not use this skill when:
- The task is unrelated to rich text (e.g. plain
<textarea> or a different editor)
- You only need general React patterns (use
react-component-dev) or App Router structure (use nextjs-app-router)
This monorepo
- Shared editor implementation:
packages/ui/components/shadcn/rich-text-editor/ (editor.tsx, extensions.ts, toolbar.tsx)
- Primary dependencies:
packages/ui/package.json (@tiptap/react, @tiptap/starter-kit, extensions)
- Consumers: Apps import via
@asym/ui (deep imports); do not duplicate editor primitives inside apps/*
- Version alignment: Every package under
@tiptap/* in a given workspace should use the same semver line. The root package.json may also list @tiptap/* for app-level usage—keep versions consistent with packages/ui when you touch either
CLIs (Skills ecosystem + Tiptap)
This repo standardizes on Bun (bun, bunx). Prefer bunx for one-off CLIs; npx remains valid for the open Skills package manager.
| Purpose |
Command |
| Install / refresh the upstream Tiptap agent skill in another workspace |
npx skills add ueberdosis/tiptap |
| Tiptap project CLI (init, add UI pieces, cloud login) |
bunx @tiptap/cli@latest (or npx @tiptap/cli@latest) |
When running Tiptap CLI against this monorepo, set the working directory to the package that owns the editor (packages/ui) unless the CLI docs require the app root.
After changing this canonical skill under docs/ai/skills/tiptap/, run:
bun run skills:sync
Then commit updates under .cursor/skills/ and .agents/skills/ so CI (bun run skills:verify) stays green.
Best practices
General
- Target Tiptap 3 and follow the official installation guides when adding new surface area
- Align all
@tiptap/* versions in the workspace you modify
- In Tiptap 3,
StarterKit already includes Link and Underline; configure them through StarterKit.configure(...) before adding standalone extensions
- Pro extensions and private registry setup: see Tiptap docs (
pro-extensions guide)
Next.js and React
- For SSR / App Router, set
immediatelyRender: false on useEditor (already done in editor.tsx; preserve when refactoring)
- Prefer the React APIs documented in Tiptap (
useEditor, EditorContent, extensions)
- In 3.20+, import
BubbleMenu / FloatingMenu from @tiptap/react/menus
useEditor defaults shouldRerenderOnTransaction to false; use useEditorState for toolbars or other UI that depends on selection/active-state changes
- For read-only feeds, previews, or list items, prefer
@tiptap/static-renderer (renderToReactElement / renderToHTMLString) over mounting a read-only useEditor instance per item
Reference repositories (optional, for deep searches)
If you need to grep upstream source or docs locally, clone (or update) into a git-ignored folder such as .reference/ (see repo .gitignore):
Do not commit these clones.
Feature map (read upstream docs)
When implementing these capabilities, open the matching section in tiptap-docs (local clone or https://tiptap.dev/docs):
- Real-time collaboration →
collaboration/
- Comments →
comments/
- Tracked changes →
tracked-changes/
- Import / export (DOCX, PDF, Markdown, etc.) →
conversion/
- Content AI (toolkit, insert content, proofreader, server AI) →
content-ai/
- Version history / snapshot / compare →
collaboration/documents/
- Pages (print layout) →
pages/
Workflow
- Open
packages/ui/components/shadcn/rich-text-editor/* and trace how extensions and the toolbar map to the document schema
- For new behavior, check Tiptap docs for the correct extension or command API
- Add dependencies in
packages/ui (and align root @tiptap/* if those packages are also used at root)
- Keep
immediatelyRender: false for Next.js client editors
- Use
useEditorState for toolbar / bubble-menu state that depends on editor.isActive(...), editor.can(), or editor.getAttributes(...)
- Use
@tiptap/static-renderer for read-only rendering unless a live editor instance is explicitly required
- Run scoped checks:
bunx turbo run lint --filter=@asym/ui and bunx turbo run typecheck --filter=@asym/ui
Checklist
References
Common mistakes
- Omitting
immediatelyRender: false and breaking hydration in the App Router
- Mixing mismatched
@tiptap/* versions across packages
- Mounting a read-only editor in feeds or lists instead of using
@tiptap/static-renderer
- Reading
editor.isActive() directly in render without useEditorState, causing stale toolbar state
- Duplicating editor code in
apps/* instead of extending @asym/ui
1---2name: tiptap3description: Tiptap rich text editor for React and Next.js. Use when building or modifying rich text editors, @tiptap extensions, StarterKit, collaboration, comments, Content AI, import/export, or Pro extensions in this monorepo.4license: MIT5---67# Tiptap — Agent skill89Guidance for coding agents working with the **Tiptap** rich text stack in this repository.1011## When to apply1213Use this skill when:1415- Editing or extending the shared rich text editor under `packages/ui/components/shadcn/rich-text-editor/`16- Adding or upgrading `@tiptap/*` packages17- Integrating Tiptap with **Next.js App Router** (SSR, client boundaries, hydration)18- Implementing collaboration, comments, tracked changes, conversion, Content AI, or Pro features1920Do **not** use this skill when:2122- The task is unrelated to rich text (e.g. plain `<textarea>` or a different editor)23- You only need general React patterns (use `react-component-dev`) or App Router structure (use `nextjs-app-router`)2425## This monorepo2627- **Shared editor implementation:** `packages/ui/components/shadcn/rich-text-editor/` (`editor.tsx`, `extensions.ts`, `toolbar.tsx`)28- **Primary dependencies:** `packages/ui/package.json` (`@tiptap/react`, `@tiptap/starter-kit`, extensions)29- **Consumers:** Apps import via `@asym/ui` (deep imports); do not duplicate editor primitives inside `apps/*`30- **Version alignment:** Every package under `@tiptap/*` in a given workspace should use the **same semver line**. The root `package.json` may also list `@tiptap/*` for app-level usage—keep versions consistent with `packages/ui` when you touch either3132## CLIs (Skills ecosystem + Tiptap)3334This repo standardizes on **Bun** (`bun`, `bunx`). Prefer `bunx` for one-off CLIs; `npx` remains valid for the open **Skills** package manager.3536| Purpose | Command |37| -------------------------------------------------------------------------- | ------------------------------------------------------- |38| Install / refresh the **upstream** Tiptap agent skill in another workspace | `npx skills add ueberdosis/tiptap` |39| **Tiptap project CLI** (init, add UI pieces, cloud login) | `bunx @tiptap/cli@latest` (or `npx @tiptap/cli@latest`) |4041When running Tiptap CLI against this monorepo, set the working directory to the package that owns the editor (**`packages/ui`**) unless the CLI docs require the app root.4243After changing **this** canonical skill under `docs/ai/skills/tiptap/`, run:4445```bash46bun run skills:sync47```4849Then commit updates under `.cursor/skills/` and `.agents/skills/` so CI (`bun run skills:verify`) stays green.5051## Best practices5253### General5455- Target **Tiptap 3** and follow the official installation guides when adding new surface area56- Align **all** `@tiptap/*` versions in the workspace you modify57- In **Tiptap 3**, `StarterKit` already includes **Link** and **Underline**; configure them through `StarterKit.configure(...)` before adding standalone extensions58- **Pro extensions** and private registry setup: see Tiptap docs (`pro-extensions` guide)5960### Next.js and React6162- For SSR / App Router, set **`immediatelyRender: false`** on `useEditor` (already done in `editor.tsx`; preserve when refactoring)63- Prefer the **React** APIs documented in Tiptap (`useEditor`, `EditorContent`, extensions)64- In **3.20+**, import `BubbleMenu` / `FloatingMenu` from **`@tiptap/react/menus`**65- `useEditor` defaults `shouldRerenderOnTransaction` to **`false`**; use **`useEditorState`** for toolbars or other UI that depends on selection/active-state changes66- For read-only feeds, previews, or list items, prefer **`@tiptap/static-renderer`** (`renderToReactElement` / `renderToHTMLString`) over mounting a read-only `useEditor` instance per item6768### Reference repositories (optional, for deep searches)6970If you need to grep upstream source or docs locally, clone (or update) into a **git-ignored** folder such as `.reference/` (see repo `.gitignore`):7172- https://github.com/ueberdosis/tiptap73- https://github.com/ueberdosis/tiptap-docs7475Do not commit these clones.7677## Feature map (read upstream docs)7879When implementing these capabilities, open the matching section in **tiptap-docs** (local clone or https://tiptap.dev/docs):8081- Real-time collaboration → `collaboration/`82- Comments → `comments/`83- Tracked changes → `tracked-changes/`84- Import / export (DOCX, PDF, Markdown, etc.) → `conversion/`85- Content AI (toolkit, insert content, proofreader, server AI) → `content-ai/`86- Version history / snapshot / compare → `collaboration/documents/`87- Pages (print layout) → `pages/`8889## Workflow90911. Open `packages/ui/components/shadcn/rich-text-editor/*` and trace how `extensions` and the toolbar map to the document schema922. For new behavior, check Tiptap docs for the correct extension or command API933. Add dependencies in `packages/ui` (and align root `@tiptap/*` if those packages are also used at root)944. Keep `immediatelyRender: false` for Next.js client editors955. Use `useEditorState` for toolbar / bubble-menu state that depends on `editor.isActive(...)`, `editor.can()`, or `editor.getAttributes(...)`966. Use `@tiptap/static-renderer` for read-only rendering unless a live editor instance is explicitly required977. Run scoped checks: `bunx turbo run lint --filter=@asym/ui` and `bunx turbo run typecheck --filter=@asym/ui`9899## Checklist100101- [ ] Changes live in `packages/ui` unless an app-only integration is explicitly required102- [ ] All `@tiptap/*` versions aligned in touched workspaces103- [ ] Next.js editor options safe for SSR (`immediatelyRender: false` where applicable)104- [ ] Toolbar / active-state UI uses `useEditorState` when it must track selection or mark changes105- [ ] Read-only rendering uses `@tiptap/static-renderer` unless a live editor is truly needed106- [ ] Toolbar/commands and schema stay consistent (no orphaned marks/nodes)107- [ ] Lint and typecheck pass for `@asym/ui`108109## References110111- `references/upstream.md` — attribution and refresh instructions112- Official agent skill page: https://tiptap.dev/docs/resources/agent-skill113114## Common mistakes115116- Omitting `immediatelyRender: false` and breaking hydration in the App Router117- Mixing mismatched `@tiptap/*` versions across packages118- Mounting a read-only editor in feeds or lists instead of using `@tiptap/static-renderer`119- Reading `editor.isActive()` directly in render without `useEditorState`, causing stale toolbar state120- Duplicating editor code in `apps/*` instead of extending `@asym/ui`