<?xml version="1.0" encoding="UTF-8"?><rss 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" version="2.0"><channel><title><![CDATA[Behavio One]]></title><description><![CDATA[Behavio One]]></description><link>https://behavio-one.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 21 Nov 2026 16:37:18 GMT</lastBuildDate><atom:link href="https://behavio-one.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[AI couldn't see the bug. Working examples from Clay UI changed that]]></title><description><![CDATA[A page turn flashed black on phones and AI fixes kept failing. Working examples from Clay UI and an emulator found the cause.]]></description><link>https://behavio-one.hashnode.dev/ai-couldn-t-see-the-bug-working-examples-from-clay-ui-changed-that</link><guid isPermaLink="true">https://behavio-one.hashnode.dev/ai-couldn-t-see-the-bug-working-examples-from-clay-ui-changed-that</guid><category><![CDATA[AI]]></category><category><![CDATA[webdev]]></category><category><![CDATA[React]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Marcin Tabędzki]]></dc:creator><pubDate>Wed, 18 Nov 2026 18:28:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ad1c62b192238b3eacee622/6fd14a09-139d-4c2f-91fe-49fe73dfee1c.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><em>Originally published on</em> <a href="https://www.linkedin.com/pulse/ai-couldnt-see-bug-working-examples-from-clay-ui-changed-4ilef/"><em>LinkedIn</em></a><em>.</em></p>
<p>I wanted readers to turn the pages of <a href="https://theartofai.behavio.one">The Art of AI</a> like a real book. On my laptop the animation looked right. On my phone, parts of the page flashed black.</p>
<p>Several attempts to fix it with Claude Opus 5.5 failed. Working examples found through <a href="https://clayui.behavio.one">Clay UI</a> pointed to a better approach, which we proved in an Android emulator and checked on my phone. Opus built the first working prototype, and Fable 5.2 settled it and brought it to the version that is live today.</p>
<p>This article is about how we got from plausible fixes to a page turn that works, and what made the difference.</p>
<h2>A book that should turn like paper</h2>
<p>The Art of AI is an illustrated book of short reflections on artificial intelligence, published as a website. I prepared the code for the page turn myself, so that a page lifts at the corner, curls softly and settles on the next one. When it broke on my phone, I asked Claude Opus 5.5 to help me fix it.</p>
<h2>What I saw on the phone</h2>
<p>During a turn, parts of the page went black. Often the whole lower half vanished behind a straight edge under the illustration, and sometimes stripes ran across the paper. A few frames later the page was fine again, so it looked like a flicker. On a computer none of this happened.</p>
<p>This is a screenshot I took on my phone in the middle of a turn. The text is cut off and the left half of the page is simply missing.</p>
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/phone-flicker.jpg" alt="Phone screenshot in the middle of a page turn: the left half of the page is missing" style="display:block;margin:0 auto" />

<h2>Why the AI kept failing</h2>
<p>The AI failed several times before it got anywhere. Its first report said: "I couldn't find a single flash frame." It had checked in a desktop browser set to a phone's screen size. That copies the size of a phone, but not its small graphics memory, and that is where the fault lived. Reading the code did not reveal the cause.</p>
<p>My own assumption didn't help. I said it had not flickered before, but the older version broke the same way in an Android emulator. There was no recent change to blame.</p>
<p>The older version in the Android emulator. Stripes and broken paper run across both pages, with the same library and the same pages as before.</p>
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/old-version.png" alt="The older version in the Android emulator with stripes across both pages" style="display:block;margin:0 auto" />

<p>The emulator gave shaky answers too: the same unchanged build broke in 17%, 27% and 53% of frames on three runs. So the AI guessed and tested one suspect after another, from shadows and the paper texture to the illustrations and browser hints. None of them fixed it.</p>
<p>Frames from one emulator recording of the live site. Black lower halves, half-drawn pages and stripes appear in different frames of the same turns.</p>
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/emulator-frames.jpg" alt="Frames from an emulator recording with black lower halves and half-drawn pages" style="display:block;margin:0 auto" />

