LKSHY / WORKS

ThinkForge.

How do you let AI rewrite one scene without losing the rest of the script?

Product architecture & full-stack development at Insturix
Next.js · TipTap · MongoDB · Gemini

One script, two editors

A writer can move a scene while an AI assistant proposes a rewrite. If both replace the whole document, a small edit can overwrite unrelated work. I gave sections, scenes and prose stable IDs and mapped the TipTap selection back to those IDs.

Make each change reversible

I reduced edits to four operations. Before saving an AI batch, the server simulates the changes, checks the tree structure and limits edits to the permitted nodes. The batch and its inverse are recorded together, so a writer can undo a rewrite.

Keep the writer in control

I added generation locks, streaming updates and confirmation for destructive edits. The writer can follow a generation in progress and recover earlier versions through the operation log.

Discuss a build