Ghost Publishing Engine
A multi-brand AI publishing system. It found topics, wrote articles as three AI personas with distinct voices, scored its own drafts and published them to Ghost CMS on a schedule.
Built · its IP lives on in the Content Engine
The problem
A publication needs writers, editors, an SEO person and a publishing schedule. Working alone, I had none of them, and the obvious shortcut, one AI prompt writing generic articles, makes every article read the same. I wanted several distinct voices, automatic topic discovery, quality checks that reject AI slop, and posts that go out on schedule whether or not anyone is working.
What I built
A Python engine where every part takes a brand as its first input, and each brand is only data: its voice, personas, series formats and affiliate products are JSON files, with nothing hardcoded. Topics go into a queue, Claude writes each one as the persona it fits best, the draft passes a quality check, and the article publishes to Ghost CMS. I ran it all from a Flask dashboard, with no terminal. Seven launchd jobs kept it on schedule, from every five minutes to monthly.
The pipeline · from topic to published article
- ExtractPolymarket prediction markets · Google News RSS · a watched folder of transcripts → a SQLite queue of topics, each with its source
- RouteEach topic goes to the persona whose keywords match it best · fuzzy matching drops repeat topics
- WriteClaude, with each persona's own prompts · listicles, deep dives, opinion pieces · prompts for AI video
- GateClaude scores each draft 1–5 · a refusal detector catches replies where Claude declined to write, so they aren't published as articles · each persona has a list of banned AI phrases
- PublishGhost Admin API (JWT) · the persona as the author · SEO and affiliate links · at most 5 a day, in the best posting times
Tools and stack
Python · Claude API · Flask Dashboard · SQLite · Ghost Admin API (JWT) · launchd × 7 · Polymarket / RSS · YouTube API · OOP Multi-Brand
Key results
- Three personas with 20+ written rules each: a dry, observant skeptic; a Gen-Z conspiracy-questioner who knows philosophy; and a gentle naturalist who delights in dark nature facts. Their output was measurably different
- Quality checks in code: a refusal detector, a banned-phrase list for each persona ("here's the thing" is on it) and a self-score before anything publishes
- Brands as data: adding a second brand means adding a folder of JSON files, with no code changes
- Full test suite for the core, agents, extractors, destinations and dashboard, plus a dry-run mode on every automation script
- Reused in the Content Engine: its personas, its scoring and its brands-as-data design went into the recipe-based Content Engine
Challenges and lessons
The hard part was making the articles sound different from each other. Distinct voices took structure: keywords that steer each topic to a persona, lists of banned AI phrases, and example openings for each series so the model copies something specific. The second lesson: the method I wrote down outlasted the running system. When I later rebuilt content production as a recipe engine, this system's personas, scoring rubric and brands-as-data design carried over almost unchanged.