<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/feed.xsl"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Adebesin Tolulope (Lope) — Blog</title>
        <link>https://lope.adebesin.com/blog</link>
        <description>Notes on open source, engineering with LLMs, and projects I'm building.</description>
        <lastBuildDate>Fri, 06 Nov 2026 03:14:53 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>CC BY-NC-SA 4.0 — Adebesin Tolulope</copyright>
        <atom:link href="https://lope.adebesin.com/feed.xml" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[The IR behind your ternary]]></title>
            <link>https://lope.adebesin.com/blog/the-ir-behind-your-ternary</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/the-ir-behind-your-ternary</guid>
            <pubDate>Wed, 04 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Before Panda CSS writes a single class, it turns your style into a tree. How that tree feeds both the stylesheet and the rewritten code, and when a call can't be rewritten.]]></description>
            <content:encoded><![CDATA[<p>What Panda builds from your style before it writes a single class.</p><post-cover></post-cover><p><em>Panda internals, part 5. Start with <a href="https://lope.adebesin.com/blog/build-once-at-build-time">Build once, at build time</a> if you're new here.</em></p><p><a href="https://lope.adebesin.com/blog/panda-never-runs-your-code">Part 4</a> ended on a promise. With <a href="https://panda-css.com/docs/styling/source-transforms" rel="nofollow">source transforms</a> on, this call:</p><pre><code>css({ fontSize: 'xl', color: active ? 'red.700' : 'gray.700' })
</code></pre><p>ships to the browser as this:</p><pre><code>active ? "c_red.700 fs_xl" : "c_gray.700 fs_xl"
</code></pre><p>Two finished class strings and the condition you wrote. No <code>css()</code> call left.</p><p>To get there, Panda doesn't go straight from your code to class names. It builds something in between first.</p><p><em>Just want the habits? Skip to <a href="#what-this-means-for-your-code">what this means for your code</a>.</em></p><h2 id="something-in-between">Something in between</h2><p>Compilers rarely turn their input straight into output. They first turn it into a model of the program that's easier to work with, then generate output from that model. The model is called an intermediate representation, or IR.</p><p>Panda has one for styles. It's called the StyleTree, and every style call gets one.</p><p>The reason Panda needs it is that one style can produce two outputs. There's the stylesheet, which every Panda project gets. And with source transforms on, there's your rewritten code. Both have to agree on what your style means, so both are built from the same tree.</p><h2 id="the-shapes-in-the-tree">The shapes in the tree</h2><p>A StyleTree node is one of a few shapes. Written as TypeScript, it looks roughly like this:</p><pre><code>type StyleTree =
  | string | number | boolean | null
  | { token: string }
  | { [key: string]: StyleTree }
  | StyleTree[]
  | { branches: StyleTree[] }
  | { ternary: Source, consequent: StyleTree, alternate: StyleTree }
  | { and: Source, value: StyleTree }
  | { open: true }
  | { open: true, fallback: StyleTree }
</code></pre><p>Most of it is plain values. The interesting shapes are the last five:</p><ul><li><strong>Ternary</strong> keeps both sides. The condition itself isn't stored as a value. Panda keeps a pointer to where it sits in your source, so it can copy it out later.</li><li><strong>And</strong> is <code>condition &amp;&amp; value</code>.</li><li><strong>Branches</strong> holds alternatives with no condition to point at, like a conditional value imported from another file.</li><li><strong>Open</strong> means Panda can't know this value at build time.</li><li><strong>Open with a fallback</strong> means Panda can't know the value, but it knows what to fall back to.</li></ul><p>Conditions like <code>_hover</code> and <code>md</code> aren't special nodes. They're ordinary nested objects, so a ternary inside <code>_hover</code> just lives one level deeper, at <code>_hover → color</code>.</p><p>Here's the running example as a tree:</p><p><img alt="A css() call becomes a StyleTree: an object with fontSize set to xl and color set to a ternary on active, with red.700 and gray.700 as its branches. The tree then feeds two outputs: the stylesheet, with fs_xl, c_red.700 and c_gray.700, and the rewritten code, active ? &quot;c_red.700 fs_xl&quot; : &quot;c_gray.700 fs_xl&quot;." src="https://lope.adebesin.com/images/blog/the-ir-behind-your-ternary/tree.svg" width="1200" height="860"></p><h2 id="how-your-code-becomes-branches">How your code becomes branches</h2><p><a href="https://lope.adebesin.com/blog/panda-never-runs-your-code">Part 4</a> covered how Panda works out values without running your code. The StyleTree is where that work lands.</p><p>When Panda can work out a ternary's condition at build time, it picks the matching side and stores only that. No ternary ends up in the tree.</p><p>When the condition depends on runtime, like <code>active</code> here, it keeps both sides in a ternary node.</p><p>The logical operators split two ways:</p><ul><li><code>active &amp;&amp; value</code> becomes an <strong>And</strong> node.</li><li><code>a ?? b</code> and <code>a || b</code>, with a left side Panda can't know, become <strong>Open with a fallback</strong>, where <code>b</code> is the fallback.</li></ul><p>That last rule is the answer to part 4's opening puzzle. <code>colorByType[type] ?? 'gray.100'</code> is an open value with <code>'gray.100'</code> as its fallback. So <code>gray.100</code> is the only color Panda ever sees.</p><h2 id="output-one-the-stylesheet">Output one: the stylesheet</h2><p>To generate CSS, Panda flattens the tree into the atoms from <a href="https://lope.adebesin.com/blog/every-style-is-an-atom">part 2</a>. Every branch gets its atoms emitted, because Panda can't know which one will run.</p><p>So the running example produces three atoms:</p><pre><code>.fs_xl { font-size: var(--font-sizes-xl) }
.c_red\.700 { color: var(--colors-red-700) }
.c_gray\.700 { color: var(--colors-gray-700) }
</code></pre><p>For the other shapes:</p><ul><li>An <strong>And</strong> node emits its value.</li><li>An <strong>open</strong> node with a fallback emits the fallback.</li><li>An <strong>open</strong> node without one emits nothing, since there's nothing to emit.</li></ul><p>This is the same for every Panda project, with or without source transforms.</p><h2 id="output-two-your-code">Output two: your code</h2><p>With source transforms on, the bundler plugin walks the same tree and rewrites the call.</p><p>It looks for each place in the tree that holds a condition. Then it moves the condition outward, to the edge of the whole call. Each branch gets the static styles plus its own value, and becomes a complete class string. That's how the opening call became <code>active ? "c_red.700 fs_xl" : "c_gray.700 fs_xl"</code>.</p><p><code>fs_xl</code> appears in both strings, because each one has to be complete on its own.</p><p>Conditions nested under <code>_hover</code> work the same way:</p><pre><code>// you write
css({ fontSize: 'xl', _hover: { color: active ? 'red.700' : 'gray.700' } })

// your bundle ships
active ? "fs_xl hover:c_red.700" : "fs_xl hover:c_gray.700"
</code></pre><p>And a conditional spread is just a ternary with an empty side:</p><pre><code>// you write
css({ fontSize: 'xl', ...(active &amp;&amp; { color: 'red.700' }) })

// your bundle ships
active ? "c_red.700 fs_xl" : "fs_xl"
</code></pre><h2 id="two-conditions-not-four-strings">Two conditions, not four strings</h2><p>Add a second condition and you might expect four strings, one for every combination. That's not what happens:</p><pre><code>// you write
css({
  fontSize: 'xl',
  color: active ? 'red.700' : 'gray.700',
  padding: compact ? '2' : '4',
})

// your bundle ships
"fs_xl" + " " + (active ? "c_red.700" : "c_gray.700") + " " + (compact ? "p_2" : "p_4")
</code></pre><p>Each condition gets its own small ternary, and the pieces are joined. Atoms that every branch shares, like <code>fs_xl</code> here, are pulled out and written once. Each new condition adds one ternary, so the output grows linearly.</p><p>That works because each atom is independent. <code>color</code> doesn't care what <code>padding</code> is.</p><h2 id="when-it-does-multiply">When it does multiply</h2><p>Recipes are different, and so are patterns with default values. A recipe's default variants and compound variants depend on the whole selection, not one variant at a time. So for these, Panda builds every combination as a decision tree:</p><pre><code>// you write
badge({ tone: danger ? 'danger' : 'neutral', size: big ? 'lg' : 'sm' })

// your bundle ships
"badge" + " " + (danger
  ? (big ? "badge--tone_danger badge--size_lg" : "badge--tone_danger badge--size_sm")
  : big ? "badge--tone_neutral badge--size_lg" : "badge--tone_neutral badge--size_sm")
</code></pre><p>That gets big fast. Two conditions make four strings, five make thirty-two, and every one of them is a full class string. At some point the rewrite stops paying off: the strings Panda would inline end up bigger than the short recipe call they replace. So Panda caps it at 16 combinations. A recipe call with more than that stays a runtime call, which is the smaller option.</p><p>There's also a separate cap for any single call: past 64 conditional sites, Panda doesn't rewrite it at all.</p><h2 id="when-the-tree-has-an-unknown-in-it">When the tree has an unknown in it</h2><p>A call can't become a fixed string if some value in it is open. But Panda doesn't give up on the whole call. It rewrites what it can and leaves only the unknown part to the runtime:</p><pre><code>// you write
css({ fontSize: 'xl', width: props.width })

// your bundle ships
__pcx("fs_xl", css({ width: props.width }))
</code></pre><p><code>__pcx</code> is a tiny helper the transform imports to join the two halves.</p><p>Property-level <code>&amp;&amp;</code> lands in the same place:</p><pre><code>// you write
css({ fontSize: 'xl', color: active &amp;&amp; 'red.700' })

// your bundle ships
__pcx("fs_xl", css({ color: active &amp;&amp; 'red.700' }))
</code></pre><p>The spread version above did get rewritten, so why not this one? The difference is the falsy side. <code>active &amp;&amp; { color: 'red.700' }</code> is either an object or nothing to merge. But <code>active &amp;&amp; 'red.700'</code> evaluates to whatever <code>active</code> is when it's falsy: <code>false</code>, <code>0</code>, an empty string. Panda can't turn an unknown value like that into a fixed class, so it hands it to the runtime.</p><p>Two more cases keep the whole call at runtime:</p><ul><li><strong>Two conditions writing the same property.</strong> In an object, the last write wins. Separate atomic classes can't express "the last one wins", so Panda leaves the call alone.</li><li><strong>Conditions that live in another file.</strong> When a conditional value comes through an import, Panda knows both branches, so the stylesheet still gets both. But the condition itself is in the other file, so there's nothing local to copy into the rewrite.</li></ul><h2 id="what-this-means-for-your-code">What this means for your code</h2><p>Most of this happens without you thinking about it. A few habits keep more calls fully rewritten:</p><ul><li><strong>Ternaries and conditional spreads compile away.</strong> Prefer <code>...(active &amp;&amp; { color: 'red.700' })</code> or <code>active ? 'red.700' : undefined</code> over <code>color: active &amp;&amp; 'red.700'</code>.</li><li><strong><code>??</code> and <code>||</code> on a runtime value keep that value at runtime.</strong> Only the fallback gets CSS. If you know all the possible values, use a recipe or a lookup that Panda can read.</li><li><strong>Keep the condition next to the call.</strong> A condition imported from another file still gets its CSS, but not the rewrite.</li><li><strong>Give runtime values their own property.</strong> Everything else in the call still becomes classes.</li><li><strong>One variant beats five booleans.</strong> A recipe with many conditional variants can hit the 16-combination cap. A single variant with several values doesn't multiply.</li></ul><p>None of these are required. A call that can't be rewritten still works, it just keeps its runtime form.</p><h2 id="one-tree-two-outputs">One tree, two outputs</h2><p>Both outputs come from one model of your style, so they always agree.</p><p><em>Next in the series: how Panda makes variants fast, and what <code>cva</code> and <code>sva</code> do with the same combination logic. If you missed the earlier parts: <a href="https://lope.adebesin.com/blog/build-once-at-build-time">Build once, at build time</a>, <a href="https://lope.adebesin.com/blog/every-style-is-an-atom">Every style is an atom</a>, <a href="https://lope.adebesin.com/blog/look-it-up-once">Look it up once</a>, <a href="https://lope.adebesin.com/blog/panda-never-runs-your-code">Panda never runs your code</a>, <a href="https://lope.adebesin.com/blog/what-runtime-means-in-panda">What runtime means in Panda</a>.</em></p>]]></content:encoded>
            <enclosure length="0" type="image/svg+xml" url="https://lope.adebesin.com/images/blog/the-ir-behind-your-ternary/tree.svg"/>
        </item>
        <item>
            <title><![CDATA[What "runtime" means in Panda]]></title>
            <link>https://lope.adebesin.com/blog/what-runtime-means-in-panda</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/what-runtime-means-in-panda</guid>
            <pubDate>Wed, 28 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Does Panda CSS have a runtime? Yes, a small one, and it never creates CSS. What ships to the browser by default, what it does there, and how source transforms remove it.]]></description>
            <content:encoded><![CDATA[<p>What actually ships to the browser when you use Panda.</p><post-cover></post-cover><p><em>An interlude in the Panda internals series, between <a href="https://lope.adebesin.com/blog/panda-never-runs-your-code">part 4</a> and <a href="https://lope.adebesin.com/blog/the-ir-behind-your-ternary">part 5</a>. Call it the series' OVA. I've had to explain what "runtime" means in Panda more than once, so this one clears it up before we go deeper.</em></p><p>The question comes up every time Panda is compared to another styling library: does it have a runtime?</p><p>Yes. A small one. It never creates CSS.</p><p>Both halves of that answer matter, and people usually only hear one of them. "It has a runtime" turns into "it's CSS-in-JS like Emotion". "It's build time" turns into "nothing ships". Neither is right. Here's what does ship.</p><h2 id="three-things-by-default">Three things by default</h2><p>Take one component:</p><pre><code>import { css } from '../styled-system/css'

export function Title() {
  return &lt;h1 className={css({ color: 'red.300', fontSize: '2xl' })}&gt;Hi&lt;/h1&gt;
}
</code></pre><p>With Panda's default setup, three things reach the browser.</p><p><img alt="By default, three things ship: the stylesheet, your style objects and the css() function. With transform: true, the same stylesheet ships with plain class strings, and the objects and the function are gone." src="https://lope.adebesin.com/images/blog/what-runtime-means-in-panda/ships.svg" width="1200" height="675"></p><p><strong>1. A stylesheet.</strong> Panda generates CSS at build time and writes it to a real <code>.css</code> file. You load it like any other stylesheet. The rules for <code>color: red.300</code> and <code>fontSize: 2xl</code> are in there before your app starts.</p><p><strong>2. Your style objects.</strong> <code>{ color: 'red.300', fontSize: '2xl' }</code> is an argument in your component code, so it stays in your JavaScript bundle. Panda extracted it for the stylesheet, but it didn't remove it from your source.</p><p><strong>3. The <code>css()</code> function.</strong> It takes that object and returns class names:</p><pre><code>'c_red.300 fs_2xl'
</code></pre><p>To do that, it walks the object, resolves shorthands, sorts conditions and builds each name from a small table of utility names that Panda generates into <code>styled-system/css</code>.</p><p>So when someone says Panda leaves styles in your bundle, they're right about the objects. The CSS is a different story.</p><h2 id="what-the-runtime-never-does">What the runtime never does</h2><p>The <code>css()</code> function doesn't generate CSS. It doesn't inject a <code>&lt;style&gt;</code> tag or touch the DOM. It builds strings that point at rules the stylesheet already has.</p><p>That's the line between Panda and runtime CSS-in-JS. Emotion and styled-components generate CSS in the browser and insert it while your app renders. Panda did that work during the build, so all the browser does is look up the class names.</p><p>There's one opt-in exception. If you use <a href="https://panda-css.com/docs/theming/multiple-themes" rel="nofollow">multiple themes</a> and load one on demand, <code>injectTheme</code> puts that theme's CSS into a <code>&lt;style&gt;</code> tag. Even then, the CSS was generated at build time. The browser only inserts it.</p><h2 id="removing-the-runtime">Removing the runtime</h2><p>In v2, you can remove the last two items as well. Turn on <a href="https://panda-css.com/docs/styling/source-transforms" rel="nofollow">source transforms</a> with <code>transform: true</code> on the bundler plugin:</p><pre><code>import pandacss from '@pandacss/vite'

export default defineConfig({
  plugins: [pandacss({ transform: true })],
})
</code></pre><p>The same option works on the webpack, Rollup and Bun plugins. Rspack and Rolldown go through the webpack and Rollup ones.</p><p>With it on, the bundler rewrites each call to the class string Panda already worked out:</p><pre><code>// you write
&lt;h1 className={css({ color: 'red.300', fontSize: '2xl' })}&gt;Hi&lt;/h1&gt;

// your bundle ships
&lt;h1 className="c_red.300 fs_2xl"&gt;Hi&lt;/h1&gt;
</code></pre><p>The object is gone, and so is the call. Pattern calls, recipe calls and style props on the <code>styled</code> factory get the same treatment. <code>&lt;Stack gap="4"&gt;</code> becomes a plain <code>&lt;div&gt;</code> with a class string.</p><p>A few things stay:</p><ul><li><strong>Calls Panda can't resolve.</strong> If a value only exists at runtime, the call keeps its runtime form. That's by design. <a href="https://lope.adebesin.com/blog/panda-never-runs-your-code">Part 4</a> covers what Panda can follow and where it stops.</li><li><strong>Joins with your own class names.</strong> When a call site mixes Panda styles with a class from somewhere else, Panda rewrites what it can and joins the rest. Where the merge needs real conflict resolution, it imports <code>cx</code> from your <code>styled-system</code>.</li><li><strong>Turbopack.</strong> It has no plugin API, so there's no Turbopack adapter yet. On Next.js 16, that means running <code>next dev --webpack</code> and <code>next build --webpack</code>, or keeping transforms off. There's also an unofficial workaround, below.</li></ul><h2 id="an-unofficial-turbopack-workaround">An unofficial Turbopack workaround</h2><p>Turbopack can't take a plugin, but it does run loaders, and a loader can rewrite JavaScript. The hard part of a Turbopack adapter is the CSS, and you can skip that entirely: let the Panda CLI write the stylesheet, import it, and leave the bundler only the JavaScript to rewrite.</p><p>The loader asks Panda's compiler to transform each file:</p><pre><code>// panda-turbopack-loader.cjs
let ready
async function getCompiler(cwd) {
  if (!ready) ready = (async () =&gt; {
    const { createNodeDriver } = await import('@pandacss/compiler')
    const driver = await createNodeDriver({ cwd })
    driver.codegen({ cwd })
    driver.parseFiles()
    return driver.compiler ?? driver
  })()
  return ready
}

module.exports = function pandaLoader(source) {
  const callback = this.async()
  const id = this.resourcePath
  ;(async () =&gt; {
    const { transformSource, shouldTransform } = await import('@pandacss/transformer')
    if (!shouldTransform(id)) return callback(null, source)
    const compiler = await getCompiler(this.rootContext)
    const result = transformSource({ path: id, source, compiler })
    callback(null, result.changed ? result.code : source, result.map)
  })().catch(callback)
}
</code></pre><pre><code>// next.config.mjs
export default {
  turbopack: {
    rules: { './app/**/*.tsx': { loaders: ['./panda-turbopack-loader.cjs'] } },
  },
}
</code></pre><p>Run <code>panda --watch</code> (or <code>panda cssgen</code> before a build) and import <code>styled-system/styles.css</code> in your root layout.</p><p>On Next.js 16.4.3 with Panda 2.4.0, a plain <code>next build</code> gives HTML with the final class names in it, and the <code>css()</code> runtime is gone from the client chunks. <code>next dev</code> gives the same result, and hot reload works: change a style and the new class name shows up without a page reload, with component state intact.</p><p>Leave out the <code>as: '*.tsx'</code> option you'll see in older loader examples. On 16.4 it renames files to <code>card.tsx.tsx</code> and the build fails.</p><p>It's unofficial, so know the limits:</p><ul><li><strong><code>cx</code> brings the runtime back.</strong> When a call mixes in a dynamic class name, the loader leaves <code>import { cx } from '../styled-system/css'</code>. That file also sets up <code>css()</code>, so the whole runtime ships again. The same component built with the Vite plugin ships without it.</li><li><strong>Hot reload needs <code>panda --watch</code>.</strong> The loader updates the class name on every save, but the rule behind it only exists once the CLI rewrites the stylesheet. Without the watcher, a new value gives you a class name with no CSS.</li><li><strong>Each build worker starts its own Panda.</strong> Next runs several, and each one loads the compiler.</li></ul><h2 id="the-numbers">The numbers</h2><p>I built a small Preact app with Vite and Panda 2.4.0, using the default presets. Preact is small enough that Panda's share of the bundle is easy to see. Each component has four <code>css()</code> calls, with hover, focus and responsive styles, and one ternary.</p><p>All sizes are gzipped:</p><table><thead><tr><th>JS</th><th>Transforms off</th><th>Transforms on</th></tr></thead><tbody><tr><td>Preact alone, no Panda</td><td>5.1 kB</td><td>5.1 kB</td></tr><tr><td>1 component</td><td>11.8 kB</td><td>5.3 kB</td></tr><tr><td>40 components</td><td>13.0 kB</td><td>6.5 kB</td></tr></tbody></table><p>The stylesheet for 40 components was 7.0 kB both times.</p><p>A few things stand out:</p><ol><li><strong>The stylesheet didn't change.</strong> Same file, same hash. The transform only touches JavaScript.</li><li><strong>The saving is fixed.</strong> About 6.4 kB goes with one component, and about the same with forty. That's the runtime leaving.</li><li><strong>With transforms on, Panda costs almost nothing in JS.</strong> One component adds 0.2 kB over plain Preact. That's the class strings.</li><li><strong>Objects compress well.</strong> Going from 1 to 40 components adds 1.2 kB either way. The strings that replace the objects compress about as well as the objects did.</li><li><strong>Neither build injects CSS.</strong> No <code>insertRule</code>, no <code>&lt;style&gt;</code> element, with transforms on or off.</li></ol><p>The ternary is worth a look too. <code>color: active ? 'red.700' : 'gray.700'</code> didn't stay a runtime call. It became a ternary between two finished strings:</p><pre><code>className: e ? `c_red.700 fs_xl fw_bold lh_tight` : `c_gray.700 fs_xl fw_bold lh_tight`
</code></pre><h2 id="should-you-turn-it-on">Should you turn it on?</h2><p>The win is real but fixed: a few kilobytes gzipped, and it doesn't grow much with your app. Your numbers will differ, so measure your own bundle before and after. If you're on Turbopack, or a lot of your <code>css()</code> calls depend on runtime values, leaving it off is fine. Your CSS is still generated at build time either way.</p><h2 id="the-short-version">The short version</h2><p>Next time someone asks, here's the whole answer:</p><blockquote><p>Panda generates all your CSS at build time. By default, your style objects and a small <code>css()</code> function ship to the browser, and that function only turns objects into class names. It never creates CSS. Turn on source transforms and those are replaced with plain strings at build time.</p></blockquote><p><em>If you want the full trip a <code>css()</code> call takes through the build, start with <a href="https://lope.adebesin.com/blog/build-once-at-build-time">Build once, at build time</a>.</em></p>]]></content:encoded>
            <enclosure length="0" type="image/svg+xml" url="https://lope.adebesin.com/images/blog/what-runtime-means-in-panda/ships.svg"/>
        </item>
        <item>
            <title><![CDATA[Practice what you maintain]]></title>
            <link>https://lope.adebesin.com/blog/practice-what-you-maintain</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/practice-what-you-maintain</guid>
            <pubDate>Mon, 26 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Why my portfolio now runs on Panda CSS and Ark UI, the libraries I help maintain, and what else changed over one tired weekend.]]></description>
            <content:encoded><![CDATA[<h3 id="why-my-portfolio-now-runs-on-the-libraries-i-help-maintain-and-what-else-changed-over-one-tired-weekend">Why my portfolio now runs on the libraries I help maintain, and what else changed over one tired weekend.</h3><p>Last week <a href="https://x.com/zarazhangrui" rel="nofollow">Zara Zhang</a> posted <a href="https://x.com/zarazhangrui/status/2113148949842534482" rel="nofollow">this</a> and it blew up:</p><blockquote><p>Your personal website is the new resume</p></blockquote><p>I bookmarked it and told myself I'd redesign my site. Then I remembered how long the last redesign took me.</p><h2 id="it-took-me-years">It took me years</h2><p>On January 1, 2023, I opened an issue on this repo called "Upgrade to v2". I closed it in June this year. Most of that time I just couldn't decide what my site should look like.</p><p>In the end I went with something like <a href="https://antfu.me" rel="nofollow">antfu.me</a>. <mention handle="antfu" name="Anthony Fu"></mention> is one of the people I look up to in open source, and I love his taste in design. A lot of this site borrows from his, even the handwritten logo. What's mine is the green, what's on the pages, and what it's built with.</p><p>So I didn't want to redesign again. I kept the look and changed the stack.</p><h2 id="practice-what-you-preach">Practice what you preach</h2><p>The site moved to Nuxt in June, mostly because I'd started liking Nuxt. Also, the green matched my avatar. Maybe that's why I love Zag too 😅</p><p>The styling was <a href="https://unocss.dev" rel="nofollow">UnoCSS</a>, which is also Anthony's work, and it served the site well. But I maintain Panda CSS and Ark UI, and I'm in the middle of a whole <series-link name="Panda internals">series on Panda's internals</series-link>. It made sense for my own site to use what I maintain. So over the weekend I moved it to Panda CSS v2, with Ark UI underneath the components.</p><p>Using it on my own site shows me where Panda can improve, and I learn better patterns I can take back to the Panda ecosystem. For example, turning on <code>strictTokens</code> flagged every value I'd hardcoded, so I swapped them for design tokens. Panda's style lint now runs in CI on every pull request, next to formatting, linting and types.</p><h2 id="the-rest-of-the-weekend">The rest of the weekend</h2><p>I was tired, but I was fired up too. Here's what else I shipped:</p><ul><li>Blog, Talks and Releases tabs. My first talk is on the talks page, and the releases tab lists every PR I've merged across open source.</li><li>A handwritten logo and favicon.</li><li>An accessibility pass: contrast, heading order, alt text and menu focus.</li><li>Self-hosted fonts.</li><li>Better share cards that show each post's description and its part in a series.</li></ul><h2 id="staying-on-nuxt-for-now">Staying on Nuxt for now</h2><p>I also read Marina Aísa's <a href="https://marinaaisa.com/blog/the-point-of-a-personal-website/" rel="nofollow">What is the point of a personal website anymore?</a>. She moved her site from a Nuxt single-page app to a static Astro site. Her rule: "every piece I add has to justify why it's there."</p><p>I'm not doing that yet. I like Nuxt, so I'm sticking with it for now. Maybe later.</p><p>Oh, and it's official now. I'm a maintainer at <a href="https://zagjs.com" rel="nofollow">Zag</a> 👼</p><p>If you want to see how Panda works under the hood, start with <a href="https://lope.adebesin.com/blog/build-once-at-build-time">part 1 of the series</a>.</p><series-card name="Panda internals"></series-card>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Panda never runs your code]]></title>
            <link>https://lope.adebesin.com/blog/panda-never-runs-your-code</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/panda-never-runs-your-code</guid>
            <pubDate>Sat, 24 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Panda CSS reads your source at build time and never runs it. What its static evaluator can follow, where it stops, and how to write styles it can see.]]></description>
            <content:encoded><![CDATA[<p>What Panda figures out before your app runs.</p><post-cover></post-cover><p><em>Panda internals, part 4. Start with <a href="https://lope.adebesin.com/blog/build-once-at-build-time">Build once, at build time</a> if you're new here.</em></p><p>Here's a component where every color is written right there in the file:</p><pre><code>const colorByType = {
  primary: 'red.300',
  secondary: 'blue.300',
}

function Section() {
  const [type] = useState('primary')
  const cls = css({
    color: colorByType[type] ?? 'gray.100',
  })

  return &lt;section className={cls} /&gt;
}
</code></pre><p>Panda only generates CSS for one of them, <code>gray.100</code>.</p><p>The reason is that Panda never runs your code. It reads it. At build time it works out each style value from the source alone, and it stops wherever a value depends on something only the running app knows. Here, that's <code>type</code>, which comes from <code>useState</code>. If <code>type</code> were a plain <code>const</code>, Panda could follow it and pick the right color.</p><p>So the useful question is what Panda can work out, and where it stops. In short, it follows:</p><ol><li>Constants, destructuring and math.</li><li>Imports from other files.</li><li>Enums and <code>token()</code>.</li><li>Small helper functions.</li><li>Ternaries, as long as both sides are known.</li></ol><p>Anything that depends on props, state or a network response is out of reach.</p><h2 id="constants-destructuring-and-math">Constants, destructuring and math</h2><p>The simplest case is a value you could find by reading the file top to bottom:</p><pre><code>const theme = {
  accent: 'red.300',
  space: 4,
} as const

const { accent } = theme

css({
  color: accent,
  padding: `${theme.space * 2}px`,
})
</code></pre><p>Panda follows <code>accent</code> back to <code>theme</code>, and works out the template to <code>8px</code>. Template literals, math and comparisons all work. So do TypeScript-only wrappers like <code>as const</code> and <code>satisfies</code>, which Panda simply looks through.</p><p>The rule for variables is that the value has to stay put. A <code>const</code> with a known value works. A <code>let</code> works too, unless something reassigns it later. Once a value can change, Panda can't know which version your code sees.</p><h2 id="imports-from-other-files">Imports from other files</h2><p>Most real styles live in more than one file. Say <code>tokens.ts</code> exports a color:</p><pre><code>export const brand = 'red.300'
</code></pre><p>And a component imports it:</p><pre><code>import { brand } from './tokens'

css({ color: brand })
</code></pre><p>Panda follows the import into <code>tokens.ts</code> and reads <code>brand</code> there. It resolves paths the same way your tooling does, including <code>tsconfig</code> path aliases and <code>package.json</code> exports. It also follows <code>export *</code> barrels. When <code>tokens.ts</code> changes, the files that import it get re-read too.</p><p>A few shapes it doesn't follow:</p><ul><li><strong>Default and namespace imports.</strong> <code>import theme from './theme'</code> and <code>import * as theme</code> aren't followed. Use named imports.</li><li><strong>Ambiguous barrels.</strong> If two <code>export *</code> lines both export a <code>brand</code>, Panda can't tell which one you mean, so it leaves it.</li><li><strong>Values that aren't static over there either.</strong> Following an import doesn't help if the other file builds the value at runtime.</li></ul><h2 id="enums-and-token">Enums and <code>token()</code></h2><p>TypeScript enums work, as long as each member has an explicit value:</p><pre><code>enum Size {
  Small = '8px',
  Large = '16px',
}

