
When we talk about AI in software engineering, most of the attention stays on the editor. We celebrate how fast an agent can write a function, generate a React component, or untangle a regex. But if you have shipped real applications, you know writing the code is the first step and rarely the hard one. The friction starts when you try to get that code out of your editor and into a live environment that actually works.
When I built this site with AI doing most of the typing, the Go handlers and the React components were the easy stretch. The real hurdles were Docker, IAM permissions on AWS, CloudFront behavior, and the unglamorous work of proving the live build was not quietly broken. That last part is where the "prompt to preview" story gets interesting, because it is exactly where local-only AI tooling falls down.
The trap of code that works on localhost
For a long time an AI agent lived in a sandbox on your machine. It could edit files across your repo, but it had no idea what your deployment looked like. You would watch it generate a feature, run a dev server on localhost, see it work, and assume you were done. Then you pushed, and the real environment disagreed. A missing environment variable. An asset path that broke on the CDN. A schema mismatch that only showed up against the staging database.
I hit the sharpest version of this myself. When I migrated the frontend from Create React App to Vite, everything looked perfect. The build was green. Every unit test passed. The linter was clean. And the live page rendered completely blank.
The cause was a single global that the old toolchain defined in the browser and Vite does not. The first line of code that read it threw, the whole app failed to mount, and none of my checks noticed, because none of them load the page the way a browser does. Unit tests exercise functions in memory. A type checker reads types. A linter reads style. Not one of them opens the site and looks at it. The bug lived in the exact gap between "the code is correct" and "the page works," and the only tool that could see it was a real browser.
That gap is the thing an AI-native pipeline has to close, and the fix is not more unit tests. It is verifying the real build in something close to production before you trust it.
The smoke test that checks a real build
So I built one. Before anything reaches production, a smoke test spins up the actual stack: it boots the Go backend against a local database, seeds real content, runs the true production build, and then runs the real prerender step that generates the static pages crawlers see. Then it makes assertions about the output, not the source:
- a blog detail page exists AND contains rendered article content,
not an empty shell
- no localhost or 127.0.0.1 origin leaked into the built HTML
- the production origin is present where it should be
- the data seed is embedded, exactly once, in a form the strict
production security policy will not blockNone of those are unit tests. They are checks against a produced artifact, in a run that mirrors production closely enough to catch the class of bug that only appears once things are assembled. If the prerender ever emits an empty shell again, or leaks a local URL, or ships a seed the security headers would reject, the smoke test fails and I find out on my machine instead of from a visitor. This is the "automated verification in a live-ish environment" that the AI-native deployment hype describes. I just wire it in front of every deploy rather than waiting for a platform to offer it.
Keeping production deploys intentional
The other half of the pipeline is the part I deliberately did not automate. AI helped me write the Terraform and the deploy script. It did not get the keys to production. The actual deploy is one command I run myself, on purpose, behind my own credentials:
eval $(aws configure export-credentials --format env) && \
cd infra && ./deploy.sh -auto-approveThat script builds the Lambda package and the frontend, applies the infrastructure, syncs the site to storage, and invalidates the CDN cache. It is fully scripted, so it is repeatable and boring, which is what you want from a deploy. But nothing runs it except me deciding it is time. The agent never holds broad cloud credentials, and production never happens as a side effect of a passing check.
This is the line I would draw for anyone letting AI near their infrastructure. Give agents scoped permissions, never administrative ones. Let them build previews and run verification automatically, because that is where speed is safe. Keep the final push to the live site a human decision, because that is where a mistake is expensive and hard to walk back. The pattern that works is not "the agent deploys." It is "the agent prepares, verifies, and hands me something I can ship with one intentional command."
Closing the full-stack loop
For a solo developer, standing up and maintaining a real deployment pipeline used to demand dedicated DevOps time that pulled you away from building anything people actually use. What changed is not that AI writes the code. It is that the whole loop can now hang together for one person: the agent writes the code, a smoke test verifies the real build, and I own the final deploy behind a guardrail I trust.
The result is that I spend less time debugging deployment scripts and more time on the product itself. Prompt to preview is not a slogan about a magic button that pushes to production. It is a pipeline you build on purpose, where the fast parts are automatic, the risky part stays human, and something real gets checked before anyone calls it done.