desfazer-refazer-colaborativo-seletivo

Implements distributed per-client undo/redo for selective rollback of AI-generated text in collaborative editors.

Updated Jul 19, 2026
One-click install
npx skills add https://github.com/Ryanzucchi/Eldritch_Lich --skill desfazer-refazer-colaborativo-seletivo-ryanzucchi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: desfazer-refazer-colaborativo-seletivo
Source: https://github.com/Ryanzucchi/Eldritch_Lich/tree/main/.agents/skills/desfazer-refazer-colaborativo-seletivo
Command: npx skills add https://github.com/Ryanzucchi/Eldritch_Lich --skill desfazer-refazer-colaborativo-seletivo-ryanzucchi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? In collaborative writing sessions, a global undo stack causes one author's Ctrl+Z to revert another co-author's live edits, and there is no clean way to reject AI-generated suggestions without destroying surrounding human text. This Skill implements distributed undo/redo so each writer only reverts their own edits or selectively rolls back AI-inserted blocks. ## Core Features & Use Cases - Per-Client Undo Stacks: Each client maintains its own local transaction log keyed by character IDs and vector clocks, so Ctrl+Z never touches other collaborators' concurrent edits. - Counter-Operation Generation: Undo produces explicit CRDT delete/re-insert operations targeting exact character IDs, propagated as normal network changes. - Selective AI Rollback: Transactions tagged as AI-generated can be reverted independently while preserving concurrent human edits. - Use Case: A writer accepts an AI copilot suggestion mid-paragraph, keeps typing, then clicks "Reject AI Suggestion" — only the AI text disappears, leaving the human sentences intact. ## Quick Start Ask the assistant to implement per-client distributed undo/redo with selective AI-block rollback in the Yjs-based collaborative editor following this skill's step-by-step process.

Frequently Asked Questions about desfazer-refazer-colaborativo-seletivo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement undo/redo in a collaborative CRDT editor?▼

Maintain a separate undo stack per client that logs local transactions with affected character IDs and vector clocks. On undo, generate an explicit counter-operation (delete inserted IDs or re-insert deleted IDs) and propagate it as a normal CRDT change rather than moving a global history pointer.

How to selectively undo AI-generated text in a shared document?▼

Tag AI-inserted transactions with an author-type metadata label such as AI_CO_WRITER. When the writer rejects a suggestion, scan the transaction log and issue counter-operations only against the character IDs of that AI block, preserving concurrent human edits.

Why does Ctrl+Z revert my collaborator's text in shared editors?▼

This happens when the editor uses a single global undo stack on the server, so the last operation undone belongs to whoever typed most recently. The fix is isolating undo queues per client replica so each user's Ctrl+Z only affects their own client_id operations.

Does Yjs support per-user undo out of the box?▼

Yes, the Yjs UndoManager tracks local-origin transactions and can serve as the v1 fallback for linear per-client undo. Selective non-linear rollback of arbitrary AI blocks requires the custom counter-operation approach described in this skill.

What are the limitations of distributed selective undo?▼

Re-inserting deleted text while preserving original character IDs can cause complex interleaving behavior in late merges. The skill recommends falling back to simple linear local undo for v1 and notes it should not be used for LGPD permanent deletion or full-chapter version restores.