<h2>The way out: working examples from Clay UI</h2>
<p>The AI failed again and again; the way out came from the patterns in <a href="https://clayui.behavio.one">Clay UI</a>, which is open source on <a href="https://github.com/behavio1/clay-ui">GitHub</a>. Clay UI searches catalogs of ready-made interface components and downloads their source code. For a page-flip book it found two working examples: page-flip from Kokonut UI and book-flip from Avara.</p>
<p><a class="embed-card" href="https://youtu.be/itN9cm4diZ8">https://youtu.be/itN9cm4diZ8</a></p>

<p>What <a href="https://clayui.behavio.one">Clay UI</a> does, in under 40 seconds of clay: proven components from real libraries, shaped to your style. <a href="https://youtu.be/itN9cm4diZ8">Watch the film</a>.</p>
<p>They paid off first on the buttons. Ours switched off during every turn and faded to 42% opacity. Kokonut keeps its buttons on and ignores extra clicks in code, and we did the same.</p>
<p>The controls frame by frame during page turns. In the left column, before the fix, Previous and Next fade out on every turn.</p>
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/buttons.jpg" alt="Previous and Next buttons frame by frame during page turns, before and after the fix" style="display:block;margin:0 auto" />

<p>On the pages, the examples changed the question. It stopped being "what is wrong with my page" and became "what do working page turns do differently". In plain words: my version made the phone redraw the whole page again and again during a turn. The working examples draw the page once and then only move that finished image.</p>
<p>For developers: Avara turns a page with a 3D rotation, which the graphics chip can apply to an already painted layer. My library cut the page to a new shape in every frame, so the browser had to repaint it 60 times a second. With a paper texture and a large illustration on every page, the phone ran out of graphics memory, and each missing tile showed as black.</p>
<p>A quick copy of Avara's approach, with rigid pages, removed the black halves, but the page turned like a board. I wanted the soft curl. The patterns gave us the direction; proving it and building it were still ahead.</p>
<h2>The key: patterns plus emulation and tests</h2>
<p>The patterns inspired a much stricter process. Opus 5.5 limited Chrome's graphics memory in the emulator to 96 MB, a deliberately low setting that imitates a phone under pressure. From then on the bug appeared every time, just as on my phone. Then it ran a control: the same library with plain pages, under the same limit, turned 65 frames without a broken one.</p>
<p>The control run: the same library with plain pages, recorded frame by frame. Every turn draws cleanly.</p>
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/control.jpg" alt="Control test comparing the page-flip library alone with the full book pages" style="display:block;margin:0 auto" />

<p>So in this test the library alone held up. The difference was my heavy pages, painted again in every frame. A memory reading showed that my page held 118 MB of graphics memory even at rest.</p>
<p>The drawing below shows the difference in what the phone has to do in every frame of a turn.</p>
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/diagram.png" alt="Diagram: repainting the whole page every frame versus moving a finished image" style="display:block;margin:0 auto" />

<p>The tests also showed why guessing never worked. Removing one ingredient made the page lighter, but it was still painted again in every frame.</p>
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/chart.png" alt="Chart of broken frames per variant in the emulator tests" style="display:block;margin:0 auto" />

<h2>Fable 5.2 settles it</h2>
<p>Opus 5.5, guided by the Clay UI patterns, found the direction and built a first prototype: the turn drawn from finished pictures of the pages. In the emulator, under the same low memory limit, we checked 949 animation frames in a row and found no broken one. Fable 5.2 settled the matter and brought it to the version that is live today.</p>
<p>Fable measured the graphics memory and wrote its own page-curl engine on a canvas, a drawing surface inside the browser. A script photographs each of the 86 pages in a fixed phone layout. During a turn the canvas finds the fold line, keeps the front of the page flat and mirrors the back of the paper over the fold, so nothing on the page is painted again. When I opened it on my phone, I wrote back: "It looks very good, I can't see anything breaking."</p>
<p>The comparison below comes from the emulator with the 96 MB limit. The top two rows are the old version and the bottom two the canvas version, turning the same pages.</p>
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/before-after.jpg" alt="Before and after: the page turn on the phone" style="display:block;margin:0 auto" />

