Skip to content
All builds

Smart Converter

What it does for you

Units, ingredient-aware cooking measures, and fragrance dilution, one offline tool with a fully tested math core.

Smart Converter screenshot

Screenshots

Smart Converter screenshot 1

In more detail

A three-in-one converter. One tab handles everyday units, one handles cooking (it knows a cup of flour and a cup of honey weigh very different amounts), and one handles fragrance dilution, like how much alcohol to add to hit a certain strength. All the math is checked by an automated test, not eyeballed.

Honest limits

The 50 assertions check the math, not the interface. There was no local headless browser wired up that day, so the screenshot came later. The ingredient list is a fixed table of 15, and nothing is saved between visits.

How I built it

Claude Code, about an hour and a half. I set the scope: three tabs, fragrance as the headliner, and a core I could test. Claude proposed the structure that ended up mattering most in the whole sprint: put every calculation in one pure module, convert.js, with no page code in it. The browser imports that file, and a Node test file, verify.mjs, imports the exact same file. Claude wrote the module, 50 assertions, and the UI in one pass, and ran it all on a small serve.mjs server.

What's in it: 11 unit categories with a live formula readout, 15 cooking ingredients with real densities, an oven converter that includes British gas marks, a recipe scaler, and a fragrance calculator with presets from eau de cologne up to parfum, showing results in mL and drops.

The design hook flagged my display font twice. First Fraunces, then my replacement, Instrument Serif, which was also on its overused list. We landed on Young Serif, which actually fits an apothecary name like Tincture. It also flagged a side accent bar and a stray em dash in the copy. The tests stayed green through all of it because the logic never changed.

What I learned

  • A converter is only trustworthy if its math is tested, and the cheapest way to earn that is one side-effect-free module that both the page and a Node test import. node verify.mjs checks the shipped code: 50 for 50.
  • Cooking conversion is a density problem, not a units problem. You can't go from cups to grams without knowing the ingredient, so grams is the base and density is the bridge (flour 0.53, honey 1.42 g/mL).
  • Fragrance dilution is conservation of aroma. To dilute a sample down, hold the amount of aroma fixed and the "add this much carrier" answer falls out.
  • Temperature isn't a simple ratio like the other units. It needs an offset too, so it gets its own function instead of a fake factor.

What carried forward

This is where the tested core pattern was born. #10 used it the next day with palette.js, and #11 with a QR encoder. In September, the shared build brief I gave every parallel builder made "tested core plus verify.mjs plus serve.mjs" the standard. By the end, 93 of the shipped projects had a recorded test count, 22,356 checks in total. A lot of that started with this one module.

If I took it further

I'd save recent conversions and let people add their own ingredient densities. That table is the one piece a power user would want to extend.

#009 Built with Claude Code June 23, 2026 50 automated checks

Want one like this?