January 19, 2026 . 11 min read
Agentic Engineering with Rails 8: The Structured Way to Vibe Code a SaaS in 2026
Jeronim Morina
Founder, Omaship
"Vibe coding" became the buzzword of 2025. But the teams shipping the best AI-assisted software are not vibing — they are practicing agentic engineering: a structured discipline where AI coding agents operate inside well-defined conventions, project context files, and test-driven workflows. Rails 8 turns out to be the ideal foundation for this approach, and the reasons go deeper than you might expect.
This guide explains what agentic engineering is, how it differs from the casual "vibe coding" mindset, why Rails 8's design philosophy makes it uniquely powerful for AI-assisted SaaS development, and how to set up Claude Code, Cursor, and Codex to do their best work on your project.
From vibe coding to agentic engineering
The term "vibe coding" was coined by Andrej Karpathy in early 2025. The core idea: instead of writing code character by character, you describe the intent and let an AI agent translate that into working code. You stay in the flow, iterate fast, and focus on what the software should do rather than how every method is implemented.
That vision was compelling. But in practice, "just vibe it" produced mixed results. Teams that treated AI agents like magic wands ended up with inconsistent code, hallucinated file paths, and architectures that fell apart at scale. The ones that succeeded were doing something fundamentally different: they were engineering their workflows around the agents.
Agentic engineering is the discipline that emerged from this reality. It means:
- Giving your AI agents structured project context (AGENTS.md, .cursorrules) so they understand your conventions before writing a single line
- Using test-driven development as the feedback loop that keeps agent output reliable
- Choosing frameworks and architectures that minimize ambiguity for agents — conventions over configuration, single-language stacks, predictable file structures
- Treating AI as a capable teammate that needs good onboarding, not a black box you throw prompts at
Vibe coding is the promise. Agentic engineering is how you actually deliver on it.
Why Rails 8 is the ideal framework for agentic engineering
Ruby on Rails has always been opinionated. David Heinemeier Hansson calls it the "omakase stack" — a curated set of tools chosen by the chef, not a buffet where you pick everything yourself. In the age of AI coding agents, this philosophy went from a nice-to-have to a decisive advantage.
Convention over configuration is an AI superpower
When every Rails project follows the same conventions — models in app/models/, controllers in app/controllers/, tests in test/, database schema in db/schema.rb — AI agents never have to guess where things live. They have been trained on millions of Rails repositories that all follow these patterns.
Compare this to the JavaScript ecosystem where every project invents its own folder structure. A cursor rails template works out of the box because Rails is the template. The conventions are the configuration.
For agentic engineering, this means you can say "add a comments model with user association and soft deletes" and the AI knows exactly which files to create, where to put them, and which patterns to follow. No ambiguity, no hallucination about file paths.
Single-language stack means less context switching
Rails 8 with Hotwire delivers the complete package: server-rendered HTML with Turbo for interactivity, Stimulus for lightweight JavaScript behavior, and Action Cable for real-time features. Your entire application lives in one language ecosystem.
When you use a split stack (say, a Rails API plus a React frontend), the AI agent needs to maintain mental models of two different paradigms. It writes a Ruby endpoint, then switches to TypeScript for the fetch call, then JSX for the component, then maybe a state management layer. Each context switch is an opportunity for inconsistency.
With Rails 8 and Hotwire, "add real-time notifications" is a single-context task. The AI writes one Turbo Stream broadcast, one channel, and a partial. Done.
db/schema.rb: the single source of truth agents love
Every Rails project has a db/schema.rb that describes the entire database structure in one readable file. When Claude Code needs to understand your data model before generating a feature, it reads this single file. When it needs to add a column, it generates a migration that follows the exact pattern of your existing migrations.
No ORM configuration scattered across decorators. No separate GraphQL schema to keep in sync. One file, one truth, zero confusion.
Rails 8's built-in deployment with Kamal
Agentic engineering does not stop at feature development. Rails 8 ships with Kamal for zero-downtime deployment to any server. AI agents can help you configure deploy.yml, set up SSL, and troubleshoot deployment issues because Kamal follows documented, predictable conventions.
No Kubernetes manifests. No Terraform files. No 47-step CI/CD pipeline. Just kamal deploy and your SaaS is live.
Setting up your Rails project for agentic engineering
Framework choice is the foundation, but there are specific patterns that make AI coding agents dramatically more effective. Here is the setup we have refined through months of daily agentic engineering with Claude Code, Cursor, and Codex.
The AGENTS.md pattern: onboarding your AI teammate
AGENTS.md is a markdown file in your repository root that provides project-specific context to AI coding agents. Think of it as onboarding documentation for your AI teammate. Claude Code also reads CLAUDE.md, which is typically symlinked to AGENTS.md. It tells the agent:
- Which gems and tools the project uses
- Testing conventions (Minitest vs RSpec, how to run specific tests)
- Code style preferences (no abbreviations, explicit over implicit)
- Architecture decisions (why certain patterns were chosen)
- Common pitfalls and how to avoid them
A well-written AGENTS.md can cut AI hallucinations by 80% or more. Instead of guessing which testing framework you use, the agent reads the file and knows. Instead of inventing a custom service object pattern, it follows the documented approach.
This is the single most important artifact in agentic engineering. Without it, you are vibe coding. With it, you are engineering.
Here is a minimal example of what belongs in an AGENTS.md for a Rails SaaS project:
# AGENTS.md
## Project
Rails 8 SaaS application. Ruby 3.3, Rails 8.0.
## Commands
- Run tests: `bin/rails test`
- Run single test: `bin/rails test test/models/user_test.rb`
- Lint: `bin/rubocop`
- DB migrate: `bin/rails db:migrate`
## Conventions
- Minitest, not RSpec
- Tailwind CSS via tailwindcss-rails
- Hotwire (Turbo + Stimulus) for interactivity
- No service objects — use model concerns and plain Ruby objects
- Authentication via built-in Rails 8 authentication generator
## Patterns
- Multi-tenancy via current_account scoping
- Stripe billing via pay gem
- Background jobs with Solid Queue
AGENTS.md as the emerging standard
AGENTS.md has emerged as the tool-agnostic convention for project-level AI context, now used by over 60,000 open-source projects and stewarded by the Agentic AI Foundation under the Linux Foundation. Claude Code reads both AGENTS.md and CLAUDE.md (we recommend symlinking CLAUDE.md to AGENTS.md). Cursor reads .cursorrules, GitHub Copilot uses .github/copilot-instructions.md, and OpenAI's Codex reads AGENTS.md. Some teams maintain all of them.
A related convention worth watching is skills files — reusable capability packages that give agents procedural knowledge about specific tools and frameworks. Where AGENTS.md describes your project, skills give agents expertise in the technologies your project uses.
The key insight: the content matters more than the filename. Whether you use AGENTS.md, CLAUDE.md, or .cursorrules, the critical thing is that your project has a machine-readable document explaining how the codebase works.
Projects without these files are like hiring a contractor and refusing to explain the house plans. The AI will build something, but it might not be what you wanted.
Setting up Cursor for agentic Rails development
Cursor is the most popular AI-powered code editor. Here is how to configure it for structured agentic engineering with a Rails project:
- Index your project properly. Cursor's context window works best when it can see related files. Keep your
.gitignoreclean so it does not indexnode_modulesortmp/. - Use @-mentions for context. When asking Cursor to generate a new controller, reference the existing ones: "@app/controllers/users_controller.rb follow this pattern for a new comments_controller."
- Let it run tests. Enable terminal access so Cursor can run
bin/rails testafter making changes. The feedback loop between generation and verification is where agentic engineering separates itself from unstructured vibe coding. - Use .cursorrules. Create a
.cursorrulesfile with the same content as yourAGENTS.md. Cursor reads this automatically for every conversation.
Setting up Claude Code for agentic Rails development
Claude Code is Anthropic's terminal-based AI coding agent. It excels at multi-file changes and complex refactors — exactly the kind of work that comes up when building SaaS features. It is also the most naturally "agentic" tool available: it reads files, runs commands, and iterates autonomously.
- Let it explore first. Claude Code reads files, runs commands, and builds context before writing code. Do not rush it with overly specific instructions. Say "add Stripe checkout" and let it discover your existing billing setup.
- AGENTS.md is auto-loaded. Claude Code automatically reads
AGENTS.md(andCLAUDE.md) from your project root at the start of every session. Keep it updated. - Use it for migrations. Claude Code is excellent at generating Rails migrations because it can read
db/schema.rband understand the existing data model before adding to it. - Run the TDD loop. The best workflow: describe the feature, let Claude Code write a failing test, then let it implement until the test passes. Red-green-refactor, powered by an agent that can run your test suite.
Setting up Codex and Copilot for Rails
OpenAI's Codex is a cloud-based agentic coding tool that runs in a sandboxed environment and works from your GitHub repository. GitHub Copilot complements it with real-time inline suggestions.
- Codex reads AGENTS.md. Place your project conventions in
AGENTS.mdat the repo root and Codex will use them as context for every task. - Copilot thrives on patterns. Write one model method with your preferred style, and Copilot will replicate it across similar methods. Rails' repetitive patterns (CRUD controllers, model validations) are Copilot's sweet spot.
- Use Copilot Chat for ERB. ERB templates are harder for AI than pure Ruby. Use Copilot Chat to ask "write an ERB partial for a user card with Tailwind" rather than relying on inline suggestions.
- Add .github/copilot-instructions.md. This file configures Copilot's behavior per-repository. Same content as
AGENTS.md, different filename.
The agentic engineering workflow for SaaS development
Here is the workflow we use daily to build SaaS features with AI coding agents. It looks like vibe coding from the outside, but the structure underneath is what makes it reliable:
- Describe the feature in plain English. "Add a team invitation system where account admins can invite users by email. Invitations expire after 7 days."
- Let the agent write failing tests first. This ensures the agent understands the requirements before writing implementation code. The test is the contract.
- Implement until green. The agent writes model, controller, views, and migrations. Run
bin/rails testafter each change. - Review the diff. Agentic engineering does not mean blind trust. Read the generated code, check for security issues, verify the migration is reversible.
- Refactor if needed. Ask the agent to extract a concern, rename a method, or improve test coverage. It already has full context.
- Ship it.
kamal deployand move on to the next feature.
With a well-structured Rails codebase and proper agent configuration, this loop takes minutes per feature instead of hours. The agent handles the boilerplate, you handle the product decisions.
Common mistakes that keep you stuck in "vibe coding" mode
The gap between vibe coding and agentic engineering often comes down to avoidable mistakes. Here are the ones we see most often:
1. Starting from an empty Rails app
A fresh rails new gives you nothing — no authentication, no billing, no multi-tenancy, no deployment config. When an AI agent starts adding these from scratch, it makes dozens of small decisions that may not be compatible with each other. You end up with a Frankenstein architecture.
Starting from a well-structured foundation means the agent extends existing patterns instead of inventing new ones. The first 10,000 lines of code matter more than the next 100,000.
2. No AGENTS.md or project context
Without a context file, AI agents fall back to generic training data. They might suggest RSpec when you use Minitest, or generate a service object when you prefer concerns. Every wrong assumption compounds into technical debt. This single omission is the difference between agentic engineering and undirected vibe coding.
3. Skipping test generation
The fastest way to accumulate bugs with any AI-assisted workflow is to skip tests. AI-generated code without tests is a time bomb. Always include test generation in your prompts: "add X with full test coverage." In agentic engineering, the test suite is not optional — it is the feedback mechanism that keeps the agent on track.
4. Using too many custom abstractions
Every custom abstraction is something the AI needs to learn. Service objects, interactors, form objects, presenters, decorators — each one adds cognitive load for the agent. Rails' built-in patterns (concerns, callbacks, validations, scopes) are already in the AI's training data. Use them.
Rails 8 features that supercharge agentic development
Rails 8 shipped several features that are particularly useful for agentic engineering:
- Built-in authentication generator.
bin/rails generate authenticationcreates a complete, secure authentication system. No Devise, no complex gem configuration. AI agents can extend it because it is plain Rails code, not a black box. - Solid Queue, Solid Cache, Solid Cable. Background jobs, caching, and WebSockets all backed by your database. No Redis to configure, no external dependencies to explain to the AI. Fewer moving parts means fewer things for the agent to get wrong.
- Kamal 2 for deployment. Deployment configuration lives in your repo as
config/deploy.yml. AI agents can read, modify, and troubleshoot it like any other config file. - Propshaft for assets. Simple, predictable asset pipeline. No Webpack, no Vite configuration. Agents handle static assets without confusion.
- Thruster as default web server proxy. SSL termination and HTTP/2 built in. One less thing to configure, one less thing for the agent to hallucinate about.
The economics of agentic engineering with Rails
Let us talk numbers. A solo founder using agentic engineering on a well-structured Rails codebase can realistically:
- Ship a complete SaaS MVP in 2-4 weeks (not months)
- Maintain production quality with comprehensive tests
- Deploy with zero DevOps knowledge via Kamal
- Iterate based on user feedback in hours, not days
The bottleneck is no longer writing code. It is making product decisions, talking to users, and knowing what to build. If your framework and foundation handle the "how," you can focus entirely on the "what."
This is why investing in the right starting point matters. A $300 SaaS starter kit that saves you 3 weeks of foundation work is not an expense — it is the highest-ROI investment you will make.
Getting started with agentic engineering on Rails 8
If you are ready to move beyond casual vibe coding and adopt agentic engineering for your next SaaS project, here is the practical checklist:
- Choose a solid foundation. Do not start from
rails new. Use a starter kit that includes authentication, billing, multi-tenancy, and deployment — so your AI agent extends patterns instead of inventing them. - Set up AGENTS.md. Document your project's conventions, commands, and architecture decisions. Symlink
CLAUDE.mdto it for tool compatibility. This file is the foundation of agentic engineering. It will pay for itself within the first coding session. - Pick your AI tools. Claude Code for terminal-based agentic work and multi-file refactors, Cursor for editor-integrated development, Codex for cloud-based task execution, Copilot for inline suggestions. Most developers use two or three in combination.
- Establish the TDD loop. Test-first agentic engineering produces dramatically better results than generate-and-pray. Make it a habit from day one.
- Ship early, iterate fast. With Kamal, deployment is a single command. Do not wait for perfection. Ship, get feedback, and let the agent help you iterate.
The developers building the fastest in 2026 are not the best typists or the most experienced architects. They are the ones who have set up their codebases to amplify AI agents — who have moved from vibe coding to agentic engineering.
Rails 8 gives you the conventions. A curated starter kit gives you the patterns. Structured agent configuration gives you the reliability. Combine all three and you have the most productive SaaS development workflow available today.