<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ePOST</title>
    <description>The latest articles on DEV Community by ePOST (@etpost).</description>
    <link>https://dev.to/etpost</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3847822%2F0cf6b06b-cbea-4c3a-b346-083ccb45eb38.png</url>
      <title>DEV Community: ePOST</title>
      <link>https://dev.to/etpost</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/etpost"/>
    <language>en</language>
    <item>
      <title>RitualFlow: I Built an AI Habit Engine That Generates Personalized Notion Pages Every Day</title>
      <dc:creator>ePOST</dc:creator>
      <pubDate>Sat, 28 Mar 2026 15:06:15 +0000</pubDate>
      <link>https://dev.to/etpost/ritualflow-i-built-an-ai-habit-engine-that-generates-personalized-notion-pages-every-day-4j54</link>
      <guid>https://dev.to/etpost/ritualflow-i-built-an-ai-habit-engine-that-generates-personalized-notion-pages-every-day-4j54</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/notion-2026-03-04"&gt;Notion MCP Challenge&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Ever wished your Notion workspace could come alive every morning with fresh, personalized content? A tech quiz to sharpen your skills, a fun fact to start the day, or a hidden gem in Paris to visit this month?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RitualFlow&lt;/strong&gt; is a CLI tool that turns Notion into an automated habit engine. You define habits in a Notion database — each with a frequency (daily, weekly, monthly) and an AI prompt — and RitualFlow generates rich, personalized content pages automatically using Claude.&lt;/p&gt;

&lt;p&gt;Think of it as a &lt;strong&gt;personal content assistant&lt;/strong&gt; that reads your Notion config, generates AI content with web search capabilities, and writes beautifully formatted pages back into Notion — with deduplication, progress tracking, and a live dashboard.&lt;/p&gt;

&lt;h3&gt;
  
  
  What it actually does
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Reads&lt;/strong&gt; your habit definitions from a Notion database (name, frequency, prompt, category)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generates&lt;/strong&gt; AI content using Claude (Anthropic API or Claude Code CLI fallback) with web search for up-to-date information&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Writes&lt;/strong&gt; rich Notion pages with proper formatting (headings, bullets, toggles for quiz answers, quotes, code blocks)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tracks&lt;/strong&gt; everything — live stats callout, per-habit history, period-aware deduplication&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Key features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Full CLI&lt;/strong&gt;: &lt;code&gt;setup&lt;/code&gt;, &lt;code&gt;run&lt;/code&gt;, &lt;code&gt;add&lt;/code&gt;, &lt;code&gt;delete&lt;/code&gt;, &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;history&lt;/code&gt; — manage everything from the terminal&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart deduplication&lt;/strong&gt;: daily pages keyed by date, weekly by week number, monthly by month — never generates duplicates&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rich Notion output&lt;/strong&gt;: markdown-to-Notion block conversion with headings, bullets, numbered lists, toggles, blockquotes, bold/italic/code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live dashboard&lt;/strong&gt;: a stats callout on your main page updates after each run ("This week: 3 generated | Total: 12 generated")&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Link feed&lt;/strong&gt;: newest generated pages appear as links on your main RitualFlow page&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API + CLI fallback&lt;/strong&gt;: uses Anthropic API if available, seamlessly falls back to Claude Code CLI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web search&lt;/strong&gt;: generated content uses live web data (tech news, real places, current facts)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Built-in templates&lt;/strong&gt;: tech quiz with toggle answers, fun facts, Paris discovery, weekly tech digest&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Actions&lt;/strong&gt;: fully automated scheduling — daily at 8 AM, weekly on Mondays, monthly on the 1st&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom prompts&lt;/strong&gt;: define any prompt you want — RitualFlow is not limited to built-in templates&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/f6GQH1vAb24"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Show us the Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/et-POST" rel="noopener noreferrer"&gt;
        et-POST
      &lt;/a&gt; / &lt;a href="https://github.com/et-POST/ritualflow" rel="noopener noreferrer"&gt;
        ritualflow
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      AI-powered habit automation for Notion — define habits, generate personalized content with Claude, and track everything in a beautiful Notion dashboard. Built for the Notion MCP Challenge.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;RitualFlow&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;AI-powered habit automation for Notion&lt;/strong&gt; — automatically generate personalized content (quizzes, digests, discoveries...) based on habits you define in a Notion database.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/ad1338116477c204094b7d65b1f8b62156f0dfca05c584a0a305abf4df36bdd1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d332e31312b2d626c7565"&gt;&lt;img src="https://camo.githubusercontent.com/ad1338116477c204094b7d65b1f8b62156f0dfca05c584a0a305abf4df36bdd1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f707974686f6e2d332e31312b2d626c7565" alt="Python 3.11+"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/42876bfb687dd2c62a96a6b2e6a4ed336b78263e9223953bed107d6f9ae01543/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4e6f74696f6e2d4150492d626c61636b"&gt;&lt;img src="https://camo.githubusercontent.com/42876bfb687dd2c62a96a6b2e6a4ed336b78263e9223953bed107d6f9ae01543/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4e6f74696f6e2d4150492d626c61636b" alt="Notion API"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/7308dbf66b44555ccdde58686bc0f8d66cec895d65dc0ad798cbd6aebdb830c1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436c617564652d41492d6f72616e6765"&gt;&lt;img src="https://camo.githubusercontent.com/7308dbf66b44555ccdde58686bc0f8d66cec895d65dc0ad798cbd6aebdb830c1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f436c617564652d41492d6f72616e6765" alt="Claude AI"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How it works&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;[Notion DB: Habits] --&amp;gt; [RitualFlow CLI] --&amp;gt; [Notion: Generated Pages]
                             |      |
                      Anthropic API  Notion API
                      (generation)   (read/write)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Define habits&lt;/strong&gt; in a Notion database — each with a name, frequency, prompt, and category&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run RitualFlow&lt;/strong&gt; — it reads your habits, generates AI content via Claude, and writes rich Notion pages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Track progress&lt;/strong&gt; — a live stats callout on your Notion page shows weekly and all-time generation counts&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Generated pages are stored as child pages under each habit, with automatic deduplication and a link feed on your main page.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Smart content generation&lt;/strong&gt; — custom prompts or built-in templates (tech quiz, fun facts, place discovery, weekly digest)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multiple frequencies&lt;/strong&gt; — daily, weekly, monthly habits with period-aware deduplication&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anthropic API + CLI fallback&lt;/strong&gt; — uses the…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/et-POST/ritualflow" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Notion DB: Habits] --&amp;gt; [RitualFlow CLI] --&amp;gt; [Notion: Generated Pages]
                             |      |
                      Anthropic API  Notion API
                      (generation)   (read/write)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The project is structured as a clean Python package:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cli.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Click-based CLI with 6 commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;habits.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reads habit config from Notion DB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;generator.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;AI content generation (API + CLI fallback)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;writer.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates rich Notion pages with markdown conversion&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dashboard.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Live stats callout management&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;setup_notion.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;One-command Notion workspace setup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;templates.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Built-in prompt templates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;utils.py&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Direct Notion API calls via httpx&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  The workflow in 4 commands
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Setup — creates database + stats block in Notion&lt;/span&gt;
ritualflow setup

