# velt-rewriter-best-practices

> Claude/Codex skill by [@velt-js](https://omgskills.com/library/velt-js/index.md) · 0 stars · Updated 2026-06-24

Best practices for the Velt Rewriter — the AI text-rewriter feature that lets users select text and apply AI-generated rewrites or anchor AI-assisted comments. Use whenever the user is integrating the Velt Rewriter, calling enableRewriter/disableRewriter, subscribing to textSelected events, calling askAi (multi-provider AI generation auto-routed by model prefix across OpenAI/Anthropic/Gemini), calling replaceText to swap DOM text, calling addComment to anchor a Velt comment to a text range, toggling the default selection toolbar with enableDefaultUI/disableDefaultUI, building custom rewriter UI with the wireframe variables (componentConfig.\* on velt-rewriter-text-portal-wireframe / velt-rewriter-dialog-wireframe / velt-rewriter-bottom-sheet-wireframe), or typing against RewriterAskAiRequest / RewriterReplaceTextRequest / RewriterAddCommentRequest / AiModel. Trigger even if the user does not say 'Velt' explicitly — any mention of an AI text rewriter, in-place text replacement after AI generation, selection-toolbar AI prompt, or AI rewrite suggestions anchored to text ranges should pull this skill.

## Install

```sh
git clone https://github.com/velt-js/velt-plugin-cursor /tmp/velt-plugin-cursor && ln -s /tmp/velt-plugin-cursor/skills/velt-rewriter-best-practices ~/.claude/skills/velt-rewriter-best-practices
```

## From README

Velt Rewriter Best Practices Implementation guide for the Velt Rewriter — an AI text-rewriter primitive that lets users select text and apply AI-generated rewrites or anchor AI-assisted comments. Covers the full client-side pipeline (enableRewriter → on('textSelected') → askAi → replaceText / addComment), the default-toolbar toggle, AI model typing, and wireframe-driven custom UI. When to Apply Reference these guidelines when: Adding AI text-rewrite functionality to a React, Next.js, or web application Wiring the canonical Rewriter pipeline (enable → subscribe → generate → apply) Calling askAi and picking a model — Velt auto-routes the provider from the model prefix Replacing DOM text in-place after AI generation (replaceText) Anchoring AI suggestions as Velt comments on the selected text range (addComment) Controlling whether Velt's built-in selection toolbar shows (enableDefaultUI / disableDefaultUI) Building a custom Rewriter UI on top of the wireframe primitives (componentConfig.

## Links

- HTML page: https://omgskills.com/library/velt-js/velt-plugin-cursor/skills/velt-rewriter-best-practices/
- GitHub: https://github.com/velt-js/velt-plugin-cursor
- Author: [@velt-js](https://omgskills.com/library/velt-js/index.md)

## More from this repo

- [install-velt](https://omgskills.com/library/velt-js/velt-plugin-cursor/skills/install-velt/index.md) — Full guided installation of the Velt collaboration SDK into a React or Next.js project.
   - [@velt-js](https://omgskills.com/library/velt-js/index.md) · 0 stars
- [velt-activity-best-practices](https://omgskills.com/library/velt-js/velt-plugin-cursor/skills/velt-activity-best-practices/index.md) — Velt Activity Logs implementation patterns and best practices for React, Next.js, and web applications.
   - [@velt-js](https://omgskills.com/library/velt-js/index.md) · 0 stars
- [velt-approval-engine-best-practices](https://omgskills.com/library/velt-js/velt-plugin-cursor/skills/velt-approval-engine-best-practices/index.md) — Best practices for the Velt Approval Engine — the declarative workflow runtime for multi-step agent + human approval...
   - [@velt-js](https://omgskills.com/library/velt-js/index.md) · 0 stars
