<?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: Oleksandr Gamanyuk</title>
    <description>The latest articles on DEV Community by Oleksandr Gamanyuk (@ogamaniuk).</description>
    <link>https://dev.to/ogamaniuk</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F311650%2F7cf393c0-3395-43c9-89c5-dda4e9118a72.png</url>
      <title>DEV Community: Oleksandr Gamanyuk</title>
      <link>https://dev.to/ogamaniuk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ogamaniuk"/>
    <language>en</language>
    <item>
      <title>Running a free AI app without going broke: dollars per call, a daily budget and per-IP limits</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Mon, 16 Nov 2026 16:00:00 +0000</pubDate>
      <link>https://dev.to/misterblocks/running-a-free-ai-app-without-going-broke-dollars-per-call-a-daily-budget-and-per-ip-limits-484</link>
      <guid>https://dev.to/misterblocks/running-a-free-ai-app-without-going-broke-dollars-per-call-a-daily-budget-and-per-ip-limits-484</guid>
      <description>&lt;p&gt;&lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;Mister Blocks&lt;/a&gt; is free, needs no account, and every build is a few minutes of Claude Opus thinking about bricks. That's a couple of dollars a build. Put that on the open internet and one bored person with a script can spend your month's budget before lunch.&lt;/p&gt;

&lt;p&gt;Here is the plumbing that keeps it free &lt;em&gt;and&lt;/em&gt; affordable. None of it is clever, but all of it was needed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/amazon-delivery-van-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9atgbln7mv7li5fdq8i6.jpg" alt="Amazon delivery van as a white and blue brick model on a wooden table" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Amazon Delivery Van: 102 pieces, 11 steps. More &lt;a href="https://misterblocks.com/builds/trucks" rel="noopener noreferrer"&gt;LEGO trucks&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Log every call, in dollars
&lt;/h2&gt;

&lt;p&gt;Every Claude call goes through one function, and every call writes one row to MongoDB: which run, which step, the model, input and output tokens, cache reads and writes, &lt;strong&gt;the cost in USD&lt;/strong&gt;, and how many seconds it took.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;PRICE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cacheRead&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cacheWrite&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// USD per million tokens&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;usd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;input_tokens&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;PRICE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;output_tokens&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;PRICE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;output&lt;/span&gt;
  &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cache_read_input_tokens&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;PRICE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cacheRead&lt;/span&gt;
  &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cache_creation_input_tokens&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="no"&gt;PRICE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cacheWrite&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;1e6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details that matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The row is written &lt;strong&gt;before&lt;/strong&gt; checking whether the call was refused or cut off. A failed call still costs money, so it still counts.&lt;/li&gt;
&lt;li&gt;A database error is logged and ignored. Accounting must never be the reason a build fails.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A small admin endpoint shows tokens and dollars for one run, for today and for all time. That's how I know a build costs "a couple of dollars" rather than guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. A site-wide daily budget, checked first
&lt;/h2&gt;

&lt;p&gt;With every call in dollars, a budget is one query: sum &lt;code&gt;usd&lt;/code&gt; since midnight UTC. Before any expensive action, that's checked against &lt;code&gt;DAILY_BUDGET_USD&lt;/code&gt; (25 by default). If it's spent, the site says so plainly ("Mister Blocks has used up today's building budget. Please come back tomorrow.") and the 3D guides keep working, since they cost nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Per-visitor limits, without accounts
&lt;/h2&gt;

&lt;p&gt;Then a per-visitor counter: one Mongo document per &lt;code&gt;kind|ip|date&lt;/code&gt;, incremented with an upsert. The limits:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;th&gt;Per IP per day&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;New build from a photo&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New build from an idea&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chat messages&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each limit has its own human message ("You can start 5 new builds a day. Try again tomorrow, or keep chatting in a build you already started."), returned with HTTP 429.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/coco-2-delivery-robot-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9drfahu7ydx3u4d0na4q.jpg" alt="Coco 2 delivery robot as a pink and white brick robot on wheels" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Coco 2 delivery robot: 61 pieces, 10 steps. More &lt;a href="https://misterblocks.com/builds/robots" rel="noopener noreferrer"&gt;robot builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Knowing the visitor's real IP
&lt;/h2&gt;

