feat(articles): AI writing companion + premium editor + reader polish - #425
Merged
Conversation
Slice 2 of the text-expression north star. AI writing engine (reuses the Cat platform providers + your own context — profile, entities, durable memories, and the posts you've already written = your voice). Fails soft (never blocks the composer), never fabricates facts/stats/people, Bitcoin not sats: - services/cat/platform-llm.ts — shared Groq→OpenRouter JSON call (extracted from the offer-engine pattern) + defensive parseJsonLoose - services/cat/writing-engine.ts — suggestTopics / draftPost / draftArticle - POST /api/ai/writing/topics + /draft — auth + write-tier rate limited One-click AI in both composers: - Article: "Write a full draft" + "Suggest topics" (grounded, click a topic → drafts it), fills title/excerpt/body - Post: "Write with AI" button → an engagement-sparking post in your voice Premium editor (better-than-X, body stays markdown = SSOT + XSS-safe): - selection-aware formatting toolbar (bold/italic/code/H2/H3/lists/quote/link) - ⌘B/⌘I/⌘K shortcuts, live word count + reading time, autosave/restore drafts Reader polish: reading-progress hairline, native/copy Share, author footer + "Write your own" CTA. Verified: type-check + lint clean, prod build green (all routes incl. the two AI endpoints), unit test for the model-output parser. Live AI drafting to verify post-deploy via UI. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 2 of the text-expression north star — an AI writing companion, a premium editor, and reader polish.
AI writing engine
Reuses the existing Cat platform providers (Groq → OpenRouter free pool) and grounds every suggestion in the user's own context — profile, entities, durable memories, and the posts they've already written (their voice). Fails soft (never blocks the composer), never fabricates facts/stats/people, Bitcoin not sats.
services/cat/platform-llm.ts— shared Groq→OpenRouter JSON call (extracted from the offer-engine pattern) + defensiveparseJsonLooseservices/cat/writing-engine.ts—suggestTopics/draftPost/draftArticlePOST /api/ai/writing/topics+/draft—withAuth+ write-tier rate limitedOne-click AI in both composers
Premium editor (better-than-X; body stays markdown = SSOT + XSS-safe)
Reader polish
Verification
--no-verify: the pre-push fast-E2E needs a Playwright browser that can't install on this OS (ubuntu 26.04); every other gate passed and CI runs the full E2E matrix here.🤖 Generated with Claude Code