css({ padding: Size.Large })
</code></pre><p>An auto-numbered member, one with no <code>= value</code>, gets dropped.</p><p><code>token()</code> is the same idea from the other direction. Instead of Panda following your value, Panda fills in its own:</p><pre><code>import { token } from '../styled-system/tokens'

css({
  boxShadow:
    `0 0 0 1px ${token('colors.blue.500')}`,
})
</code></pre><p>At build time, <code>token('colors.blue.500')</code> is replaced with the token's actual value, and <code>token.var(...)</code> with its <code>var(--...)</code> reference. This only happens when <code>token</code> comes from your generated <code>styled-system</code>. A different function that happens to be called <code>token</code> is left alone.</p><h2 id="small-helper-functions">Small helper functions</h2><p>Helpers have the most specific rules. This one works:</p><pre><code>const ring = (color: string) =&gt; ({
  outlineWidth: '2px',
  outlineColor: color,
})

css(ring('blue.500'))
</code></pre><p>Panda isn't running <code>ring</code>. It reads the function's body, substitutes <code>'blue.500'</code> for <code>color</code>, and gets a plain object back.</p><p>That only works for a small set of shapes. A helper can be a single arrow expression, or a few <code>const</code> or <code>let</code> declarations followed by one <code>return</code>. It can destructure its parameters, use defaults, spread objects and call other helpers that follow the same rules.</p><p>It can't use <code>if</code>, loops, more than one <code>return</code>, <code>...rest</code> patterns, or built-ins like <code>.map</code> and <code>Object.fromEntries</code>. Those helpers are left unresolved, and their styles don't get generated. Most of the time the fix is a ternary:</p><pre><code>function ring(color?: string) {
  if (!color) return {}
  return { outlineColor: color }
}
</code></pre><p>becomes:</p><pre><code>const ring = (color?: string) =&gt;
  color ? { outlineColor: color } : {}
</code></pre><p>Same behavior, and now it's a shape Panda can read.</p><p>In v1, a JavaScript evaluator did this work. In v2 there's no interpreter at all, which is why helpers have to fit these shapes.</p><h2 id="ternaries-and">Ternaries, <code>&amp;&amp;</code> and <code>??</code></h2><p>Panda can't know which branch of a ternary runs, so it keeps both:</p><pre><code>css({
  fontWeight: active ? 'bold' : 'normal',
})
</code></pre><p>Both <code>bold</code> and <code>normal</code> get CSS. If the condition is something Panda already knows, like <code>size === 'lg'</code> with a constant <code>size</code>, it picks the right branch instead.</p><p>There's one catch. Both sides have to be workable. If either branch depends on something unknown, Panda drops the whole ternary, not just the bad half.</p><p><code>&amp;&amp;</code>, <code>||</code> and <code>??</code> behave differently. When Panda can't work out the left side, it uses the right side. So <code>isOpen &amp;&amp; 'red.300'</code> gives you <code>red.300</code>.</p><p>That's the answer to the puzzle from the top:</p><pre><code>colorByType[type] ?? 'gray.100'
</code></pre><p><code>type</code> comes from the running app, so the left side is unknown, and <code>??</code> resolves to its right side. <code>gray.100</code> is the only value Panda ever sees.</p><h2 id="two-smaller-rules">Two smaller rules</h2><p>A default value counts. In <code>function Button({ size = 'md' })</code>, Panda generates CSS for <code>md</code>. Anything a caller passes in later is unknown.</p><p>A partly known object still counts. If an object mixes static values with runtime ones, Panda keeps the static ones and skips the rest. One unknown property doesn't throw away the whole object.</p><h2 id="mdx-files-too">MDX files too</h2><p>Panda reads <code>.mdx</code> files in your <code>include</code> the same way. It picks up imports, <code>{expressions}</code> and the props on components:</p><pre><code>import { Box } from '../styled-system/jsx'

&lt;Box color="red.300"&gt;Hello&lt;/Box&gt;
</code></pre><p>It skips fenced code blocks, inline code, frontmatter and link URLs, so a code example in your docs never turns into real CSS. This landed in Panda 2.1.2. Before that, the Markdown around a component could stop its styles from being found.</p><h2 id="fixing-the-puzzle">Fixing the puzzle</h2><p>Since <code>type</code> is only known at runtime, the fix is to put every color somewhere Panda can see it. A <code>cva</code> recipe does that, because each variant is written out in full:</p><pre><code>const section = cva({
  base: { color: 'gray.100' },
  variants: {
    type: {
      primary: { color: 'red.300' },
      secondary: { color: 'blue.300' },
    },
  },
})

