Cursor × Railway: Fueling Vibe Coding with Ephemeral PR Environments

AI can draft code in seconds – but only disciplined workflows turn that speed into shippable software. Here’s the exact loop I use: Cursor writes the patch, Railway spins up a live preview for every pull request, and I merge with confidence.

The Hidden Cost of Fast AI-Assisted Coding

LLM output ≠ production-ready. Without testing and isolated environments you’ll just create bugs faster.

Best practices still matter: TDD, clean architecture, CI, and ephemeral PR environments.

Goal: See every agent-generated change running in its own sandbox before it touches main.

The Stack

ToolRole
CursorGenerates code, opens feature branches + PRs automatically.
GitHubSource of truth; PR triggers downstream automations.
RailwayDetects the Dockerfile, builds the app, and – because PR Environments are enabled – spins up one deployment per pull request.

Walk-Through: Branding My Slide Deck

Okay, here you go! We are going to see an example of editing my presentation.

1. Enable PR Envs

Railway → Settings → Deploy → PR Environments → On

Railway PR-Environments settings panel with “Enable Bot PR Environments” toggled on.
Railway project settings for kyryl-opens-ml/ai-engineering-coding repository connected to main branch.

2. Prompt Cursor

Now, when Cursor can create its own feature branches, let’s ask it to do something small but useful. For example, my slides are very generic and lack branding at the moment, so let’s add a logo to each of them.

@Cursor repo=kyryl-opens-ml/ai-engineering-coding "Add KOML logo to all slides in slides.md please: https://avatars.githubusercontent.com/u/154631148?s=400&u=7655f835707397b8e92ad05044b5c3c9f7678348&v=4"

3. Cursor Workflow

  • Creates a branch and edits slides.md.
  • Pushes → GitHub PR → Railway build + deploy.

And boom – work has started. We rolled the dice; maybe the output will be great, maybe not. With vibe coding, you never know! But after approximately 5 minutes, Cursor’s background agent finished its first iteration.

Slack message to Cursor requesting KOML logo insertion and showing the logo preview.
Ask
Cursor agent reply summarizing logo addition, with links to view the new PR branch.
Thread

I can see all the changes on my GitHub:

GitHub pull request titled “Add KOML logo to all slides #8” displaying 125 line additions.

4. Review Links

But one more important thing happens as well – Railway created a new environment for us and deployed Cursor’s changes, and now you can see actual changes on the live app!

5. Decide

  • Looks good? Click Merge.
  • Needs tweaks? Comment; Cursor refines and redeploys
Original slide titled “How wide is the gap?” without KOML branding.
Main branch
Updated slide titled “How wide is the gap?” with KOML logo in the top-right corner.
Cursor PR

Pretty nice! I’ll probably merge it to make my presentation more branded.

Punchline!

To move truly efficiently with AI coding, you need a very strong engineering function – one example is ephemeral environments! Cursor and Railway work really well together to enable it – give it a try!

Further reading:
How vibe coding scales in real teams
Why we’re in an AI-programming renaissance

Leave a Reply

Scroll to Top

Discover more from Kyryl Opens ML

Subscribe now to keep reading and get access to the full archive.

Continue reading