<h2>The last details</h2>
<p>The first version showed a picture of the page during a turn and switched back to live text when the turn ended. Every small difference between the two showed as a jump. Fable 5.2 fixed them one by one:</p>
<ul>
<li>The chapter 9 title sat on three lines during a turn and on two after it. The line breaks are now recorded with the pictures and forced on the live page.</li>
<li>After each turn the text got a little thinner and the illustration twitched. The pictures had been taken on a Mac, which draws text bolder than a phone. They are now taken without that, and the picture stays on screen after the turn too, so there is no switch to see.</li>
<li>A zoomed illustration jumped at the end of closing. It now lands on the picture's exact spot, with matching corners and shadow.</li>
<li>A page now has to finish turning before the next turn can start.</li>
</ul>
<h2>What made the difference</h2>
<p>On its own, AI kept failing on this. Working patterns from <a href="https://clayui.behavio.one">Clay UI</a> showed what good page turns do differently, and a detailed process of emulation and tests turned that idea into proof. Opus 5.5 found the direction with them, and Fable 5.2 finished the job. The Clay UI source is on <a href="https://github.com/behavio1/clay-ui">GitHub</a>.</p>
<p>The last part was mine. Our automated checks missed a title that changes lines and text that gets a little thinner. I caught them by reading my own book on my own phone. You can turn its pages at <a href="https://theartofai.behavio.one">theartofai.behavio.one</a>.</p>
<hr />
<img src="https://behavio-website-media.b-cdn.net/clay-ui/article-ai-bug/author-marcin-card.jpg" alt="About the author: Marcin Tabędzki, author of The Art of AI, builds Clay UI and AI tools at Behavio One" style="display:block;margin:0 auto" />