section({ type })
</code></pre><p>Now every color is in the source, so every color gets CSS, and the runtime only has to pick a class.</p><p>That's the pattern behind everything in this post. Panda can work out a lot more than people expect: imports, enums, tokens, helpers, both sides of a ternary. When it can't, move the values into a shape it can read, like a recipe, or list them in <a href="https://panda-css.com/docs/styling/static" rel="nofollow"><code>staticCss</code></a> so Panda generates them anyway.</p><p><em>Next in the series: <a href="https://lope.adebesin.com/blog/the-ir-behind-your-ternary">how Panda rewrites those ternaries straight into your code</a>. If you missed the earlier parts: <a href="https://lope.adebesin.com/blog/build-once-at-build-time">Build once, at build time</a>, <a href="https://lope.adebesin.com/blog/every-style-is-an-atom">Every style is an atom</a>, <a href="https://lope.adebesin.com/blog/look-it-up-once">Look it up once</a>.</em></p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Look it up once]]></title>
            <link>https://lope.adebesin.com/blog/look-it-up-once</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/look-it-up-once</guid>
            <pubDate>Tue, 20 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Why calling css() on every render stays cheap. The three ways Panda CSS's runtime memo builds a cache key, and why it waits before trusting an object.]]></description>
            <content:encoded><![CDATA[<p>Why calling <code>css()</code> on every render stays cheap.</p><post-cover></post-cover><p><em>Panda internals, part 3. Part 1: <a href="https://lope.adebesin.com/blog/build-once-at-build-time">Build once, at build time</a>. Part 2: <a href="https://lope.adebesin.com/blog/every-style-is-an-atom">Every style is an atom</a>.</em></p><p>In Panda, the CSS is already written at build time. What <code>css()</code> does in the browser is hand back class names. This call returns <code>'c_red.300 p_4'</code>:</p><pre><code>css({ color: 'red.300', padding: '4' })
</code></pre><p>No CSS gets created there. But <code>css()</code> runs a lot. Every component, every render, and on the server for every request. So Panda wraps it in a small cache, <code>memo()</code>. The same goes for <code>cva</code>, <code>sva</code>, recipes and patterns in the generated <code>styled-system</code>.</p><p>A cache needs a key, and the key has to be cheap to build. Panda picks one of three, per call:</p><ol><li>Flat styles get a hash of their values.</li><li>Composed styles get looked up by the objects inside them.</li><li>Everything else gets a string.</li></ol><h2 id="building-the-key-was-the-slow-part">Building the key was the slow part</h2><p>The first version of this cache used <code>JSON.stringify</code>. Turn the arguments into a string, use the string as the key.</p><p>It's correct, but it runs on every call, hits and misses alike. To find out the answer was already sitting in the cache, <code>memo()</code> first had to serialize the whole style object. In a page full of variant buttons, that stringify was the single biggest cost in the whole <code>css()</code> path.</p><p>That's why the memo in v2 picks its key based on what the arguments look like.</p><p>There's also a check before any of the three. When <code>css()</code> gets a single style object, it first looks that exact object up in a <code>WeakMap</code>. Pass the same object again, like one defined once at module level, and that's the whole lookup. An object written inline is a new object on every render, though, so it misses and moves on.</p><h2 id="_1-flat-styles-hash-the-values">1. Flat styles: hash the values</h2><p>The call at the top of this post is the common case the hash is built for. One object, no nesting, plain strings and numbers as values.</p><p>For those, Panda skips the string entirely. It walks the object once and folds every key and value into a number:</p><pre><code>let h = 5381
for (const key in style) {
  const text = key + String(style[key])
  for (const ch of text) {
    h = (h * 33) ^ ch.charCodeAt(0)
  }
}
</code></pre><p>That's simplified. If it hits a nested object halfway through, it gives up and returns <code>null</code>, and the call moves on to another path.</p><p>A hash can collide, so a match on the number isn't trusted on its own. Panda keeps a few entries per hash and compares the actual keys and values before returning anything. On a variant-heavy button benchmark, that alone gave <a href="https://github.com/chakra-ui/panda/commit/6e3c1600dc197250ae61ccda76fb79cff6cba53f" rel="nofollow">30 to 40 percent more SSR throughput</a>.</p><h2 id="_2-composed-styles-follow-the-objects">2. Composed styles: follow the objects</h2><p>You build a component on top of a component, and forward styles down:</p><pre><code>const base = css.raw({ px: '4' })
const danger = css.raw({ bg: 'red.500' })

function Button({ css: extra = [] }) {
  const cls = css([base, ...extra])
  return &lt;button className={cls} /&gt;
}

function DangerButton({ css: extra = [] }) {
  return &lt;Button css={[danger, ...extra]} /&gt;
}
</code></pre><p>Every render builds new arrays, <code>[danger, ...extra]</code> and <code>[base, ...extra]</code>. But <code>base</code> and <code>danger</code> are the same objects every time, created once when the module loaded.</p><p>The hash can't help here, because the arguments contain arrays. And stringify serializes the whole composition again, every render, for every element.</p><p>So when the arguments contain an array, Panda keys the call on <strong>object identity</strong> instead of value. It walks a small tree, a trie, one step per item in the arguments:</p><pre><code>root
└─ base
   └─ danger → 'px_4 bg_red.500'
</code></pre><p>The same objects in the same order always reach the same leaf.</p><p>Each step that holds an object is a <code>WeakMap</code>, so a style object that only lived for one render isn't kept alive by the cache.</p><p>On a three-level chain, that <a href="https://github.com/chakra-ui/panda/commit/25137db545ce9129462662483390b49f82d85ba8" rel="nofollow">took a composed call from 1.52ms to 0.85ms</a>. On a six-level chain, 2.11ms to 1.28ms.</p><h3 id="only-objects-it-has-seen-before">Only objects it has seen before</h3><p>Keying on identity works for the chain above, but not for this:</p><pre><code>&lt;Button css={[{ mt: '2' }]} /&gt;
</code></pre><p>That <code>{ mt: '2' }</code> is a fresh object on every render. Its identity never repeats, so the trie would never hit. Worse, every render would add new branches that nothing ever reads again. Keying every composed call on identity made this shape <a href="https://github.com/chakra-ui/panda/commit/172c52fb5326e84c3ab7e9aea2b718b1c0610ed2" rel="nofollow">about 7x slower</a> than just serializing it.</p><p>So a call only gets a place in the trie once the objects in it have been seen before. Until then, it goes down the value path like any other call. Reading the trie allocates nothing, so a miss is cheap. And the "have I seen these objects?" bookkeeping only runs on every fourth miss, not every miss.</p><p>That's enough for a repeating chain to land in the trie within a few calls, while inline styles barely pay anything for being checked. The inline shape ended up faster than it was before identity keys existed.</p><h2 id="_3-everything-else-stringify">3. Everything else: stringify</h2><p>Responsive values, nested conditions, anything the hash bails on and that isn't a composed array:</p><pre><code>css({ padding: { base: '2', md: '4' } })
</code></pre><p>These still use <code>JSON.stringify</code>. V8's stringify is native code, and it beats walking a nested object in JavaScript. For shapes that don't fit the first two paths, it's the fastest key available.</p><h2 id="how-big-the-cache-can-get">How big the cache can get</h2><p>Each part of the cache has a limit:</p><ul><li>The last call is checked first, because re-rendering with the same arguments is common.</li><li>Each hash keeps up to eight entries. Older ones for the same hash drop off.</li><li>Each cache keeps up to 500 entries. Past that, the oldest goes.</li><li>Identity lookups use <code>WeakMap</code>s, so they don't hold on to objects your code has let go of.</li></ul><p>Put together, on dense server-rendered pages, the <a href="https://panda-css.com/blog/panda-css-v2" rel="nofollow">v2 benchmarks</a> have repeated inline styles about 3x faster than the unmemoized path, a three-level wrapper chain about 4x, a six-level chain about 3x, and repeated flat objects 30 to 40 percent faster.</p><h2 id="calls-that-never-run">Calls that never run</h2><p>Part 1 covered source transforms. With <code>transform: true</code>, the bundler replaces calls Panda can fully work out at build time with the plain class string. Those never reach the memo at all, because they never run.</p><p>What's left at runtime is what couldn't be resolved ahead of time, like styles built from props or state. Those are the calls the memo is for.</p><p><em>Next in the series: <a href="https://lope.adebesin.com/blog/panda-never-runs-your-code">Panda never runs your code</a>, how Panda works out your style values without ever running your code. If you're new here, start with <a href="https://lope.adebesin.com/blog/build-once-at-build-time">Build once, at build time</a> and <a href="https://lope.adebesin.com/blog/every-style-is-an-atom">Every style is an atom</a>.</em></p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Every style is an atom]]></title>
            <link>https://lope.adebesin.com/blog/every-style-is-an-atom</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/every-style-is-an-atom</guid>
            <pubDate>Sat, 17 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How Panda CSS breaks your styles into atomic CSS, keeps each atom exactly once, and where atoms stop.]]></description>
            <content:encoded><![CDATA[<p>How Panda turns your styles into atoms, and keeps each one exactly once.</p><post-cover></post-cover><p><em>Panda internals, part 2. Part 1: <a href="https://lope.adebesin.com/blog/build-once-at-build-time">Build once, at build time</a>.</em></p><p>In part 1, I wrote about a generator I built that spat out 62,656 lines of CSS. It made a rule for every token, every utility, every condition. Every single one of those rules was an atom: one property, one value, one condition.</p><p>Panda works with the exact same unit. The difference is which atoms it keeps, and how many times it keeps them.</p><h2 id="same-declaration-many-names">Same declaration, many names</h2><p>Say you have three components:</p><pre><code>const card = css({ display: 'flex', padding: '4', color: 'gray.700' })
const header = css({ display: 'flex', padding: '4', _hover: { color: 'red.300' } })
const footer = css({ display: 'flex', padding: '4' })
</code></pre><p>With component-scoped CSS, each of these gets its own class. <code>display: flex</code> and <code>padding: 1rem</code> get written three times, under three different names. That's how component-scoped CSS is meant to work: one class per component, so the stylesheet grows with your components.</p><p>Panda counts something else. How many <em>different</em> declarations are in there?</p><ul><li><code>display: flex</code></li><li><code>padding: 4</code></li><li><code>color: gray.700</code></li><li><code>color: red.300</code>, on hover</li></ul><p>Four. That's all the CSS this code needs.</p><h2 id="what-an-atom-is">What an atom is</h2><p>An atom is the smallest piece of a style that still means something. A property, a value, and the conditions it applies under.</p><p>In v2 it's a real type in the Rust engine. Simplified, it looks like this:</p><pre><code>struct Atom {
    prop: Box&lt;str&gt;,
    value: AtomValue,
    conditions: SmallVec&lt;[Box&lt;str&gt;; 2]&gt;,
    important: bool,
}
</code></pre><p>If you don't read Rust, think of it as:</p><pre><code>type Atom = {
  prop: string
  value: string
  conditions: string[]
  important: boolean
}
</code></pre><p><code>conditions</code> is an ordered list, outside to inside. <code>{ md: { _hover: { color: 'red.300' } } }</code> becomes <code>['md', '_hover']</code>. A plain style with no condition gets an empty list.</p><h2 id="into-the-set">Into the set</h2><p>When Panda reads a file, the encoder walks every style object it extracted and turns each leaf into an atom. Then it puts the atom into a hash set.</p><p>A set only keeps one copy of anything. So the three <code>display: flex</code> declarations from earlier become one atom. The second and third inserts just find it already there.</p><p>There are two of these sets. Each file has its own. Then the project keeps one combined set, and counts how many files use each atom. That count matters in watch mode. Delete a file, and the atoms only that file used go away. The ones other files still need stay.</p><p>This isn't new to v2. v1 did the same thing in JavaScript, with a <code>Set&lt;string&gt;</code>. The key was a string built by gluing the parts together:</p><pre><code>'display]___[value:flex'
</code></pre><p>v2 keeps the same idea, but the key is a typed struct with its hash computed once and cached.</p><p>Ternaries work a little differently. Panda reads your code at build time, so it can't know which side of a ternary runs:</p><pre><code>css({ color: isActive ? 'red.300' : 'gray.700' })
</code></pre><p>So it keeps both. Two atoms, <code>c_red.300</code> and <code>c_gray.700</code>.</p><h2 id="from-atom-to-class">From atom to class</h2><p>Each atom becomes one class name. By default they're readable:</p><ul><li><code>display: flex</code> → <code>d_flex</code></li><li><code>padding: 4</code> → <code>p_4</code></li><li><code>color: gray.700</code> → <code>c_gray.700</code></li><li><code>color: red.300</code> on hover → <code>hover:c_red.300</code></li></ul><p>Conditions go in front, the property gets shortened, the value stays as you wrote it. If you'd rather ship short hashed names, there's <code>hash: true</code> in your config. It's off by default.</p><p>Either way, the same atom gives the same class name. Every build, every machine.</p><p>So the three components from earlier come out as this:</p><pre><code>@layer utilities {
  .d_flex { display: flex }
  .p_4 { padding: var(--spacing-4) }
  .c_gray\.700 { color: var(--colors-gray-700) }
  .hover\:c_red\.300:is(:hover, [data-hover]) { color: var(--colors-red-300) }
}
</code></pre><p>Four rules for three components. Add a fiftieth component with <code>display: flex</code> and <code>padding: 4</code>, and you get zero new rules.</p><p>So your stylesheet grows with the number of distinct atoms you use, not the number of components you write. And since your tokens are a finite set, there are only so many atoms to make.</p><h2 id="order-without-import-order">Order, without import order</h2><p>In plain CSS, when two rules have the same specificity, whichever one loaded last wins. Move an import, and your button changes color.</p><p>A set has no order. So before writing anything out, Panda sorts every rule by a fixed key:</p><ol><li>Plain rules first, then rules with a selector, then rules inside at-rules.</li><li>At-rules in a fixed order: supports, media, container, print. Size queries sort by their size.</li><li>Selector priority, from a table of pseudo-classes, so <code>:hover</code> and <code>:focus</code> land in a predictable order.</li><li>Property priority. Shorthands go before longhands, so <code>padding-top</code> comes after <code>padding</code> and wins.</li></ol><p>Ties fall back to the property name and the value. Nothing in that list depends on which file Panda read first, or what you imported where.</p><p>Class names and CSS order are two separate things. The class name is what your component gets. Where the rule sits in the file is decided by the sorter, and only the sorter.</p><h2 id="where-atoms-stop">Where atoms stop</h2><p>Two places work differently.</p><p><strong>Recipes.</strong> Config recipes, the ones you define under <code>recipes</code> in your Panda config, aren't atomic. A button recipe gives you <code>.button</code> and <code>.button--size_md</code>, with the declarations grouped under those class names in <code>@layer recipes</code>. They go through the same encoder walk, but come out grouped, in the order you wrote them. Atomic recipes, <code>cva</code> and <code>sva</code>, are different. They do become atoms.</p><p>So "everything in Panda is atomic" isn't quite true. It also means recipe rules don't get the set's dedup for free. When the same recipe shows up from two places, say your app and a <code>designSystem</code> package, Panda has to dedupe those groups on its own.</p><p><strong>Last write wins.</strong> In JavaScript, the later key wins:</p><pre><code>const style = { ...base, ...override }
</code></pre><p>Atomic classes don't work like that. If two classes both set <code>color</code>, the browser picks whichever rule comes later <em>in the stylesheet</em>. Not by where it appears in your object or your <code>className</code> string.</p><p>Panda handles most of this for you. <code>css(base, override)</code> merges the objects first, then turns the result into atoms, so the override wins the way you'd expect. And with source transforms on, if Panda can't tell which value wins at build time, it doesn't guess. It leaves the call alone.</p><p>The thing to avoid is joining two class strings by hand and expecting the second one to win. Merge styles with <code>css()</code>, not with string concatenation.</p><h2 id="in-short">In short</h2><p>So when you write <code>css({ ... })</code>, you're not adding a stylesheet. You're adding atoms to a set.</p><p>Often, they're already in it.</p><p><em>Next in the series: <a href="https://lope.adebesin.com/blog/look-it-up-once">Look it up once</a>, why calling <code>css()</code> on every render stays cheap.</em></p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build once, at build time]]></title>
            <link>https://lope.adebesin.com/blog/build-once-at-build-time</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/build-once-at-build-time</guid>
            <pubDate>Fri, 16 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[What Panda CSS actually does with your css() call at build time, step by step, and why doing that work before the browser matters.]]></description>
            <content:encoded><![CDATA[<p>What Panda does with your <code>css()</code> call before the browser ever sees it.</p><post-cover></post-cover><p><em>Panda internals, part 1.</em></p><p>Earlier this year, before I worked on Panda, I tried to get Chakra to ship static CSS instead of running Emotion in the browser. My first attempt was a generator that wrote a CSS rule for every token, every utility and every condition, ahead of time. It produced 62,656 lines of CSS. 3.8 MB. Almost none of it would ever be used.</p><p>So, technically, build time. Just the dumb version of it. 😅</p><p>Panda does its work at build time too, but it starts somewhere else. It reads your code first, and only generates what you actually wrote. It reads your files, finds your Panda calls, works out their values without running anything, turns them into CSS, and leaves the browser almost nothing to do.</p><p>We'll follow one component through all of it. A token in <code>tokens.ts</code>:</p><pre><code>export const brand = 'red.300'
</code></pre><p>And a badge in <code>badge.tsx</code> that uses it:</p><pre><code>import { css } from '../styled-system/css'
import { brand } from './tokens'

const size = 'lg'

export function Badge({ active }: { active: boolean }) {
  return (
    &lt;span
      className={css({
        color: brand,
        padding: size === 'lg' ? '3' : '2',
        fontWeight: active ? 'bold' : 'normal',
      })}
    /&gt;
  )
}
</code></pre><h2 id="why-not-just-do-it-in-the-browser">Why not just do it in the browser</h2><p>Runtime CSS-in-JS makes your user's browser pay the rent. On every render, something has to turn style objects into CSS, hash a class name and inject a <code>&lt;style&gt;</code> tag, on the user's device.</p><p>That cost is well measured by now. Sam Magura, one of Emotion's maintainers, <a href="https://dev.to/srmagura/why-were-breaking-up-wiht-css-in-js-4g9b" rel="nofollow">cut render time from 54.3ms to 27.7ms</a> by moving off it. Last month, GitHub <a href="https://github.blog/engineering/architecture-optimization/improving-site-performance-by-shipping-more-css/" rel="nofollow">wrote up</a> moving Primer onto CSS Modules, and server rendering took 55% less time. It also doesn't fit React Server Components, which can't inject styles at render time. A plain CSS file has no such problem.</p><p>My Chakra experiment showed the trade honestly. The render timer went <em>up</em>, from about 1ms to 2.5ms, because the browser now parses a stylesheet up front. But Total Blocking Time went from 160ms to 10ms. A little CSS parsing, in exchange for no style work during render.</p><h2 id="before-any-of-this-styled-system">Before any of this: <code>styled-system</code></h2><p>That <code>import { css } from '../styled-system/css'</code> has to come from somewhere. When you run <code>panda codegen</code>, Panda writes a <code>styled-system</code> folder into your project, generated from your config. It holds <code>css</code>, <code>cva</code>, patterns, recipes, the JSX helpers, and types for every token you defined. That's where your autocomplete comes from.</p><p>Keep that in mind. The <code>css</code> you import is a small generated function, and it never creates CSS in the browser.</p><h2 id="_1-read">1. Read</h2><p>Panda only looks at the files you point it at, through <code>include</code> in your config:</p><pre><code>export default defineConfig({
  include: ['./src/**/*.{ts,tsx}'],
})
</code></pre><p>Each of those files is parsed once into a syntax tree. In v2 the parser is <a href="https://oxc.rs" rel="nofollow">Oxc</a>, written in Rust, and it's fast. In the <a href="https://panda-css.com/blog/panda-css-v2" rel="nofollow">v2 release</a>, extracting 100 files went from 187ms to 7.5ms, and re-parsing a single file in watch mode dropped from about 652µs to under 2µs.</p><p>In most setups, Panda also looks at a file's imports before doing anything else. No Panda imports, and it can usually move on.</p><p><code>badge.tsx</code> imports <code>css</code> from <code>styled-system/css</code>, so Panda keeps going.</p><h2 id="_2-find">2. Find</h2><p>Panda checks what you imported and from where: <code>css</code>, <code>cva</code>, patterns like <code>stack</code>, your recipes, and JSX like <code>styled.div</code> or <code>&lt;Box&gt;</code>. Then it finds every place you call them.</p><p>It also checks scope. If you declare your own <code>css</code> that shadows the import, Panda knows that one isn't Panda's and leaves it alone.</p><p>In <code>badge.tsx</code>, it finds one <code>css()</code> call with three properties in it.</p><h2 id="_3-work-out-the-values">3. Work out the values</h2><p>This is the interesting part. Panda has the call, but <code>color: brand</code> and <code>padding: size === 'lg' ? '3' : '2'</code> aren't values yet. They're expressions.</p><p>Panda never runs your code. It works the values out from the syntax alone. That's a real difference from tools like Linaria, which fall back to running your code in Node when they can't work a value out.</p><p>Here's what happens to our three properties:</p><ul><li><strong><code>color: brand</code>.</strong> <code>brand</code> is imported from <code>tokens.ts</code>, so Panda follows the import, sees <code>'red.300'</code>, and uses that.</li><li><strong><code>padding</code>.</strong> <code>size</code> is a <code>const</code> with a literal value, so Panda knows it's <code>'lg'</code>. Now <code>size === 'lg'</code> can be decided, and the ternary resolves to <code>'3'</code>.</li><li><strong><code>fontWeight</code>.</strong> <code>active</code> is a prop. Panda can't know it at build time. But both branches are plain values, so it keeps both: <code>'bold'</code> and <code>'normal'</code>.</li></ul><p>That last rule has a catch. Both branches have to be workable. If either side can't be worked out, the whole ternary is dropped, not half of it.</p><p>Template literals, simple math and TypeScript casts like <code>as const</code> get worked out too. What doesn't:</p><ul><li>A <code>let</code> that gets reassigned somewhere.</li><li>A function parameter, unless its type spells out the literal values.</li><li>Anything that only exists at runtime. Props, state, an API response.</li></ul><p>Those get skipped. Panda would rather generate nothing than guess. The Panda docs have <a href="https://panda-css.com/docs/styling/dynamic-styling#runtime-reference-on-known-objects" rel="nofollow">a good example</a> of how that can catch you out:</p><pre><code>const colorByType = {
  primary: 'red.300',
  secondary: 'blue.300',
}

css({ color: colorByType[type] ?? 'gray.100' })
</code></pre><p><code>colorByType</code> is static, but <code>type</code> isn't. So the only thing Panda can extract here is the fallback, <code>gray.100</code>. The other colors never make it into the CSS.</p><p>v1 did all of this with a JavaScript evaluator. v2 works the expressions out directly in Rust, with no interpreter involved.</p><h2 id="_4-turn-it-into-css">4. Turn it into CSS</h2><p>Now Panda has plain values. Each property, value and condition becomes an atom, each atom is kept once, and they're sorted into a fixed order and written out:</p><pre><code>@layer utilities {
  .c_red\.300 { color: var(--colors-red-300) }
  .p_3 { padding: var(--spacing-3) }
  .fw_bold { font-weight: var(--font-weights-bold) }
  .fw_normal { font-weight: var(--font-weights-normal) }
}
</code></pre><p>Four rules. Both font weights are there, because Panda doesn't know which one you'll need. Nothing else is, which is the whole difference from my 62,656 lines.</p><h2 id="_5-whats-left-for-the-browser">5. What's left for the browser</h2><p>Remember the generated <code>css</code> function? In the browser, it takes your object and returns class names. The same names the build already wrote into the stylesheet:</p><pre><code>'c_red.300 p_3 fw_bold'
</code></pre><p>No CSS created, no <code>&lt;style&gt;</code> tag injected. Just a string.</p><p>In v2, even that can go. Turn on <a href="https://panda-css.com/docs/styling/source-transforms" rel="nofollow">source transforms</a> with <code>transform: true</code> on the Vite, webpack, Rollup or Bun plugin, and the bundler replaces the call with the strings Panda already worked out. The <code>active</code> check stays, because that's still a runtime decision. It's opt-in, it doesn't work with Turbopack yet, and any call Panda couldn't resolve stays as a normal runtime call.</p><h2 id="what-build-time-cant-see">What build time can't see</h2><p>All of this only works on what's in your source. When Sage <a href="https://www.adebayosegun.com/blog/chakra-panda-and-ark-whats-the-plan" rel="nofollow">wrote about Panda</a> back in 2023, it was described as "constrained to styles that can be statically analyzed." That's the deal.</p><p>When a value really does depend on runtime, you've got a few options:</p><ul><li><strong>Recipes.</strong> This is the one <a href="https://panda-css.com/docs/styling/dynamic-styling#runtime-reference-on-known-objects" rel="nofollow">the Panda docs push hardest</a>. For the <code>colorByType</code> case above, a <a href="https://panda-css.com/docs/recipes/atomic-recipe" rel="nofollow"><code>cva</code> recipe</a> with a <code>type</code> variant puts every color in the source, so all of them get extracted.</li><li><strong>CSS variables.</strong> Set the variable at runtime, reference it in your styles:<pre><code>&lt;div
  className={css({ color: 'var(--accent)' })}
  style={{ '--accent': accent }}
/&gt;
</code></pre></li><li><strong><a href="https://panda-css.com/docs/styling/static" rel="nofollow"><code>staticCss</code></a>.</strong> Tell Panda in your config which styles to generate anyway.</li><li><strong>Tokens.</strong> If a value can be a token, make it one. A finite set of tokens means a finite stylesheet.</li></ul><h2 id="the-whole-trip">The whole trip</h2><p>So here's what happened to that one <code>css()</code> call.</p><p>It started as an object full of expressions in <code>badge.tsx</code>. Panda read the file, found the call, followed <code>brand</code> into another file, decided <code>size === 'lg'</code>, kept both sides of <code>active</code>, and wrote four CSS rules. In the browser, all that's left is a function that hands back a string. With source transforms, not even that.</p><p>The browser gets a stylesheet that's already done.</p><p>Step 4 skipped over how atoms actually work: how Panda decides what counts as one, keeps each exactly once, and puts them in order. That's <a href="https://lope.adebesin.com/blog/every-style-is-an-atom">part 2</a>.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Predictable codebase]]></title>
            <link>https://lope.adebesin.com/blog/predictable-codebase</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/predictable-codebase</guid>
            <pubDate>Sat, 26 Sep 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[The IQ.wiki rewrite that taught me what a predictable codebase looks like, the harsh reviews it took, and why those rules let Claude write code like mine.]]></description>
            <content:encoded><![CDATA[<p>Why constraints scale code. For the humans on the team, and for the agents.</p><p><img alt="Four feature folders side by side, each holding the same four files: page, loading, error and queries. The last folder is dashed and still being written, and it already matches the others." fetchPriority="high" loading="eager" src="https://lope.adebesin.com/images/blog/predictable-codebase/cover.svg" width="1200" height="520"></p><p>When we started building <a href="https://www.bethelflow.com/" rel="nofollow">BethelFlow</a>, I had a lot of opinions about how I wanted the codebase to look. What I didn't have was any experience setting one up.</p><p>Up to that point I'd been a feature person. Someone else had already picked the linter, wired the formatter, decided where things lived and what a component was allowed to be. I'd show up, read the room, and ship inside it. That's a real skill, but it's a different one. On BethelFlow there was no room to read. The frontend was mine to set up, from the first <code>package.json</code> down, and every decision I didn't make on purpose was going to get made by accident.</p><h2 id="where-i-learned-what-good-looked-like">Where I learned what good looked like</h2><p>The lesson came from somewhere else first. At <a href="https://iq.wiki" rel="nofollow">IQ.wiki</a> we did a full revamp: a new look, and a move off Chakra UI v2 onto Tailwind. It would have been easy to treat it as a reskin. We didn't. We started with the most structural thing we could do, which was making sure the new codebase was future proof, easy to read, and strongly typed from day one.</p><p>A few things from that rewrite stuck with me for good.</p><p><strong>Types you don't write by hand.</strong> We used <a href="https://gql-tada.0no.co/" rel="nofollow">gql.tada</a>, which infers the TypeScript type of a GraphQL query straight from the schema. You write the query, and the result already has its shape. No hand-maintained interface drifting away from what the API actually returns. Where data came from somewhere GraphQL couldn't vouch for, <a href="https://zod.dev" rel="nofollow">Zod</a> did the same job at runtime. We spent our effort getting more types <em>inferred</em> instead of <em>written</em>, and I loved how clean that felt. If you want the idea behind it in one essay, it's Alexis King's <a href="https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/" rel="nofollow">Parse, don't validate</a>.</p><p><strong>A component does one thing.</strong> Small files. Not many lines. If a component was fetching, formatting, deciding, and rendering all at once, it got split. The old name for this is <a href="https://en.wikipedia.org/wiki/Separation_of_concerns" rel="nofollow">separation of concerns</a>, and it's less a rule than a habit of asking "what is this file actually for?"</p><p><strong>Composition over one big component.</strong> No single component juggling <code>isLoading</code>, <code>isError</code>, and the happy path in a tangle of ternaries. The error state rendered its own thing. The loading state rendered its own thing. The data rendered its own thing. React already gives you the pieces for this: <a href="https://react.dev/learn/thinking-in-react" rel="nofollow">composing components</a>, <a href="https://react.dev/reference/react/Suspense" rel="nofollow"><code>&lt;Suspense&gt;</code></a> for loading, and in Next.js, <a href="https://nextjs.org/docs/app/api-reference/file-conventions/error" rel="nofollow">error boundaries</a> for failure. Very clean principle.</p><p>None of it was clever. That was the point. It was simple, and simple stayed simple as the codebase grew.</p><h2 id="bringing-it-home">Bringing it home</h2><p>So I made BethelFlow the same. And it wasn't easy to start.</p><p>The tooling part was the quick bit. <a href="https://biomejs.dev" rel="nofollow">Biome</a> for linting and formatting. A <a href="https://typicode.github.io/husky/" rel="nofollow">husky</a> pre-commit hook running <a href="https://github.com/lint-staged/lint-staged" rel="nofollow">lint-staged</a>, so nothing unformatted gets committed in the first place. A pre-push hook that runs a full build. CI that runs <code>biome ci</code>, lints our i18n keys, and runs <a href="https://knip.dev" rel="nofollow">knip</a> to fail the build on unused files. TypeScript in <code>strict</code> mode. Boring, and exactly what I wanted.</p><p>The people part took longer. Getting everyone to follow the same rules meant long days of review. 🙃 Sending a PR back because a component did three things. Because a type was declared twice. Because a fetch was typed by hand when the schema was sitting right there. It felt very harsh back then. I could have let it slide. It worked, after all.</p><p>But every time I thought about overlooking it, I pictured myself a year later, opening a file I couldn't read, not knowing what was going on, in a codebase I was supposed to own. Short-term strictness felt expensive. Long-term unmaintainability was going to be more expensive, and it doesn't send an invoice. It just slows everything down until one day you notice.</p><p>So I made the choice: make it predictable enough that <em>I</em> could always understand it. There was no AI in the codebase then. This wasn't about agents. I just wanted type safety and good principles. Segregation of concerns. Declare a type once, and let every function call infer from it.</p><h2 id="what-that-looks-like-in-practice">What that looks like in practice</h2><p>Every feature in the dashboard has the same shape. Take prayer requests:</p><pre><code>prayer-request/
├── page.tsx
├── _schema.ts
├── _actions.ts
├── _hooks/
└── _components/
    ├── prayer-requests-view.tsx
    ├── prayer-requests-table.tsx
    ├── update-status-modal.tsx
    └── ...
</code></pre><p>Open any other feature, services, departments, records, and you'll find the same files in the same places. You don't learn the codebase feature by feature. You learn it once.</p><p>The types live in <code>_schema.ts</code>, declared exactly once as Zod schemas, and the TypeScript types fall out of them with <code>z.infer</code>. The server actions parse what the API sends back with the same schema, with <code>safeParse</code>, so a surprise shape from the backend gets stopped at the edge instead of leaking into a component three files away. Nothing downstream ever has to wonder what it was handed. Mutations go through <a href="https://next-safe-action.dev" rel="nofollow">next-safe-action</a>, with an auth client every action builds on, which I wrote about in <a href="https://lope.adebesin.com/blog/stop-yapping-lock-in">Stop yapping, Lock in</a>. Even the URL is typed, with <a href="https://lope.adebesin.com/blog/nuqs-because-urls-should-do-more">nuqs</a> parsers living in that same <code>_schema.ts</code>.</p><p>Here's the part I'm most fond of. Once a function returns typed data, nobody downstream declares that type again. They ask the function for it. The table that renders prayer requests never imports a <code>PrayerRequest[]</code> interface. It borrows the shape straight from the thing that fetched the data:</p><pre><code>type PrayerRequestRows = NonNullable&lt;
  Awaited&lt;ReturnType&lt;typeof usePrayerRequests&gt;&gt;['prayerRequests']
&gt;
</code></pre><p>Read it inside out. <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#returntypetype" rel="nofollow"><code>ReturnType</code></a> gets what the function returns. It's async, so that's a promise, and <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#awaitedtype" rel="nofollow"><code>Awaited</code></a> unwraps it. Index into <code>prayerRequests</code>, strip the <code>null</code> with <code>NonNullable</code>, and you have the exact rows the table is going to receive. Change the schema, and the action, the hook, the table, the column headers and the bulk-update modal all update with it. Or they stop compiling and tell you where to look. Some version of that line lives in almost 90 files, borrowing types from 57 different functions. Declare the type once, and let every call site infer it.</p><p>And the components compose. The prayer-request view is a few lines long. It owns the layout, wraps the list in <code>&lt;Suspense&gt;</code> with a table skeleton as the fallback, and lets the list worry about data. The skeleton renders the skeleton. The table renders the table. Nobody checks <code>isLoading</code>.</p><p>The same idea goes one level deeper. Every dashboard table is one shared <code>DashboardTable</code> that knows nothing about prayer requests, members or services. A feature doesn't fork it to add a bulk action. It passes in a small action object with a <a href="https://react.dev/reference/react/Children#calling-a-render-prop-to-customize-rendering" rel="nofollow">render prop</a> for the modal. The table owns selection and when the modal opens. The feature owns what the modal is. And because the action is generic over the row, the selected rows arrive already typed with that inferred shape from above. One table, lots of features, and none of them reach inside it.</p><p>Across the dashboard there are close to five hundred component and page files now. The median one is about a hundred lines. That number is the whole philosophy, measured.</p><p>It's one of the best things I did for the BethelFlow codebase, btw. 😅</p><h2 id="then-claude-joined-the-team">Then Claude joined the team</h2><p>Now we have Claude contributing, working the way I work. And the payoff is almost funny to watch.</p><p>Give it a new page to build and it doesn't invent anything. It reads a neighbouring feature, sees <code>_schema.ts</code>, <code>_actions.ts</code>, <code>_components/</code>, and produces the same shape. Schemas first, types inferred, a view that composes, a skeleton for the loading state. It uses the design system the same way, because there's only one way to use it.</p><p>This isn't magic, and it isn't really about the model. An LLM is a very good pattern-matcher, and it will match whatever patterns you have. A codebase with five ways to fetch data gets a sixth. A codebase with one way gets that one way, again. Strict types give it a compiler that says no before I have to. Consistent structure gives it an example to copy. DRY code means there's one place to change and one place to learn from. The guardrails I put up for humans turned out to be the exact same guardrails an agent needs. I wrote more about that overlap in <a href="https://lope.adebesin.com/blog/context-is-everything">Context is everything</a>: briefing an agent well and briefing a person well are mostly the same job.</p><p>The design system went through the same cleanup. We used to have hardcoded colour values scattered around, and at some point I'd had enough of that. They moved into tokens. Today it's <a href="https://tailwindcss.com" rel="nofollow">Tailwind CSS</a> with <a href="https://ui.shadcn.com" rel="nofollow">shadcn/ui</a>, and every colour is a CSS variable behind a semantic name like <code>bg-card</code> or <code>text-muted-foreground</code>. That change helped people, but it helped Claude even more. There is no hex code to guess. There's a name, and the name is right.</p><h2 id="whats-next">What's next</h2><p>The foundation holds, so now it's about building on it. Keeping up with the latest Next.js releases for speed, which is a lot less scary when the type checker and the build both have your back. And eventually a move to <a href="https://panda-css.com" rel="nofollow">Panda CSS</a>, once I have the time to do the switch properly. Given everything above, I expect most of that migration to be mechanical. Which is exactly how a migration should feel.</p><p>But mostly I'm just proud of how this codebase has grown. Humans and agents can both walk into it and contribute without asking where things go, because the code already tells them. That was the whole goal. Not clever. Predictable.</p>]]></content:encoded>
            <enclosure length="0" type="image/svg+xml" url="https://lope.adebesin.com/images/blog/predictable-codebase/cover.svg"/>
        </item>
        <item>
            <title><![CDATA[Hey Elvon!]]></title>
            <link>https://lope.adebesin.com/blog/hey-elvon</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/hey-elvon</guid>
            <pubDate>Thu, 10 Sep 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Five people, one random class assignment, and Elvon, the autonomous trash collector we built. The wiring disasters, the burned wire, and the defense.]]></description>
            <content:encoded><![CDATA[<p>How a random group assignment became the best team I've worked with, and a robot that actually moves.</p><p><img alt="Elvon, the autonomous trash collector, on the lab table with its bin, wheels and exposed wiring" src="https://lope.adebesin.com/images/blog/hey-elvon/cover.jpg" fetchPriority="high" loading="eager" width="2176" height="1080"></p><p>Hey Elvon!</p><p>I didn't like working on school group projects. Simply because projects were usually left to one person to take the full brunt of the work. But I think I had the great opportunity of working with this amazing team in building Elvon.</p><p>The team selection was done in class at random, and we got assigned a trash collector. Every other project had the variation of line follower only, or obstacle detection.</p><h2 id="meet-the-team">Meet the team</h2><p>Five of us. Babatunde Yetunde (our group leader), Ogundipe Victor (circuit specialist), Ajayi John (our media director), Alonge Emmanuel (build and packaging), and Adebesin Tolulope (software guy, that's me).</p><p><img alt="The team around the workbench, minus John, who was behind the camera" src="https://lope.adebesin.com/images/blog/hey-elvon/team.jpg" width="2000" height="991"></p><p>Before any robotics project, we need to simulate and make a visual prototype, which Victor helped create for us to build freely.</p><p><img alt="The Arduino, motor driver and ultrasonic sensor wired up on the breadboard for obstacle detection" src="https://lope.adebesin.com/images/blog/hey-elvon/prototype.jpg" width="1500" height="1125"></p><h2 id="day-one-was-all-vibes">Day one was all vibes</h2><p>For the first day, it was all vibes and chill. I remember it was so calm and everyone was so excited because it was going smoothly. We brought cameras, ready to take the occasion. And yeah, it did go smoothly.</p><p>And yeah, I tried to engage this time without being more passive. I was laughed at, obviously, so you don't know anything outside of working on your laptop (partly true). Because at the first point of touch, I didn't know what to do. I also have the fear of, well, electricity. We also tried to check if our glue gun was hot (yeah, I touched it and got a bit burnt, others claimed it wasn't hot). What are they feeding you guys?</p><video src="https://lope.adebesin.com/videos/blog/hey-elvon/glue-gun.mp4" poster="/videos/blog/hey-elvon/glue-gun.poster.webp" controls muted loop playsinline></video><p><a href="https://lope.adebesin.com/videos/blog/hey-elvon/glue-gun.mp4">"Just a little tap." Easy for him to say.</a></p><p>John took the major part of the camera work, he's a pro with cameras. Emmanuel and I started with the coupling, making sure we had the chassis ready and wheels for the more structural engineers to work here, Victor and Yetunde (their final year projects involved using Arduino, so they had more experience at it). And yeah, we got the very first setup. The motor connected and battery working as well. I <a href="https://x.com/I_am_Lope/status/2090907430687309843" rel="nofollow">posted this</a> as we were packing up for the day.</p><p><img alt="The bare chassis on its wheels, motors wired, nothing else on it yet" src="https://lope.adebesin.com/images/blog/hey-elvon/chassis.jpg" width="1500" height="1125"></p><h2 id="the-code">The code</h2><p>We also wrote out the code for the robot.</p><pre><code>// ==================== TIMINGS ====================
const unsigned long TURN_90_MS    = 500;   // calibration knob: bump up if it under-rotates (&lt; ~90 deg)
const unsigned long REVERSE_MS    = 600;
const unsigned long PIR_WARMUP_MS = 30000;

// ==================== ROBOT STATES ====================
enum RobotState {
  PATROL,
  PIR_WAIT,
  OBSTACLE_AVOID
};

RobotState currentState = PATROL;
</code></pre><p>Three states. That's the whole brain. Patrol until something is in the way, wait when a human shows up, avoid when the ultrasonic says there's a wall. No map, no path planning (more on why later).</p><p>And the ultrasonic read, which is about as simple as it gets:</p><pre><code>int readDistanceCm() {
  digitalWrite(TRIG, LOW);
  delayMicroseconds(2);

  digitalWrite(TRIG, HIGH);
  delayMicroseconds(10);

  digitalWrite(TRIG, LOW);

  unsigned long duration = pulseIn(ECHO, HIGH, 25000);

  if (duration == 0) {
    return 999;   // nothing came back, treat as clear
  }

  return (int)(duration / 58UL);
}
</code></pre><p>I think progressing from there was fully robotics. We worked on the obstacle avoidance, which I <a href="https://x.com/I_am_Lope/status/2091286868742566077" rel="nofollow">shared on my X page</a>.</p><video src="https://lope.adebesin.com/videos/blog/hey-elvon/obstacle-avoidance.mp4" poster="/videos/blog/hey-elvon/obstacle-avoidance.poster.webp" controls muted loop playsinline></video><p><a href="https://lope.adebesin.com/videos/blog/hey-elvon/obstacle-avoidance.mp4">Elvon backing off a wall and picking a new direction</a></p><h2 id="then-everything-started-breaking">Then everything started breaking</h2><p>One would think, oh yes, we're so done, let's get it. But that's when errors started surfacing, when we started to merge our other components together.</p><p>First was the problem that our motor was going in the opposite direction, hence no motion could be produced. Recalling that we made a judgement that we should alternate the wires around the motor board.</p><p>That was the tip of the iceberg.</p><h2 id="the-pir-sensors-humbled-us">The PIR sensors humbled us</h2><p>Merging the PIR sensors led to more real facing work (sensors are hard challenges). First it wasn't detecting properly. We wanted to use two sensors (for maximum efficiency), but it bit us in the back. Our robot was overstimulated, it sensed everything, and hence stopped at every point in time.</p><p>Before we also realized that we had maxed the output on the PIR sensors, so it had too long a range and that affected how it worked. After we figured that out, though a lot of times we had to edit our code thinking the code wasn't detecting as expected, it was the signals we were receiving that were not properly formed.</p><p>We removed one PIR and then we moved forward.</p><p><img alt="The PIR sensor with its two potentiometers, sensitivity and delay, both turned all the way up" src="https://lope.adebesin.com/images/blog/hey-elvon/pir-sensor.jpg" width="1080" height="775"></p><h2 id="giving-it-a-name-and-a-voice">Giving it a name, and a voice</h2><p>Now, a working robot. Let's add more human touch. Yetunde led the vision for the product here. We had to coin out the name for the robot. We called it Elvon.</p><p>So we added 3 audios to make the robot more human. Three tracks on the SD card, three moments:</p><table><thead><tr><th>Track</th><th>When it plays</th><th>What Elvon says</th></tr></thead><tbody><tr><td><code>0001.mp3</code></td><td>On boot, before it starts roaming</td><td><em>"Hi, I'm Elvon, your autonomous trash collector, made by CPE Group 7."</em></td></tr><tr><td><code>0002.mp3</code></td><td>A PIR sees a person</td><td><em>"Hi, kindly drop your trash in the waste bin."</em></td></tr><tr><td><code>0003.mp3</code></td><td>Bin-full sensor trips, robot parks</td><td><em>"Please empty the trash."</em></td></tr></tbody></table><p>You can hear all three in the demo video: <a href="https://1drv.ms/v/c/0b40b905323055ca/IQDLE1FB-RF9TpgcVQfxtQ6jAZ7Tr8_ad21ayhlklzirNjE?e=dRcxQE" rel="nofollow">Elvon, full run</a>.</p><p>Now the robot would introduce itself after a warm boot, and then move (without a map, this is most efficient for motor robots). If it senses it's expected to work, it says the line out loud and holds still long enough for you to actually drop something.</p><p>And here's the part I'm still not over. The first version of that voice was <strong>me</strong>. I recorded all three lines myself, and we actually shipped it, because the team said I sounded robotic. 😔 That was the compliment.</p><p>We only swapped it for a synthesised one because that one was louder, and in a room full of people you need the volume more than you need the authenticity.</p><p>But nah. Nothing made a sound.</p><h2 id="two-nights-fighting-a-speaker">Two nights fighting a speaker</h2><p>We thought okay, maybe the code. We went to the code and adjusted, and we did find out that the signals were probably polluting the way the speaker is meant to act, and the servo signal, because there was no edge case handled in the code. But the speaker still didn't work.</p><p>We had to wait till 9pm for 2 days trying to fight the speaker to work. We tried different techniques, using a resistor to bring the voltage down for it to maybe work for the DF module. We also tried to use maybe a 3.3V from the breadboard.</p><p>Oh, I forgot to mention that our board has a different design, hence the other side of the board wasn't even getting necessary voltage. We had to pass voltage from the battery across, and that helped, but the speaker didn't work.</p><p>We were almost giving up and switching to an LED, but we argued that's not efficient design. It's very easy to miss an LED, or even a screen, as not everyone would be watching a screen to see "drop trash."</p><p>We tried troubleshooting and we got a lot of static. What could be wrong?</p><p>Eventually we figured it out. We connected one of the output pins of the DFPlayer to a common ground with the Arduino.</p><p>(It's the DFPlayer, though. Nothing was wrong with the speaker. Two nights. A ground wire.)</p><p>Here it is, <a href="https://testfutaedu-my.sharepoint.com/:v:/g/personal/ogundipevocpe2020_futa_edu_ng/IQCY9FMv5TFMTqkmJd5GG_yOAccUtvn-4Avei3hgZUlujEs?e=hyawX2" rel="nofollow">the moment Elvon says its first line out loud</a>.</p><h2 id="teardown-four-days-out">Teardown, four days out</h2><p>Now all was working, but we needed the robot to reverse and turn properly. That wasn't even working. We tuned the code, made more adjustments, fixed a lot.</p><p>4 days to our defense, we had to tear it all down again, from the ground, pick each piece and troubleshoot so it doesn't give any issue.</p><p>And yay, we got it running. Really running. And all that was left was packaging.</p><p><img alt="Elvon fully disassembled on the table, every part laid out before the rebuild" src="https://lope.adebesin.com/images/blog/hey-elvon/teardown.jpg" width="960" height="540"></p><p>Emmanuel was solid here. He helped to ensure the proper packing of the robot, the design build.</p><h2 id="the-bin-and-the-wire-that-burned">The bin, and the wire that burned</h2><p>We wanted to make it more sophisticated by adding a servo motor to power the waste bin, but we ran into a few troubles. One, the bin we got was too heavy for the small body of the robot, hence the robot couldn't move.</p><p>On the same day, two days to our defense, the robot wire got burned pretty bad. We were able to isolate the problem quickly (we could have lost our project to a burn), (hey! I don't like hardware). Random burn, and we were just running tests.</p><p>But we didn't let that make us panic. We took an old charger and removed its pieces to make it work.</p><p><img alt="Sparks off a shorting wire" src="https://lope.adebesin.com/images/blog/hey-elvon/burnt-wire.gif" width="640" height="358"></p><p><em>(Oh no, another one, a few days before defense.)</em></p><h2 id="what-we-learned-about-power">What we learned about power</h2><p>And yes it did work. We resumed packing and were able to establish a few principles.</p><p>It takes a lot of power to run the small build, which affects the way the robot turns around. We advise using 4 batteries, but you have to use a buck converter here so you don't burn your Arduino.</p><p>The power drains battery, hence it wouldn't do for a long stretch of work. TTF would probably be high. But it's rechargeable, so it's easy to work with in short bursts and you can get it powered quickly.</p><h2 id="defense-day">Defense day</h2><p>The day of defense, our charger module stopped working 😭. Why must this happen?</p><p>Somehow everyone was unfazed. I mean, we spent so many late nights here, tired, hungry. We made our video for the whole project from start to finish and hoped we didn't have to do a long demo that would require us turning.</p><p>And yeah! We defended it. Funny, we were ready to answer questions but our demo and video were impressive enough that we didn't even have to go through any questioning. Our lecturer was very impressed. The design, the implementation. And amazing thought to every component.</p><p>One simple piece of engineering here is: simple design, but make it work. Don't overcomplicate it.</p><p>And yes, the robot is working. And the team really is the best I've worked with so far, responsive and very active group.</p><p><img alt="The five of us, one shot each, stitched into a single grid" src="https://lope.adebesin.com/images/blog/hey-elvon/team-grid.jpg" width="1560" height="694"></p><h2 id="lets-hear-from-the-team">Let's hear from the team</h2><p>I couldn't write this and only give you my side of it. I sat each of them down and asked the same seven questions. Same questions, wildly different answers, which is the part I love.</p><p>Here's what I asked everyone:</p><ol><li>What was the exact moment during the build when you realized your part of the system was actually going to hold together?</li><li>What was the worst late-night hardware or wiring disaster you had to debug when everyone else was half asleep?</li><li>If you could erase one component or bug from your memory forever, what would it be?</li><li>Looking back at the whole thing, what piece of the project are you secretly most proud that you pulled off?</li><li>If given another robotics project, would you love to participate?</li><li>What was the teamwork like for you?</li><li>Word of advice for other people that want to build theirs.</li></ol><hr><h3 id="victor-circuit-specialist">Victor, circuit specialist</h3><p><a href="https://x.com/Victobiloba" rel="nofollow">Victor on X</a> · <a href="https://www.linkedin.com/in/victor-ogundipe-933b34259/" rel="nofollow">LinkedIn</a></p><p><img alt="Victor, our circuit specialist" src="https://lope.adebesin.com/images/blog/hey-elvon/victor.jpg" width="1600" height="1067"></p><p><strong>The moment it held together.</strong>
There was a time everything stopped working, all the sensors. The moment we disconnected them and started all over again and they started working one after the other.</p><p><strong>The worst late night.</strong>
The night Yetunde had us wait till the speaker worked and it didn't 😭</p><p><em>(I want it on record that we did eventually beat the speaker. It just took a second night.)</em></p><p><strong>One thing to erase from memory.</strong>
It would be the PIR sensor oo. Tweaking the potentiometer on it to adjust the sensitivity isn't easy, you can't really tell the effect.</p><p><strong>Most proud of.</strong>
I didn't do it alone, we all did, because the code, the hardware connection and all. But basically I'll say the operation of the entire robot.</p><p><strong>Would you do another one?</strong>
Yes, if there's no strict deadline haha.</p><p><strong>The teamwork.</strong>
The teamwork was perfect, we had the ideal team.</p><p><strong>Advice.</strong>
Make sure you have a good team where everyone is willing to pour in their contributions.</p><hr><h3 id="john-media-director">John, media director</h3><p><img alt="John, our media director" src="https://lope.adebesin.com/images/blog/hey-elvon/john.jpg" width="1600" height="1067"></p><p><strong>The moment it held together.</strong>
For me, that moment came when we finally powered the system and saw the different parts responding the way we had designed them to. Seeing the sensors communicate with the controller and the motors respond to the commands made everything feel real.</p><p>At that point, it wasn't just wires, components, and code anymore. It was becoming an actual robot. That was when I knew, "Okay, this thing is really going to work."</p><p><strong>The worst late night.</strong>
One of the most frustrating moments was when the system suddenly refused to behave as expected, even though we were convinced the connections were correct.</p><p>We had to go through the wiring, power supply, sensors, motor connections, and code one after another. The funny part was that everyone was already tired, so every small problem felt ten times bigger.</p><p>Eventually, we discovered that the problem was related to a connection we had overlooked. Fixing it and seeing the system respond again was honestly one of the most satisfying moments of the entire build.</p><p><em>(Every single one of our bugs was a connection we had overlooked. Every one.)</em></p><p><strong>One thing to erase from memory.</strong>
There were moments when one loose or misplaced connection could make us question everything we had done. You could spend a long time checking the code, only to eventually discover that the real problem was a simple hardware connection.</p><p>Robotics really teaches you not to assume that the problem is where you first think it is.</p><p><strong>Most proud of.</strong>
I'm most proud of the fact that we were able to bring the different sections of the project together into one functioning system.</p><p>It wasn't just about making a motor move or getting a sensor to produce a reading. The real achievement was integrating the hardware, programming, sensing, movement, and collection mechanism so that they could work together toward one goal.</p><p><strong>Would you do another one?</strong>
The project was challenging, but it was also a great learning experience. Robotics gives you the opportunity to combine programming, electronics, mechanical design, and problem-solving.</p><p><strong>The teamwork.</strong>
Everyone had different strengths, and there were times when we didn't immediately agree on the best way to approach a problem. But that's also part of working as a team. We had to communicate, listen to different ideas, divide responsibilities, and help each other when something wasn't working.</p><p><strong>Advice.</strong>
The mistakes, debugging, late nights, and small victories are all part of what makes building a robot worthwhile.</p><p>At the end of the day, the biggest achievement isn't just having a working autonomous trash collector. It's knowing that you and your team took an idea, struggled through the challenges, learned along the way, and eventually turned that idea into something that could actually move and perform a task.</p><hr><h3 id="yetunde-group-leader">Yetunde, group leader</h3><p><a href="https://www.linkedin.com/in/yetunde-babatunde-345009226/" rel="nofollow">Yetunde on LinkedIn</a></p><p><img alt="Yetunde, who named Elvon and led the vision" src="https://lope.adebesin.com/images/blog/hey-elvon/yetunde.jpg" width="1600" height="1067"></p><p><strong>The moment it held together.</strong>
From the beginning. I came to work on the project with a positive mindset. And yeah, God was with us from the start 💪. I believed everything was going to work perfectly from the start.</p><p><strong>The worst late night.</strong>
The sensor fusion for the ultrasonic sensor and PIR sensor, along with the operation logic of the robot. It didn't go smoothly at first. I didn't troubleshoot it alone though.</p><p><strong>One thing to erase from memory.</strong>
None. Every bug and error and every troubleshooting was an important step in achieving the final result. I won't erase them from my memory. I will use them as experience for later.</p><p><strong>Most proud of.</strong>
The human interaction part of the work. The DFPlayer module was not working at all, but I didn't want to give up on it. After much troubleshooting, it started responding.</p><p><strong>Would you do another one?</strong>
Yeah, I think it would be nice.</p><p><strong>The teamwork.</strong>
Great, very great. I worked with teammates who were active, tenacious and smart.</p><p><strong>Advice.</strong>
When you get stuck, rest a while, come back, check again, troubleshoot again, till it all works well.</p><hr><h3 id="emmanuel-build-and-packaging">Emmanuel, build and packaging</h3><p><img alt="Emmanuel, who built and packaged the chassis" src="https://lope.adebesin.com/images/blog/hey-elvon/emmanuel.jpg" width="1600" height="1067"></p><p><strong>The moment it held together.</strong>
It was the exact moment we dropped the chassis on the floor with all the components inside, and nothing broke or fell out. When we turned on the power and the motor wheels actually moved, moving the whole weight smoothly without the wheels shaking or bending.</p><p><em>(He says "dropped" like it was a planned test. It was not a planned test.)</em></p><p><strong>The worst late night.</strong>
That had to be around 9:00 PM when the ultrasonic sensor suddenly stopped detecting obstacles and the robot was just crashing straight into the wall.</p><p><strong>One thing to erase from memory.</strong>
Definitely, trying to get the speaker to work. It was really stressful troubleshooting that. At first we thought we got the wrong model of the DFPlayer.</p><p><strong>Most proud of.</strong>
I'm secretly most proud of how the PIR sensor and the ultrasonic sensor smoothly work together, because part of the bug we faced is getting the PIR to differentiate an obstacle, which is handled by ultrasonic, from an actual human motion.</p><p><em>(This is the one nobody outside the team would notice, and it's the hardest thing in the build. A wall and a person look the same to a PIR.)</em></p><p><strong>Would you do another one?</strong>
Yeah, I would love to do it again.</p><p><strong>The teamwork.</strong>
It was a great experience, honestly. We had to heavily rely on each other. While I was focused on the chassis and the obstacle avoidance, others were handling the PIR motion sensor and the speaker audio. Communication was key, because if one person's code or wiring messed up, the whole robot would just park. We pushed each other through the frustrating moments.</p><p><strong>Advice.</strong>
My advice is simple: triple-check your power supply and use quality jumper wires. Most importantly, start small. Build the chassis and get the wheels moving first before you start adding all the fancy sensors.</p><hr><h2 id="where-it-landed">Where it landed</h2><p>Five people, one Arduino Uno, two PIR sensors (one of which we fired), an ultrasonic, a DFPlayer that only needed a ground wire, and a robot with a name.</p><p>If you're building yours: keep the design simple, keep the wiring accessible, and when the code looks wrong, check the ground first. 😅</p><p>And get the team right. That part isn't in the datasheet.</p><h2 id="build-your-own">Build your own</h2><p>Everything above is what happened. If you want to build one, here's the same thing as an order of operations, with our mistakes taken out.</p><h3>Build your own Elvon</h3><p>9 steps &#183; a few evenings</p><ol><li><strong>Get the chassis rolling first</strong><p><em>4WD acrylic chassis, TT gear motors, L298N motor driver, Arduino Uno, battery pack</em></p><p>Nothing else matters until the thing moves. Mount the motors, wire the driver, and write the smallest sketch that drives all four wheels forward for two seconds.</p><p>Do this before the deck goes on and before a single sensor is attached. Every hour you spend on sensors while the motors are unproven is an hour you'll spend twice.</p><p><strong>Gotcha:</strong> If a wheel spins backwards, don't debug the code. Swap the two wires on that motor's terminal block.</p></li><li><strong>Calibrate the turns by hand</strong><p>There's no encoder here, so a turn is just "drive the wheels in opposite directions for N milliseconds." That number is a knob you tune by watching it:</p><pre><code>const unsigned long TURN_90_MS = 500;   // bump up if it under-rotates
const unsigned long REVERSE_MS = 600;
</code></pre><p>Put a piece of tape on the floor, run the turn ten times, and adjust until it lands square. Do it on a fresh battery, then again on a low one, and pick something that survives both.</p><p><strong>Gotcha:</strong> These are wall-clock guesses, not geometry. Your floor, your battery level and your tyres all change them.</p></li><li><strong>Add the ultrasonic and get obstacle avoidance working</strong><p><em>HC-SR04 ultrasonic sensor</em></p><p>One sensor, one job: how far is the thing in front of me. When it reads under your threshold, stop, reverse for <code>REVERSE_MS</code>, turn, and carry on.</p><p>This is the point where it starts looking like a robot rather than a car.</p><video src="https://lope.adebesin.com/videos/blog/hey-elvon/obstacle-avoidance.mp4" poster="/videos/blog/hey-elvon/obstacle-avoidance.poster.webp" controls muted loop playsinline></video><p><a href="https://lope.adebesin.com/videos/blog/hey-elvon/obstacle-avoidance.mp4">Elvon backing off a wall and picking a new direction</a></p><p><strong>Gotcha:</strong> Reverse before you turn. Turning against a wall you're already touching just grinds.</p></li><li><strong>Add exactly one PIR, and turn it down</strong><p><em>HC-SR501 PIR sensor</em></p><p>We started with two PIRs for coverage and the robot became useless, stopping every few seconds because something, somewhere, was warm and moving. We pulled one out and it got better immediately.</p><p>Then turn the sensitivity down. The two little pots on the board are range and hold time, and the sane starting position is nowhere near maximum.</p><p>Budget 30 seconds of warm-up before you trust a single reading:</p><pre><code>const unsigned long PIR_WARMUP_MS = 30000;
</code></pre><p>A PIR that just powered on lies to you.</p><p><strong>Gotcha:</strong> Both potentiometers maxed is the mistake we made. Full sensitivity plus full delay means it triggers on everything and then refuses to let go.</p></li><li><strong>Give the motion a state machine</strong><p>Three states covered everything Elvon needed to do:</p><pre><code>enum RobotState {
  PATROL,
  PIR_WAIT,
  OBSTACLE_AVOID
};
</code></pre><p>Patrol until something interesting happens, wait when a person appears, back off when a wall appears. Write it this way from the start. Retrofitting states onto a pile of <code>if</code> statements is how we lost an evening.</p><p><strong>Gotcha:</strong> Without explicit states, the speaker and the servo fight the drive loop and you'll blame the sensors.</p></li><li><strong>Wire the voice last</strong><p><em>DFPlayer Mini, microSD card, small speaker</em></p><p>Name your tracks <code>0001.mp3</code>, <code>0002.mp3</code>, <code>0003.mp3</code> on the card and trigger them by index. Ours were a greeting on boot, a prompt when the PIR saw someone, and a complaint when the bin filled up.</p><p>Test the module on its own, on the bench, before it goes anywhere near the robot. And if you record the voice yourself, know that the synthesised one is louder, and in a room full of people volume beats authenticity.</p><p><strong>Gotcha:</strong> Tie the DFPlayer's ground to the Arduino's ground. If you get static or silence, this is the problem. It cost us two nights and it was one wire.</p></li><li><strong>Sort out power before you add anything heavy</strong><p><em>4x battery, buck converter</em></p><p>Turning draws more than driving straight, and a sagging pack shows up as a robot that suddenly can't complete a rotation. We landed on four batteries through a buck converter.</p><p>Expect short runtimes. It's rechargeable, so it's fine for demos, but it won't patrol a corridor all afternoon.</p><p><strong>Gotcha:</strong> Feed 4 batteries straight to the Arduino and you'll burn it. The buck converter isn't optional.</p></li><li><strong>Mount the bin, and weigh it first</strong><p>Hold the empty bin in one hand and the chassis in the other. If the bin feels comparable, it's too heavy.</p><p>We wanted a servo to tip it and gave that up. The bin that works is a light one, fixed in place, sitting over the drive platform rather than behind it.</p><p><strong>Gotcha:</strong> The first bin we bought was too heavy for the chassis. Fully assembled, the robot simply refused to move.</p></li><li><strong>Tear it down once before you demo it</strong><p>Take the whole thing apart, check every joint, and rebuild it. It feels like a waste of an evening and it is the reason nothing failed in front of our lecturer.</p><p>Have a spare of whatever charges it. Our charger module died on defense day.</p><p><strong>Gotcha:</strong> Do this four days out, not the night before. Ours turned up a wire that had already burned.</p></li></ol>]]></content:encoded>
            <enclosure length="0" type="image/jpeg" url="https://lope.adebesin.com/images/blog/hey-elvon/cover.jpg"/>
        </item>
        <item>
            <title><![CDATA[A year, a verse and an ecosystem]]></title>
            <link>https://lope.adebesin.com/blog/a-year-a-verse-and-an-ecosystem</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/a-year-a-verse-and-an-ecosystem</guid>
            <pubDate>Mon, 31 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A year inside the chakraverse: the components, the codemod, the pro work I wasn't proud of, and what building for other developers taught me.]]></description>
            <content:encoded><![CDATA[<p>A year in the chakraverse. What I built, what I threw away, and where we're headed.</p><p><img alt="A year, a verse and an ecosystem. The Panda, Chakra UI, Zag and Ark marks floating around the title on a warm cream background." src="https://lope.adebesin.com/images/blog/a-year-a-verse-and-an-ecosystem/cover.svg" fetchPriority="high" loading="eager" width="1200" height="630"></p><p>A year ago, I was working as an IT student at a polytechnic networking department. Reasonably a very serene environment, I was able to meet every quota of work, my day job at <a href="https://iq.wiki" rel="nofollow">IQ.wiki</a>, and my IT as well.</p><p>During one of those days, I got a random email from <a href="https://adebayosegun.com" rel="nofollow">Segun Adebayo</a>, popularly known as Sage, asking for a collaboration on <a href="https://chakra-ui.com" rel="nofollow">Chakra UI</a> and <a href="https://zagjs.com" rel="nofollow">zag</a>.</p><p><img alt="An email from Oluwasegun Adebayo, dated Mon, Aug 25 2025 at 4:05 PM. It reads: Hey Tolulope, I came across your portfolio and I found it quite impressive. Saw that you use Chakra UI at IQ.Wiki which is great! I'm looking to grow the team of contributors to Chakra UI and thought you might be a good fit. Is this something you're open to? We provide: great onboarding and guidance so you don't feel lost, contribute in your free time (minimum ~5 hours every week), decent compensation for contributors depending on impact. Regards, Sage, Creator of Chakra UI." src="https://lope.adebesin.com/images/blog/a-year-a-verse-and-an-ecosystem/sage-email.png" width="2352" height="802"></p><p>Prior to that time my open source arc had been an on and off topic, but I genuinely still wanted to contribute meaningfully to the community. I had been looking for a dedicated project to keep extending, something to add to the body of open source. Relatively new, I had no idea what being a contributor actually was. It quite differs from what I'd known about.</p><p>And I should be honest about the first few weeks, because "I had no idea" is doing a lot of quiet work in that sentence. The first time I properly opened zag and chakra, I felt completely out of my depth. Machines calling machines, files pointing at files, and me sitting there trying to find where a single component even begins. I kept waiting for someone to notice I didn't really know what I was doing yet.</p><p>The thing that took me a while to see is that everybody is figuring it out as they go. The people I was intimidated by are also reading code they didn't write, also guessing, also wrong sometimes. They've just been doing it for longer, and they've stopped treating being lost as a sign they don't belong.</p><p>There's one idea I kept bumping into all year, and I only found the words for it much later, when I was writing a talk. Decide once, use everywhere. It sounds like a design system thing, and it is, but it turned out to be the thing underneath almost everything I worked on this year. So that's really what this is about.</p><p>Before I move on though, I'd like to tell a short story.</p><p>I had this colleague about 3-4 years ago at IQ.wiki, name is <mention handle="anubra266" name="Abraham Aremu"></mention>. I really respect him, and going through older conversations in the IQ.wiki team, he was everywhere (in a good and amazing way lol). He previously had been working on Chakra UI and the entire ecosystem, and he'd share his findings on our then WhatsApp group about <a href="https://chakra-ui.com" rel="nofollow">chakra</a>, <a href="https://zagjs.com" rel="nofollow">zag</a>, <a href="https://pandacss.com" rel="nofollow">panda</a>, <a href="https://ark-ui.com" rel="nofollow">ark</a>, <a href="https://choc-ui.com" rel="nofollow">choc ui</a> (I recall I wanted to contribute to it but got overwhelmed).</p><p>Nonetheless, I think I found it interesting someone close to home was contributing to a widely used UI framework across the dev community. So by the time that email landed, I already had some picture in my head of what the inside of this thing looked like.</p><p>He's still at it, by the way. An Ark port for Ripple, a Panda ecosystem site. Which I find a bit funny now, that the person who made me think any of this was possible is building on the things I help maintain.</p><h2 id="the-machine-broke">The machine broke</h2><p>It started pretty calm. I couldn't get started properly, my machine broke almost the same week I started setting up for chakra work 😄.</p><p>But I couldn't let that stop me. I had to gather out every ounce of money on me and got a new machine, a MacBook M4. And I think the work became smoother from then on. It started pretty slowly, being unsure of what to do or even how some things work.</p><p>But Sage was very kind, teaching every single step he applies to making decisions about building components. So my very work was mostly on Chakra UI.</p><h2 id="anatomy-and-the-components">Anatomy, and the components</h2><p>If you go by what shipped, this part of the year was components. That's the surface though. A design system isn't a folder of components, the components are just the part you can see. The interesting bit is always the layer under them, and that's where most of the work actually went.</p><p>My very first contribution after was a <a href="https://chakra-ui.com/docs/components/accordion#explorer" rel="nofollow">component explorer</a> to show how anatomy makes up different components. Chakra components are built from parts, a root, a trigger, a positioner, a content, an item, and all of that used to live in a table in the docs. Now you can click a part and watch it light up in a live preview, with the slot recipe generated underneath, so you can see what you're styling before you style it.</p><p>Then I was able to work on a <a href="https://chakra-ui.com/docs/components/tags-input" rel="nofollow">TagsInput</a> next.</p><p>A bit more components came around after. <a href="https://chakra-ui.com/docs/components/carousel" rel="nofollow">Carousel</a>, <a href="https://chakra-ui.com/docs/components/splitter" rel="nofollow">Splitter</a>, <a href="https://chakra-ui.com/docs/components/rich-text-editor" rel="nofollow">RTE</a> based on <a href="https://tiptap.dev" rel="nofollow">Tiptap</a>.</p><p>I enjoyed working on RTE cos we started out as making it a dedicated package on its own but changed it since perhaps it could just be a composition than a package 😄.</p><p>If you've not come across one before, a composition is what our docs call a <a href="https://chakra-ui.com/docs/components/avatar#closed-component" rel="nofollow">closed component</a>. Chakra components are open by default, every part is yours to place, which is lovely for flexibility, but it also means a <a href="https://chakra-ui.com/docs/components/tooltip" rel="nofollow">Tooltip</a> looks like this every single time you want one:</p><pre><code>&lt;Tooltip.Root&gt;
  &lt;Tooltip.Trigger asChild&gt;
    &lt;Button&gt;Hover me&lt;/Button&gt;
  &lt;/Tooltip.Trigger&gt;
  &lt;Portal&gt;
    &lt;Tooltip.Positioner&gt;
      &lt;Tooltip.Content&gt;
        &lt;Tooltip.Arrow /&gt;
        Delete this item
      &lt;/Tooltip.Content&gt;
    &lt;/Tooltip.Positioner&gt;
  &lt;/Portal&gt;
&lt;/Tooltip.Root&gt;
</code></pre><p>And you'd be writing that again and again. So we close it up. One component, the parts wired inside, and the two things you'd actually change left as props:</p><pre><code>&lt;Tooltip content="Delete this item"&gt;
  &lt;Button&gt;Hover me&lt;/Button&gt;
&lt;/Tooltip&gt;
</code></pre><p>You add it with <a href="https://chakra-ui.com/docs/get-started/cli" rel="nofollow"><code>npx @chakra-ui/cli snippet add tooltip</code></a> and it drops into your own <code>components/ui</code> folder as plain source, so if you want the arrow gone, or a longer delay, or some variant nobody else asked for, you just open the file and change it. It's not an import from us. It's yours.</p><p>Which is the other half of decide once, use everywhere, and the half I didn't understand at first. Some decisions should be made once and shared, that's your tokens. But some of them aren't ours to make at all, and the honest thing is to hand you the source and get out of the way.</p><p>Which is why the RTE ended up there too. As a package we'd own that editor forever, and carry Tiptap's whole extension matrix along with it, and every "can I add one more toolbar button" would turn into a prop, then an API, then something we can't change later. As a composition you just run it and it's in your repo:</p><pre><code>npx @chakra-ui/cli snippet add rich-text-editor
</code></pre><h2 id="the-codemod">The codemod</h2><p>Few things after was to build a codemod for people coming from v2 to v3.</p><p>It was quite the experience. I took mostly inspiration from the Next.js codemod, and eventually we were able to make it work, tested it across several v2 projects till we were fully satisfied it was working. And it is working today.</p><p>Same idea again, if you squint. Decide how a v2 Modal becomes a v3 one exactly once, write that decision down as code, and then it runs everywhere instead of living in somebody's head for four hundred files.</p><p>Doing a major upgrade by hand is tiring. You rename the props, you convert a Modal to its compound form, you fix the theme, then you do it again everywhere, and somewhere along the line you start missing things. So it's one command instead, and you can look at what it wants to do before you let it:</p><pre><code>npx @chakra-ui/codemod upgrade --dry
</code></pre><p>The <a href="https://chakra-ui.com/docs/get-started/migration" rel="nofollow">migration guide</a> has the rest of it.</p><h2 id="the-part-i-wasnt-proud-of">The part I wasn't proud of</h2><p>Moving on, it was to attend to a few features in the pro system. I didn't have much fun there 🫠.</p><p>Maybe I did, but I felt majority of the work I did there weren't really pretty and I was really hard on myself after 😔.</p><p>But nonetheless, we got people the ability to invite to teams licensing.</p><h2 id="chakra-v4-and-the-turn-to-panda">Chakra v4, and the turn to Panda</h2><p>Around this time chakra v4 started becoming a conversation, and a tour component.</p><p>For chakra v4, we had so many different ideas, of which I did do some little experiments (wonder if to share them here), but it was a baseline start, and the direction we're heading towards lives here. Many have been asking us the same question for a while: <em>"When will chakra become build time?"</em> Sage had already written about where this was going in <a href="https://adebayosegun.com/blog/the-future-of-chakra-ui" rel="nofollow">The future of Chakra UI</a>, and one line in there has basically been our to-do list.</p><p>After more thoughts, Sage decided let's move that up. Let's make <a href="https://v2.pandacss.com" rel="nofollow">Panda CSS</a> v2.</p><p>Now v2 was to bring a lot of grace to v1 (really awesome job on there). v2 was mostly inspired to improve the very said nuance v1 faced. One was speed, and a couple of ecosystem requested features.</p><p>During the iterations, I unceremoniously got invited to be a maintainer at Panda v2 (I did make myself a confetti 🎉).</p><p>I think v2 has progressed so much and I'm very excited about the upcoming release. The team has been working so hard in making it very much smooth, especially in building a design system.</p><p>And Panda is where decide once, use everywhere stops being a nice phrase and becomes an actual config field. You build your tokens and recipes in one package, point an app at it with a single key, and the app stops regenerating a system it only wanted to use.</p><p>The speed reveals on large projects. On a 100-file project, a cold parse of every file went from 177ms to 7.6ms. The warm re-parse of a single file, the watch-mode hot path, went from 652µs to 1.8µs (Hey, don't be a nerd!). That second one is the gap between saving a file and seeing the style, and it's small enough now to disappear.</p><p>Personally, I'd say we're here already. PandaCSS v2 is here and here to stay. And you can try it out yourself today.</p><p><img alt="Two bars comparing a cold parse of 100 files. The v1 ts-morph pipeline fills the whole track at 177ms. The v2 Rust compiler is a small dot at 7.6ms." src="https://lope.adebesin.com/images/blog/a-year-a-verse-and-an-ecosystem/speed.svg" width="1200" height="420"><em>Same config, same 100 files. The numbers come straight out of the bench report in the repo, so you can rerun them yourself.</em></p><h2 id="late-nights">Late nights</h2><p>I'd say the late nights are mostly making sure we have lesser APIs, and thinking about how users would feel using it.</p><p>That's deciding if we want the user to be the one making this styling decision, and not being opinionated about designs. Deciding once is only good when it's the right decision to be making on someone's behalf, and a lot of the job is working out which ones aren't. Making sure it doesn't force a model, and that the model we do choose is simply accessible. Be able to create UI with minimal code as possible.</p><p>The other one is just fighting with types and experimenting.</p><p>So it's rarely some heroic debugging session, it's mostly sitting with an API for hours trying to make it smaller. I built a scheduler machine in zag this year and put a whole resource concept in it, because obviously a scheduler needs resources right? Then I took it out again, nothing was using it yet.</p><h2 id="the-mindset-shift">The mindset shift</h2><p>It's quite a lot. One is that you need to read a lot and understand things before making a comment or answering a discussion, before deciding what to work on, before picking up an issue.</p><p>In the past I'd ask Sage how he came about the design thoughts and the inspiration, and he gave the one answer everyone gives. <em>"From years of experience."</em></p><p>I understand it now. Largely it's also picking out what shapes the ecosystem. In the age of AI where we can simply build just anything and everything, you put more thoughts into delivering the best for users, and you don't break anything.</p><p>My PR review strategy became almost same as what Sage teaches haha.</p><p>Around the ecosystem, off Panda I do reviews and answer discussions across the <a href="https://chakraverse.dev" rel="nofollow">chakraverse</a>. Not zag yet (feels like so much going on 😂), but interestingly my first ever contribution was to zag, before I even got an invite to collaborate with Sage.</p><p>These days it looks like leaving direction notes on somebody else's pull request instead of opening my own. There's a POC for v4 that someone else started, and my actual job on it was to read it properly, write down where I thought it should go, and then ask if we could align instead of pulling in two directions. A year ago I would not have thought that was my place to do.</p><p>So somewhere along the line it turned from me asking the questions to me answering them, and I didn't really notice it happen.</p><p>Moving on, I think the rosy part of conversations was then becoming a maintainer at Chakra UI as well. Being in charge of releases and <a href="https://nesbitt.io/2026/08/28/now-hiring-senior-open-source-maintainer.html" rel="nofollow">every other thing a maintainer does</a>.</p><h2 id="where-would-i-be-going-from-here">Where would I be going from here?</h2><p>ARK V6!!! (Someone's excited)</p><p><img alt="A GitHub notification reading &quot;@segunadebayo has invited you to collaborate on the chakra-ui/ark repository&quot;, with Lope's avatar and Sage's avatar side by side, joined by a plus sign." src="https://lope.adebesin.com/images/blog/a-year-a-verse-and-an-ecosystem/ark-invite.png" width="1484" height="642"></p><p>Which is around when it stopped feeling like four separate projects I was helping out on, and started feeling like one thing.</p><p>To properly work on Chakra UI v4, we have to do a lot of upstream work to make sure Chakra UI users get the very best, of which I'm pretty sold on.</p><p>And our direction is very simple. <a href="https://v2.pandacss.com" rel="nofollow">Panda</a> v2, <a href="https://v2.zagjs.com/" rel="nofollow">zag</a> v2, <a href="https://ark-ui.com" rel="nofollow">ark</a> v6, <a href="https://chakra-ui.com" rel="nofollow">chakra</a> v4. In that order, cos the ones on top can't really move till the ones under them do.</p><p>Panda v2 is the one I'm really excited about. Try the beta, play with it, and don't go all <em>beta could be bitter</em>. No, the beta we have here is better, people are already building on it. If you find anything wrong, <a href="https://github.com/chakra-ui/panda/discussions/3599" rel="nofollow">tell us here</a>.</p><p><strong>Phew! A busy year in <a href="https://chakraverse.dev/" rel="nofollow">chakraverse</a>.</strong></p><p>In all of this, I think I perhaps might have forgotten how I totally much started. But the most exciting thing here has been working at Chakra UI, and every project, and for one I'm totally grateful for the privilege to be able to give back to the dev community and also learn from the dev community.</p><p>And more is coming. We'll keep improving every of the projects you use today, for you to build better relationships with UIs.</p><p>So go build something you're proud of. And when you do, come tell me about it. I'll be around.</p>]]></content:encoded>
            <enclosure length="0" type="image/svg+xml" url="https://lope.adebesin.com/images/blog/a-year-a-verse-and-an-ecosystem/cover.svg"/>
        </item>
        <item>
            <title><![CDATA[Almost got got]]></title>
            <link>https://lope.adebesin.com/blog/almost-got-got</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/almost-got-got</guid>
            <pubDate>Sun, 23 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[I almost pasted malware into my terminal while downloading a sermon. That near-miss became our CPE 510 project on making security policy stick.]]></description>
            <content:encoded><![CDATA[<p><img alt="Almost Got Got, a field guide to social engineering" src="https://lope.adebesin.com/images/blog/almost-got-got/og.png" fetchPriority="high" loading="eager" width="2400" height="1260"></p><p>Security is important.</p><p>Well, this is another project to wrap up my last day at Forcados.</p><p>I had already prepared a slide some time during the semester for our fair project.</p><blockquote><p><strong>CPE 510 - COMPUTER SECURITY TECHNIQUES</strong></p><p>Page 360 of Network Security Essentials<br>
Sub-Topic: Malware countermeasure approaches</p><p>Assignment: There are four main elements of prevention listed by SP 800-83: <em>Policy, Awareness, Vulnerability Mitigation, Threat Mitigation.</em></p><p>Divide yourselves into four groups, one element per group and do something educative or presentable with the element assigned to your group, it can even go beyond the classroom, towards the whole school.</p></blockquote><p>The experience was mostly personal. I was trying to download a sermon, and I think it was on the old site, and yeah, there was some weird behavior. I saw an Apple boot screen, so identical, and then I was told to copy some things into the terminal to make the window go away. In a panic, I almost fell for the trick till I researched it. 😅</p><p>When our CPE 510 group got handed "Malware Countermeasure Approaches", specifically SP 800-83's four elements, the first thing I noticed was how useless every textbook definition felt next to what had just almost gotten me. So I started where everyone starts, the team slide. Then I went a step further and put together an actual policy document for FUTA, a proper Malware Prevention Policy. It was solid. But it didn't feel right. It was still just us talking at people, and it needed more of the community in it.</p><p>That's when the idea clicked: gather real stories from real people, and build the thing around them. I took it to the group and they agreed in unison. And watching how the other groups were approaching their elements, I already knew what I didn't want. We shouldn't make policy boring. We should make it fun, something that leaves a memory.</p><p>So I made two forms, one for the inner team and one for the public. Eleven came back from the team, twelve from outside. Twenty-three stories. ❤️ And the wild part wasn't the number, it was how close to home all of it was. Friends. Neighbours. People a text away. Appreciate everyone who shared. And once we lined the stories up, the pattern was impossible to miss.</p><p>The core was mostly social engineering, which is a prevalent issue in the modern world. In the developer space, we've been having a lot of supply chain attacks and even malware, GitHub ones, npm ones. It's been a really crazy 2026. Lots of tools have been developed to track these; thankful to Sentry today for their immense efforts, and the npmx community for one.</p><p>So here's the thing about those four elements. Awareness, Vulnerability Mitigation, Threat Mitigation, those three are mostly about machines. Patch this, scan that, filter the other. But Policy? Policy is about people. And that's exactly why I didn't want us to write the usual "users shall not..." document that nobody reads and everybody forgets.</p><p>Because think about what actually happened to me. No virus caught me. No firewall failed. A website just... asked me to do something, and I almost did it. That's social engineering. There's no antivirus for a human being deciding to trust the wrong thing. The only thing that stops it is you knowing the trick before it reaches you.</p><p>So that became our whole idea: a playbook, not a rulebook.</p><p>Instead of listing rules, we list the moves. The way the scammer plays it, and the one line that beats it. Like:</p><p>The move: someone calls saying they're from ICT, and your account gets shut down unless you confirm your password right now.
The counter: ICT will never ask for your password. Ever. Hang up.</p><p>Same information a boring policy would give you. But this one you'll actually remember when your phone rings.</p><p>That's where the forms came in. I didn't want to sit and invent scams from a textbook, I wanted real ones. So the inner form is for my team, twelve of us, each person owns one "play," researches it, and writes the move and the counter. The public form is for everyone else, the whole school and beyond, just tell us your story. Have you ever been scammed, or nearly? What happened?</p><p>And people showed up ❤️. Honestly, it was a little scary seeing how common all of it is.</p><p>The pattern was almost always the same. Someone pretending to be your bank, or a person you trust, and a push to move money or read out a code right now. Not one of the stories was a real hack. Every single one was just... persuasion. That's the whole thing. The vulnerability was trust.</p><p>Getting it to feel right took a while. More sessions than I'll admit, going back and forth on how it should look and how it should read. A slide deck? A poster? A PDF nobody opens? We kept pulling it apart and putting it back together until it became two things in one: a playbook you can scroll on your phone, and a field manual you can flip through like a little book. The design mattered as much as the words, because a policy nobody enjoys reading is a policy nobody reads.</p><p>The plan is to put it all together as a webpage. One link. Something you can open on your phone, read in three minutes, and actually enjoy reading. Fun on the surface, but real underneath, because there's still a proper policy sitting under the playbook, the kind FUTA ICT could actually adopt if they wanted to.</p><p>It's live here: <strong><a href="https://almostgotgot.vercel.app" rel="nofollow">almostgotgot.vercel.app</a></strong>. Fifteen plays, the habits that beat them, and the real cases behind each.</p><p><img alt="The playbook, a field guide to social engineering" src="https://lope.adebesin.com/images/blog/almost-got-got/hero.png" width="2880" height="1880"></p><p>You can read it straight down the page, or flip through the whole thing like a book.</p><p><img alt="The book view" src="https://lope.adebesin.com/images/blog/almost-got-got/book-cover.png" width="2880" height="1880"></p><p><img alt="The habits, and the plays" src="https://lope.adebesin.com/images/blog/almost-got-got/overview.png" width="2880" height="7200"></p><p>Funny how it started. I was just trying to download a sermon. 😅 Almost got got. And instead of keeping it to myself, it turned into a thing that might stop someone else from almost getting got too. That's the part I like. Not a policy in a folder. Something people remember.</p><p>And while this might feel like a school project, security, the kind of threats we're facing now, is your responsibility and mine. It might not affect you today. It might be something far off you read about in the news. But some of it gets closer. Someone around you could get hit by a supply chain attack, dev-related, that quietly gains access, and by that law of the universal circle where everyone seems connected, you could end up part of the attack too.</p><p>So keep your passwords carefully. Guard your privacy as much as you guard everything else. Your network, your internet, guard those too. Open links you trust. If you don't trust one, view it through something that keeps it away from your PC. And if you must run code, run it in a virtual machine.</p><p>Don't spin the wheel to claim some iPhones. Don't open that link. Don't download that free game. Protect your friends.</p><p>Here's what I keep coming back to, as someone who builds things: security isn't a compliance checklist. It's a UX problem. If the safe path isn't also the easy, obvious, memorable one, people will keep pasting the command from the fake Apple boot screen. Every time. That's not their failure, it's a design failure. So we designed the safe path to be the one you actually remember.</p><p>And I really do believe the internet can be made safe. Not by some big company, not by one clever tool, though those help. It begins with you and me, and the small careful choices we make every day.</p><p>Let's make the web, the internet, a safe place again.</p>]]></content:encoded>
            <enclosure length="0" type="image/png" url="https://lope.adebesin.com/images/blog/almost-got-got/og.png"/>
        </item>
        <item>
            <title><![CDATA[My Pastor Once Said]]></title>
            <link>https://lope.adebesin.com/blog/my-pastor-once-said</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/my-pastor-once-said</guid>
            <pubDate>Sun, 09 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[The product design story behind a BethelFlow campaign: a card generator for the lines our pastors never stopped saying. The numbers, and where it landed.]]></description>
            <content:encoded><![CDATA[<p>A campaign for the lines that stuck. What I designed, what broke, what the numbers said, and where it landed.</p><p><img alt="The My Pastor Once Said landing page, a wall of quote cards fanning out around the words &quot;My Pastor Once Said…&quot; in BethelFlow blue." src="https://lope.adebesin.com/images/blog/my-pastor-once-said/hero.png" fetchPriority="high" loading="eager" width="2880" height="1800"></p><p>Every church has a few lines it never forgot. The one your pastor said at the end of every service. The sentence you were half-listening to at seventeen that you're still carrying at twenty-seven. <em>Shalom.</em> <em>You are not a mistake.</em> <em>Shout hallelujah.</em> You know the ones.</p><p>We wanted to collect them. Not in a database, but on people's phones, in group chats, on statuses. So we built <a href="https://www.bethelflow.com/my-pastor-once-said" rel="nofollow"><strong>My Pastor Once Said</strong></a> for <a href="https://www.bethelflow.com/" rel="nofollow">BethelFlow</a>: type a line your pastor never stopped saying, add a photo, and walk out with a card built to pass on. This is the story of designing it. The idea, my part in it, the rough edges, and where it is now.</p><h2 id="borrowing-a-good-idea">Borrowing a good idea</h2><p>The seed was <a href="https://cowrywise.com/mothers-day" rel="nofollow">Cowrywise's Mother's Day page</a>, <em>"Mama once said…"</em>, a small, joyful thing that turned a feeling everyone already had into something you could make and send in under a minute. We wanted that shape, pointed at the people who shaped our faith.</p><p>The strategy underneath it is plain. The movement is the hook, and <em>"start a church on BethelFlow"</em> is the quiet conversion sitting under it. Top of funnel dressed as a keepsake. That framing mattered, because it set the bar for the whole thing: it had to be the kind of page a person shares for their own reasons, not because we asked.</p><p>My part was the experience. Make it fast to pick up, cheap to run, and good enough that sharing it never feels like an ad.</p><h2 id="designing-for-a-five-second-pickup">Designing for a five-second pickup</h2><p>The rule I set myself: a stranger should understand what this is and start making one before they've decided whether to. That meant the payoff couldn't live at the end of a form. It had to be <em>right there</em> while you typed.</p><p>So the create flow is a small wizard, the line, then the photo, then the card, with a live preview sitting next to the form the whole time. Cowrywise reveals the card after you finish. We diverged and let you watch it assemble as you go. You type a name, it appears on the card. You paste the quote, the card breathes. The work and the reward share a screen.</p><p><img alt="Step one of the create flow: a form asking &quot;What did they always say?&quot; beside a live preview of the card updating in real time." src="https://lope.adebesin.com/images/blog/my-pastor-once-said/compose-line.png" width="2880" height="1800"></p><p>The whole thing wears BethelFlow's blue with a single gold accent for the campaign. Close enough to the brand that it reads as <em>them</em>, distinct enough that it reads as an <em>occasion</em>. No purple, no sub-brand. Just BethelFlow in a good mood.</p><h2 id="the-photo-never-leaves-your-browser">The photo never leaves your browser</h2><p>Here's the decision I'm still happy about. Early on, I didn't want to store anyone's uploads. Partly cost, mostly trust. Asking someone to hand you a photo of their pastor on day one is a big ask, and "where does this go?" is a fair question.</p><p>So at first, nothing went anywhere. The draft, your words and your photo, lived in the browser's own IndexedDB, survived a reload, and rendered the card locally. Download straight from the page. <em>"We're not storing your images"</em> wasn't marketing. It was just literally where the code stood. The photo genuinely never left the device.</p><p><img alt="Step two: adding a photo, with the card preview now showing the portrait behind the quote." src="https://lope.adebesin.com/images/blog/my-pastor-once-said/compose-photo.png" width="2880" height="1800"></p><p>That worked beautifully right up until people wanted to do the one thing the whole campaign was about: send it to someone.</p><h2 id="the-url-is-not-a-database">The URL is not a database</h2><p>A couple of friends, <mention handle="codiejay"></mention> and <mention handle="Tolu-Mals"></mention>, are the reason this part of the story exists at all. They made their cards and immediately hit the wall the whole campaign was pointed at: they wanted to <em>send</em> them, and sharing wasn't really there yet. Their nudging is what turned "download and keep" into "share and pass on," and, a few detours later, what put photos on Vercel Blob.</p><p>Because sharing breaks the no-storage stance. A shared link needs two things I didn't have: a page that lives at a URL, and an image a link preview can actually show. My first instinct was to cling to the principle and smuggle the entire card <em>into the link</em>, encoding the name, quote, and year as a blob of base64 in the path, so the URL itself carried the card and I still stored nothing.</p><p>Two walls, fast. A phone photo is two to five megabytes; it cannot live in a URL, full stop, no matter how you encode it. And even the text-only version produced links about three hundred and twenty characters long, the kind of link that looks less like a keepsake and more like something a stranger DMs you before stealing your bank details.</p><p>I gave up gracefully. Photos moved to Vercel Blob, but on my terms: the upload only fires when you actually reach for <em>share</em>, it's deduped by a hash of the file so refreshing never piles up copies, and a weekly job sweeps anything older than ninety days. The promise softened honestly, <em>we don't store it until you choose to send it</em>, instead of breaking. And in return we got real shareable pages, copy-to-clipboard, and link previews with the actual card in them.</p><p><img alt="The result screen: &quot;Download and share,&quot; with the finished card and a row of share buttons." src="https://lope.adebesin.com/images/blog/my-pastor-once-said/share-light.png" width="2880" height="1800"></p><h2 id="the-preview-that-rendered-nothing">The preview that rendered nothing</h2><p>The links worked. The previews didn't. A shared card came up blank where the image should be. I went hunting in the usual places first: the upload, the cache, my own markup. It took a while before it clicked that the culprit wasn't the card at all. It was satori.</p><p>The link-preview image is generated with <code>next/og</code>, which is satori under the hood. My card had a scrim, the dark gradient that keeps white text legible over a bright photo, and I'd written it the way you write it in a browser: pinned to all four edges, no explicit size. Every browser understands that. Satori doesn't. It sized the scrim to zero by zero, painted nothing, and on any light-coloured photo the white quote simply dissolved into the background.</p><p>The fix was one of those humbling one-liners: give the overlay real dimensions. The renderer that isn't a browser needs to be told the things a browser would have inferred. Scrim painted, text back, previews readable.</p><h2 id="shorter-prettier-links">Shorter, prettier links</h2><p>The base64 links still bothered me. A keepsake shouldn't look like a ransom note. So the payload came out of the URL entirely. Each shared card became a tiny record with a random eight-character id, and the link just points at that. Roughly three hundred and twenty characters down to about fifty.</p><p>The part I cared about was not breaking anyone who'd already shared. The resolver just looks at the length and picks a path. A short id gets looked up, an old long token still decodes inline like before.</p><pre><code>return param.length &lt;= 16 ? loadShareCard(param) : decodeCard(param)
</code></pre><p>Nobody's link died. Old and new both resolve to the same card. Migrations you can skip are the best kind.</p><h2 id="the-first-day-and-the-dip">The first day, and the dip</h2><p>Launch day did better than I'd let myself hope. In a single day the page took <strong>168 views from 117 different people</strong>, and over the run it made <strong>72 cards from 42 of them</strong>. For a side campaign built around a feeling, that's a lot of people choosing to make something.</p><p>And then, as campaigns do, it breathed out. The day after launch it was 56 views, then 18 the day after, then single digits. A steady exhale over the week.</p><p>Some of that taper is just gravity. But some of it I did to myself. Midweek I shipped a security-headers change, closed my laptop, and went to bed pleased. The new Content-Security-Policy quietly broke image downloading for everyone: the browser refused to fetch an image the app had literally just made. PostHog is how I found out. <strong>42 failed shares</strong>, almost all of them from a <em>handful</em> of people tapping a dead button over and over, exactly the way you jab an elevator button that isn't wired to anything.</p><p>That bug got its own post, because it deserved one. <a href="https://lope.adebesin.com/blog/the-button-that-did-nothing">The button that did nothing</a> is the full autopsy. The short version: I'd been building on the one device where everything worked, and instrumenting failure so faintly that only luck told me it was happening.</p><h2 id="most-of-them-were-on-a-phone">Most of them were on a phone</h2><p>The same dashboard said something quieter and more important than any single bug. Most people arrived on a phone, and on a phone they finished at less than half the rate they did on a desktop. I had lovingly designed a three-step, side-by-side wizard for a screen most of my users weren't holding.</p><p>So the create flow got rebuilt for a thumb. The separate <em>line</em> and <em>photo</em> steps merged into one compose screen with the card preview pinned to the top, so the payoff is always in frame instead of two taps away. "Take a photo" wires straight to the camera. Desktop keeps its roomy stepped wizard. The layout branches on the viewport rather than pretending one shape fits both.</p><p>The rest was performance, because a beautiful page that stutters on a mid-range Android is not a beautiful page. The marquee, that scrolling wall of example cards, got a lighter animation that pauses on hover and stands still for anyone who's asked for reduced motion. The decorative images lazy-load so they stop fighting the first paint. And the card-capture engine changed under the hood after WebKit kept dropping the photo out of exports.</p><p><img alt="The scrolling wall of community cards, real lines people submitted." src="https://lope.adebesin.com/images/blog/my-pastor-once-said/marquee.png" width="2880" height="612"></p><h2 id="one-card-two-themes">One card, two themes</h2><p>A small thing I'm fond of: the card and the whole page render in light and dark off the same live preview, so it looks intentional whichever way your phone is set. Same card, same words, different room.</p><p><img alt="The result screen in dark mode, the card glowing against a near-black page." src="https://lope.adebesin.com/images/blog/my-pastor-once-said/share-dark.png" width="2880" height="1800"></p><h2 id="where-it-landed">Where it landed</h2><p>Here's the whole shape of it, start to finish.</p><p><img alt="A showcase board of the finished product: the landing page, the three-step create flow, the light and dark cards, and the community wall." src="https://lope.adebesin.com/images/blog/my-pastor-once-said/showcase.png" width="4800" height="9298"></p><p>Looking back, the thread through every good decision was the same. I kept holding a principle, and users kept, gently, asking me to bend it. <em>Don't store the photo</em> met <em>let me send this to my sister.</em> <em>Keep it pure in the URL</em> met <em>a phone photo is five megabytes.</em> <em>Ship the elegant wizard</em> met <em>I'm on a bus, on a phone, using one thumb.</em> The design got better every time I let the principle bend without letting it break: storing photos only at the moment of sharing, shortening links without stranding old ones, rebuilding the flow for the device people actually held.</p><p>It's evergreen, and it's still up. If your pastor had a line you never forgot, the one you can still hear in their voice, go <a href="https://www.bethelflow.com/my-pastor-once-said" rel="nofollow">make a card</a>. Send it to someone who needs it today. We'd genuinely love to see the ones that stuck with you.</p>]]></content:encoded>
            <enclosure length="0" type="image/png" url="https://lope.adebesin.com/images/blog/my-pastor-once-said/hero.png"/>
        </item>
        <item>
            <title><![CDATA[The button that did nothing]]></title>
            <link>https://lope.adebesin.com/blog/the-button-that-did-nothing</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/the-button-that-did-nothing</guid>
            <pubDate>Fri, 07 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Most of my users were on a phone, tapping a download button that did nothing. What a session recording taught me about building where users live.]]></description>
            <content:encoded><![CDATA[<p>Most of my users lived on a phone. I built the whole thing on a laptop. Here's what that cost, and the rule I keep now.</p><p><img alt="A download button pressed over and over, each tap rippling out into nothing, with a counter reading times twenty." src="https://lope.adebesin.com/images/blog/the-button-that-did-nothing/cover.svg" fetchPriority="high" loading="eager" width="1200" height="520"></p><p>You've met a dead button. The crosswalk one that isn't wired to anything. The elevator "close door" that's decoration. The one you press, and when nothing happens you press it again, harder, because surely it heard you the first time. There's a particular small humiliation in it, standing there jabbing a button while the world declines to respond.</p><p>I built one of those. Not for me. For most of the people who showed up.</p><h2 id="the-recording-i-couldnt-stop-watching">The recording I couldn't stop watching</h2><p>We shipped a little thing on <a href="https://www.bethelflow.com/" rel="nofollow">BethelFlow</a> called <em>My Pastor Once Said</em>. You type a line your pastor never stopped saying, add a photo, and it makes a shareable card. Simple, joyful, exactly the kind of thing that's supposed to just work. I wrote about <a href="https://lope.adebesin.com/blog/my-pastor-once-said">designing the whole campaign</a> separately. This post is about the part that broke.</p><p>Then I opened a session replay one morning. An iPhone. Mobile Safari. Someone had made their card. It was right there on the screen, finished, theirs. Then they tapped <strong>Download</strong>. Nothing. They tapped it again. Again. I counted later: twenty times over eight minutes. Then they tried WhatsApp twice, then they left. No card ever reached them.</p><p>I watched it the way you watch someone wave at a sliding door that isn't going to open. And the worst part is that on my machine, a desktop running Chrome, I had pressed that exact button a hundred times and it worked every single time. It worked in the only place I ever tested it.</p><h2 id="three-different-silences">Three different silences</h2><p>When I finally pulled the button apart, it wasn't broken in one way. It was quietly broken in three, and each one was invisible from where I sat.</p><p><strong>One: iOS doesn't honour the download trick.</strong> The pattern every tutorial teaches is simple: make an anchor, set <code>download</code>, click it in code. Safari on iOS simply ignores it. And my click landed <em>after</em> an <code>await</code> while the image rendered, so the user's tap was already spent by the time the download tried to fire.</p><pre><code>const dataUrl = await renderCardDataUrl(cardRef.current) // the tap is gone by here
saveDataUrl(dataUrl, filename)                           // iOS: politely does nothing
</code></pre><p>On desktop this saves a file. On a phone it's a dead button. Same code, opposite outcome, and I only ever stood on the side where it worked.</p><p><strong>Two: the failure underneath, that hit everyone.</strong> Our security headers set <code>connect-src 'self' https: wss:</code>. Reasonable. But building the image meant turning a data URL into a blob, and I'd done it the lazy way, <code>fetch(dataUrl)</code>. <code>fetch</code> answers to <code>connect-src</code>. So the browser blocked me from fetching <em>my own image</em>, the call threw, and the file was never built. Not just on iOS. Everywhere. iOS just failed more loudly because it had no fallback to limp to.</p><p>The fix was to stop asking the network for something I already held in my hand, and decode the base64 myself:</p><pre><code>// was: const blob = await fetch(dataUrl).then(r =&gt; r.blob())  // CSP blocks this
const [head, body] = dataUrl.split(",", 2)
const bytes = Uint8Array.from(atob(body), c =&gt; c.charCodeAt(0))
const blob = new Blob([bytes], { type: "image/png" })
</code></pre><p><strong>Three: the button, hammered.</strong> To feel snappy, I'd pre-warmed the share on hover. But on every failure it reset and tried again on the <em>next</em> pointer event. So a person poking a dead button didn't just get silence. They fired off eleven, fifteen failed requests into the dark, and not one of them made a sound I could hear.</p><h2 id="the-colour-that-never-came">The colour that never came</h2><p>There was a quieter one still. On this card, the photo <em>is</em> the colour. Without it you get a flat gradient. iPhones shoot photos as HEIC, and an <code>&lt;img&gt;</code> renders HEIC on Safari and almost nowhere else. So a card built and shared from a phone, opened by a friend on Chrome, lost its photo entirely. And the handler I'd written to be "safe" made sure no one ever knew:</p><pre><code>&lt;img src={imageUrl} onError={(e) =&gt; { e.currentTarget.style.display = "none" }} /&gt;
</code></pre><p>Hide the broken image. No error, no log, just a colourless card where a face should be. I've written before about <a href="https://lope.adebesin.com/blog/quietest-bug">silence wearing the costume of safety</a>. Here it was again, in a different disguise. The fix was to stop trusting whatever the phone handed me and re-encode every upload to a plain JPEG the moment it's picked. And if it genuinely can't be decoded, to <em>say so</em> instead of swallowing it.</p><h2 id="the-number-i-hadnt-looked-at">The number I hadn't looked at</h2><p>Fixing the button felt like the work. It wasn't. The work was the number I'd never bothered to open: <strong>who was actually here.</strong></p><p>On mobile, 148 people landed and 26 made a card. An 18% finish. On desktop, 42 landed and 17 made a card. Forty percent. Seventy-eight percent of everyone who came was on a phone, and on a phone they finished at less than half the rate they did on a desktop. I had poured the entire build into the 22% I could see. Not out of some decision, but because my machine happened to be one of them, and a laptop never once felt the dead button.</p><h2 id="building-where-your-users-live">Building where your users live</h2><p>So we rebuilt the create flow for a thumb, not a mouse. One screen instead of three. The card previewing live as you type, so the payoff arrives while you're still working instead of two taps later. "Take a photo" wired straight to the camera.</p><p><img alt="The rebuilt mobile create flow: one screen, the card preview pinned to the top updating live as you fill the fields below." src="https://lope.adebesin.com/images/blog/the-button-that-did-nothing/compose-mobile.png" width="1170" height="1870"></p><p>And the part I'd change first if I could do it all again: we stopped <em>pretending to be the platform</em>. Instead of hand-rolling a download the phone doesn't understand, we hand the finished card to the phone's own share sheet. The one button iOS actually knows how to press.</p><pre><code>if (navigator.canShare?.({ files: [file] })) {
  await navigator.share({ files: [file], title, text })
}
</code></pre><p>One line, and suddenly the button presses back. Save to Photos, WhatsApp, wherever. All the things the person was reaching for in the first place, through the door their phone already knew how to open.</p><p><img alt="The mobile result screen: the finished card with a full-width &quot;Share your card&quot; button that hands off to the phone's native share sheet." src="https://lope.adebesin.com/images/blog/the-button-that-did-nothing/share-mobile.png" width="1170" height="1690"></p><h2 id="make-the-silence-loud">Make the silence loud</h2><p>Then we did the unglamorous thing: we made failure audible. Every failed share now carries its reason with it, so the next time something goes quiet I don't have to get lucky with a replay to find out.</p><p>Because the real bug was never the anchor tag or the header. Those were an afternoon. The real bug was that a person stood there tapping twenty times and the only reason I ever knew was that I happened to scrub through a recording weeks later. A dead button is bad. A dead button you can't see is how you quietly lose three-quarters of the people who came.</p><h2 id="the-rule-i-keep">The rule I keep</h2><p>Build on the device most of your users are actually holding, not the one you happen to own. And instrument every failure so it can't hide. The gap between a bug and a disaster is almost always just whether the button can tell you it's dead.</p><p>The card generator works on a phone now. If you've got a line your pastor never stopped saying, go make one at <a href="https://www.bethelflow.com/my-pastor-once-said" rel="nofollow">My Pastor Once Said</a>. Press the button. It should press back.</p>]]></content:encoded>
            <enclosure length="0" type="image/svg+xml" url="https://lope.adebesin.com/images/blog/the-button-that-did-nothing/cover.svg"/>
        </item>
        <item>
            <title><![CDATA[Context is everything]]></title>
            <link>https://lope.adebesin.com/blog/context-is-everything</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/context-is-everything</guid>
            <pubDate>Sat, 18 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[What years of building AI agents taught me about context engineering, and why it is mostly the same skill as briefing another human well.]]></description>
            <content:encoded><![CDATA[<p><img alt="A conversation panel you've walked into halfway: the top lines cut off, the middle clear, the last line only half typed." src="https://lope.adebesin.com/images/blog/context/cover.svg" fetchPriority="high" loading="eager" width="1200" height="520"></p><p>There's a specific kind of lost you feel walking into a conversation halfway through. People are laughing at something. Someone says "yeah, but that's exactly what <em>he</em> did," and you nod along like you know who <em>he</em> is. You don't. You've got the words but none of the wiring underneath them, and if you're not careful you'll repeat the half you caught as if it were the whole thing. That's the dangerous part. Not knowing nothing. Knowing <em>half</em>.</p><p>We spend our whole lives quietly topping each other up. You mention a person and I already have years of them loaded. You say "the usual" and the waiter knows. Almost none of what makes a conversation work is <em>in</em> the conversation; it's the shared state both of you dragged in with you.</p><p>A language model has none of that. Every single call is a stranger walking in halfway through, and your entire job is to catch it up, in just the right number of words, before it says something confident and wrong.</p><p>For a good while I lived close to AI agents, a lot of it around a crypto Q&amp;A agent called <a href="https://iq.wiki" rel="nofollow">AIDEN</a>. I haven't been in the thick of it for a bit now, but the lesson it drilled into me hasn't left. I've watched a model answer a question with total confidence and be completely, embarrassingly wrong, for one reason: it had been handed half the picture, with no way of knowing the other half existed. That's the part that stuck. The model isn't the hard part. Deciding what it gets to see is.</p><h2 id="the-art-of-deciding-what-not-to-say">The art of deciding what <em>not</em> to say</h2><p>The early years of that codebase read like a diary of a fight against a tiny window. The model underneath had a context budget of about <strong>4,000 tokens</strong>. Four thousand. And the questions people asked were things like "what are the biggest gainers today," which means a crypto API payload with hundreds of coins and thousands of fields, enum lists containing every token id that has ever existed. None of it fit. Not close.</p><p>So what got built, long before big context windows made any of it look quaint, was an elaborate machine whose entire purpose was deciding what <strong>not</strong> to send the model:</p><ul><li>There were ~30 API endpoints, too many to describe to a 4k model, so the endpoint <em>descriptions</em> got embedded and vector-searched to pull the top 10 candidates.</li><li>Ten was still too much. There's a loop, still in the codebase today, that encodes the candidate function definitions and just pops them off the end one at a time until they fit:</li></ul><pre><code>while (encode(functionsString).length &gt; maxTokens &amp;&amp; reducedEntries.length &gt; 1) {
  reducedEntries.pop()
  functionsString = JSON.stringify(Object.fromEntries(reducedEntries))
}
</code></pre><ul><li>Parameters like <code>coin_ids</code> have thousands of valid values, so those couldn't be inlined either: a second vector table <em>of enum values</em>, searched against the query to return ~20 likely ones.</li><li>When an API response came back too big, it got filtered by <em>another model call</em>, asking one to write a <code>jq</code> expression that projected the giant blob down to only the fields the question needed, then retrying by feeding it its own error.</li><li>Documents got chopped into 150-token chunks; keep the top 5, glue them together.</li><li>Conversation history got truncated by hand: chop any assistant reply past 150 characters, counted by character, with the comment <em>"prevent information saturation."</em></li></ul><p>The commit history is full of the desperation. <code>MAX_TOKENS</code> changed <strong>five times in a single day</strong>: 4000, then 3500, then 4000, then 8000, then back to 4000. There's a one-liner that just <em>"increases max tokens to 3 times if it's not english,"</em> because Korean and Chinese tokenize worse and there was no better idea at the time. There's a commit called <strong>"avoid caching sorry answers,"</strong> because the system had been caching its own <em>failures</em>. The README describes one of these subsystems and then admits, out loud, <em>"This is a big system as well 😅."</em> Twice.</p><p>When I got close to all of it, it was humbling to sit with. It felt less like engineering intelligence and more like being a very anxious travel agent for a genius who forgets everything the second you stop talking. But every one of those hacks is the same move underneath: <em>don't dump, decide.</em> Nobody had a name for it yet. It just felt like janitorial work you did so the smart part could work at all.</p><h2 id="then-we-gave-it-a-team">Then we gave it a team</h2><p>The rebuilds came as the models got bigger and smarter. You'd think that would make the whole problem evaporate.</p><p>It didn't. It just changed shape. In one of the newer versions the very first real crisis, only weeks in, was adding a token counter and model-based data filtering in the same week, because the fresh, powerful model was <em>still</em> drowning in raw API payloads. Same bottleneck. New house.</p><p>But the answer this time wasn't a bigger pile of filters. It was decomposition. One overloaded API agent got split into five specialists (CoinGecko, DeBank, DeFiLlama, Etherscan, IQAI) with a top-level <strong>router</strong> that stopped answering anything itself and just classified each question and handed it to exactly one specialist. Single hop. Its instruction literally says <em>"Do NOT provide your own answer after transferring."</em></p><p>The point of that is context. A CoinGecko question now travels with <em>only</em> CoinGecko instructions and <em>only</em> CoinGecko tools. It never has to carry DeBank's entire world in its head. Each agent gets a narrow, purpose-built slice of reality instead of one prompt straining to be everything at once.</p><p>And we got ruthless about history. There's a step that, before every model call on a specialist, throws the thread away and hands it <em>only the current question</em>. The default number of past turns kept? <strong>One.</strong> A tiny separate model rewrites your follow-up ("what about <em>its</em> price?") into a standalone question first, so the specialist never needs the backstory; it gets a question that already resolved "it."</p><p>We even stopped dumping tool menus. Instead of loading dozens of endpoint schemas, an agent <em>searches</em> for the tool it needs, then writes code to call it. And the newest rebuilds lean into that hard: give a specialist a single tool, let the model write a little function that runs in a sandbox, do the fetch-filter-sort-slice <em>inside</em> that call, and hand back only the ten rows it asked for. The 250-row array it worked through never touches the model's context. There's a line in there I love:</p><blockquote><p>Too large to hand back safely, return a truncated string so it can't overflow the consuming model's context window.</p></blockquote><p>Years earlier the move was popping function definitions off a list until they fit. This is the grown-up version of the exact same instinct, and somewhere in the middle of watching all of it, I stopped seeing this as janitorial work and realized it <em>was</em> the job. The whole job.</p><h2 id="it-has-a-name-now">It has a name now</h2><p>Somewhere around the middle of 2025, while I was buried in this stuff, watching agents keep choking on context they'd been handed badly, the rest of the field named the thing.</p><p>In June 2025, Shopify's Tobi Lütke put it like this:</p><p><img alt="Tobi Lütke: “I really like the term ‘context engineering’ over prompt engineering… the art of providing all the context for the task to be plausibly solvable by the LLM.”" src="https://lope.adebesin.com/images/blog/context/tobi-context-engineering.png" width="1194" height="536"><em>Tobi Lütke, June 19, 2025.</em></p><p>Days later, Andrej Karpathy amplified it into the definition everyone now quotes:</p><p><img alt="Andrej Karpathy: “context engineering is the delicate art and science of filling the context window with just the right information for the next step.”" src="https://lope.adebesin.com/images/blog/context/karpathy-context-engineering.png" width="1194" height="1356"><em>Andrej Karpathy, June 25, 2025. The line that renamed the discipline.</em></p><blockquote><p>context engineering is the delicate art and science of filling the context window with just the right information for the next step. <span>...</span> Too little or of the wrong form and the LLM doesn't have the right context for optimal performance. Too much or too irrelevant and the LLM costs might go up and performance might come down.</p></blockquote><p>That last sentence is the part nobody warns you about. I used to think the whole problem was <em>scarcity</em>, not enough room. So when the windows finally got huge, I assumed we'd won. The token budget in that codebase tells the real story: it went from around 4,000 to a full million, and then someone quietly dialed it back to 500,000, for performance. We'd been handed almost infinite room and <em>chose</em> to use less. Because more context isn't free context. Anthropic frames it as an <strong>attention budget</strong>: like us, a model has limited working memory, and the more you cram in, the <em>worse</em> its recall gets. They call it "context rot," where the answer is technically in the window but buried in the middle where nothing looks. The <a href="https://www.ai-engineer.me/context-is-everything/" rel="nofollow">ai-engineer.me essay that shares this post's title</a> puts it best: <em>"bottlenecks can't be eliminated, they can only be moved around."</em> Bigger windows didn't kill the bottleneck. They moved it from <em>"will it fit"</em> to <em>"of everything that now fits, what actually deserves to be there."</em></p><p>When I read <a href="https://www.langchain.com/blog/context-engineering-for-agents" rel="nofollow">LangChain's four moves</a>, I laughed, because they're a tidy map of everything I'd watched us stumble into by feel. <strong>Write</strong> context out to somewhere durable, that's saving what an agent found so a later step can use it. <strong>Select</strong> the right pieces back in, that's the vector search. <strong>Compress</strong> what you keep, that's the <code>jq</code> filter and "return a small summary." <strong>Isolate</strong> it across agents, that's the scoped specialists. There are now whole companies, like <a href="https://supermemory.ai/" rel="nofollow">supermemory</a>, which bills itself as "the memory layer for AI agents, a context engineering platform," selling the pillar we'd been hand-rolling since it was a 150-token chunk in a database table.</p><p>Karpathy ended his post with a line I think about a lot: <em>the term "ChatGPT wrapper" is tired and really, really wrong.</em> He's right. The model is one component. The thick, unglamorous layer around it, deciding what it sees, when, and in what shape, is most of the actual software. It's most of the actual <em>work.</em></p><h2 id="back-to-the-humans">Back to the humans</h2><p>Here's the thing that keeps getting me, though. We are <em>terrible</em> context engineers with each other, and we've had a lot longer to practise.</p><p>Think about how we brief people. We fire off the Slack message with none of the backstory and wonder why the reply misses. We say "you know what I mean" to someone who probably does not. We walk a new teammate up to a two-year-old system and drop them at the door. We do to each other exactly what a bad prompt does to a model: too little context, or the wrong shape, and then we're surprised by the confident wrong answer that comes back.</p><p>The uncomfortable mirror is that everything I learned bolting context onto a forgetful model is just... good communication, formalized. Rewrite the follow-up so it stands alone: that's not making someone reconstruct the whole thread from memory. Return a summary, not the raw arrays: that's respecting someone's attention budget instead of forwarding the 200-email chain. Give each specialist only their slice: that's not CC'ing forty people on something two of them own. Write it down somewhere durable: that's the doc that outlives the one person who remembers.</p><p>We get away with being sloppy because humans are absurdly good at filling gaps. You lob half a sentence and repeated patterns, shared history, a lifted eyebrow do the rest. The model has none of that grace. It exposes, ruthlessly, how much of what we call "communicating" was actually just <em>the other person quietly doing the context engineering for us.</em></p><h2 id="the-refactor">The refactor</h2><p>Context is expensive. Assembling it, curating it, keeping it fresh, that's real cost, in tokens and in effort. But missing context is more expensive. It's the confident wrong answer, the rework, the argument that was really just two people running on different halves of the same conversation.</p><p>For years I thought I was solving a machine problem: squeeze the data through the tiny hole, then rank it once the hole got big. I was really learning the oldest problem there is: how do you get what's in your head <em>plausibly, correctly</em> into someone else's, using only the words you can afford to spend.</p><p>The essay I keep quoting opens with a line that turned out to be the whole point: <em>"With LLMs, as with people, context is everything."</em></p><p>Every conversation with a model is a stranger walking in halfway through. Turns out most of my conversations with people are too. The real, defining skill, whether the other side is a language model or a person who deserves better than half the story, is catching them up before they nod along to something they only half understand.</p><p>So: say more than "Hi." Say enough.</p>]]></content:encoded>
            <enclosure length="0" type="image/svg+xml" url="https://lope.adebesin.com/images/blog/context/cover.svg"/>
        </item>
        <item>
            <title><![CDATA[The quietest kind of bug]]></title>
            <link>https://lope.adebesin.com/blog/quietest-bug</link>
            <guid isPermaLink="false">https://lope.adebesin.com/blog/quietest-bug</guid>
            <pubDate>Thu, 16 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Optional chaining hides the failure you most need to see. A BethelFlow user found the bug before I did. My honest take, and the rule I keep.]]></description>
            <content:encoded><![CDATA[<p>Why optional chaining hides the failure you most need to see, and the rule I keep for it.</p><quiet-cover></quiet-cover><p>You know the little light on your dashboard. The orange one.</p><p>It flicks on one morning and you tell yourself you'll deal with it later. The car still drives. Nothing feels different. So you keep going, day after day, the light glowing quietly in the corner of your eye until you stop seeing it at all. Then one evening, on the highway, late for something that actually matters, the engine gives out. The light had been trying to tell you for weeks. You'd just trained yourself not to listen.</p><p>We do this everywhere, don't we? The strange noise in the house you slowly tune out. The "we should talk" text you leave on read. The friend who says "I'm fine" so smoothly that you let yourself believe them. None of it is loud. All of it is waiting. The problem never actually left when the signal went quiet. It just picked its moment.</p><p>Code has an operator for exactly this. For years, it was my favourite one.</p><h2 id="the-code-that-never-speaks-up">The code that never speaks up</h2><p>Optional chaining. <code>?.</code>. You reach into an object, and if something along the way is missing, it politely returns <code>undefined</code> instead of throwing. No crash. No noise. It just keeps going.</p><p>That sounds like a gift until it costs you. Here is what it cost me.</p><p>On the church records page in <a href="https://www.bethelflow.com/" rel="nofollow">BethelFlow</a>, the names went blank. Not everywhere, and not all at once, but rows that should have read "The Adebayo family, Ushering department" were quietly showing a dash. <code>—</code>. As if the record had no family and no department at all. No error. Nothing in the console. The data was sitting right there in the API response the whole time. The screen just refused to show it.</p><p>A user found it before I did. That part still stings.</p><p>Here is the line that did it, and I'll be honest with you: I wrote it on autopilot.</p><pre><code>value={r.familyId ? (family?.familyName ?? "—") : null}
</code></pre><p>Read it slower than I did. <code>family</code> is a lookup object I fetched separately on the client. When it hadn't loaded yet, or the lookup simply missed, <code>family</code> was <code>undefined</code>. So <code>family?.familyName</code> short-circuited to <code>undefined</code>, <code>?? "—"</code> caught it, and the row cheerfully rendered a dash. Optional chaining did exactly what it promised. It did not throw. It also never once mentioned that the whole premise of the line, "I have this family object," was false.</p><p>And here's the part I have to own. I didn't reach for <code>?.</code> because I'd thought carefully about what should happen when a family is missing. I reached for it because the red squiggle went away. It felt like handling the case. It was the "yeah, all good" of code. It was silence wearing the costume of safety.</p><p>That's the take, and I'll say it plainly: <strong>optional chaining is a bug-swallowing machine.</strong> It takes a loud, early failure and turns it into a quiet <code>undefined</code> that either sits on the screen as a blank, or travels three functions downstream and finally explodes as "cannot read x of undefined" somewhere that has nothing to do with where it actually broke.</p><h2 id="guarding-harder-just-moves-the-silence">Guarding harder just moves the silence</h2><p>When the names went blank, my first instinct was the wrong one. Guard harder. Sprinkle a few more <code>?.</code> upstream so nothing could possibly throw.</p><p>But think about what that actually does. It doesn't fix the bug. It moves the silence. Every <code>?.</code> you add is one more place that will show nothing instead of telling you something broke. You can optional-chain an entire file and never once be told what's missing. That isn't a safe codebase. It's a codebase that has quietly agreed never to alarm you. 😅</p><p>That isn't a fix. It's a strip of tape over the warning light, so now the dashboard looks calm too. It's the friend who only learned to say "I'm fine" more convincingly.</p><h2 id="am-i-saying-never-use-it-no">Am I saying never use it? No</h2><p>I use optional chaining every single day. For data that is <em>genuinely</em> optional, reaching one level in is exactly what the operator is for:</p><pre><code>const avatar = user.profile?.avatarUrl ?? fallback
</code></pre><p>That's honest code. <code>profile</code> is allowed to be absent, and I decided right here, in one glance, what happens when it is. The absence is <em>expected</em>, and it's <em>handled</em>. That is the whole test.</p><p>My rule is a length limit. <strong>Three links is the ceiling.</strong> <code>a?.b?.c</code> and I can still hold in my head which of those can be null and why. <code>a?.b?.c?.d?.e</code> and I have stopped reasoning entirely. That chain isn't safety, it's a nervous tic, a quiet confession that I don't know the shape of my own data and I'd like the language to paper over it for me.</p><p>Granted, three is a heuristic, not a law. Some days it's two. The number matters less than the honesty it forces: if the chain is long enough that you can't say out loud which link is allowed to be missing, the answer is almost never one more <code>?.</code>. It's that you're reaching into the wrong object.</p><p>That was the real story in BethelFlow. The fix wasn't to guard the lookup harder. It was to stop chaining into a maybe-missing client lookup and put the name on the record itself, where it belonged:</p><pre><code>value={r.familyId ? (r.familyName ?? "—") : null}
</code></pre><p>No lookup. No chain. Nothing left to go quietly missing.</p><h2 id="early-returns-say-the-quiet-part-out-loud">Early returns say the quiet part out loud</h2><p>Before I reach for optional chaining now, I reach for a guard clause. I decide what the absence <em>means</em>, at the point where it happens, while I still have the context to decide it well.</p><p>So instead of threading a maybe-null value through a whole function and hoping:</p><pre><code>function greeting(user) {
  return `Hi, ${user?.profile?.contact?.firstName ?? "there"}`
}
</code></pre><p>I handle it at the door:</p><pre><code>function greeting(user) {
  if (!user.profile) return null
  return `Hi, ${user.profile.contact.firstName}`
}
</code></pre><p>Yes, it's more typing. That's the honest cost, and I'll pay it every time, because of what it buys. The null case becomes a decision I actually made instead of a default I fell into. The rest of the function runs on known-good data, so the happy path stays flat and easy to read. And the next person, who is usually a tired future version of me, can read the top of the function and know exactly what it needs to work.</p><p>That last one is the real prize. A guard clause is how a function says its preconditions out loud, and that shared understanding is what lets code compose without everyone holding the whole call graph in their head. Optional chaining hides the precondition. An early return speaks it.</p><h2 id="the-rule-i-keep">The rule I keep</h2><p>Reach for <code>?.</code> when the absence is expected and you've handled it, and keep the chain to about three. Reach for a guard when the absence would mean something is wrong, and handle it right there, while you still know why.</p><p>Because the kindest thing a piece of code can do is the same thing that little orange light was trying to do all along. When something is wrong, say so early, say it out loud, and say it close to where it happened, while listening is still cheap. Silence is not safety. Ask the user who spent a week staring at a dash where their family's name should have been.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Being Heard Isn't Just About Speaking — It's About Understanding]]></title>
            <link>https://iamlope.medium.com/being-heard-isnt-just-about-speaking-it-s-about-understanding-b700929c5743</link>
            <guid isPermaLink="false">https://iamlope.medium.com/being-heard-isnt-just-about-speaking-it-s-about-understanding-b700929c5743</guid>
            <pubDate>Mon, 26 May 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[A guide to internationalization (i18n) in Next.js using next-intl to build multilingual, user-aware web experiences.]]></description>
        </item>
        <item>
            <title><![CDATA[A Form, A Pen, and A Prayer]]></title>
            <link>https://iamlope.medium.com/a-form-a-pen-and-a-prayer-aed96e4b490c</link>
            <guid isPermaLink="false">https://iamlope.medium.com/a-form-a-pen-and-a-prayer-aed96e4b490c</guid>
            <pubDate>Mon, 28 Apr 2025 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[Stop yapping, Lock in]]></title>
            <link>https://iamlope.medium.com/stop-yapping-lock-in-5e0a0673ab19</link>
            <guid isPermaLink="false">https://iamlope.medium.com/stop-yapping-lock-in-5e0a0673ab19</guid>
            <pubDate>Fri, 25 Apr 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Securing Next.js server actions with next-safe-action — typed input validation, Zod schemas, and clean error handling.]]></description>
        </item>
        <item>
            <title><![CDATA[Nuqs: Because URLs Should Do More]]></title>
            <link>https://iamlope.medium.com/nuqs-because-urls-should-do-more-5d5d86e873c1</link>
            <guid isPermaLink="false">https://iamlope.medium.com/nuqs-because-urls-should-do-more-5d5d86e873c1</guid>
            <pubDate>Mon, 17 Feb 2025 00:00:00 GMT</pubDate>
            <description><![CDATA[Type-safe URL search-param state management in Next.js with nuqs, so user context persists across refreshes and shared links.]]></description>
        </item>
        <item>
            <title><![CDATA[Love Language]]></title>
            <link>https://iamlope.medium.com/love-language-11cc15e6160c</link>
            <guid isPermaLink="false">https://iamlope.medium.com/love-language-11cc15e6160c</guid>
            <pubDate>Mon, 10 Feb 2025 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[The Lies Imposter Syndrome Tells Us]]></title>
            <link>https://iamlope.medium.com/the-lies-imposter-syndrome-tells-us-0dc6905b34f0</link>
            <guid isPermaLink="false">https://iamlope.medium.com/the-lies-imposter-syndrome-tells-us-0dc6905b34f0</guid>
            <pubDate>Sun, 02 Feb 2025 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[Networking: Your Tool for Growth in Tech]]></title>
            <link>https://iamlope.medium.com/networking-your-tool-for-growth-in-tech-3f3f7dfb1f1b</link>
            <guid isPermaLink="false">https://iamlope.medium.com/networking-your-tool-for-growth-in-tech-3f3f7dfb1f1b</guid>
            <pubDate>Mon, 20 Jan 2025 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[Chasing the Missing 'n': A Debugger's Odyssey]]></title>
            <link>https://iamlope.medium.com/chasing-the-missing-n-a-debugger-s-odyssey-5c6412dafdc2</link>
            <guid isPermaLink="false">https://iamlope.medium.com/chasing-the-missing-n-a-debugger-s-odyssey-5c6412dafdc2</guid>
            <pubDate>Thu, 16 Jan 2025 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[Don't Dry Out]]></title>
            <link>https://iamlope.medium.com/dont-dry-out-6d988a723c3d</link>
            <guid isPermaLink="false">https://iamlope.medium.com/dont-dry-out-6d988a723c3d</guid>
            <pubDate>Sun, 22 Dec 2024 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[The Virtual Colony: Why Communication Matters in Remote Teams]]></title>
            <link>https://iamlope.medium.com/the-virtual-colony-why-communication-matters-in-remote-teams-3928c1c61d3d</link>
            <guid isPermaLink="false">https://iamlope.medium.com/the-virtual-colony-why-communication-matters-in-remote-teams-3928c1c61d3d</guid>
            <pubDate>Sun, 01 Dec 2024 00:00:00 GMT</pubDate>
        </item>
    </channel>
</rss>