David Khourshid

David Khourshid

David is the founder of Stately.ai and creator of XState, the most popular open-source state machine & statecharts library. He's a longtime advocate for event-driven modeling and visual diagramming as the foundation for reliable UIs and, increasingly, AI agents. When he's not at a computer keyboard, he's at a piano keyboard.
Goodbye Slop; Welcome Determinism
React Day Berlin 2026React Day Berlin 2026
Upcoming
Goodbye Slop; Welcome Determinism
Vibe coding feels productive until you have to maintain it. Behind the agent "thinking..." you ignore and the code you never opened lies a growing pile of wasted tokens, nondeterministic behavior, and compounding errors hiding in plain sight.
This talk pushes back on the status quo: elaborate agent architectures, "prompting astrology", overnight automation loops burning through context windows and credit cards. We'll look at why determinism, state machines, and explicit guardrails aren't "old-school"... they're the only sustainable way forward.
We'll look at why vibe coding compounds technical debt faster than any era before it, and how modeling behavior explicitly lets you ship AI features you actually understand, maintain, and trust.
Cloning Full-Stack Apps with AI: What It Really Takes
React Summit US 2026React Summit US 2026
Upcoming
Cloning Full-Stack Apps with AI: What It Really Takes
Vibe coding is easy, until you have to make an app that actually works. Sure, AI agents can spin up an impressive demo in minutes, but building a full-stack app that's robust, bug-free, and true to spec is where things get messy. And completely cloning an existing full-stack app? That's next-level difficult. Adding more agents just multiplies the mess, and spec-driven development piles stale specs on top of it. So... what does it actually take?

In this talk, we'll explore a radically different approach, learned from building (and cloning) hundreds of apps for RL agent training environments and more: a living spec (yes, including state machines) and an AI-generated implementation that iterate on each other until reaching equilibrium, where the app provably does what the spec says. You'll learn how to model full-stack behavior as states, events, and effects, why letting agents modify their own workflows beats any rigid pipeline, and how to apply this experimental but extremely effective iterative loop to your own AI-assisted development today.
Cloning Full-Stack Apps with AI: What It Really Takes
AI Coding Summit NYCAI Coding Summit NYC
Upcoming
Cloning Full-Stack Apps with AI: What It Really Takes
Vibe coding is easy, until you have to make an app that actually works. Sure, AI agents can spin up an impressive demo in minutes, but building a full-stack app that's robust, bug-free, and true to spec is where things get messy. And completely cloning an existing full-stack app? That's next-level difficult. Adding more agents just multiplies the mess, and spec-driven development piles stale specs on top of it. So... what does it actually take?

In this talk, we'll explore a radically different approach, learned from building (and cloning) hundreds of apps for RL agent training environments and more: a living spec (yes, including state machines) and an AI-generated implementation that iterate on each other until reaching equilibrium, where the app provably does what the spec says. You'll learn how to model full-stack behavior as states, events, and effects, why letting agents modify their own workflows beats any rigid pipeline, and how to apply this experimental but extremely effective iterative loop to your own AI-assisted development today.
Goodbye, useState
React Summit US 2025React Summit US 2025
29 min
Goodbye, useState
State management is easy, until it's not. Sure, useState() is fine for simple component state management – that's literally what it's for. But as our React apps grow in complexity, the inevitable long chain of useStates make it more difficult to understand and maintain app logic, turning our components into Rube Goldberg machines.React 19 opens up a whole new world of state management patterns that actually make sense for local, shared, and global state. In this talk, we'll transition from using useState() everywhere to discovering how server components, URL parameters, and more can make state management much simpler. We'll also revisit classic hooks, learn about new hooks, and see how 3rd-party state management libraries and local-first apps can be useful.Let's say goodbye (mostly) to useState(), and hello to a future where state management isn't just a stack of setStates.
Making State Management Intelligent
React Summit 2024React Summit 2024
31 min
Making State Management Intelligent
Managing state in React is complicated. Humans are even more complicated. As developers, it's our job to deliver seamless and intuitive user experiences, but the sheer complexity of human behavior and the real world can make this harder than it should be. In this talk, we'll explore a radical new approach to app development where language models (LLMs) and reinforcement learning (RL) can be used to handle app logic in a more intelligent and human-centric way. We're bringing artificial intelligence to state management in ways that go much, much further than "call the OpenAI API and hope for the best". You will learn how you can leverage AI in your existing React apps to create the best UX possible, and peer into the future of AI agents.
Using useEffect Effectively
React Advanced 2022React Advanced 2022
30 min
Using useEffect Effectively
Top Content
Can useEffect affect your codebase negatively? From fetching data to fighting with imperative APIs, side effects are one of the biggest sources of frustration in web app development. And let’s be honest, putting everything in useEffect hooks doesn’t help much. In this talk, we'll demystify the useEffect hook and get a better understanding of when (and when not) to use it, as well as discover how declarative effects can make effect management more maintainable in even the most complex React apps.
The State of XState
React Finland 2021React Finland 2021
18 min
The State of XState
Over the past few years, state machines, statecharts, and the actor model have proven to be viable concepts for building complex application logic in a clear, visual way with XState. In this talk, we'll take a peek into the future of XState, including new features in the next version, and new tools and services that will make it even easier to create and collaborate on state machines.
The Visual Future of State Management
JSNation Live 2021JSNation Live 2021
32 min
The Visual Future of State Management
Learn about state modeling with state machines and statecharts can improve the way you develop application logic, and get a sneak peek of never-before-seen upcoming visual tools that will take state management to the next level.
XState: the Visual Future of State Management
React Summit Remote Edition 2021React Summit Remote Edition 2021
35 min
XState: the Visual Future of State Management
Top Content
Learn about state modeling with state machines and statecharts can improve the way you develop your React applications, and get a sneak peek of never-before-seen upcoming visual tools that will take state management to the next level.