&lt;span class="c"&gt;# 2. Add habits&lt;/span&gt;
ritualflow add &lt;span class="s2"&gt;"Daily Tech Quiz"&lt;/span&gt; &lt;span class="nt"&gt;--freq&lt;/span&gt; daily &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--prompt&lt;/span&gt; &lt;span class="s2"&gt;"Generate a 5-question quiz on a random programming topic"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--category&lt;/span&gt; tech

ritualflow add &lt;span class="s2"&gt;"Paris Discovery"&lt;/span&gt; &lt;span class="nt"&gt;--freq&lt;/span&gt; monthly &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--prompt&lt;/span&gt; &lt;span class="s2"&gt;"Suggest an interesting place to discover in Paris"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--category&lt;/span&gt; wellness

&lt;span class="c"&gt;# 3. Run — generates content for all active habits&lt;/span&gt;
ritualflow run

&lt;span class="c"&gt;# 4. Check status&lt;/span&gt;
ritualflow status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Notion output structure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RitualFlow Page
├── [Stats Callout]  "This week: 3 generated | Total: 12 generated"
├── [Link] Daily Tech Quiz – 28 mars 2026
├── [Link] Paris Discovery – Mars 2026
└── RitualFlow - Habits (database)
    ├── Daily Tech Quiz (active, daily)
    │   ├── Daily Tech Quiz – 28 mars 2026
    │   └── Daily Tech Quiz – 27 mars 2026
    └── Paris Discovery (active, monthly)
        └── Paris Discovery – Mars 2026
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How I Used Notion MCP
&lt;/h2&gt;

&lt;p&gt;Notion MCP is at the core of RitualFlow — it's both the &lt;strong&gt;input&lt;/strong&gt; and the &lt;strong&gt;output&lt;/strong&gt; of the entire workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reading: Notion as the configuration layer
&lt;/h3&gt;

&lt;p&gt;The habits database is the single source of truth. Users configure everything in Notion — habit names, frequencies, AI prompts, categories, active/inactive toggles. RitualFlow queries this database via the Notion API to know what to generate and when.&lt;/p&gt;

&lt;p&gt;This means &lt;strong&gt;users never touch config files or code&lt;/strong&gt; to customize their habits. They just edit a Notion database row.&lt;/p&gt;

&lt;h3&gt;
  
  
  Writing: Notion as the content destination
&lt;/h3&gt;

&lt;p&gt;Generated content is written as rich child pages under each habit row. The markdown-to-Notion block conversion handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Headings&lt;/strong&gt; (h1/h2/h3) for structure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Toggle blocks&lt;/strong&gt; from &lt;code&gt;&amp;lt;details&amp;gt;/&amp;lt;summary&amp;gt;&lt;/code&gt; for quiz answers&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bulleted and numbered lists&lt;/strong&gt; for key points&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Blockquotes&lt;/strong&gt; for callouts and quotes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inline formatting&lt;/strong&gt; (bold, italic, code) for emphasis&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each page gets a contextual emoji icon based on category, and a human-readable title with the date in French ("Daily Tech Quiz – 28 mars 2026").&lt;/p&gt;

&lt;h3&gt;
  
  
  Dashboard: Notion as the tracking layer
&lt;/h3&gt;

&lt;p&gt;After each run, RitualFlow updates a stats callout block on the main page with weekly and all-time generation counts. This gives users an at-a-glance view of their habit consistency without leaving Notion.&lt;/p&gt;

&lt;p&gt;A link feed on the main page surfaces the most recent generated pages — newest first, right below the stats.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Notion MCP unlocks
&lt;/h3&gt;

&lt;p&gt;The key insight: &lt;strong&gt;Notion becomes the entire application interface&lt;/strong&gt;. There's no separate UI, no web app, no dashboard to build. Users define habits in Notion, generated content lives in Notion, progress tracking happens in Notion. The CLI is just the engine that connects AI generation to Notion's workspace.&lt;/p&gt;

&lt;p&gt;This makes RitualFlow instantly familiar to any Notion user — no learning curve beyond adding a row to a database.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Tech stack&lt;/strong&gt;: Python 3.11+, Anthropic SDK, notion-client + httpx, Click, python-dotenv&lt;/p&gt;

</description>
      <category>notionchallenge</category>
      <category>mcp</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