<p><strong>About the author:</strong> Marcin Tabędzki, author of <a href="https://theartofai.behavio.one">The Art of AI</a>, builds <a href="https://clayui.behavio.one">Clay UI</a> and AI tools at Behavio One. Find me on LinkedIn: <a href="https://www.linkedin.com/in/marcin-tabedzki/">linkedin.com/in/marcin-tabedzki</a></p>
]]></content:encoded></item><item><title><![CDATA[Let your coding agent start from a real component instead of writing one from scratch]]></title><description><![CDATA[Clay UI finds real components in shadcn/ui, Magic UI, Kokonut UI and more, and gives your coding agent their source to adapt. Free, MIT.]]></description><link>https://behavio-one.hashnode.dev/let-your-coding-agent-start-from-a-real-component-instead-of-writing-one-from-scratch</link><guid isPermaLink="true">https://behavio-one.hashnode.dev/let-your-coding-agent-start-from-a-real-component-instead-of-writing-one-from-scratch</guid><category><![CDATA[React]]></category><category><![CDATA[AI]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Marcin Tabędzki]]></dc:creator><pubDate>Sun, 15 Nov 2026 18:27:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ad1c62b192238b3eacee622/951ffdf5-948b-4c40-acbe-23ce677c8a34.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Ask Claude Code, Codex or Cursor for "a hotel date picker with a price under each night" and you will get a calendar written from zero. It renders. It usually misses the details a mature component already handles: check-out on a night that is booked by the next guest, a minimum stay, the total under the selected range, keyboard navigation.</p>
<p>We built Clay UI so the agent looks in established component libraries first, then adapts real code to your project.</p>
<p>Demo videos and the site: <a href="https://clayui.behavio.one">https://clayui.behavio.one</a></p>
<h2>What the agent does with it</h2>
<p>Install the skill in a project:</p>
<pre><code class="language-bash">npx @behavio1/clayui init
</code></pre>
<p>Then ask in plain words, in any language. The skill tells the agent to translate the request into a concrete English search and run the CLI:</p>
<pre><code class="language-bash">clayui search "date range picker booking nightly price" --available-only --json
</code></pre>
<p>For that request the top three results are:</p>
<pre><code class="language-text">kokonut/stay-picker     A date range picker for booking stays. Every night shows its price...
kokonut/team-selector   Seat picker with a scrubbable number, generated avatars and a price line
shadcn/calendar         Select a date or a range of dates (react-day-picker)
</code></pre>
<p>The agent shows you the options with preview links. You pick one, and it downloads the source:</p>
<pre><code class="language-bash">clayui get kokonut/stay-picker --out .clayui-examples --json
</code></pre>
<p>The folder holds the component files exactly as the library publishes them, the usage notes from its docs, and a <code>clayui.json</code>. Here is part of the real one:</p>
<pre><code class="language-json">{
  "id": "kokonut/stay-picker",
  "sourceUrl": "https://raw.githubusercontent.com/kokonut-labs/kokonutui/main/public/r/stay-picker.json",
  "sourceRef": "main",
  "license": "MIT",
  "dependencies": ["lucide-react", "motion"],
  "gaps": ["local-imports-missing"],
  "missingLocalImports": [
    { "file": "components/kokonutui/stay-picker.tsx", "import": "@/lib/utils" }
  ],
  "files": ["components/kokonutui/stay-picker.tsx"]
}
</code></pre>
<p>It also stores a SHA-256 for every file. The gap here is the usual <code>cn</code> helper from <code>@/lib/utils</code>, which most shadcn-style projects already have. The agent sees it and either reuses yours or adds it.</p>
<p>The agent then rewrites the example into your codebase: your tokens, your data, your naming. Clay UI never runs <code>npm install</code> and writes only into the examples folder.</p>
<h2>Where the components come from</h2>
<p>shadcn/ui, Radix, Base UI, Sonner, Vaul, cmdk, NumberFlow, Beautiful UI, RareUI, Magic UI, Aceternity UI, 21st.dev and Kokonut UI. The CLI keeps a local index of them and refreshes it from each library's registry or repository.</p>
<h2>Two decisions that mattered</h2>
<p><strong>Be honest about what is missing.</strong> A component that imports <code>../utils/foo</code> you did not get is not a working example. <code>get</code> resolves every relative and alias import against the delivered files and reports the ones that are missing as <code>local-imports-missing</code>. Paid or deleted items exit with code 3 instead of writing a half-empty folder. The agent reads those gaps before it starts adapting.</p>
<p><strong>Search without a key, better with one.</strong> Out of the box the search is BM25 over names, descriptions and synonyms, with no account needed. Set a Gemini API key and it adds semantic search with <code>gemini-embedding-001</code>, which handles loose requests like "this checkout feels cheap" much better. Query embeddings are cached for 30 days.</p>
<h2>Try it</h2>
<ul>
<li>Install: <code>npx @behavio1/clayui init</code></li>
<li>Code and docs (MIT): <a href="https://github.com/behavio1/clay-ui">https://github.com/behavio1/clay-ui</a></li>
<li>How we measure search quality: <a href="https://github.com/behavio1/clay-ui/blob/main/docs/search-tuning.md">https://github.com/behavio1/clay-ui/blob/main/docs/search-tuning.md</a></li>
<li>Short demos: <a href="https://www.youtube.com/@BehavioOne">https://www.youtube.com/@BehavioOne</a></li>
</ul>
<p>The CLI is a small Rust binary, shipped through npm for macOS, Linux and Windows. If a search returns the wrong component for your request, open an issue with the query. That is the most useful feedback we can get.</p>
<p><em>Disclosure: this account belongs to Behavio One, the team that built Clay UI.</em></p>
]]></content:encoded></item></channel></rss>