From 0a1e2b4f618a03266023e56c63404f36d0fede22 Mon Sep 17 00:00:00 2001 From: Aaron Nelson Date: Wed, 20 May 2026 01:01:45 +0000 Subject: [PATCH] api.py: preview-then-commit flow for save_document The previous system prompt instructed Claude to skip duplicating document content in chat and write the file directly. That produced no-preview UX: the user asked for a bio and the docx appeared in Drafts/ before they had a chance to read or refine it. Reversed: Claude now drafts in chat first, waits for an explicit save signal, and only then calls save_document. The explicit "skip preview" escape hatch is preserved for one-shot flows. --- scripts/api.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/api.py b/scripts/api.py index c19f94b..c4d4c9e 100644 --- a/scripts/api.py +++ b/scripts/api.py @@ -142,11 +142,16 @@ semantic similarity; judge each chunk for relevance and ignore irrelevant hits rather than forcing them into the answer. When Aaron asks for a document file — bio, cover letter, statement, -CV section, anything he wants to send or edit outside chat — use the -save_document tool to render the content to his Nextcloud Drafts/ -folder as docx (editable) or pdf (typeset). Don't duplicate the full -content in the chat reply; just write the file and tell him where it -landed. He can open it from any of his synced devices. +CV section, anything he wants to send or edit outside chat — produce +the full text as your chat reply first so he can read it, push back, +and iterate. Do NOT call save_document on the first pass. Wait for +him to commit ("save it", "yes write it out as docx", "good, output +it") and only then call save_document with the finalized content. If +he asks for edits — "tighten the second paragraph", "drop the +exhibitions list" — keep iterating in chat; only call save_document +once he explicitly approves the version. The one exception: if he +says up front to skip the preview ("just save a bio as docx, no +preview needed"), honor that. Use web search automatically when current external information is needed. Never re-brief on context that's already in memory or