autosave-e-historico-de-versoes

Implements debounced autosave, snapshot versioning, and diff-based version restoration for editor documents.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires diff-match-patch, fast-diff.

What problem does it solve? Writers risk losing work when connections drop or when they need to recover an earlier draft. This Skill defines how to persist editor content automatically with debounce, buffer saves offline in IndexedDB, and maintain a restorable version history without duplicating storage. ## Core Features & Use Cases - Debounced Autosave: Sends document updates to PATCH /api/documents/:id only after 2 seconds of typing inactivity, with an IndexedDB offline queue that replays on reconnection. - Snapshot Versioning: Creates full snapshots every 10 minutes (capped at 50 per document) and stores compact diff-match-patch diffs between snapshots. - Version Restoration UI: A history panel lists versions with timestamps and previews, and restoring always snapshots the current state first so nothing is lost. - Use Case: A novelist loses Wi-Fi mid-chapter; edits queue in IndexedDB, sync on reconnection, and the next day they restore yesterday's version from the history panel in under 3 seconds. ## Quick Start Implement autosave with debounce and version history for the editor document following the autosave-e-historico-de-versoes skill.

Frequently Asked Questions about autosave-e-historico-de-versoes

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

FAQPage Schema
How do I implement autosave with debounce in a text editor?▼

Listen to the editor's update event and start a debounced timer of 2000ms. When the timer expires, serialize the document with editor.getJSON() and send it to PATCH /api/documents/:id in the background without blocking the UI.

How to save editor content when the user goes offline?▼

Store the serialized document JSON in an IndexedDB pending_saves store with doc_id, content_json, and timestamp. When navigator.onLine becomes true, replay the queue in chronological order and show a locally saved badge in the status bar.

diff-match-patch vs storing full snapshots for version history?▼

Use both together: store full snapshots every 10 minutes as restoration points, and store only diff-match-patch diffs between snapshots to compress history. Cap snapshots at 50 per document to bound storage growth.

When should I not use this autosave approach?▼

Do not use it for real-time CRDT collaboration, which belongs to a dedicated concurrency skill, or for full-account cloud backup, which is infrastructure scope. It targets single-document editor persistence and version history only.

Why does autosave overload the server with requests?▼

Sending a request per keystroke generates hundreds of requests per minute for active typists. A 2000ms debounce collapses typing bursts into one request per pause, and the offline IndexedDB buffer prevents data loss without extra server load.