Build a local writing app for long-form drafts where AI actions operate on the document itself rather than in a separate chat panel. Core loop: a two-pane Markdown editor (source left, rendered preview right) over a folder of .md files on disk. Three AI actions, each bound to a keyboard shortcut and each scoped differently: 1. Continue — takes the last 800 words before the cursor and drafts the next paragraph in the same voice, inserted inline as a suggestion the user accepts or rejects. 2. Rewrite selection — takes the highlighted passage plus a short instruction typed by the user ("tighter", "less formal", "cut by half") and returns a replacement shown as a word-level diff. 3. Critique — sends the whole document and returns structured feedback: where the argument is thin, which paragraphs repeat each other, which claims are asserted without support. Render it as a list anchored to line numbers, not as prose. Write a snapshot into a .history/ directory on every save so any past version can be diffed and restored from inside the app. Use Anthropic or OpenAI, whichever key is present in the environment. With no key configured the editor and the version history must still work completely; only the three AI actions are disabled, with a message saying why. Out of scope: multi-user editing, comment threads with replies, share links, and any hosted backend. This is a single-writer tool over local files.