Get early access
Back to episodes
#537 months ago

Agentic Coding for Frontend Apps

We do a lot of deep research and planning advice for building complex backend systems but in this week's episode, we're gonna talk about ways you can move faster and maintain quality for frontend code. While backend systems rely on good overall design and tend to be programatically verifiable, frontends require much tighter iteration loops and taste, and these explorations just don't suit themselves to complex up front planning. On the other hand, that shouldn't be an excuse to just regress to yoloing prompts. Good frontend code requires taste, judgement, and is just as vulnerable to a descent into chaotic spaghetti slop. Similar to our learning tests episode, this chat will cover small tactical side quests you can incorporate into your planning and development workflow to improve your frontend throughput. We'll primarily explore storybook as a vessel for interacting with and previewing UI, and approaches to separate presentation logic from business logic. By the end, you may find yourself wanting to ditch figma altogether and just write the components live.

Project details

Open in GitHub

Practical techniques for moving faster and maintaining quality when building frontend code with AI agents — covering Storybook as a development vessel, separating presentation from business logic, and tight iteration loops that don't devolve into prompt yolo.

Video

Links

Whiteboards

Key Takeaways

  • Storybook is unit testing for your UI. The same reason you write a unit test instead of spinning up a whole app to check one function applies here. When Dex needed to fix a to-do card that looked wrong in the "deleting" state, he didn't click through the app to recreate it — he opened the story, set is_deleting: true in the props, and iterated right there. Same component, 20 different states, zero app spinning up.
  • Separate pure components from wired components and life gets a lot easier. Pure components just take props and render; wired components handle fetching, state, and hooks. Keeping them separate means the agent only has to think about one thing at a time, and your Storybook only has to model props — not mock API calls, manage auth, or fake a database. The rule: if a component fetches data it's wired, if it only renders data it's pure, and only the pure ones go in Storybook.
  • Storybook beats Figma for agentic workflows. Figma always has a translation step — the designer approves the mockup, then someone turns it into React. With Storybook the mockup is the React component, so when your team says "approved" it's already implemented in your design system. The frontend engineer's job becomes just wiring up the data instead of translating designs into code.
  • A browser agent plus Storybook gives you a fully automated visual iteration loop. You can get Storybook to output a PNG from the CLI, and Dex uses a browser agent skill to screenshot Storybook components and feed them back to Claude. The pattern: write the story, screenshot it, have Claude iterate until it looks right, screenshot again — no human in the loop for pure visual changes.
  • Frontend and backend need different workflows. For backend code, reading the plan is enough to know if it's right; for frontend code, you have to see it. Storybook gives you a place to see every state your UI can be in without recreating it in production, which lets you apply the same tight agentic loop to UI that you've been using for everything else.

Resources

All episodes