AI-generated product demos from source code: what stands in the way
A recent Hacker News post asked whether AI can generate reliable product demonstrations directly from source code. The discussion identified three core challenges: understanding application workflows, identifying meaningful UI states, and synchronizing animations with narration. These problems highlight why the gap between a functioning codebase and a polished demo remains difficult for current models to bridge.
The workflow reconstruction problem
Source code encodes behavior, but it does not encode intent. A feature may span multiple files, services, and asynchronous boundaries, and the order in which a user experiences it — click a button, see a modal, fill a form, submit, receive confirmation — is not directly readable from the implementation. An AI attempting to generate a demo must infer the intended user journey from function signatures, routing tables, and component hierarchies.
This inference breaks down when workflows involve conditional logic that depends on server state, user permissions, or feature flags. The AI might generate a demo that shows the happy path but misses the error states that users actually encounter. Without access to product specifications or user research, the model has no ground truth for which workflows matter most.
UI states that matter versus states that exist
Frontend frameworks proliferate state: loading flags, form validity, optimistic updates, toast notifications, modal visibility, focus management, and more. Much of this state is implementation detail. A user cares that a form submission failed and an error message appeared; they do not care that a Redux action dispatched, a saga intercepted it, and a reducer updated a slice.
An AI that cannot filter meaningful states from noise will produce demos that linger on spinner animations or flash intermediate states that a human would never notice. The challenge is compounded by state that lives outside the component tree — in URL query parameters, localStorage, service workers, or server-side session data. Reconstructing the full UI state at any moment requires whole-application awareness that current static analysis tools rarely provide.
Timing the demo to the script
A product demo pairs visual action with spoken explanation. The narration describes what the viewer should notice; the animation must give the viewer time to notice it. AI-generated demos struggle with this synchronization because code execution speed is unpredictable. An API call might resolve in fifty milliseconds or three seconds. A CSS transition might last two hundred milliseconds or two seconds depending on the design system.
If the AI generates a fixed script and then records the application running at real speed, the narration and visuals drift apart. If the AI slows down or speeds up the recording to match the script, the demo no longer reflects real performance. Some tools attempt to solve this by generating the animation and narration separately — rendering keyframes that align with script beats — but this requires the AI to simulate the UI rather than capture it, introducing fidelity loss.
Current approaches and their limits
Several strategies are being explored. Static analysis tools extract call graphs and component trees, then annotate likely user interactions. Runtime instrumentation captures actual state transitions during a human-driven session, giving the AI a trace to follow. Code-aware rendering engines rebuild each frame from the application state, allowing precise control but requiring the AI to maintain a complete UI model.
Each approach has trade-offs. Static analysis misses dynamic behavior. Runtime traces only cover the paths a human happened to take. Code-aware rendering demands a model of the entire frontend that must be updated with every code change. None fully automates the judgment calls that make a demo feel purposeful rather than mechanical.
Human judgment remains the bottleneck
Commenters on the Hacker News thread consistently noted that human review is indispensable. A product manager must verify that the demo tells the right story. A designer must adjust pacing and emphasis. A narrator must adapt the script to the actual flow. The AI can propose a structure, surface candidate states, and estimate timings — but the final decisions about what to show, in what order, and how to explain it still require product sense.
The most effective workflows treat AI as a first-draft generator. The model produces a rough sequence from the codebase, and humans refine it into a presentation. This division of labor matches the current capabilities: AI excels at pattern matching across large codebases; humans excel at narrative coherence and audience awareness.
Outlook
As codebases grow and UI frameworks add more abstraction layers, the raw difficulty of extracting demos from source will increase. Tooling improvements — better flow extraction, state diffing, synchronization libraries — will help, but they will not eliminate the need for human direction. The reliable part of AI-generated demos is the skeleton: which screens exist, which actions connect them, how data moves. The unreliable part is the polish that makes a demo persuasive. That boundary is where the work remains.