&lt;p&gt;Per-IP limits only work if you know the IP. The site runs on Vercel, but &lt;code&gt;misterblocks.com&lt;/code&gt; is served through a &lt;strong&gt;Cloudflare Worker&lt;/strong&gt; that forwards to Vercel (the domain's DNS lives in a Cloudflare zone, and a Worker custom domain was the cleanest way in).&lt;/p&gt;

&lt;p&gt;That means Vercel sees Cloudflare's IP, not the visitor's. So the Worker adds two headers: the visitor's IP from &lt;code&gt;cf-connecting-ip&lt;/code&gt;, and a shared secret. The site trusts the IP header &lt;strong&gt;only when the secret matches&lt;/strong&gt;; otherwise it falls back to &lt;code&gt;x-forwarded-for&lt;/code&gt;. Without the secret check, anyone could send a fake IP header and get unlimited builds.&lt;/p&gt;

&lt;p&gt;The same Worker redirects &lt;code&gt;www&lt;/code&gt; to the bare domain and rewrites any redirect that names the Vercel address. Old &lt;code&gt;*.vercel.app&lt;/code&gt; names get a permanent redirect to &lt;code&gt;misterblocks.com&lt;/code&gt;, except for requests that came from the Worker itself, which would otherwise loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Spend tokens where they matter
&lt;/h2&gt;

&lt;p&gt;Not every call needs the same effort:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Call&lt;/th&gt;
&lt;th&gt;Effort&lt;/th&gt;
&lt;th&gt;Max tokens&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Reading the photo of your pieces&lt;/td&gt;
&lt;td&gt;high&lt;/td&gt;
&lt;td&gt;64,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Designing a model&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;24,000 (photo) / 64,000 (idea)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fixing reported problems&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;32,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Translating a build&lt;/td&gt;
&lt;td&gt;medium&lt;/td&gt;
&lt;td&gt;32,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tagging categories for SEO&lt;/td&gt;
&lt;td&gt;low&lt;/td&gt;
&lt;td&gt;2,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Recognising pieces in a messy photo is where mistakes are most expensive, so it gets the most thinking. Picking two category tags gets almost none.&lt;/p&gt;

&lt;p&gt;Other habits that keep the bill down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Structured output&lt;/strong&gt; (a JSON schema on every call), so there's no retry because the answer didn't parse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt caching&lt;/strong&gt; on the long, fixed system prompt of the idea designer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Patches, not rewrites.&lt;/strong&gt; When the stud checker finds problems, the model answers with a patch (remove these pieces, add these) instead of the whole model again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A deadline.&lt;/strong&gt; The photo designer gets up to three rounds, but a new round only starts if it's still under 170 seconds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server-side fallback&lt;/strong&gt;: if the model declines, the API falls back to another model instead of failing the whole build.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/pancake-chef-robot-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fir1yf11aczm8vyfqhc8w.jpg" alt="Pancake chef robot as a white brick robot at a stove" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Pancake Chef Robot: 142 pieces, 20 steps.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Long jobs without long requests
&lt;/h2&gt;

&lt;p&gt;An idea build can take ten minutes. The request that starts it answers right away; the work continues with &lt;code&gt;waitUntil&lt;/code&gt; and writes its progress onto the build document (throttled to one write per 1.2 seconds). The page polls a tiny, uncached endpoint every 2 seconds. If a job stops reporting for 150 seconds, it's shown as failed with a retry button, rather than a progress bar that never moves.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it costs to look
&lt;/h2&gt;

&lt;p&gt;The 3D guides, the printable booklets and the PDFs cost nothing per visit: the models are stored, the pictures are drawn in your browser, and the files sit in Cloudflare R2 with a one-year cache. Only &lt;em&gt;making&lt;/em&gt; something new costs money. That's why the limits only apply there.&lt;/p&gt;

&lt;p&gt;Browse the free guides as much as you like: &lt;a href="https://misterblocks.com/builds/robots" rel="noopener noreferrer"&gt;robots&lt;/a&gt;, &lt;a href="https://misterblocks.com/builds/trucks" rel="noopener noreferrer"&gt;trucks&lt;/a&gt;, &lt;a href="https://misterblocks.com/builds/easy" rel="noopener noreferrer"&gt;easy builds&lt;/a&gt;, or &lt;a href="https://misterblocks.com/lego-build-ideas" rel="noopener noreferrer"&gt;LEGO build ideas&lt;/a&gt;. And when you want your own, snap your bricks at &lt;strong&gt;&lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;misterblocks.com&lt;/a&gt;&lt;/strong&gt;, which works like a &lt;a href="https://misterblocks.com/lego-scanner-app" rel="noopener noreferrer"&gt;LEGO scanner app&lt;/a&gt; with no install.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/hover-courier-drone-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd504uzgtxk9m1dobqapa.jpg" alt="Hover courier drone as a brick quadcopter on a landing pad" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Unofficial fan builds. LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this site.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>serverless</category>
      <category>cloudflare</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Printable LEGO instructions from a three.js viewer: cqw units, headless Edge and a page count</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Sun, 15 Nov 2026 16:00:00 +0000</pubDate>
      <link>https://dev.to/misterblocks/printable-lego-instructions-from-a-threejs-viewer-cqw-units-headless-edge-and-a-page-count-5bbh</link>
      <guid>https://dev.to/misterblocks/printable-lego-instructions-from-a-threejs-viewer-cqw-units-headless-edge-and-a-page-count-5bbh</guid>
      <description>&lt;p&gt;A 3D viewer is great on a laptop. On the living-room floor, with a kid and a pile of bricks, you want paper. So every guide on &lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;Mister Blocks&lt;/a&gt; prints as a real instruction booklet, comes as a PDF, and works offline once you've opened it.&lt;/p&gt;

&lt;p&gt;This is how that works, with no PDF library and no server-side rendering of 3D.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0vizbb3l4wmsdwfdov91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0vizbb3l4wmsdwfdov91.png" alt="Page 6 of the printed booklet for the Ladder 9 Fire Engine: a big step number, a blue box with the pieces needed, and the model so far" width="800" height="608"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The booklet is just a web page
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;/builds/&amp;lt;name&amp;gt;-lego-build/print&lt;/code&gt; lays the guide out like a LEGO booklet: a cover, &lt;strong&gt;one step per page&lt;/strong&gt; (the number, a blue box of the pieces it needs, what to do, and the model so far as big as the page allows), then the parts list.&lt;/p&gt;

&lt;p&gt;The trick that makes it look the same on screen and on paper: everything inside a page is sized in &lt;strong&gt;&lt;code&gt;cqw&lt;/code&gt;&lt;/strong&gt;, 1% of the sheet's width (CSS container query units). The sheet on screen and the sheet in the print dialog are the same shape, so the text and pictures land in the same places.&lt;/p&gt;

&lt;p&gt;Paper size is a toggle. US Letter landscape is the default and A4 is one click away. The toggle swaps an &lt;code&gt;@page&lt;/code&gt; rule and a class on &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;, and remembers your choice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/ladder-9-fire-engine-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjldj5in9igsc24rkqhvi.jpg" alt="The Ladder 9 Fire Engine as a red six-wheel brick model with a silver ladder" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Ladder 9 Fire Engine: 127 pieces, 15 steps, 18 printed pages. More &lt;a href="https://misterblocks.com/builds/trucks" rel="noopener noreferrer"&gt;LEGO trucks&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Every picture is drawn in your browser
&lt;/h2&gt;

&lt;p&gt;There are no stored step images. The print page runs the same three.js viewer off screen and takes snapshots:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The cover&lt;/strong&gt;: the finished model in its own lighting, framed a little wider than tight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Each step&lt;/strong&gt;: the model so far, on white, framed on &lt;em&gt;what's built so far&lt;/em&gt;. The camera is never closer than 60% of the distance that fits the whole model, so step 1 (four plates) doesn't fill the page like a close-up. Then the white edges are cropped off.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Each kind of piece&lt;/strong&gt;: drawn on its own, &lt;strong&gt;all from the same camera distance&lt;/strong&gt;, so a 1×1 plate looks small next to a 2×4 brick, just like in a real booklet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Wheels are the exception: they're drawn flat in 2D, because the viewer can't draw a wheel without the plate it sits on.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fotwx2cuc1ra5aswuj0qa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fotwx2cuc1ra5aswuj0qa.png" alt="The cover page of the printed booklet with the piece, step and parts counts" width="800" height="608"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  PDFs: headless Edge and a page count
&lt;/h2&gt;

&lt;p&gt;A PDF is the print page printed by &lt;strong&gt;headless Edge&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;msedge --headless=new --no-pdf-header-footer --virtual-time-budget=&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;ms&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --print-to-pdf=out.pdf &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;url&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;?paper=a4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The time budget grows with the model (40 s plus a bit per piece and per step), because a 1,400-piece sculpture takes a while to draw 120 times.&lt;/p&gt;

&lt;p&gt;Before anything is uploaded, the script &lt;strong&gt;counts the pages in the PDF&lt;/strong&gt;: it should be 1 cover + 1 page per step + 1 page per 40 kinds of piece. If the count is off, a picture didn't finish drawing, so that PDF is skipped instead of shipping a booklet with a blank step. Good ones go to Cloudflare R2, Letter and A4, in English and Ukrainian, and only get redone when the guide changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/sky-hook-tower-crane-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi5qoes5ucy41vrsvov2n.jpg" alt="Sky Hook tower crane as a yellow brick crane lifting a blue load" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Sky Hook Tower Crane: 112 pieces, 12 steps. One of the &lt;a href="https://misterblocks.com/builds/easy" rel="noopener noreferrer"&gt;easy builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Offline: guides you've opened keep working
&lt;/h2&gt;

&lt;p&gt;The site is a PWA. The service worker uses a different strategy per kind of request:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Request&lt;/th&gt;
&lt;th&gt;Strategy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pages&lt;/td&gt;
&lt;td&gt;network first; the saved copy if offline &lt;strong&gt;or after 4 s with no answer&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A build's data&lt;/td&gt;
&lt;td&gt;network first, saved copy offline: a guide opened once works offline&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;/app.js?v=&amp;lt;deploy&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;cache first (that address never changes)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;three.js, fonts&lt;/td&gt;
&lt;td&gt;cache first, but only CORS responses (opaque ones can cost ~7 MB of quota each)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New designs, chat&lt;/td&gt;
&lt;td&gt;network only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you open a page that isn't saved, the offline page lists the guides that &lt;em&gt;are&lt;/em&gt;, newest first, titled from their cached pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug that taught me to version everything
&lt;/h2&gt;

&lt;p&gt;One morning a fan build wouldn't open on my phone. The page was new, but the phone still had yesterday's &lt;code&gt;build.js&lt;/code&gt; cached (Cloudflare's browser cache keeps it for hours), and yesterday's script didn't know the new &lt;code&gt;/builds/&amp;lt;name&amp;gt;&lt;/code&gt; addresses.&lt;/p&gt;

&lt;p&gt;Now every script and stylesheet is linked as &lt;code&gt;/&amp;lt;file&amp;gt;?v=&amp;lt;deploy id&amp;gt;&lt;/code&gt;, the deploy id taken from the commit SHA. The service worker is served from an API route with the same id baked in, so &lt;strong&gt;every deploy changes the worker&lt;/strong&gt;, browsers install the new one, and it deletes the old deploy's caches. Pages themselves are never served stale.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/dig-dog-excavator-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5s3cias2fec5qe33tjck.jpg" alt="Dig Dog excavator as a yellow brick excavator digging on a sand base" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pick any guide, press &lt;strong&gt;Print or save as PDF&lt;/strong&gt;, and see how it comes out: &lt;a href="https://misterblocks.com/builds/trucks" rel="noopener noreferrer"&gt;trucks&lt;/a&gt;, &lt;a href="https://misterblocks.com/builds/robots" rel="noopener noreferrer"&gt;robots&lt;/a&gt;, &lt;a href="https://misterblocks.com/builds/cars" rel="noopener noreferrer"&gt;cars&lt;/a&gt; or the full list of &lt;a href="https://misterblocks.com/lego-build-ideas" rel="noopener noreferrer"&gt;LEGO build ideas&lt;/a&gt;. Everything is free at &lt;strong&gt;&lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;misterblocks.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Unofficial fan builds. LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this site.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>pwa</category>
      <category>webdev</category>
    </item>
    <item>
      <title>From a text prompt to a stud-checked LEGO model: research, design, look, fix</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Sat, 14 Nov 2026 16:00:00 +0000</pubDate>
      <link>https://dev.to/misterblocks/from-a-text-prompt-to-a-stud-checked-lego-model-research-design-look-fix-23f5</link>
      <guid>https://dev.to/misterblocks/from-a-text-prompt-to-a-stud-checked-lego-model-research-design-look-fix-23f5</guid>
      <description>&lt;p&gt;On &lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;Mister Blocks&lt;/a&gt; you can type "Breaking Bad RV" or "a capybara in a hot spring" and, a few minutes later, get a LEGO model with step-by-step instructions where every stud is checked.&lt;/p&gt;

&lt;p&gt;The first version was one big prompt: "design this in bricks". It worked about as well as you'd expect. This post is about the pipeline that replaced it: &lt;strong&gt;research, plan, design, check the shape, look at it, fix every stud&lt;/strong&gt;, and how it shows its progress so a long wait doesn't feel like a hang.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/breaking-bad-rv-fleetwood-bounder-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feo7uuokvwllws1jhv18l.jpg" alt="The Breaking Bad RV as a cream and brown brick model on a wooden table" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Breaking Bad RV (Fleetwood Bounder): 123 pieces, 13 steps. More &lt;a href="https://misterblocks.com/builds/tv-shows" rel="noopener noreferrer"&gt;TV show builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1. Research first, with a search budget
&lt;/h2&gt;

&lt;p&gt;The planner gets web search, capped at three searches. It decides whether the idea is buildable (it declines hateful symbols, sexual content and real-world gore), then writes a short plan:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;strong&gt;name&lt;/strong&gt; (which becomes the page address, &lt;code&gt;/builds/&amp;lt;name&amp;gt;-lego-build&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;piece target&lt;/strong&gt;: vehicles 70–160, characters and creatures 120–250, buildings and scenes 100–220&lt;/li&gt;
&lt;li&gt;a &lt;strong&gt;size&lt;/strong&gt; in studs&lt;/li&gt;
&lt;li&gt;a brief of 8–14 steps, with the colours of every visible part&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The colours rule came from a real failure. Asked for a Waymo Ojai, the pipeline drew it white with a glass band all the way round. That's the &lt;em&gt;older&lt;/em&gt; Waymo, a Jaguar. The planner now has to take colours from the research "for the exact version asked for, never from an older or related model of the same brand", and name the colour of the body, the face, the glass and the roof.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/waymo-ojai-robotaxi-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9gucx9xfcc14bfas86b1.jpg" alt="Waymo Ojai robotaxi as a pale blue brick van with a black face and roof sensor" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The Waymo Ojai, after the fix: pale blue with a black face. 112 pieces. More &lt;a href="https://misterblocks.com/builds/cars" rel="noopener noreferrer"&gt;LEGO cars&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The same incident added a design rule: the windscreen part is a low, raked car windscreen, but &lt;strong&gt;vans, buses and robotaxis have an upright one&lt;/strong&gt;, built as a wall of clear bricks, with solid pillars holding the roof up and something inside (seats, a dashboard) so the glass doesn't look empty.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. One line per piece
&lt;/h2&gt;

&lt;p&gt;The designer writes the model as plain text, one line per piece:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ID KIND X Y Z LX LZ H STEP COLOR DIR ON
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nine kinds of part (plate, brick, slope, axle plate, wheel, fender, windscreen, steering wheel, chain) on a stud grid. It's wrapped in a strict JSON schema, so the response always parses, and the long fixed system prompt is cached between calls.&lt;/p&gt;

&lt;p&gt;Plain lines beat nested JSON objects here for one practical reason: &lt;strong&gt;you can count them while they stream&lt;/strong&gt;. More on that below.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Shape check: did it build the right size?
&lt;/h2&gt;

&lt;p&gt;The most common failure wasn't broken studs. It was a model that was technically fine and far too small. The comment in the code still says it: &lt;em&gt;"a Waymo robotaxi came out as a low 62-piece box"&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So before anything else, the design is compared with the plan. If it has fewer than 75% of the target pieces, a footprint under 75% of the planned size, or a height under 75% of the planned height, it goes back with exactly those numbers. Up to two rounds.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Look review: draw it in ASCII and ask
&lt;/h2&gt;

&lt;p&gt;Then the model looks at its own work. The design is drawn as &lt;strong&gt;ASCII side, front and top views&lt;/strong&gt;: one letter per colour, one character per stud. Those drawings go back with the research brief and one question: compare it with the real thing, the way a kid holding the real thing would.&lt;/p&gt;

&lt;p&gt;It's crude, but it catches the things a stud checker can't: a car whose face is the wrong colour, a character with no arms, a stadium with no stands.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/dodger-stadium-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F61lne97zixz0kslgmkcg.jpg" alt="Dodger Stadium as a 1,394-piece brick diorama with blue seats and green field" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Dodger Stadium: 1,394 pieces, 118 steps. More &lt;a href="https://misterblocks.com/builds/sports" rel="noopener noreferrer"&gt;sports builds&lt;/a&gt; and &lt;a href="https://misterblocks.com/builds/buildings" rel="noopener noreferrer"&gt;LEGO buildings&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Fix every stud
&lt;/h2&gt;

&lt;p&gt;Finally, the stud checker: unknown sizes, colours missing from the palette, empty steps, pieces held by nothing, overlaps, wheels that can't turn. Up to 40 problems go back per round, and the model answers with a &lt;strong&gt;patch&lt;/strong&gt; (remove these ids, add or replace these lines), not a whole new design. Up to six rounds.&lt;/p&gt;

&lt;p&gt;If anything is still wrong at the end, the build is saved anyway, and the chat says so plainly and offers "say 'fix it'" instead of pretending it's perfect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Progress that means something
&lt;/h2&gt;

&lt;p&gt;A Vercel function can run for 800 seconds, so the pipeline gets 11 minutes and leaves the rest to save. The request that starts it answers immediately; the work continues in the background (&lt;code&gt;waitUntil&lt;/code&gt;) and writes its progress onto the build itself. The page polls a tiny endpoint every 2 seconds.&lt;/p&gt;

&lt;p&gt;The progress bar is real:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Planning (12–35%)&lt;/strong&gt;: the model's thinking is streamed as a summary, and the page shows its &lt;strong&gt;last finished sentence&lt;/strong&gt; after "Planning:". Never half a thought.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Placing (35–92%)&lt;/strong&gt;: because every piece is one line, the server counts lines as they stream and shows &lt;strong&gt;"Placing piece 84 of about 120…"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checking&lt;/strong&gt;: "Checking every stud: fixing 6 problems (round 2)…".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stages that won't fit are skipped: a shape or look round only starts if more than 5 minutes are left, a fix round if more than 2.5. And if a job stops reporting for 150 seconds, the page says the designer stopped and offers a retry, instead of spinning forever.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/the-knight-hollow-knight-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fi5sz9hadg4178af7f1g0.jpg" alt="The Knight from Hollow Knight as a small white and blue brick figure" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The Knight (Hollow Knight): 74 pieces, 9 steps. More &lt;a href="https://misterblocks.com/builds/video-games" rel="noopener noreferrer"&gt;video game builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Then you can talk to it
&lt;/h2&gt;

&lt;p&gt;Every build has a chat. "Make the roof red" or "add a trailer" sends the current design, the remaining problems and the last few messages, and asks for a patch, which goes through the same checks. Your first message makes your own copy, so nobody else's build changes.&lt;/p&gt;

&lt;p&gt;Try it with your own idea at &lt;strong&gt;&lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;misterblocks.com&lt;/a&gt;&lt;/strong&gt;, see what others asked for on &lt;a href="https://misterblocks.com/custom-lego-instructions" rel="noopener noreferrer"&gt;custom LEGO instructions&lt;/a&gt;, or browse &lt;a href="https://misterblocks.com/builds/easy" rel="noopener noreferrer"&gt;easy builds&lt;/a&gt; and &lt;a href="https://misterblocks.com/builds/buildings" rel="noopener noreferrer"&gt;buildings&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/capybara-in-a-hot-spring-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcikedpld2qv3wcxlszx9.jpg" alt="A capybara relaxing in a hot spring, as a brick diorama" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Unofficial fan builds. LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this site. Characters and brands belong to their owners.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>llm</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Sculpting 1,300-piece LEGO models in code: ellipsoids, voxels and clear supports</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Fri, 13 Nov 2026 16:00:00 +0000</pubDate>
      <link>https://dev.to/misterblocks/sculpting-1300-piece-lego-models-in-code-ellipsoids-voxels-and-clear-supports-2enn</link>
      <guid>https://dev.to/misterblocks/sculpting-1300-piece-lego-models-in-code-ellipsoids-voxels-and-clear-supports-2enn</guid>
      <description>&lt;p&gt;Most builds on &lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;Mister Blocks&lt;/a&gt; are small and playable: a truck, a robot, a figure you can hold. But I also wanted big display pieces, the kind that sit on a shelf: a 1,300-piece Dragonite, a portrait of Jensen Huang, a tennis player mid-serve.&lt;/p&gt;

&lt;p&gt;Nobody is going to draw those layer by layer. So I sculpt them in code: describe the shape with a few geometric primitives, sample it at brick resolution, and let a packer turn it into real bricks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/mega-dragonite-voxel-sculpture-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu08olz96tp63als8gkso.jpg" alt="Mega Dragonite as a 1,297-piece voxel sculpture on a wooden table" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Mega Dragonite: 1,297 pieces, 125 steps. See all &lt;a href="https://misterblocks.com/builds/sculptures" rel="noopener noreferrer"&gt;LEGO sculptures&lt;/a&gt; and &lt;a href="https://misterblocks.com/builds/dragons" rel="noopener noreferrer"&gt;dragon builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  A sculpture is a list of rules
&lt;/h2&gt;

&lt;p&gt;Each rule is a body region, a colour, and a test that says whether a point is inside. The first rule that matches a point wins, so details (eyes, stripes) go first and the big body shapes last:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'yellow'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;14.7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;22.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;7.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                              &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;ell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;19.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;22.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;7.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;// eyes&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'head'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'black'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="nf"&gt;ell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;head&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;3.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'crests'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;'azure'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="nf"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;15.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;24.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;12.5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;12.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;25.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;16.5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mf"&gt;9.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;26.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.55&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'body'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'black'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="nf"&gt;ell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;13.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;12.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;3.3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'legs'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'black'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;cap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;L&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ankle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;L&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;knee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;cap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ankle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;R&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;knee&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'feet'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="s1"&gt;'dkblue'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;ell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;10.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;8.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;3.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nf"&gt;ell&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;23.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;8.6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;3.1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;4.4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a slice of Mega Greninja. There are only a handful of primitives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;ell&lt;/code&gt;: an ellipsoid (heads, bodies, eyes)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cap&lt;/code&gt;: a capsule between two points (a limb)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chain&lt;/code&gt;: a bent tube through several points (a tail, a crest, an arm with an elbow)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;box&lt;/code&gt;: for stands and bases&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mirrorAbout(x)&lt;/code&gt;: the other side of a symmetric figure, so you only write one arm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anything else is a plain function. Greninja's water shuriken is a small polar test: a hub, a rim and four blades twisted into a pinwheel.&lt;/p&gt;

&lt;h2&gt;
  
  
  From shape to voxels
&lt;/h2&gt;

&lt;p&gt;Units are studs, and one brick is 1.2 studs tall (a LEGO brick is 9.6 mm high on an 8 mm grid). A &lt;code&gt;scale&lt;/code&gt; knob sets how many voxels per model unit. That one number is the piece-count dial: at 1.4, Greninja lands on a 48×40 base at around 1,200 pieces.&lt;/p&gt;

&lt;p&gt;Every voxel centre is tested against the rules. Each voxel is one stud wide and one brick tall. A lone voxel with nothing above or below gets a copy underneath, so single studs don't hang in the air.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/jensen-huang-voxel-sculpture-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg48g27m71gzdhb6a8wtj.jpg" alt="Jensen Huang voxel sculpture in his black leather jacket, holding a chip" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Jensen Huang: 1,360 pieces, 142 steps. More &lt;a href="https://misterblocks.com/builds/famous-people" rel="noopener noreferrer"&gt;famous people&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  From voxels to bricks
&lt;/h2&gt;

&lt;p&gt;Each layer is packed greedily with the biggest same-colour brick that fits, from 2×8 down to 1×1. The long side runs along x on even layers and along z on odd ones, so the layers interlock like a real build instead of forming loose columns.&lt;/p&gt;

&lt;p&gt;The display base is two layers of plates laid crosswise: 16×16s underneath, and on top a pattern of 4-wide and 8-wide plates offset by 4 studs, so &lt;strong&gt;no top seam ever sits on a bottom seam&lt;/strong&gt;. The base must be a multiple of 8 studs on each side, or the script refuses to run.&lt;/p&gt;
&lt;h2&gt;
  
  
  Clear supports, until it's one piece
&lt;/h2&gt;

&lt;p&gt;Here's the part that makes it work in real plastic. A sculpted arm or a wing tip is often attached to nothing below it. After packing, the model goes through the same stud checker the site uses for every build. Anything that "falls apart" or "is not attached to anything" gets a &lt;strong&gt;trans-clear voxel under every empty cell beneath it&lt;/strong&gt;, and the whole thing is packed and checked again. It repeats (up to 40 rounds) until the checker says the model is a single connected piece.&lt;/p&gt;

&lt;p&gt;Clear supports are what real display models use too: you barely see them in a photo, and the model doesn't sag. When Mega Dragonite was first built it needed only three, because its wings hold each other up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/coco-gauff-voxel-sculpture-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flcbzr3qrukulr26opdmm.jpg" alt="Coco Gauff voxel sculpture mid-serve on a blue tennis court base" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Coco Gauff: 1,188 pieces, 124 steps. More &lt;a href="https://misterblocks.com/builds/sports" rel="noopener noreferrer"&gt;sports builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  1,200 pieces, in steps a person can follow
&lt;/h2&gt;

&lt;p&gt;A 1,200-piece model with one step per layer would have steps of 80 bricks. Nobody can follow that. So the steps are cut like a real instruction book:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The first three steps are always the base: the bottom layer, then the top layer's left half, then its right half.&lt;/li&gt;
&lt;li&gt;After that, each layer is grouped by body region (head, arms, legs…), and regions marked as "sided" are split into left and right.&lt;/li&gt;
&lt;li&gt;A group of more than 18 pieces is split front to back into "(1 of 3)", "(2 of 3)"…&lt;/li&gt;
&lt;li&gt;A tiny group of fewer than 5 is merged with a neighbour, as long as the result stays at 18 or fewer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The step text writes itself: &lt;em&gt;"Layer 14 of 29, part 2 of 3: 12 bricks for the arms."&lt;/em&gt; Finally the model is mirrored front to back, so the 3D guide opens on the face.&lt;/p&gt;
&lt;h2&gt;
  
  
  Running one
&lt;/h2&gt;

&lt;p&gt;Every sculpture is a single file that exports its rules and runs on its own:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node scripts/data/mega-greninja.js --steps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It prints how many supports were added, the piece and step count, the colours used, the smallest and largest step, and either "ok: holds together" or what doesn't.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/porsche-mission-s-voxel-sculpture-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fujjipn3wl6wndvsl11o1.jpg" alt="Porsche Mission S as a white voxel sculpture" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Porsche Mission S: 965 pieces, 73 steps. More &lt;a href="https://misterblocks.com/builds/cars" rel="noopener noreferrer"&gt;LEGO cars&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Same character, two sizes
&lt;/h2&gt;

&lt;p&gt;Many sculptures also have a small brick-built version for kids, made with the hand-drawn layer packer instead: &lt;a href="https://misterblocks.com/builds/mega-dragonite-lego-build" rel="noopener noreferrer"&gt;Mega Dragonite&lt;/a&gt; and &lt;a href="https://misterblocks.com/builds/mega-greninja-lego-build" rel="noopener noreferrer"&gt;Mega Greninja&lt;/a&gt; are both around 200 pieces, next to their 1,200-piece display versions. Browse the &lt;a href="https://misterblocks.com/builds/pokemon" rel="noopener noreferrer"&gt;Pokémon builds&lt;/a&gt; to see both.&lt;/p&gt;

&lt;p&gt;Every guide is free, turns in 3D and prints as a booklet. Or start from your own pile at &lt;strong&gt;&lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;misterblocks.com&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Unofficial fan builds. LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this site. Characters, people and brands belong to their owners.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>3d</category>
      <category>algorithms</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Making three.js bricks look like real LEGO: studio light, hollow undersides and a real wooden table</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Thu, 12 Nov 2026 16:00:00 +0000</pubDate>
      <link>https://dev.to/misterblocks/making-threejs-bricks-look-like-real-lego-studio-light-hollow-undersides-and-a-real-wooden-table-2h4</link>
      <guid>https://dev.to/misterblocks/making-threejs-bricks-look-like-real-lego-studio-light-hollow-undersides-and-a-real-wooden-table-2h4</guid>
      <description>&lt;p&gt;The first 3D viewer on &lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;Mister Blocks&lt;/a&gt; drew bricks as coloured boxes with little cylinders on top. It was technically correct and looked like a spreadsheet. Kids building from instructions need to &lt;em&gt;recognise&lt;/em&gt; the piece in their hand, so I spent a surprising amount of time making three.js bricks look like real plastic.&lt;/p&gt;

&lt;p&gt;Here's what made the difference, roughly from biggest to smallest.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/tesla-cybertruck-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh9gi8tty7a76x5k0d0o5.jpg" alt="Tesla Cybertruck as a brick model on a wooden table" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Tesla Cybertruck: 61 pieces, 9 steps. More &lt;a href="https://misterblocks.com/builds/cars" rel="noopener noreferrer"&gt;LEGO cars&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Light it like a product photo
&lt;/h2&gt;

&lt;p&gt;Flat lighting is what makes 3D bricks look like boxes. Real ABS plastic has a soft sheen and bright edges, because in every product photo it's sitting in a studio.&lt;/p&gt;

&lt;p&gt;So the viewer builds one: an environment map of a soft grey room with a big softbox overhead and strip lights at the sides. Every brick reflects it a little, which gives the tops a gentle sheen and catches a highlight along every edge. That one change did more than everything else in this post.&lt;/p&gt;

&lt;p&gt;Two smaller fixes made it read correctly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Colour space.&lt;/strong&gt; Colours are picked in sRGB (that's what LEGO colour charts give you), converted to linear for the renderer to mix light, and the picture goes back to sRGB at the end. Skip that and the lighting mixes the wrong numbers, so colours come out muddy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seam lines that work on dark bricks.&lt;/strong&gt; Joins between bricks get a thin line: dark on light bricks, &lt;strong&gt;light on dark bricks&lt;/strong&gt;. Without the second half, a black wall looked like one solid slab.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Put it on a real table
&lt;/h2&gt;

&lt;p&gt;A model floating in a blue void reads as a render. The same model on a wooden table reads as &lt;em&gt;something you could build&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The table is a top-down photo of our own wooden table, scaled so 1,125 pixels = 34 studs (27 cm), mirrored so it tiles without seams, and fading into a dim room behind the model like a close-up photo. A soft dark patch right under the model grounds it, and the sun's shadow box is fitted tightly around the model, so its shadow is sharp where it touches the table and soft further out.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/shelby-cobra-427-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Funeqi6afq82w28iys7iu.jpg" alt="Shelby Cobra 427 in blue and white racing stripes, on a wooden table" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Shelby Cobra 427: 69 pieces, 8 steps. One of the &lt;a href="https://misterblocks.com/builds/easy" rel="noopener noreferrer"&gt;easy builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every build's picture on the site (the gallery cards, Open Graph images, the image sitemap) is the real viewer, drawn by a headless browser at 1600×1200 on that table and stored in R2. Same renderer, same look, everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Bricks are hollow underneath
&lt;/h2&gt;

&lt;p&gt;When you open a piece from the parts list, it slowly tips over to show its underside, because that's how you tell a brick from a stack of plates, and a 2×4 from a 2×4 &lt;em&gt;tile&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzlfodhistsfdkz72p29a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzlfodhistsfdkz72p29a.png" alt="A white 2×4 brick in the piece viewer, tipped over to show the open cavity and three hollow tubes underneath" width="800" height="943"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The underside is real LEGO geometry (1 unit = 8 mm): a 1 mm top and 1.2 mm walls around an open cavity. Pieces 2 wide or more get a hollow tube (6.5 mm outside, 4.8 mm hole) between every four studs; 1-wide pieces get a thin pin. The cavity ceiling and tube holes are drawn dark so you see them as holes, not as a flat bottom.&lt;/p&gt;

&lt;p&gt;Only the single-piece viewer draws this. A 1,000-piece model stays solid, because nobody sees the bottom of a brick that's sitting on another brick.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Draw less, so 1,300 pieces stay fast
&lt;/h2&gt;

&lt;p&gt;Some of the &lt;a href="https://misterblocks.com/builds/sculptures" rel="noopener noreferrer"&gt;sculptures&lt;/a&gt; have more than 1,300 pieces, and they have to animate on a phone.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Geometry is &lt;strong&gt;shared by every piece of the same size&lt;/strong&gt;, and outlines are computed once per size.&lt;/li&gt;
&lt;li&gt;All the studs of one piece are &lt;strong&gt;one mesh&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Covered studs aren't drawn.&lt;/strong&gt; For each stud, the viewer knows the step at which something will sit on it, and hides it from that step on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last one had a bug that only showed in the exploded view. With the layers pulled apart, the covered studs were still hidden, so every layer looked smooth on top with nothing to connect to. Now, exploded, every piece shows all its studs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/robocop-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgiy8ce84qrkd886tcibj.jpg" alt="RoboCop as a gray brick figure" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;RoboCop: 91 pieces, 9 steps. In &lt;a href="https://misterblocks.com/builds/robots" rel="noopener noreferrer"&gt;robots&lt;/a&gt; and &lt;a href="https://misterblocks.com/builds/movies" rel="noopener noreferrer"&gt;movie builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Small things that make it feel right
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scrubbing never bounces.&lt;/strong&gt; Pressing Next drops the new pieces in with a little fall. Dragging the step slider is instant, and a hidden piece cancels any half-finished drop. Before that, scrubbing back and forth made the whole model jitter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The slider doesn't resize under your finger.&lt;/strong&gt; The step label used to sit next to the slider; its changing length resized the slider while you dragged it. It moved to its own line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tall figures keep their heads.&lt;/strong&gt; The camera frames the whole model as seen from its viewing angle, not from straight ahead, so tall figures fit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Degrees vs radians.&lt;/strong&gt; Some stored builds had their camera angles saved in degrees (&lt;code&gt;az 30, el 35&lt;/code&gt;) and the viewer read them as radians, so a few models opened looking up from under the table. Now any angle that's clearly degrees is read as degrees.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Night mode&lt;/strong&gt; turns the lights down and lets neon pieces glow with a soft bloom, for the city and sci-fi builds.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hover to explain.&lt;/strong&gt; Point at a brick and a card says what it is; point at a step in the list and its pieces light up while everything else fades.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/sans-undertale-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2For8swefbcu8d0dj0gx0a.jpg" alt="Sans from Undertale as a brick figure on a white base" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Sans (Undertale): 116 pieces, 10 steps. More &lt;a href="https://misterblocks.com/builds/video-games" rel="noopener noreferrer"&gt;video game builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Every build on the site uses this viewer, and every guide prints as a booklet or a PDF. A few to turn around:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://misterblocks.com/builds/rick-s-space-cruiser-rick-and-morty-lego-build" rel="noopener noreferrer"&gt;Rick's Space Cruiser&lt;/a&gt; from &lt;a href="https://misterblocks.com/builds/tv-shows" rel="noopener noreferrer"&gt;TV shows&lt;/a&gt; and &lt;a href="https://misterblocks.com/builds/space" rel="noopener noreferrer"&gt;space&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://misterblocks.com/builds/xbox-series-x-lego-build" rel="noopener noreferrer"&gt;Xbox Series X with a controller&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://misterblocks.com/builds/bluey-s-queenslander-house-lego-build" rel="noopener noreferrer"&gt;Bluey's Queenslander house&lt;/a&gt; from &lt;a href="https://misterblocks.com/builds/buildings" rel="noopener noreferrer"&gt;buildings&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/rick-s-space-cruiser-rick-and-morty-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1kc7v5jtgw7vtzie4yvh.jpg" alt="Rick's Space Cruiser from Rick and Morty as a brick model" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or snap a photo of your own loose bricks at &lt;strong&gt;&lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;misterblocks.com&lt;/a&gt;&lt;/strong&gt;: it works like a &lt;a href="https://misterblocks.com/lego-scanner-app" rel="noopener noreferrer"&gt;LEGO scanner app&lt;/a&gt; and gives you &lt;a href="https://misterblocks.com/custom-lego-instructions" rel="noopener noreferrer"&gt;custom instructions&lt;/a&gt; for builds made from exactly what you have.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Unofficial fan builds. LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this site. Characters and brands belong to their owners.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>threejs</category>
      <category>webgl</category>
      <category>javascript</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Voxels aren't LEGO: teaching a brick packer to build like a person</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Wed, 11 Nov 2026 22:29:18 +0000</pubDate>
      <link>https://dev.to/misterblocks/voxels-arent-lego-teaching-a-brick-packer-to-build-like-a-person-4jdh</link>
      <guid>https://dev.to/misterblocks/voxels-arent-lego-teaching-a-brick-packer-to-build-like-a-person-4jdh</guid>
      <description>&lt;p&gt;When you ask an AI for "SpongeBob's house in LEGO", the hard part isn't the shape. The hard part is that &lt;strong&gt;a shape made of cubes isn't a LEGO model.&lt;/strong&gt; Real builders don't stack 1×1 bricks into a block. They cross the layers so they lock, use one big plate for a base, leave the inside hollow, and use as few &lt;em&gt;kinds&lt;/em&gt; of parts as possible, so you can actually collect them.&lt;/p&gt;

&lt;p&gt;This post covers the packer I wrote for &lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;Mister Blocks&lt;/a&gt;, and the rules it learned, mostly from me looking at a build and saying "nobody would build it like that".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/bluey-s-queenslander-house-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmb04h7oe66hth0xc9l1k.jpg" alt="Bluey's Queenslander house as a brick model on a wooden table" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Bluey's Queenslander house: 128 pieces, 15 steps. One of the &lt;a href="https://misterblocks.com/builds/buildings" rel="noopener noreferrer"&gt;LEGO buildings&lt;/a&gt; the packer made.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 1: draw it like a top view, layer by layer
&lt;/h2&gt;

&lt;p&gt;A build is described as a stack of layers. Each one is a top-down drawing where every character is one stud of a colour:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;brickGrid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="no"&gt;W&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;D&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="no"&gt;Y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'#f2cd37'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Yellow'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;W&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'#ffffff'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'White'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;G&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'#4b9f4a'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Green'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;R&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'#c91a09'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Red'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;base&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'G'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                                &lt;span class="c1"&gt;// one base, from the biggest real plates&lt;/span&gt;
&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;layer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'brick'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'..YYYY..'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'..YWWY..'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// rows of studs, '.' = empty&lt;/span&gt;
&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slope&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'+z'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'R'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;             &lt;span class="c1"&gt;// hand-placed parts take their cells first&lt;/span&gt;
&lt;span class="n"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'W'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;                 &lt;span class="c1"&gt;// one tall brick instead of three layers&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then &lt;code&gt;pack()&lt;/code&gt; turns each layer into real bricks. That's where all the rules live.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 1: cross the layers, stagger the seams
&lt;/h2&gt;

&lt;p&gt;The first version filled each layer greedily with the biggest brick that fit. It looked right in 3D and would have fallen apart in your hands: every layer had its seams in the same place, so the model was really a set of loose columns.&lt;/p&gt;

&lt;p&gt;So odd layers prefer pieces along one axis and even layers along the other. And when several pieces fit, the packer scores them by area &lt;strong&gt;plus half again if the piece bridges two or more pieces of the layer below&lt;/strong&gt;. That's what builders do without thinking: put the 2×4 across the join.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 2: one base, from real plates
&lt;/h2&gt;

&lt;p&gt;A base is one layer of the biggest plates LEGO actually makes (16×16, 8×16, 6×16…), never two thin layers glued together. And a plate never sits exactly on an identical plate, because that pair only holds itself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/gundam-rx-78-2-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4wl4hw5k1cyz2h26slp5.jpg" alt="Gundam RX-78-2 as a brick figure on a gray base" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Gundam RX-78-2: 91 pieces. More in &lt;a href="https://misterblocks.com/builds/mechs" rel="noopener noreferrer"&gt;LEGO mechs&lt;/a&gt; and &lt;a href="https://misterblocks.com/builds/anime" rel="noopener noreferrer"&gt;anime builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 3: nothing rests on air
&lt;/h2&gt;

&lt;p&gt;This one took the longest. A drawing happily puts a brick where there is nothing underneath it: an arm sticking out, the brim of a roof. In 3D it looks fine. In plastic it falls off.&lt;/p&gt;

&lt;p&gt;The fix has two parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Overhangs are packed first&lt;/strong&gt;, in a piece that also covers a cell that &lt;em&gt;does&lt;/em&gt; sit on a stud. The overhanging piece is held from below, the way you'd build it.&lt;/li&gt;
&lt;li&gt;If a lone overhang still can't be bridged, its colour is &lt;strong&gt;carried inward&lt;/strong&gt; along the shortest path of drawn cells to the nearest supported cell, and the layer is packed again. Those inside cells are almost always hidden, so the look doesn't change, but now one piece spans from the support to the overhang.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A cell that one overhang has already claimed for its colour is never taken back. Without that rule, two overhangs side by side kept trading colours forever.&lt;/p&gt;

&lt;p&gt;The report at the end fails the build if &lt;em&gt;any&lt;/em&gt; piece has nothing under it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 4: hollow inside
&lt;/h2&gt;

&lt;p&gt;A solid 2,000-piece sculpture is a 2,000-piece sculpture nobody will build. Real display models are hollow.&lt;/p&gt;

&lt;p&gt;After packing, the packer flood-fills "outside air" from beyond the grid and above the top layer. Every drawn piece that touches no outside air (from the sides, above or below) can't be seen, so it's removed, &lt;strong&gt;one at a time, as long as the model still holds together&lt;/strong&gt;. It only ever removes pieces, so a build never gets bigger.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/mega-greninja-voxel-sculpture-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fen3omozgn4j3pz01ywgd.jpg" alt="Mega Greninja voxel sculpture with its water shuriken, on a wooden table" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Mega Greninja as a 1,183-piece sculpture, with clear supports added until the whole model is one connected piece. See all &lt;a href="https://misterblocks.com/builds/sculptures" rel="noopener noreferrer"&gt;LEGO sculptures&lt;/a&gt; and &lt;a href="https://misterblocks.com/builds/pokemon" rel="noopener noreferrer"&gt;Pokémon builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 5: a short parts list
&lt;/h2&gt;

&lt;p&gt;My first review of a small build was blunt: it was hard to collect and hard to build when such a simple model needed 25 different kinds of parts.&lt;/p&gt;

&lt;p&gt;So after packing, the packer keeps trying to &lt;strong&gt;drop the rarest part type&lt;/strong&gt; (one shape in one colour) and repack, as long as the list gets shorter and the model still holds together. One fewer kind of part is worth up to 4 extra pieces. 1×1s always stay as the fallback.&lt;/p&gt;

&lt;p&gt;There's one guard: if a ban only works because the repair recoloured cells (an eye turned into face colour), it's rejected. A shorter list isn't worth erasing the design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 6: tall bricks, like a person would use
&lt;/h2&gt;

&lt;p&gt;Then came the second round of review: &lt;em&gt;why three stacked 1×2 bricks when there's a 3-high block?&lt;/em&gt; Why three plates when a brick is the same height?&lt;/p&gt;

&lt;p&gt;&lt;code&gt;restack&lt;/code&gt; walks every straight vertical run of pieces with the same footprint and colour, and re-cuts it into the fewest real pieces: tall bricks first (1×2×5, 1×2×3, 2×2×3…), then bricks, then plates. Only parts that really exist are allowed; asking for a tall brick LEGO doesn't make throws an error that lists the ones it does.&lt;/p&gt;

&lt;p&gt;It's always safe, which is why it runs on every build: inside a run, every face is covered by the run itself, so nothing else was touching those faces. The top and bottom of the run (what it clips onto, and what clips onto it) stay exactly the same. A chimney becomes a 2×2×3; a wall becomes one 1×6×5.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/totoro-my-neighbor-totoro-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6p1jmjdsbdfxzb8lv9sl.jpg" alt="Totoro brick figure on green grass" width="800" height="600"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Totoro: 156 pieces, 13 steps. Also in &lt;a href="https://misterblocks.com/builds/movies" rel="noopener noreferrer"&gt;movie builds&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Rule 7: every step must be buildable
&lt;/h2&gt;

&lt;p&gt;Finally the steps. Layers are grouped into instruction steps of at most 18 pieces, and arms or tails can be named sub-assemblies with their own step. Then a build-order pass checks each step: if new pieces would only be held by a piece that arrives &lt;em&gt;later&lt;/em&gt;, that piece is brought forward. Moving a piece earlier can't break an earlier step, and a later step only gains support, so it repeats until nothing changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it adds up to
&lt;/h2&gt;

&lt;p&gt;Each rule came from looking at a finished build and asking whether a person would really build it that way. None of them are clever on their own. Together they're the difference between "a 3D shape in LEGO colours" and something my son can actually put together on the table.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/builds/mcdonald-s-restaurant-lego-build" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzzmcbw4dj1qs3u94t071.jpg" alt="McDonald's restaurant as a small brick model with the golden arches sign" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to see the results, every build has free &lt;a href="https://misterblocks.com/custom-lego-instructions" rel="noopener noreferrer"&gt;step-by-step instructions&lt;/a&gt; you can turn in 3D and print. Browse by category: &lt;a href="https://misterblocks.com/builds/buildings" rel="noopener noreferrer"&gt;buildings&lt;/a&gt;, &lt;a href="https://misterblocks.com/builds/anime" rel="noopener noreferrer"&gt;anime&lt;/a&gt;, &lt;a href="https://misterblocks.com/builds/mechs" rel="noopener noreferrer"&gt;mechs&lt;/a&gt;, &lt;a href="https://misterblocks.com/builds/sculptures" rel="noopener noreferrer"&gt;sculptures&lt;/a&gt;, &lt;a href="https://misterblocks.com/builds/tv-shows" rel="noopener noreferrer"&gt;TV shows&lt;/a&gt; or &lt;a href="https://misterblocks.com/builds/easy" rel="noopener noreferrer"&gt;easy builds&lt;/a&gt;. Or snap your own pile of bricks at &lt;strong&gt;&lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;misterblocks.com&lt;/a&gt;&lt;/strong&gt; and get &lt;a href="https://misterblocks.com/lego-build-ideas" rel="noopener noreferrer"&gt;build ideas&lt;/a&gt; from exactly what you have.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Unofficial fan builds. LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this site. Characters and brands belong to their owners.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>algorithms</category>
      <category>showdev</category>
      <category>ai</category>
    </item>
    <item>
      <title>I built a LEGO builder for my son with Claude. The hard part was making sure no brick floats</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Wed, 11 Nov 2026 06:53:19 +0000</pubDate>
      <link>https://dev.to/misterblocks/i-built-a-lego-builder-for-my-son-with-claude-the-hard-part-was-making-sure-no-brick-floats-am6</link>
      <guid>https://dev.to/misterblocks/i-built-a-lego-builder-for-my-son-with-claude-the-hard-part-was-making-sure-no-brick-floats-am6</guid>
      <description>&lt;p&gt;I built Mister Blocks for my son. We have the classic giant box of mixed LEGO: sets long broken up, instructions long gone. Every time he asked "what can I build?", I didn't have a good answer.&lt;/p&gt;

&lt;p&gt;Now he takes a photo of the pile, and a few minutes later there are a few builds made only from the bricks in that photo, with 3D step-by-step instructions he can turn, zoom and print.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw3ja5182vmrgykkx4p46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw3ja5182vmrgykkx4p46.png" alt="Mister Blocks: dump the pile, get a build that actually clicks" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first working version came out of the very first prompt to Claude. The next few days went into the part nobody warns you about: &lt;strong&gt;making sure the build actually holds together in real plastic.&lt;/strong&gt; This post is about that part.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline
&lt;/h2&gt;

&lt;p&gt;There is no framework. It's a handful of Vercel serverless functions in plain Node, MongoDB for sessions, Cloudflare R2 for images and PDFs, and three.js for the 3D view:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;api/sessions/[id]/recognize   photo  -&amp;gt; inventory (every piece: kind, size in studs, color)
api/sessions/[id]/design      inventory -&amp;gt; one model (parts with x/y/z positions + steps)
api/sessions/[id]/chat        "make it a tow truck" -&amp;gt; a changed model, same checks
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Recognize.&lt;/strong&gt; Claude (Opus 5.5) looks at the photo and returns structured JSON. Each piece gets an id (&lt;code&gt;B3&lt;/code&gt; is a brick, &lt;code&gt;P7&lt;/code&gt; a plate, &lt;code&gt;W1&lt;/code&gt; a wheel), its size in studs, its height in plates and its color. If it miscounts, you can correct it in the chat ("there are 48 of the 2×4s") and the inventory is reconciled without breaking the ids the models already use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design.&lt;/strong&gt; Claude gets the inventory and returns a model: every part placed on a grid (x and z in studs, y in plates, where a brick is 3 plates tall), plus which step it goes in.&lt;/p&gt;

&lt;p&gt;And that's where it gets interesting, because a language model's first answer is &lt;em&gt;almost&lt;/em&gt; right very often. Almost right in LEGO means a brick floating in mid-air.&lt;/p&gt;

&lt;h2&gt;
  
  
  The stud checker
&lt;/h2&gt;

&lt;p&gt;Every model goes through a checker before anyone sees it. It's one plain JS file (&lt;code&gt;core.js&lt;/code&gt;), and the server and the browser load the exact same file, so what the page shows and what the server accepts can't disagree.&lt;/p&gt;

&lt;p&gt;It checks the things that make a build fail in your hands:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Every piece is held by studs.&lt;/strong&gt; A piece's bottom cells have to land on studs of something below it, or the piece has to sit on the table. Slopes only have studs on their top row, so the checker knows that too.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No two pieces occupy the same space.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Only pieces you actually have.&lt;/strong&gt; Every part has to exist in the inventory, be of the same kind, and be used only once.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wheels can turn.&lt;/strong&gt; Nothing may come lower than the deck inside a tire's zone, except the mudguard over its own tire.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The checker returns problems &lt;strong&gt;in plain English&lt;/strong&gt;, and they go straight back to Claude:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// lib/designer.js (simplified)&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rounds&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;MAX_ROUNDS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;rounds&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;askJSON&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;schema&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;toModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inventory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;issues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;problems&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inventory&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// "B4 is held by nothing", "P2 overlaps P5", ...&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;issues&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'assistant'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;role&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'user'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sb"&gt;`The checker found these problems:\n- ${issues.join('\n- ')}\n\nFix every one and answer again in full. Same rules.`&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Up to three rounds. In practice most models pass in one or two. This loop does more for quality than any amount of prompt tuning did: the model is good at fixing a specific, named problem, and much worse at avoiding every possible problem up front.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps you can actually build
&lt;/h2&gt;

&lt;p&gt;The next surprise was in the &lt;em&gt;instructions&lt;/em&gt;, not the model. A model can be perfectly valid at the end and still impossible to build in the given order, for example when step 3 places a piece that is only held by a plate that arrives in step 5. You'd be holding that piece in the air.&lt;/p&gt;

&lt;p&gt;So there's a second pass (&lt;code&gt;fixOrder&lt;/code&gt;) that walks the steps. For every group of new pieces in a step, it checks that they clip onto something already built or stand on the table. If they don't, it pulls the holding piece forward into that step, the way a real builder would put the plate on over the pieces it holds. Moving a piece earlier never breaks an earlier step, and a later step can only gain support, so the pass is safe to repeat until nothing changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules learned from a kid's truck
&lt;/h2&gt;

&lt;p&gt;The prompt has a section of rules that came from real builds, mostly from my son's own truck. For example, the chassis that works: two wheel plates in a row, joined by a 2-wide strip of plates, a mudguard over each wheel set one stud outward, and the deck resting on the mudguards plus a center block. Before that rule existed, a lot of generated cars had decks that sat on the tires.&lt;/p&gt;

&lt;p&gt;The rules are written as plain sentences, the same way you'd explain them to a person.&lt;/p&gt;

&lt;h2&gt;
  
  
  The viewer
&lt;/h2&gt;

&lt;p&gt;The 3D viewer is a small three.js file shared by the build page, the guides and the print view. Every brick gets a gentle sheen and highlighted edges, so it reads as plastic rather than as flat boxes. You drag to turn, scroll to zoom, and step through the build one step at a time; pointing at a step in the list lights up its pieces and fades everything else back. Every guide can be printed as a booklet or saved as a PDF, and the guides you've opened work offline.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6a8fabh5z1qvm6bvsw0j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6a8fabh5z1qvm6bvsw0j.png" alt="The step-by-step viewer: Porsche Mission S, step 36 of 73" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Prompt mode and bigger builds
&lt;/h2&gt;

&lt;p&gt;Not everyone has a pile handy, so you can also describe a build in words. A few of my favourites, each a free guide you can turn in 3D, step through and print:&lt;/p&gt;

&lt;h3&gt;
  
  
  Boston Dynamics Spot, with its arm
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/g/boston-dynamics-spot-brick" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fho4x6uqwcs80mvxsbajv.png" alt="Boston Dynamics Spot as a brick model, on a factory floor with hazard tape" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The yellow-and-black robot dog on four backward-bending legs, reaching for a valve on a factory floor. 150 pieces, 13 steps. &lt;strong&gt;&lt;a href="https://misterblocks.com/g/boston-dynamics-spot-brick" rel="noopener noreferrer"&gt;Build it →&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SpongeBob's Pineapple House
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/g/spongebob-pineapple-house-brick" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Freomd2ml06ybbgr74jxs.png" alt="SpongeBob's pineapple house in bricks, with the blue door and green leaves on top" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The pineapple under the sea: round, wider in the middle, with the blue door and a crown of leaves. 237 pieces, 18 steps. &lt;strong&gt;&lt;a href="https://misterblocks.com/g/spongebob-pineapple-house-brick" rel="noopener noreferrer"&gt;Build it →&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Porsche Mission S
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/g/porsche-mission-s" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyvovcw3dasnzv8dp1po9.png" alt="Porsche Mission S as a white voxel sculpture" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Porsche's vision car in white, with the black canopy and the full-width red light bar. The big one: 965 pieces in 73 steps. &lt;strong&gt;&lt;a href="https://misterblocks.com/g/porsche-mission-s" rel="noopener noreferrer"&gt;Build it →&lt;/a&gt;&lt;/strong&gt; (Want something quicker? There's also a &lt;a href="https://misterblocks.com/g/porsche-mission-s-brick" rel="noopener noreferrer"&gt;69-piece version&lt;/a&gt;.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Mega Dragonite
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://misterblocks.com/g/mega-dragonite" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpik1jhxzc8cey2vyev1d.png" alt="Mega Dragonite as an orange voxel sculpture with cream wings, on a gray base" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A voxel sculpture of the dragon Pokémon: 1,315 pieces in 121 steps. &lt;strong&gt;&lt;a href="https://misterblocks.com/g/mega-dragonite" rel="noopener noreferrer"&gt;Build it →&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;More in the &lt;a href="https://misterblocks.com/builds" rel="noopener noreferrer"&gt;gallery&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The large sculptures go through a different path. A 3D shape is described as ellipsoids, limbs and tubes, packed into standard bricks on a plate base, and given clear supports until it holds. Then it goes through the same stud check.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost
&lt;/h2&gt;

&lt;p&gt;Each build takes a few minutes and costs a couple of dollars in API calls. Every Claude call's tokens and cost are logged to MongoDB, and there's a per-visitor daily limit plus a site-wide daily budget, so a busy day can't turn into a surprise bill.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;It's free: &lt;strong&gt;&lt;a href="https://misterblocks.com" rel="noopener noreferrer"&gt;misterblocks.com&lt;/a&gt;&lt;/strong&gt;. Snap your pile and see what it comes up with. I'd love to hear what you build, and especially what it got wrong.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Unofficial fan project. LEGO® is a trademark of the LEGO Group, which does not sponsor or endorse this site. Spot, SpongeBob SquarePants, Porsche and Pokémon belong to their owners; these are fan builds.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>showdev</category>
      <category>javascript</category>
      <category>claude</category>
    </item>
    <item>
      <title>Hacker house hardware: our vibe-coded AI video startup runs on a used gaming PC, a borrowed cable and a TV</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Mon, 26 Oct 2026 19:19:17 +0000</pubDate>
      <link>https://dev.to/kitcut/hacker-house-hardware-our-vibe-coded-ai-video-startup-runs-on-a-used-gaming-pc-a-borrowed-cable-43dj</link>
      <guid>https://dev.to/kitcut/hacker-house-hardware-our-vibe-coded-ai-video-startup-runs-on-a-used-gaming-pc-a-borrowed-cable-43dj</guid>
      <description>&lt;p&gt;&lt;em&gt;The photo at the top is night one: a TV on the living-room floor showing the Ubuntu installer, and the little PC with the blue glow that now renders every film on kitcut.ai.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; our AI video studio went from an overheating laptop, to a slow $250/month Azure VM, to a second-hand gaming PC on my living-room floor. Same 8-minute film: &lt;strong&gt;17 min 42 s in the cloud, 3 min 49 s at home.&lt;/strong&gt; The install was a one-shot gamble with no USB stick, no monitor and a borrowed network cable.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we render
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://kitcut.ai" rel="noopener noreferrer"&gt;KitCut&lt;/a&gt; turns an idea into a finished animated film. Claude writes the film as code (every drawing, camera move, caption and music cue), and the studio turns that code into an MP4:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;idea -&amp;gt; Claude writes film.js -&amp;gt; headless Chromium draws 28,800 frames (8 min @ 60 fps)
     -&amp;gt; TTS narration + word timing -&amp;gt; score + mix -&amp;gt; ffmpeg -&amp;gt; MP4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The whole product is vibe-coded: built by talking to Claude Code, commit after commit. It turns out rendering eats a lot of hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  v0: the laptop that couldn't take the heat
&lt;/h2&gt;

&lt;p&gt;The very first kitcut.ai rendered on my own laptop, a Dell XPS 15 with an i9 and an NVIDIA RTX card. On paper, plenty of machine.&lt;/p&gt;

&lt;p&gt;In practice it is an ultrabook. Put a headless browser, a TTS pipeline and ffmpeg on it at full tilt, and it went from "powerful" to "space heater" almost immediately, then throttled. Also, it is the laptop I work on.&lt;/p&gt;

&lt;h2&gt;
  
  
  v1: Azure, no GPU, $250 a month
&lt;/h2&gt;

&lt;p&gt;So we moved to the cloud: an Azure VM with 4 vCPUs, 16 GB of RAM and &lt;strong&gt;no video card&lt;/strong&gt;, for about &lt;strong&gt;$250 a month&lt;/strong&gt; all in.&lt;/p&gt;

&lt;p&gt;It was very, very slow: about 17 frames a second. Fine for a 30-second film; for an 8-minute one, the customer goes and makes coffee. Twice. Then, as demand grew, one film's narration step ballooned to 12.5 GB on that 16 GB box, the VM ran out of memory, and the studio went down.&lt;/p&gt;

&lt;p&gt;The cloud fix was a bigger VM at double the price, forever. I went shopping instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  v2: a used gaming PC
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Azure VM&lt;/th&gt;
&lt;th&gt;The used gaming PC&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CPU&lt;/td&gt;
&lt;td&gt;4 vCPUs&lt;/td&gt;
&lt;td&gt;Intel Core i7-12700, 20 threads&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RAM&lt;/td&gt;
&lt;td&gt;16 GB&lt;/td&gt;
&lt;td&gt;32 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GPU&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;td&gt;NVIDIA RTX 3070, 8 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Disk&lt;/td&gt;
&lt;td&gt;512 GB HDD&lt;/td&gt;
&lt;td&gt;1 TB NVMe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;~$250/month&lt;/td&gt;
&lt;td&gt;paid once&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two small problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No monitor.&lt;/strong&gt; I own laptops. Luckily we had just bought a TV, the first one I have owned in about 20 years. Into the living room it went, on the floor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No network cable.&lt;/strong&gt; A friend gave me one. It is still the only cable between our production studio and the internet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The one-shot Linux install
&lt;/h2&gt;

&lt;p&gt;The PC came with a second-hand Windows I did not trust. Plan: wipe it, install Ubuntu Server.&lt;/p&gt;

&lt;p&gt;The catch: &lt;strong&gt;no USB stick in the house.&lt;/strong&gt; If the install failed after Windows was gone, there would be nothing left to boot an installer from. One shot.&lt;/p&gt;

&lt;p&gt;I did not do this alone, or honestly at all. &lt;strong&gt;Claude Code&lt;/strong&gt;, running on my laptop, SSH'd into the box and did the whole thing while I held the TV remote. The trick it used, from inside the old Windows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Shrink &lt;code&gt;C:&lt;/code&gt; and make an 8 GB FAT32 partition.&lt;/li&gt;
&lt;li&gt;Copy the Ubuntu Server 24.04 ISO's files onto it, plus an &lt;code&gt;autoinstall.yaml&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Edit the first &lt;code&gt;linux&lt;/code&gt; line in &lt;code&gt;boot/grub/grub.cfg&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;linux /casper/vmlinuz autoinstall toram subiquity-storage-version=2 ---
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add a UEFI entry for the partition's &lt;code&gt;\EFI\boot\bootx64.efi&lt;/code&gt; (&lt;code&gt;bcdedit /copy {bootmgr}&lt;/code&gt;, then &lt;code&gt;bootsequence&lt;/code&gt; to boot it once). Reboot.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is the GRUB menu on the TV. Three things made the one shot survivable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;toram&lt;/code&gt; runs the installer from RAM, so it does not care what happens to the disk.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;subiquity-storage-version=2&lt;/code&gt;: without it the installer sees a disk full of partitions, says &lt;strong&gt;"no gap found large enough"&lt;/strong&gt;, and your night is over.&lt;/li&gt;
&lt;li&gt;An SSH key in the autoinstall's &lt;code&gt;early-commands&lt;/code&gt;, so even a failed install can be entered over the network instead of becoming a brick.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It worked first time. The Windows partitions were wiped afterwards, from Linux.&lt;/p&gt;

&lt;h2&gt;
  
  
  A server with no address
&lt;/h2&gt;

&lt;p&gt;A box at home has no public IP, and I was never going to do port forwarding and certificates by hand. Then I discovered &lt;strong&gt;Cloudflare Tunnel&lt;/strong&gt;: the machine dials out to Cloudflare, and kitcut.ai's traffic comes back down that connection. No open ports, no static IP, and SSH from anywhere. Claude Code set it up, along with the rest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Releases&lt;/strong&gt; run as their own systemd instances: the new one starts, the old one finishes its films, then exits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every film&lt;/strong&gt; is mirrored to Cloudflare R2. The move was a restore of &lt;strong&gt;496 films, 166.5 GB&lt;/strong&gt; from that mirror.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every job&lt;/strong&gt; runs under a memory cap. No more 12.5 GB surprises.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cutover was at 2:15 a.m.: &lt;strong&gt;16 minutes offline.&lt;/strong&gt; Then we rebooted it on purpose, just to see. Back up in 30 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Numbers
&lt;/h2&gt;

&lt;p&gt;Same 8-minute film, 1080p at 60 fps:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Azure VM&lt;/th&gt;
&lt;th&gt;Used gaming PC&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Drawing the film&lt;/td&gt;
&lt;td&gt;17 min 42 s&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;3 min 49 s&lt;/strong&gt; (4.6x)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A review still&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;3-7 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A 30 s draft&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;~10 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;It is still the studio today: &lt;strong&gt;258 films&lt;/strong&gt; (about 6.4 hours of video) since the move, 13 days of uptime and counting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And the RTX 3070?&lt;/strong&gt; The studio's AI models run on it through CUDA, with a machine-wide GPU lock so jobs take turns on the 8 GB. It also runs an open video model at home (MiniMax H3, quantised: a 5-second 768p clip in about 7 minutes, no API bill), and NVENC hardware encoding is next on the list.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fine print
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Home power and home internet. The upload measured 580-660 Mbit/s, but it is one line through one borrowed cable.&lt;/li&gt;
&lt;li&gt;No "restart VM" button. A frozen box needs a human.&lt;/li&gt;
&lt;li&gt;Backups are on us: hence the R2 mirror, and the old Azure VM kept switched off as a way back.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we'd tell another hacker house
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Measure first.&lt;/strong&gt; Every move here started from a timed render, not a feeling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RAM takes you down before CPU does.&lt;/strong&gt; Size for the worst job, and cap every job.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A tunnel makes any box a server.&lt;/strong&gt; Moving the studio is pointing a tunnel somewhere else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make one-shot moments recoverable:&lt;/strong&gt; &lt;code&gt;toram&lt;/code&gt;, the right flag, an SSH key in the installer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An AI agent makes a decent sysadmin.&lt;/strong&gt; Claude Code built the product, then built the server it runs on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Used gaming hardware beats a startup's cloud budget&lt;/strong&gt;, by a lot.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Every film on &lt;a href="https://kitcut.ai" rel="noopener noreferrer"&gt;kitcut.ai&lt;/a&gt; is drawn by the box in that photo. Type an idea and get back a finished, narrated film: a product explainer, a lesson, a cartoon series, a video a day for YouTube. Or plug kitcut.ai/mcp into Claude, ChatGPT or your own agent and let it make them.&lt;/p&gt;

</description>
      <category>startup</category>
      <category>linux</category>
      <category>nvidia</category>
      <category>selfhosted</category>
    </item>
    <item>
      <title>How we auto-generate a unique data infographic for every one of our research reports (with zero LLM tokens for the pixels)</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Fri, 19 Jun 2026 20:33:36 +0000</pubDate>
      <link>https://dev.to/hipa-ai/how-we-auto-generate-a-unique-data-infographic-for-every-one-of-our-research-reports-with-zero-llm-3mkp</link>
      <guid>https://dev.to/hipa-ai/how-we-auto-generate-a-unique-data-infographic-for-every-one-of-our-research-reports-with-zero-llm-3mkp</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4gfkjjt02cuj1fek8lcs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4gfkjjt02cuj1fek8lcs.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
We build &lt;a href="https://hipa.ai" rel="noopener noreferrer"&gt;hipa.ai&lt;/a&gt; — a platform that helps patients and healthy volunteers &lt;strong&gt;find and apply to clinical trials&lt;/strong&gt;. One of our content surfaces is a monthly &lt;a href="https://hipa.ai/research" rel="noopener noreferrer"&gt;clinical-trials research report&lt;/a&gt;, published at three scopes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;National&lt;/strong&gt;, e.g. &lt;a href="https://hipa.ai/research/us-clinical-trials-2026-05" rel="noopener noreferrer"&gt;US Clinical Trials — May 2026&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per state&lt;/strong&gt;, e.g. &lt;a href="https://hipa.ai/research/california-clinical-trials-2026-03" rel="noopener noreferrer"&gt;California Clinical Trials&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per city&lt;/strong&gt; (top ~50 US metros), e.g. &lt;a href="https://hipa.ai/research/houston-tx-clinical-trials-2026-05" rel="noopener noreferrer"&gt;Houston, TX clinical trials&lt;/a&gt; and &lt;a href="https://hipa.ai/research/new-york-ny-clinical-trials-2026-05" rel="noopener noreferrer"&gt;New York, NY clinical trials&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These reports feed our broader &lt;a href="https://hipa.ai/paid-clinical-trials" rel="noopener noreferrer"&gt;clinical trials directory&lt;/a&gt;, where people search &lt;a href="https://hipa.ai/paid-clinical-trials-houston-tx" rel="noopener noreferrer"&gt;recruiting studies by city&lt;/a&gt;, condition, and drug.&lt;/p&gt;

&lt;p&gt;That's &lt;strong&gt;1 national + 50 states + ~50 cities, every single month&lt;/strong&gt;. Every one of those pages needs a hero image that is unique, on-brand, and actually &lt;em&gt;about the data on that page&lt;/em&gt;. You can't hand-design a hundred new infographics a month, and stock photos of test tubes are worthless for SEO and worse for trust.&lt;/p&gt;

&lt;p&gt;So we generate them. This post is the &lt;strong&gt;why&lt;/strong&gt; and the &lt;strong&gt;how&lt;/strong&gt;, with the real code.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why generate images at all?
&lt;/h2&gt;

&lt;p&gt;Five reasons, roughly in order of how much they drove the decision:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Scale.&lt;/strong&gt; ~100 new reports/month. Manual design doesn't survive contact with that number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freshness.&lt;/strong&gt; The data refreshes monthly from &lt;a href="https://clinicaltrials.gov" rel="noopener noreferrer"&gt;ClinicalTrials.gov&lt;/a&gt; (via the &lt;a href="https://aact.ctti-clinicaltrials.org/" rel="noopener noreferrer"&gt;AACT&lt;/a&gt; mirror) — the same pipeline that powers our live &lt;a href="https://hipa.ai/paid-clinical-trials" rel="noopener noreferrer"&gt;clinical trials search&lt;/a&gt; and &lt;a href="https://hipa.ai/drug" rel="noopener noreferrer"&gt;drug catalog&lt;/a&gt;. A hand-made image is stale the moment the next month's snapshot lands. A generated one is regenerated for free.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brand consistency.&lt;/strong&gt; One layout engine → every image has the same dark gradient, the same lime accent, the same typography. No drift.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust + SEO.&lt;/strong&gt; The image &lt;em&gt;is&lt;/em&gt; the data — recruiting counts, top conditions, top sponsors. A reader (and Google's image understanding) sees real numbers, not a decorative photo. The infographic doubles as the article's social/OG card source.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost.&lt;/strong&gt; This is the part people get wrong. &lt;strong&gt;The image is deterministic from the data — it costs zero LLM tokens.&lt;/strong&gt; We use an LLM (Gemini 2.5 Flash) to write the &lt;em&gt;prose&lt;/em&gt;, but every pixel is computed from the SQL aggregate. More on this below, because it also dictates the pipeline ordering.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;
  
  
  The three image tracks
&lt;/h2&gt;

&lt;p&gt;Each report actually ships &lt;strong&gt;three&lt;/strong&gt; different visuals, generated three different ways:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Track&lt;/th&gt;
&lt;th&gt;What&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;How&lt;/th&gt;
&lt;th&gt;Stored?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;The big &lt;strong&gt;data infographic&lt;/strong&gt; (the in-article hero)&lt;/td&gt;
&lt;td&gt;2400×1350&lt;/td&gt;
&lt;td&gt;Satori / &lt;code&gt;next/og&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Yes — Azure Blob&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;The &lt;strong&gt;social / OG card&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;1200×630&lt;/td&gt;
&lt;td&gt;Satori / &lt;code&gt;next/og&lt;/code&gt;, on demand&lt;/td&gt;
&lt;td&gt;No — per-request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;In-page &lt;strong&gt;interactive charts&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Chart.js in the browser&lt;/td&gt;
&lt;td&gt;No — client-side DOM&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The star is &lt;strong&gt;Track 1&lt;/strong&gt;, so let's go deep there.&lt;/p&gt;

&lt;p&gt;Here's a real one (the national May 2026 report — this is a live blob URL):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9xjrxzso50ki70aeiwp6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9xjrxzso50ki70aeiwp6.png" alt="National clinical trials infographic, May 2026" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And a city-scoped one — same engine, scope-aware panels:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F94lce4qzycculn12em9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F94lce4qzycculn12em9u.png" alt="Houston clinical trials infographic, May 2026" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  How: render React → PNG with Satori, not a headless browser
&lt;/h2&gt;

&lt;p&gt;The first instinct for "turn a chart into a PNG on the server" is usually &lt;strong&gt;Puppeteer&lt;/strong&gt; (spin up headless Chrome, screenshot a &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;) or &lt;strong&gt;node-canvas&lt;/strong&gt;. We use neither. We use &lt;strong&gt;&lt;a href="https://github.com/vercel/satori" rel="noopener noreferrer"&gt;Satori&lt;/a&gt;&lt;/strong&gt; via Next.js's &lt;code&gt;ImageResponse&lt;/code&gt; (&lt;code&gt;next/og&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Why Satori:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No headless browser.&lt;/strong&gt; Puppeteer means bundling Chromium, ~300MB, cold-start pain, and a flaky process to babysit on every render. Satori is a pure function: &lt;code&gt;JSX → SVG → PNG&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It runs anywhere Next runs&lt;/strong&gt;, including the edge/serverless image route. No native Chromium dependency.&lt;/li&gt;
&lt;li&gt;The constraint Satori imposes — &lt;strong&gt;flexbox layout + inline SVG only, no arbitrary CSS&lt;/strong&gt; — turns out to be &lt;em&gt;fine&lt;/em&gt; for an infographic. Bars are &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s with a &lt;code&gt;width: "&amp;lt;pct&amp;gt;%"&lt;/code&gt;. Trend lines are an SVG &lt;code&gt;&amp;lt;polyline&amp;gt;&lt;/code&gt;. That's the whole vocabulary you need.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tradeoff: you can't drop in Chart.js server-side (it wants a canvas). So we built a tiny &lt;strong&gt;chart-primitive library&lt;/strong&gt; that speaks Satori's dialect.&lt;/p&gt;
&lt;h3&gt;
  
  
  The shared primitive library
&lt;/h3&gt;

&lt;p&gt;Everything lives in &lt;code&gt;src/lib/infographic-charts.tsx&lt;/code&gt;. The file's own header says it best:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * Satori-compatible chart primitives for infographic images.
 *
 * All components return JSX that works inside `ImageResponse` (next/og).
 * Satori supports flexbox layout and inline SVG — no Chart.js.
 */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It exports &lt;code&gt;StatCard&lt;/code&gt;, &lt;code&gt;HorizontalBars&lt;/code&gt;, &lt;code&gt;StackedBar&lt;/code&gt;, &lt;code&gt;Sparkline&lt;/code&gt;, &lt;code&gt;SectionTitle&lt;/code&gt;, &lt;code&gt;Panel&lt;/code&gt;, and an &lt;code&gt;InfographicShell&lt;/code&gt; wrapper, plus the canonical size:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;infographicSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1350&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A "bar chart" is just a flex row where the fill &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;'s width is a percentage. No library, no canvas:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;HorizontalBars&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;labelWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;labelFontSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;maxPct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(...&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pct&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;flexDirection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;column&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;alignItems&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;center&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;gap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* label … */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;flex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                        &lt;span class="na"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rgba(255,255,255,0.06)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hidden&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pct&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;maxPct&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;%`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;// ← the entire "chart"&lt;/span&gt;
              &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;100%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="na"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="na"&gt;borderRadius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="cm"&gt;/* value + percent … */&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A trend line is the one place we reach for SVG — Satori renders inline SVG, so a sparkline is a single &lt;code&gt;&amp;lt;polyline&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;points&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;padding&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;innerW&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;padding&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;innerH&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;min&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;range&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;innerH&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;,&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;svg&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;viewBox&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`0 0 &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;flex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;polyline&lt;/span&gt; &lt;span class="na"&gt;points&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;points&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"none"&lt;/span&gt; &lt;span class="na"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;strokeWidth&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"5"&lt;/span&gt;
              &lt;span class="na"&gt;strokeLinecap&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"round"&lt;/span&gt; &lt;span class="na"&gt;strokeLinejoin&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"round"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;svg&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The brand lives in &lt;code&gt;InfographicShell&lt;/code&gt; — one wrapper, so every image across the site (research, news, etc.) shares the exact same skin:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;linear-gradient(135deg, #0f172a 0%, #12304a 50%, #0f172a 100%)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="c1"&gt;// header: Hipa.ai logo • lime dot • SCOPE TITLE … month on the right&lt;/span&gt;
&lt;span class="c1"&gt;// footer: "Source: ClinicalTrials.gov / AACT" … "Hipa.ai"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;LIME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#d9f99d&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// the one accent color, used everywhere&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MUTED&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#94a3b8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;CARD_BG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rgba(255,255,255,0.07)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// frosted cards&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Composing the report infographic
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;src/lib/research-infographic.tsx&lt;/code&gt; exports a single function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="nf"&gt;createTrialsInfographic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;logoSrc&lt;/span&gt;&lt;span class="p"&gt;?)&lt;/span&gt; &lt;span class="c1"&gt;// → ImageResponse&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It takes the &lt;strong&gt;stats aggregate&lt;/strong&gt; (not prose, not the LLM output — the raw numbers) and lays out a header, a row of five &lt;code&gt;StatCard&lt;/code&gt;s (Recruiting Now / New This Month / Closing Within 90d / …), then a six-panel grid: recruiting by &lt;strong&gt;condition&lt;/strong&gt;, by &lt;strong&gt;sponsor&lt;/strong&gt;, and a third panel that &lt;em&gt;switches by scope&lt;/em&gt; (by city / by state for national / top facilities for a city report), then interventions, eligibility, and the enrollment target.&lt;/p&gt;

&lt;p&gt;It even does domain-specific cleanup so the labels fit — e.g. &lt;code&gt;abbreviateSponsor("University of California, San Francisco")&lt;/code&gt; → &lt;code&gt;"UCSF"&lt;/code&gt; and strips &lt;code&gt;Inc./LLC/Pharmaceuticals&lt;/code&gt;, and a fixed &lt;code&gt;INTERVENTION_COLORS&lt;/code&gt; map keeps "Drug" blue and "Device" purple across every single image.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The key property: the function is pure over the data.&lt;/strong&gt; Same stats in → same PNG out. Zero tokens. The pixels never touch an LLM.&lt;/p&gt;




&lt;h2&gt;
  
  
  The pipeline ordering (this is where we got burned)
&lt;/h2&gt;

&lt;p&gt;Generating the image is the easy part. &lt;em&gt;When&lt;/em&gt; you generate it is what bit us.&lt;/p&gt;

&lt;p&gt;Each report is produced by &lt;code&gt;scripts/trials/generate-trials-research.ts&lt;/code&gt;: it reads the AACT Postgres mirror, builds the aggregate, calls the LLM for the body, upserts the Mongo doc, &lt;strong&gt;and generates+uploads the infographic — inside the same per-document loop body:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Generate and upload infographic (per doc, right after the upsert)&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imgResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createTrialsInfographic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;agg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;logoSrc&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imgBuffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;imgResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arrayBuffer&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blobName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`research-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;monthlySlug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.png`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;uploadPublicBlob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;imgBuffer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imgErr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* log, continue — don't kill the whole run */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We learned three rules the hard way (a sibling pipeline once shipped 23 articles with &lt;strong&gt;404 hero images&lt;/strong&gt; because it ran "generate all docs → then upload all images" as two phases — that opens a window where the article exists but its image doesn't):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Image generation lives in the same per-doc body as the article upsert.&lt;/strong&gt; No two-phase "all articles, then all images." That window is exactly where broken images come from.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image &lt;em&gt;before&lt;/em&gt; the LLM call.&lt;/strong&gt; The PNG is deterministic and free; the LLM call costs tokens. Render+upload the image first; if upload throws, abort the doc &lt;em&gt;before&lt;/em&gt; spending a single token on prose nobody will see.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skip-existing is mandatory.&lt;/strong&gt; Reruns check "does this blob already exist?" and &lt;code&gt;continue&lt;/code&gt;. The pipeline is safe to re-run any time — it only does the missing work, and never re-bills the LLM for an article that's already live.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  A lazy fallback route
&lt;/h3&gt;

&lt;p&gt;If the batch script never ran for a given slug (or a one-off page is requested), there's a self-healing route at &lt;code&gt;src/app/research/[slug]/infographic/route.ts&lt;/code&gt;. It checks the blob, generates on miss, uploads, and 302s to the CDN — with 24h ISR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;revalidate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;86400&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 24h ISR&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;GET&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;_req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;slug&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;blobName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`research-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.png`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;publicBlobExists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;publicBlobUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;302&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// already done&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;article&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;getResearchArticleBySlug&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Not found&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;status&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createTrialsInfographic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;logoSrc&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;arrayBuffer&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;uploadPublicBlob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;            &lt;span class="c1"&gt;// generate once, cache forever&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;NextResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;publicBlobUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;blobName&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;302&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the image is generated &lt;strong&gt;at most once&lt;/strong&gt;, whether by the batch pipeline or the first visitor, then served straight off the CDN forever after.&lt;/p&gt;




&lt;h2&gt;
  
  
  Storage: cheap, public, cached
&lt;/h2&gt;

&lt;p&gt;Images go to &lt;strong&gt;Azure Blob Storage&lt;/strong&gt; (account &lt;code&gt;hipaaipublic&lt;/code&gt;, container &lt;code&gt;infographics&lt;/code&gt;), world-readable, with a 7-day cache header baked in at upload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// uploadPublicBlob(...)&lt;/span&gt;
&lt;span class="nx"&gt;blobHTTPHeaders&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;blobContentType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image/png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;blobCacheControl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;public, max-age=604800&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// 7 days at the CDN/browser&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The article page just references the deterministic URL — no DB lookup needed to find the image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt;
  &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;publicBlobUrl&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`research-&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.png`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;  &lt;span class="c1"&gt;// → https://hipaaipublic.blob.core.windows.net/infographics/research-&amp;lt;slug&amp;gt;.png&lt;/span&gt;
  &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;`Clinical trials infographic for &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; — &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;article&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;month&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1200&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;height&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;675&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;loading&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"lazy"&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the URL is a pure function of the slug, the page never queries anything to render its hero — it just points at the predictable blob path. (Alt text is templated from the scope + month, not LLM-generated — it's structured data we already have.)&lt;/p&gt;




&lt;h2&gt;
  
  
  Track 2 &amp;amp; 3, briefly
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The OG/social card&lt;/strong&gt; (1200×630) is generated on demand by &lt;code&gt;src/app/research/[slug]/opengraph-image.tsx&lt;/code&gt; — same Satori engine, same brand, but a simpler eyebrow/title/subtitle layout. It's referenced in the page's &lt;code&gt;NewsArticle&lt;/code&gt; JSON-LD so social platforms and Google get a clean card. Not stored; cheap enough to make per request. You can hit one live: &lt;a href="https://hipa.ai/research/us-clinical-trials-2026-05/opengraph-image" rel="noopener noreferrer"&gt;&lt;code&gt;/research/us-clinical-trials-2026-05/opengraph-image&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In-page interactive charts&lt;/strong&gt; are the one place we &lt;em&gt;do&lt;/em&gt; use Chart.js — because here we have a real browser. &lt;code&gt;react-chartjs-2&lt;/code&gt; renders a "Data at a Glance" section (closing-soon by condition, new trials by city/condition, a stacked new-vs-closing trend) client-side after mount. Live DOM, not an image — interactive tooltips, no PNG.&lt;/p&gt;

&lt;p&gt;So the rule of thumb we landed on:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Server-side, no browser → Satori (flexbox + SVG → PNG). Client-side, real browser → Chart.js.&lt;/strong&gt; Never drag a headless Chromium into the build just to screenshot a chart.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The one exception: raw SVG → &lt;code&gt;sharp&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;For a &lt;em&gt;different&lt;/em&gt; surface (drug-development timelines on &lt;code&gt;/drug/*&lt;/code&gt; pages) we generate Gantt-style program-span charts as &lt;strong&gt;hand-written SVG strings&lt;/strong&gt;, then rasterize with &lt;a href="https://sharp.pixelplumbing.com/" rel="noopener noreferrer"&gt;&lt;code&gt;sharp&lt;/code&gt;&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;sharp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;svg&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;density&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2400&lt;/span&gt; &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;png&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Worth mentioning as the "other approach": when the layout is geometric enough that JSX is awkward, raw SVG + &lt;code&gt;sharp&lt;/code&gt; at &lt;code&gt;density: 300&lt;/code&gt; gives you crisp, print-ready output. But for anything card-and-grid shaped, Satori-from-JSX wins on maintainability — you're writing React, not string-concatenating &lt;code&gt;&amp;lt;rect&amp;gt;&lt;/code&gt;s.&lt;/p&gt;




&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;For pSEO at scale, generate the images.&lt;/strong&gt; Manual design doesn't scale to ~100 fresh, on-brand, data-accurate visuals a month.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the pixels deterministic.&lt;/strong&gt; Let the LLM write prose; compute every pixel from your data. It's free, reproducible, and cache-friendly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Satori (&lt;code&gt;next/og&lt;/code&gt;) beats a headless browser&lt;/strong&gt; for server-rendered charts. Build a tiny flexbox+SVG primitive library once; reuse the skin everywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Order matters: image (free) before LLM (paid), in the same per-doc body, with skip-existing.&lt;/strong&gt; A two-phase design is how you ship 404 hero images.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make the image URL a pure function of the slug&lt;/strong&gt; so pages render their hero with zero extra DB calls, and add a lazy generate-on-miss route so it self-heals.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go poke at a few live ones — every infographic on these is generated by the pipeline above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://hipa.ai/research/us-clinical-trials-2026-05" rel="noopener noreferrer"&gt;National clinical trials report&lt;/a&gt; ·&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://hipa.ai/research/new-york-ny-clinical-trials-2026-05" rel="noopener noreferrer"&gt;New York&lt;/a&gt; - &lt;a href="https://hipa.ai/research/houston-tx-clinical-trials-2026-05" rel="noopener noreferrer"&gt;Houston&lt;/a&gt; ·&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hipa.ai/research/california-clinical-trials-2026-03" rel="noopener noreferrer"&gt;California&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hipa.ai/research" rel="noopener noreferrer"&gt;all monthly research reports&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  About Hipa.ai
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://hipa.ai" rel="noopener noreferrer"&gt;&lt;strong&gt;Hipa.ai&lt;/strong&gt;&lt;/a&gt; helps patients and healthy volunteers discover and apply to clinical trials across the US. If this post brought you in from the technical side, here's the product side of the same data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔎 &lt;a href="https://hipa.ai/paid-clinical-trials" rel="noopener noreferrer"&gt;&lt;strong&gt;Find clinical trials&lt;/strong&gt;&lt;/a&gt; — search recruiting studies by location, condition, and drug&lt;/li&gt;
&lt;li&gt;🏙️ &lt;a href="https://hipa.ai/paid-clinical-trials-houston-tx" rel="noopener noreferrer"&gt;&lt;strong&gt;Clinical trials near you&lt;/strong&gt;&lt;/a&gt; — city-level recruiting listings (e.g. Houston, TX)&lt;/li&gt;
&lt;li&gt;💊 &lt;a href="https://hipa.ai/drug" rel="noopener noreferrer"&gt;&lt;strong&gt;Drug catalog&lt;/strong&gt;&lt;/a&gt; — trials, alternatives, and updates by drug&lt;/li&gt;
&lt;li&gt;📊 &lt;a href="https://hipa.ai/research" rel="noopener noreferrer"&gt;&lt;strong&gt;Monthly research reports&lt;/strong&gt;&lt;/a&gt; — the national / state / city infographics this post is about&lt;/li&gt;
&lt;li&gt;📰 &lt;a href="https://hipa.ai/news" rel="noopener noreferrer"&gt;&lt;strong&gt;Healthcare data news&lt;/strong&gt;&lt;/a&gt; — provider and registry trends&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>How we put a complexity score on 3,500 government forms (without ever guessing a 'time to fill')"</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Fri, 19 Jun 2026 20:30:40 +0000</pubDate>
      <link>https://dev.to/instafill/how-we-put-a-complexity-score-on-3500-government-forms-without-ever-guessing-a-time-to-fill-goc</link>
      <guid>https://dev.to/instafill/how-we-put-a-complexity-score-on-3500-government-forms-without-ever-guessing-a-time-to-fill-goc</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpihyoua6a7uch8xfnty0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpihyoua6a7uch8xfnty0.png" alt=" " width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We run &lt;a href="https://instafill.ai" rel="noopener noreferrer"&gt;Instafill&lt;/a&gt;, an AI form-filler with a public catalog of roughly &lt;strong&gt;3,500 fillable forms&lt;/strong&gt; — IRS, SSA, ACORD, USCIS, the long tail of PDFs that make people groan. At some point a question kept coming back, from users and from us: &lt;em&gt;how hard is this form, actually, before I start?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That sounds like a UX nicety. It turned into a small but genuinely interesting engineering problem, because the answer had to satisfy four constraints at once:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic&lt;/strong&gt; — the same form must always produce the same number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reproducible by anyone&lt;/strong&gt; — given the formula and the form, you can recompute it by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Calibrated&lt;/strong&gt; — the output has to match what a human who fills these forms for a living would say (a W-9 is &lt;em&gt;not&lt;/em&gt; as hard as a 603-field insurance application).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Honest&lt;/strong&gt; — no signal we can't actually defend.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the story of the &lt;strong&gt;Form Complexity Index (FCI)&lt;/strong&gt;: a 0–100 score we compute for every form in the catalog. I'll cover &lt;em&gt;why&lt;/em&gt; we built it the way we did, the actual formula, and the most useful part — the blind spot in v1.0 that the whole catalog only revealed once we'd scored all of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a number at all
&lt;/h2&gt;

&lt;p&gt;The product reason and the engineering reason point the same way.&lt;/p&gt;

&lt;p&gt;The product framing we used internally is "the DrugBank of forms." DrugBank and PubChem give every molecule a set of computed, citable scalars — molar mass, logP, and so on. Those numbers are objective, reproducible, and &lt;em&gt;referenceable&lt;/em&gt;: a Wikipedia article can cite the molar mass of caffeine and link back. We wanted the equivalent for forms — a public, per-form page anchored by a unique computed scalar that's stable enough to be cited. The FCI is that scalar. (We &lt;a href="https://instafill.ai/form-complexity-index" rel="noopener noreferrer"&gt;publish the full methodology&lt;/a&gt; precisely so it can be independently verified — that's the whole point.)&lt;/p&gt;

&lt;p&gt;The engineering reason follows directly: if a number is going to be &lt;em&gt;cited&lt;/em&gt;, it cannot be a vibe. It can't be a model output that drifts when we retrain, and it can't be hand-assigned. It has to be a &lt;strong&gt;pure function of the form's own structure&lt;/strong&gt;, versioned, and recomputable from the published formula. That constraint is what made the rest of the design fall into place.&lt;/p&gt;

&lt;h3&gt;
  
  
  The thing we deliberately refused to ship
&lt;/h3&gt;

&lt;p&gt;The obvious feature request is "estimated time to fill: 12 minutes." We don't produce one, on purpose.&lt;/p&gt;

&lt;p&gt;A time estimate is a promise you can't keep. It depends on whether you have your data handy, whether you've filled the form before, how fast you type, how many of the conditional branches apply to &lt;em&gt;you&lt;/em&gt;. We'd be inventing precision we don't have, and the first user who took 40 minutes on our "12-minute" form would be right to be annoyed. So FCI measures &lt;strong&gt;the form&lt;/strong&gt;, not the person — the structural effort it imposes — and stops there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The data we already had
&lt;/h2&gt;

&lt;p&gt;Every form in the catalog is a &lt;code&gt;form_templates&lt;/code&gt; document with structure we'd already extracted for the actual form-filling pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;fields[]&lt;/code&gt; — each with a &lt;code&gt;form_type&lt;/code&gt; (&lt;code&gt;text&lt;/code&gt;, &lt;code&gt;date&lt;/code&gt;, &lt;code&gt;checkbox&lt;/code&gt;, &lt;code&gt;signature&lt;/code&gt;, …), a &lt;code&gt;group&lt;/code&gt;, a &lt;code&gt;page_num&lt;/code&gt;, and an &lt;code&gt;ignore&lt;/code&gt; flag&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dependencies&lt;/code&gt; — the "fill only if…" conditional rules between fields&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;form_sections&lt;/code&gt; and field groups — how the form is organized&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;table_fields&lt;/code&gt; — detected tables and repeating-row lists&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;form_pages_number&lt;/code&gt; — total PDF pages&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;areas&lt;/code&gt; — per-widget geometry, which tells us which pages actually &lt;em&gt;carry&lt;/em&gt; fields&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;asText&lt;/code&gt; — the OCR/extracted text, handy for scraping the federal OMB control number&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No new extraction work. The FCI is a derivation over data we already trusted.&lt;/p&gt;

&lt;h2&gt;
  
  
  The formula
&lt;/h2&gt;

&lt;p&gt;The index has two parts: a &lt;strong&gt;base&lt;/strong&gt; that captures the raw work, and three &lt;strong&gt;modifiers&lt;/strong&gt; that catch the ways a form can be disproportionately hard in a way the base misses.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FCI = clamp( base + T + I + Y , 0, 100 )

where base = 0.36·F + 0.26·D + 0.15·L + 0.16·C + 0.07·S
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The five base components
&lt;/h3&gt;

&lt;p&gt;Each is scaled to 0–100, then weighted.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Weight&lt;/th&gt;
&lt;th&gt;What it measures&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;F&lt;/strong&gt; — Field load&lt;/td&gt;
&lt;td&gt;0.36&lt;/td&gt;
&lt;td&gt;Count of fillable fields, log-scaled (anchors 3 → 200)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;D&lt;/strong&gt; — Input difficulty&lt;/td&gt;
&lt;td&gt;0.26&lt;/td&gt;
&lt;td&gt;Average per-field difficulty by type&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;L&lt;/strong&gt; — Length&lt;/td&gt;
&lt;td&gt;0.15&lt;/td&gt;
&lt;td&gt;Fillable pages; 12+ pages maxes it out&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;C&lt;/strong&gt; — Conditional logic&lt;/td&gt;
&lt;td&gt;0.16&lt;/td&gt;
&lt;td&gt;Share of fields gated by "fill only if…" rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;S&lt;/strong&gt; — Structure&lt;/td&gt;
&lt;td&gt;0.07&lt;/td&gt;
&lt;td&gt;Distinct field groups, log-scaled (anchors 1 → 30)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two design decisions inside the base are worth calling out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Field counts are log-scaled, not linear.&lt;/strong&gt; The jump from a 5-field form to a 50-field form is a completely different experience. The jump from 450 to 500 fields is… still a slog, but it's the same slog. Linear scaling would let giant forms dominate everything. So counts run through:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_logn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hi&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;_clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
                       &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;hi&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;"Pages" means pages that actually have fields.&lt;/strong&gt; This one bit us until we got it right. A W-9 is a &lt;em&gt;6-page PDF&lt;/em&gt; — but 5 of those pages are printed instructions. Charging a form as "long" because the government bundled a rulebook with it is just wrong. So Length counts &lt;strong&gt;fillable&lt;/strong&gt; pages, derived from the per-widget &lt;code&gt;areas&lt;/code&gt; geometry (every widget knows its 0-indexed page), falling back to field &lt;code&gt;page_num&lt;/code&gt;, and only falling back to total PDF pages as a last resort:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;_fillable_pages&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;form_template&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;areas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;form_template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;areas&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;areas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;areas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;ap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;page&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;areas&lt;/span&gt;
              &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;page&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ap&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="c1"&gt;# ... fall back to field page_num, then total PDF pages
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;About &lt;strong&gt;16% of forms&lt;/strong&gt; bundle instruction-only pages. Getting this wrong would have mis-scored one in six forms in the catalog.&lt;/p&gt;

&lt;h3&gt;
  
  
  Input-difficulty weights
&lt;/h3&gt;

&lt;p&gt;Not all fields are equal work. A checkbox is a flick; a signature is a commitment; free text is open-ended. Each field type carries a weight, and &lt;strong&gt;D&lt;/strong&gt; is the average across the form:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field type&lt;/th&gt;
&lt;th&gt;Weight&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Field type&lt;/th&gt;
&lt;th&gt;Weight&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Signature&lt;/td&gt;
&lt;td&gt;0.9&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Dropdown / Radio&lt;/td&gt;
&lt;td&gt;0.4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Free text&lt;/td&gt;
&lt;td&gt;0.6&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Checkbox&lt;/td&gt;
&lt;td&gt;0.2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Number / Date / Time&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Button&lt;/td&gt;
&lt;td&gt;0.2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  The three modifiers (the v2.0 part)
&lt;/h3&gt;

&lt;p&gt;Each modifier is &lt;strong&gt;additive&lt;/strong&gt;, &lt;strong&gt;individually capped&lt;/strong&gt;, and &lt;strong&gt;~0 for an ordinary form&lt;/strong&gt; — so a simple form scores exactly as its base, and the modifiers only lift forms that are hard along an axis the base can't see.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Modifier&lt;/th&gt;
&lt;th&gt;Max&lt;/th&gt;
&lt;th&gt;What it catches&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;T&lt;/strong&gt; — Tables &amp;amp; lists&lt;/td&gt;
&lt;td&gt;+13&lt;/td&gt;
&lt;td&gt;Grids of line items — real effort the field count understates&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;I&lt;/strong&gt; — Instructions&lt;/td&gt;
&lt;td&gt;+9&lt;/td&gt;
&lt;td&gt;Pages of rules to read first (&lt;code&gt;total pages − fillable pages&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Y&lt;/strong&gt; — Layout density&lt;/td&gt;
&lt;td&gt;+12&lt;/td&gt;
&lt;td&gt;Crowded, information-dense pages: &lt;code&gt;(fields + groups) / fillable page&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Notice that &lt;strong&gt;I&lt;/strong&gt; uses the instruction pages we &lt;em&gt;subtracted out&lt;/em&gt; of Length. They don't make the form longer to fill, but a short form bundled with a thick rulebook genuinely is harder to approach — so we measure them separately instead of throwing them away.&lt;/p&gt;

&lt;p&gt;Here's the whole compute, modifiers and all — this is the actual function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# base: v1.0 five-factor weighted sum (0-100)
&lt;/span&gt;&lt;span class="n"&gt;comp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;F&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;_logn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;F_ANCHOR&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;D&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DIFF&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;DIFF_DEFAULT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;types&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;nf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;L&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;_clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pages&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;L_DIV&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;C&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;_clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ndeps&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;nf&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;S&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;_logn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sections&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;S_ANCHOR&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;WEIGHTS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;comp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;WEIGHTS&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# additive complexity modifiers (each capped; ~0 for simple forms)
&lt;/span&gt;&lt;span class="n"&gt;comp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;T&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;_logn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n_tables&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;T_ANCHOR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;T_WEIGHT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;T_CAP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;comp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;instr_pages&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;I_DIV&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;I_WEIGHT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;I_CAP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;comp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_clamp&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nf"&gt;_logn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;density&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Y_ANCHOR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;Y_FLOOR&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;Y_WEIGHT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Y_CAP&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;_clamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;base&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;comp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;T&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;comp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;comp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The v1.0 → v2.0 story (the actually interesting part)
&lt;/h2&gt;

&lt;p&gt;We didn't ship the modifiers on day one. v1.0 was &lt;em&gt;just&lt;/em&gt; the five-factor base, and it looked great on the forms we tested it against. The bug only showed up when we scored the &lt;strong&gt;entire catalog&lt;/strong&gt; and looked at the distribution.&lt;/p&gt;

&lt;p&gt;The five tiers are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tier&lt;/th&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Simple&lt;/td&gt;
&lt;td&gt;0–28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;29–45&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;46–62&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complex&lt;/td&gt;
&lt;td&gt;63–79&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Very Complex&lt;/td&gt;
&lt;td&gt;80–100&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Under v1.0, &lt;strong&gt;Very Complex had basically nothing in it&lt;/strong&gt; — 11 forms out of 3,468, ~0.3%. That's not a tier, that's a rounding error. Something was wrong, and it wasn't the forms.&lt;/p&gt;

&lt;p&gt;The diagnosis: the base rewards &lt;strong&gt;depth&lt;/strong&gt; — more fields, more pages, more branching. But it treated three very different forms as roughly equal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a dense grid of 600 line items crammed onto 4 pages,&lt;/li&gt;
&lt;li&gt;a thin form stapled to a thick instruction booklet,&lt;/li&gt;
&lt;li&gt;and a roomy, well-spaced one-pager.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All three could land in the same band, because the base couldn't &lt;em&gt;see&lt;/em&gt; density, tables, or bundled instructions. The hardest forms in the catalog are hard along exactly those axes, and the base was blind to all of them. So the top tier stayed empty while genuinely brutal forms sat in "Complex."&lt;/p&gt;

&lt;p&gt;v2.0 fixed it without touching the base — that part was well-calibrated and we didn't want to disturb scores that were already right. We added the three additive modifiers (T, I, Y) that lift &lt;em&gt;only&lt;/em&gt; the multi-axis-hard tail, then &lt;strong&gt;recalibrated the tier cutoffs against the live distribution&lt;/strong&gt; instead of against our intuition.&lt;/p&gt;

&lt;p&gt;The result, across 3,468 forms:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tier&lt;/th&gt;
&lt;th&gt;v1.0&lt;/th&gt;
&lt;th&gt;v2.0&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Simple&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;~5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;~36%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Moderate&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;~28%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Complex&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;~23%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Very Complex&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~0.3%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~6–7%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Now every tier is meaningfully populated, the median sits around 50, and the forms everyone agrees are nightmares actually land in the top tier.&lt;/p&gt;

&lt;p&gt;The lesson, which I keep relearning: &lt;strong&gt;you cannot calibrate a population metric on a sample.&lt;/strong&gt; Our hand-picked test forms (W-9, SSA-44, a few others) all scored sensibly under v1.0 — that's &lt;em&gt;why&lt;/em&gt; we shipped it. The blind spot was structurally invisible until the metric met the full population it was meant to describe. Score everything, then look at the shape.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calibration: anchoring to forms humans already have opinions about
&lt;/h2&gt;

&lt;p&gt;The weights and anchors aren't pulled from the air, but they're also not fit by regression — we have no ground-truth "true complexity" labels, because none exist. Instead we anchored to forms our team and users have &lt;em&gt;strong, consensus intuitions&lt;/em&gt; about, and tuned until the tiers matched:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;W-9&lt;/strong&gt; → Basic (everyone's filled one; it's the definition of "routine")&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSA-44&lt;/strong&gt; → Moderate (multi-page, real work, but tractable)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Form 5695 / 8949&lt;/strong&gt; → Complex (long, heavily conditional)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ACORD 125&lt;/strong&gt; → Very Complex (603 fields — the boss fight)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A standalone calibration harness scores these anchors on every weight change and flags any that drift out of their expected tier, so a tweak that fixes one form can't silently break another.&lt;/p&gt;

&lt;h3&gt;
  
  
  A worked example: why the W-9 is a 39
&lt;/h3&gt;

&lt;p&gt;The methodology is published, so anyone can recompute this. The W-9 has 23 fillable fields (15 free text, 8 checkboxes), 1 fillable page, 5 instruction pages, 8 groups, 4 conditional fields, no tables.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Calculation&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;F&lt;/td&gt;
&lt;td&gt;&lt;code&gt;norm(23, 3, 200)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;&lt;code&gt;100 × (15×0.6 + 8×0.2) / 23&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;L&lt;/td&gt;
&lt;td&gt;&lt;code&gt;100 × (1 − 1) / 11&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;&lt;code&gt;100 × 4 / 23&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;17&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;S&lt;/td&gt;
&lt;td&gt;&lt;code&gt;norm(8, 1, 30)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;55&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;base&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0.36·46 + 0.26·46 + 0.15·0 + 0.16·17 + 0.07·55&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;35&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;+ I&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;clamp(100 × 5 / 12) × 0.10&lt;/code&gt; — 5 instruction pages&lt;/td&gt;
&lt;td&gt;+4&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;FCI&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;35 + 4 (T and Y add 0)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;39 → Basic&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The Length component is 0 — one fillable page — even though it's a 6-page PDF. The 5 instruction pages show up in the &lt;strong&gt;I&lt;/strong&gt; modifier instead, adding a modest +4. That's the fillable-vs-total page distinction doing exactly its job.&lt;/p&gt;

&lt;h2&gt;
  
  
  The engineering decisions that made it boring to operate
&lt;/h2&gt;

&lt;p&gt;The math is the fun part. The reason it actually &lt;em&gt;ships and stays correct&lt;/em&gt; is a handful of unglamorous decisions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The compute is a pure function — no I/O.&lt;/strong&gt; &lt;code&gt;compute_form_complexity(form_template)&lt;/code&gt; takes a dict and returns a dict. No DB calls, no logging, no clock except the timestamp it stamps at the end. That single property means the &lt;em&gt;identical&lt;/em&gt; code path serves the live pipeline hooks &lt;strong&gt;and&lt;/strong&gt; the one-off backfill script. There is no "the batch job computes it slightly differently than production" class of bug, because there's only one implementation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;compute_form_complexity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;form_template&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Pure. Return the `fci` sub-document, or None if no fillable fields.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;fields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;form_template&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fields&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
              &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;isinstance&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ignore&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="n"&gt;nf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fields&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;nf&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="c1"&gt;# ... all arithmetic, no side effects
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Persistence is best-effort and never raises into the form pipeline.&lt;/strong&gt; Computing a vanity score must never be able to break the thing users actually came for — filling a form. The persistence wrapper swallows everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;persist_form_complexity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;form_template&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;fci&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;compute_form_complexity&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;form_template&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;fci&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
        &lt;span class="c1"&gt;# lazy imports so the pure compute stays importable in tests/backfill
&lt;/span&gt;        &lt;span class="c1"&gt;# without dragging in Motor + the ES log handler
&lt;/span&gt;        &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;utils.mongodb&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;update_document&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;update_document&lt;/span&gt;&lt;span class="p"&gt;(...)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;log.logger&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt;
        &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warning&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;persist_form_complexity failed: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ex&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;extra&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those &lt;strong&gt;lazy imports&lt;/strong&gt; matter more than they look: they keep the pure functions importable by the backfill script and unit tests &lt;em&gt;without&lt;/em&gt; pulling in the app's database driver and Elasticsearch log handler. The math has no infrastructure dependencies, and we kept it that way at the import level, not just in spirit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every stored score records its &lt;code&gt;METHODOLOGY_VERSION&lt;/code&gt;.&lt;/strong&gt; This is the keystone of "citable." A number written to the DB carries the exact version of the formula that produced it. When we bump the version, the backfill is version-aware and idempotent — it recomputes forms whose stored version is stale and skips the rest, and it &lt;em&gt;doesn't&lt;/em&gt; touch the document's &lt;code&gt;modified&lt;/code&gt; timestamp (a methodology change is not a content change). A score is always traceable to a specific, reproducible formula. v1.0 and v2.0 are both published, with what changed and why.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell someone building their own "index"
&lt;/h2&gt;

&lt;p&gt;If you're putting a single defensible number on a population of messy real-world things, the pattern that worked for us:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Refuse the seductive-but-unfalsifiable metric.&lt;/strong&gt; Our "time to fill" was begging to be built. Not shipping it was the right call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make the compute a pure function of data you already trust.&lt;/strong&gt; It makes the metric reproducible, testable, and identical across batch and live paths — for free.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Calibrate against cases humans already have consensus on&lt;/strong&gt;, not against your own first guess.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Score the entire population before you trust the tiers.&lt;/strong&gt; Your sample will lie to you about the shape of the distribution. Ours hid an empty top tier for a whole version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version every stored value.&lt;/strong&gt; The day you want the number to be &lt;em&gt;cited&lt;/em&gt; is the day you'll be glad it's traceable to an exact formula.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The FCI now sits on every form page in the catalog as a transparent card — base, each modifier, the final score, and the breakdown — next to the form's standardized identifiers. It's a small number. Getting it to be a &lt;em&gt;trustworthy&lt;/em&gt; small number was the whole job.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The full methodology, worked examples, and live catalog distribution are public at &lt;a href="https://instafill.ai/form-complexity-index" rel="noopener noreferrer"&gt;instafill.ai/form-complexity-index&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>pdf</category>
      <category>formfiller</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>AI automation ideas most developers miss</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Wed, 04 Jun 2025 01:27:13 +0000</pubDate>
      <link>https://dev.to/ogamaniuk/underutilized-ai-automation-use-cases-hidden-opportunities-in-everyday-business-processes-305e</link>
      <guid>https://dev.to/ogamaniuk/underutilized-ai-automation-use-cases-hidden-opportunities-in-everyday-business-processes-305e</guid>
      <description>&lt;p&gt;The automation landscape is full of hype—AI copilots, chatbots, and generative content tools dominate headlines. But many of the most valuable opportunities lie elsewhere. Hidden beneath the surface are dozens of overlooked, practical AI use cases that solve real operational pain points—quietly improving speed, reducing error, and cutting costs in everyday workflows. These use cases aren’t flashy, but they’re wide open for developers looking to build automation tools that serve underserved industries or neglected business functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Document Processing and Data Extraction
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Invoice and Financial Document Automation
&lt;/h3&gt;

&lt;p&gt;Invoice processing is one of the clearest examples of repetitive work that AI can simplify—but it's still shockingly manual in many businesses. Small and mid-sized firms often handle invoices by forwarding PDFs via email, copying values into spreadsheets, and manually reconciling amounts. This is especially true in construction, real estate, manufacturing, and retail—industries with high document volume and low tech adoption.&lt;/p&gt;

&lt;p&gt;Tools like &lt;a href="https://learn.microsoft.com/en-us/ai-builder/prebuilt-invoice-processing" rel="noopener noreferrer"&gt;Microsoft AI Builder&lt;/a&gt; already offer models that extract structured data from invoices, including line items, tax fields, payment terms, and vendor data. But there’s room for specialized tools that can plug into legacy accounting platforms or provide better support for multi-language, multi-currency, or industry-specific invoice layouts (e.g. freight invoices or subcontractor forms).&lt;/p&gt;

&lt;p&gt;Beyond invoices, there are untouched opportunities in automating tax forms, purchase orders, utility bills, or bank statements—especially for small businesses and nonprofits lacking dedicated back-office teams.&lt;/p&gt;

&lt;h3&gt;
  
  
  Contract Analysis and Legal Document Workflows
&lt;/h3&gt;

&lt;p&gt;Contracts are another rich area. Many legal and operations teams still manage contracts with a patchwork of PDFs, shared drives, and spreadsheets. Even something as simple as finding a renewal date or a termination clause can take minutes of manual review per document.&lt;/p&gt;

&lt;p&gt;Contract automation platforms like &lt;a href="https://www.sirion.ai/library/contract-analytics/ai-contract-analysis/" rel="noopener noreferrer"&gt;Sirion&lt;/a&gt; are built for enterprise use, but there's demand for lighter-weight tools that focus on specific segments: short-term rental agreements, vendor onboarding forms, NDAs, or municipal contract templates.&lt;/p&gt;

&lt;p&gt;Developers can also build tools that help teams digitize legacy forms—using &lt;a href="https://instafill.ai/tools/create-fillable-pdf" rel="noopener noreferrer"&gt;Instafill.ai’s fillable PDF tool&lt;/a&gt; to convert flat Word documents or scanned PDFs into structured templates, then layering on &lt;a href="https://instafill.ai" rel="noopener noreferrer"&gt;AI-powered form filling&lt;/a&gt; for populating names, addresses, and terms from intake data. These workflows are especially valuable for legal aid clinics, HR departments, and compliance teams in regulated industries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Business Process Micro-Automations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Email, Chat, and Internal Communication
&lt;/h3&gt;

&lt;p&gt;Despite the rise of Slack and AI-powered inbox assistants, internal communication is still chaotic in many organizations. Employees lose time digging through message threads, hunting for attachments, or crafting routine follow-up emails.&lt;/p&gt;

&lt;p&gt;While some startups are building email triage tools like Shortwave and smart reply generators, there’s a growing need for AI systems that work across &lt;em&gt;channels&lt;/em&gt;—email, chat, helpdesk platforms—and provide unified workflows. For example: flagging unresolved client questions across Gmail and Intercom, generating a reminder task in Notion, and pinging the right team in Slack.&lt;/p&gt;

&lt;p&gt;Use cases like auto-generating internal updates from project tools, summarizing long email threads, or even drafting thank-you messages for sales leads remain widely unaddressed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Meeting Notes and Calendar Workflows
&lt;/h3&gt;

&lt;p&gt;Scheduling remains a massive time sink—especially in service industries where consultants, recruiters, or case managers juggle dozens of client meetings. Most still rely on email threads to coordinate times, often missing out on automation.&lt;/p&gt;

&lt;p&gt;Real opportunity exists in niche scheduling flows—like finding overlapping availability across teams in different time zones, generating follow-up notes based on call transcripts, or linking meeting outcomes to CRM or HR systems. Tools like &lt;a href="https://speechnotes.co/transcribe/" rel="noopener noreferrer"&gt;Otter.ai&lt;/a&gt; and &lt;a href="https://www.linkedin.com/pulse/3-underrated-ai-automations-could-save-you-20-hours-jacob-krogue-cpa-xnvge" rel="noopener noreferrer"&gt;Fireflies.ai&lt;/a&gt; focus on transcription, but the broader scheduling problem is still under-served.&lt;/p&gt;

&lt;p&gt;There’s also room for developer tools that let users “program their calendar” using natural language—e.g., “Block 2 hours for deep work after every client call” or “Reschedule low-priority meetings if I have more than 3 calls in a day.”&lt;/p&gt;

&lt;h3&gt;
  
  
  Expense Reporting and Receipts
&lt;/h3&gt;

&lt;p&gt;While expense automation is growing, most solutions are enterprise-focused or hard to customize. Freelancers, startups, and small teams often stitch together clunky apps with spreadsheets, spending hours just organizing receipts.&lt;/p&gt;

&lt;p&gt;Smarter AI tools could extract data from receipts, cross-check with calendar events or emails, suggest attendees for business meals, and auto-categorize purchases based on historical behavior. Context-aware automation—e.g., knowing that lunch in NYC on a travel day is reimbursable—could cut hours from monthly reporting. This space is especially ripe for lightweight browser extensions or mobile apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Content and Media Automation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Transcription, Summarization, and Voice Content
&lt;/h3&gt;

&lt;p&gt;The accuracy of transcription tools has improved dramatically, yet most are built as general-purpose platforms. Developers have an opportunity to build transcription and summarization tools tailored to niche audiences—e.g., therapists recording session notes, pastors documenting sermons, or product teams recording design reviews.&lt;/p&gt;

&lt;p&gt;Voice-based workflows also remain clunky. A well-designed app that lets users talk through a process—"Create a follow-up task, draft the email, update the CRM"—and turns it into structured output could be a huge unlock for mobile-first users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Repurposing and Distribution
&lt;/h3&gt;

&lt;p&gt;Marketing teams often drown in content they never reuse. AI tools that can take one webinar and auto-generate blog outlines, key quotes, LinkedIn posts, and video snippets are useful—but most current tools feel generic.&lt;/p&gt;

&lt;p&gt;There’s a space for specialized solutions: turning Zoom sales calls into case study drafts, summarizing customer interviews into product roadmap notes, or creating internal documentation from live training sessions. Teams want tools that understand context—not just templates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual Email Template Design with Natural Language
&lt;/h3&gt;

&lt;p&gt;Modern email design tools often claim to be “drag-and-drop,” yet teams still spend hours manually tweaking tables, columns, and mobile responsiveness using outdated editors or rigid builders. Inspired by tools like &lt;a href="https://v0.dev" rel="noopener noreferrer"&gt;v0.dev&lt;/a&gt;, which convert natural language prompts into React components, there’s a clear opportunity to bring that same approach to HTML email generation. Imagine a tool where a user can type: “Create a welcome email with a large header, two product cards, and a CTA button,” and instantly get a responsive, editable email template that works across clients.&lt;/p&gt;

&lt;p&gt;Such a system could remove the need for fiddling with nested table structures or testing across devices. For marketing teams, it means faster campaigns. For SaaS products, it unlocks user-generated templates without needing to know HTML. Developers could take this even further—allowing dynamic data binding, brand style integration, or collaborative editing, all powered by a natural language interface. Despite the massive volume of emails businesses send every day, the tooling around template creation has seen very little innovation, making this a prime opportunity for disruption.&lt;/p&gt;

&lt;h2&gt;
  
  
  Underserved Industry Workflows
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Agriculture, Field Services, and Compliance
&lt;/h3&gt;

&lt;p&gt;Agriculture remains one of the least digitized sectors. AI automation could simplify regulatory paperwork for small farms—such as pesticide use logs, livestock health reports, or subsidy applications. Similar forms-heavy tasks exist in field services like HVAC repair, construction inspections, or safety audits—often done on paper or Excel templates.&lt;/p&gt;

&lt;p&gt;Developers can create mobile-first tools that extract structured data from field reports or help auto-generate compliance documentation on the fly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Education Admin Workflows
&lt;/h3&gt;

&lt;p&gt;While edtech has focused heavily on student engagement and curriculum, there's less attention on admin workflows. Public school administrators spend hours on enrollment forms, IEP updates, teacher evaluations, and state compliance documents.&lt;/p&gt;

&lt;p&gt;Automation tools that extract data from parent forms, pre-fill annual reports, or track student plan changes over time would save massive effort—especially in districts with outdated systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Healthcare Admin and Intake
&lt;/h3&gt;

&lt;p&gt;AI is making strides in diagnostics, but there's just as much opportunity in fixing the paperwork. Medical offices still rely on clipboards, faxed referrals, and EMR notes that need reformatting. Automating intake, appointment summaries, insurance forms, or prior authorization letters could streamline front-desk workflows in small clinics.&lt;/p&gt;

&lt;p&gt;Tools that &lt;a href="https://instafill.ai/tools/create-fillable-pdf" rel="noopener noreferrer"&gt;convert flat PDFs or Word documents into fillable forms&lt;/a&gt;—and then auto-populate those forms using &lt;a href="https://instafill.ai" rel="noopener noreferrer"&gt;Instafill.ai’s AI-driven form filling&lt;/a&gt;—are already showing impact in healthcare settings, especially when processing patient intake forms or claims-related documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;For developers looking to build something useful, the best opportunities aren’t in trying to out-compete ChatGPT or build the next viral app. They’re in quietly fixing the broken, repetitive tasks that thousands of people do every day.&lt;/p&gt;

&lt;p&gt;Across industries—from agriculture and legal aid to healthcare and education—there are still forms to digitize, meetings to summarize, emails to automate, and reports to generate. These aren’t moonshots—but they’re real problems no one is solving.&lt;/p&gt;

&lt;p&gt;Start small. Focus on a workflow that’s currently being handled with Word, PDF, Excel, and email. Build something that cuts hours of effort down to seconds. That’s where the real value—and opportunity—lies.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>automation</category>
    </item>
    <item>
      <title>Comprehensive Comparison of PDF Form Filling Applications in 2025</title>
      <dc:creator>Oleksandr Gamanyuk</dc:creator>
      <pubDate>Mon, 24 Mar 2025 21:40:33 +0000</pubDate>
      <link>https://dev.to/instafill/comprehensive-comparison-of-pdf-form-filling-applications-in-2025-5612</link>
      <guid>https://dev.to/instafill/comprehensive-comparison-of-pdf-form-filling-applications-in-2025-5612</guid>
      <description>&lt;p&gt;Before diving into the detailed comparison table, it's worth noting that the PDF form filling landscape has evolved dramatically in 2025. AI-powered platforms like Instafill.ai now go far beyond simple field detection — they offer robust, workflow-integrated automation that rivals traditional manual tools in both speed and precision.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://instafill.ai" rel="noopener noreferrer"&gt;PDF Form Filling Applications&lt;/a&gt;: Features, Pricing, and Capabilities
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature/Tool&lt;/th&gt;
&lt;th&gt;Instafill.ai&lt;/th&gt;
&lt;th&gt;PDFelement&lt;/th&gt;
&lt;th&gt;Foxit PDF Editor&lt;/th&gt;
&lt;th&gt;Adobe Acrobat&lt;/th&gt;
&lt;th&gt;PDFgear&lt;/th&gt;
&lt;th&gt;FormVu&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Core Functionality&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;AI-powered automated form filling and logic handling&lt;/td&gt;
&lt;td&gt;All-around PDF editor with form capabilities&lt;/td&gt;
&lt;td&gt;Comprehensive PDF editor&lt;/td&gt;
&lt;td&gt;Industry-standard PDF solution&lt;/td&gt;
&lt;td&gt;Free basic PDF editor&lt;/td&gt;
&lt;td&gt;PDF form to HTML converter&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;AI Capabilities&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Narrative-to-form interpretation, AI field mapping, checkbox logic, validation, multi-language support&lt;/td&gt;
&lt;td&gt;AI assistant for summarizing and querying documents&lt;/td&gt;
&lt;td&gt;AI tools for summarization and questions&lt;/td&gt;
&lt;td&gt;Limited AI features&lt;/td&gt;
&lt;td&gt;Basic AI co-pilot for commands&lt;/td&gt;
&lt;td&gt;No AI mentioned&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Batch Processing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Advanced batch fill with logic, overflow tables, ZIP export, webhook/email/API triggers&lt;/td&gt;
&lt;td&gt;Form data import/export&lt;/td&gt;
&lt;td&gt;Basic batch processing&lt;/td&gt;
&lt;td&gt;Limited batch capabilities&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Form Creation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Upload custom forms and auto-map fields using AI&lt;/td&gt;
&lt;td&gt;Create interactive forms with formulas&lt;/td&gt;
&lt;td&gt;Create forms with various field types&lt;/td&gt;
&lt;td&gt;Advanced form creation tools&lt;/td&gt;
&lt;td&gt;Basic form creation&lt;/td&gt;
&lt;td&gt;Converts existing forms to HTML&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Form Validation&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Intelligent validation against form logic and external data&lt;/td&gt;
&lt;td&gt;Basic validation&lt;/td&gt;
&lt;td&gt;Basic validation&lt;/td&gt;
&lt;td&gt;Standard validation&lt;/td&gt;
&lt;td&gt;Minimal&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Platform Support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Web app, mobile/tablet friendly, Chrome/Edge extensions&lt;/td&gt;
&lt;td&gt;Windows, Mac, iOS, Android, Online&lt;/td&gt;
&lt;td&gt;Windows, Mac, iOS, Android, Online&lt;/td&gt;
&lt;td&gt;Windows, Mac, iOS, Android&lt;/td&gt;
&lt;td&gt;Windows, Mac&lt;/td&gt;
&lt;td&gt;Cross-platform via HTML&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;OCR Capabilities&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Yes, with layout-aware extraction and attachment generation&lt;/td&gt;
&lt;td&gt;Strong OCR capabilities&lt;/td&gt;
&lt;td&gt;Super OCR for scanned documents&lt;/td&gt;
&lt;td&gt;Advanced OCR&lt;/td&gt;
&lt;td&gt;Limited&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;E-Signatures&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Manual signature field left for post-fill use&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Pricing&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Starts at $65.99/month, &lt;a href="https://instafill.ai/pricing" rel="noopener noreferrer"&gt;enterprise available&lt;/a&gt; (AU cloud hosting supported)&lt;/td&gt;
&lt;td&gt;Free; $79.99/year or $129.99 one-time&lt;/td&gt;
&lt;td&gt;Free; $129.99/year/user&lt;/td&gt;
&lt;td&gt;Starts at $22.19/month&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;$1,800/month&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;G2 Rating&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Not specified&lt;/td&gt;
&lt;td&gt;4.5/5&lt;/td&gt;
&lt;td&gt;4.6/5&lt;/td&gt;
&lt;td&gt;Industry leader&lt;/td&gt;
&lt;td&gt;Not specified&lt;/td&gt;
&lt;td&gt;Not specified&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Target Audience&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Government agencies, legal firms, healthcare providers, businesses with repetitive workflows&lt;/td&gt;
&lt;td&gt;General users, SMBs&lt;/td&gt;
&lt;td&gt;Business professionals&lt;/td&gt;
&lt;td&gt;Enterprises&lt;/td&gt;
&lt;td&gt;Individuals&lt;/td&gt;
&lt;td&gt;Form-heavy organizations&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Legacy Tools Want You to Stay. AI Tools Want You to Finish.
&lt;/h2&gt;

&lt;p&gt;Let’s be blunt: most traditional PDF apps on this list were built in the early 2000s or 2010s — and haven’t evolved much since. They’ve tacked on “AI” labels in the last year, but the core experience is the same: clunky menus, drag-and-drop interfaces, and manual data entry.&lt;/p&gt;

&lt;p&gt;These apps were &lt;strong&gt;designed to keep you busy&lt;/strong&gt;. That’s their business model. Time spent in the tool = success metric. If you’re spending hours editing forms manually, they consider that a win.&lt;/p&gt;

&lt;p&gt;Instafill.ai is the opposite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI-first platforms like Instafill.ai are designed to get you out of the app as quickly as possible.&lt;/strong&gt; Their success metric is how fast you can finish the task and move on with your day. Upload a spreadsheet, forward an email, or trigger a webhook — and you're done. No need to “engage” with the software for hours. The app does the work, not you.&lt;/p&gt;

&lt;p&gt;This isn’t just a better experience — it’s a fundamentally different philosophy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Legacy apps:&lt;/strong&gt; more clicks = more value
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instafill.ai:&lt;/strong&gt; fewer clicks = more productivity&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  Unique Selling Points
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Instafill.ai&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AI-native form filling with smart formatting, logic, validation, and reusable profiles&lt;/li&gt;
&lt;li&gt;Handles narrative field conversion, checkbox toggles, overflow attachments&lt;/li&gt;
&lt;li&gt;One-time fine-tuning ensures 99–100% accuracy on future fills&lt;/li&gt;
&lt;li&gt;Supports &lt;a href="https://resources.instafill.ai/blog/batch-form-filling-beta" rel="noopener noreferrer"&gt;batch filling&lt;/a&gt;, &lt;a href="https://docs.instafill.ai" rel="noopener noreferrer"&gt;webhooks&lt;/a&gt;, and email-to-fill workflows&lt;/li&gt;
&lt;li&gt;Mobile-first, multilingual, agency-ready output — including Australian-hosted enterprise option on Microsoft Azure&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;PDFelement&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Balanced toolset for form creation, editing, and entry-level AI tasks&lt;/li&gt;
&lt;li&gt;Offers perpetual license pricing for offline users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Foxit PDF Editor&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fast, lightweight PDF editor with strong OCR and annotation tools&lt;/li&gt;
&lt;li&gt;Cheaper than Adobe but capable for everyday business use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Adobe Acrobat&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deepest legacy toolset, high trust in compliance-heavy environments&lt;/li&gt;
&lt;li&gt;Strong integration across Adobe ecosystem&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;PDFgear&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fully free, with minimal features and lightweight performance&lt;/li&gt;
&lt;li&gt;Great for students or occasional users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;FormVu&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Best for developers converting static forms to HTML&lt;/li&gt;
&lt;li&gt;Focused API for embedding forms online&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Choosing the Right Tool: Fast, Accurate, or Familiar?
&lt;/h2&gt;

&lt;p&gt;If you're filling out forms once a year, any tool will do.&lt;/p&gt;

&lt;p&gt;But if you work in healthcare, immigration, government, or law — or deal with hundreds of forms every week — &lt;strong&gt;you need automation, not another editor.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instafill.ai stands out as the most advanced form automation engine on the market in 2025. It’s not trying to look like a PDF editor from 2008 — it’s designed to replace those tools entirely.&lt;/p&gt;

</description>
      <category>instafillai</category>
      <category>pdfform</category>
      <category>agents</category>
      <category>pdf</category>
    </item>
  </channel>
</rss>
