Rails Baseline — A Rails SaaS Starter Built for Coding Agents

Rails Baseline

7 min read Original article ↗

Rails for the agent era

Start with a Rails app your agent won’t redesign.

Rails Baseline is a production-ready SaaS foundation with authentication, accounts, billing, authorization, entitlements, Hotwire, Tailwind, and Kamal — plus the working patterns and architectural context coding agents need to extend it consistently.

Founding price · $129 through purchase #20Standard price after #20 · $179

Repository

rails-baseline/
├── AGENTS.md
├── ARCHITECTURE.md
├── starter.yml
├── docs/
│   ├── contracts/
│   ├── recipes/
│   └── vendor/
├── app/
├── config/
├── db/
└── test/

AGENTS.mdcontext

Before making a non-trivial change:

  1. 01 Read ARCHITECTURE.md
  2. 02 Read the relevant contract
  3. 03 Inspect the closest implementation
  4. 04 Extend the existing pattern

Task

Add project exports.

Context found

  • tenant scoping
  • Pundit policy
  • entitlement pattern
  • background job pattern
  • tests

Ready to extend

01 / The expensive part moved

rails new is easy.
The next 100 decisions aren’t.

Codex, Claude, and Cursor can generate a Rails application from scratch in minutes.

That isn’t the expensive part anymore. A blank repository still gives the agent almost no local precedent for how your application is supposed to work.

Tenancy

How are records scoped?

Authorization

Where do permissions live?

Billing

Is Stripe state also product access?

Frontend

Does this interaction need Stimulus or React?

Jobs

How is tenant context restored?

Limits

Where does “25 projects” live?

Admin

What does a system administrator mean?

Integrations

What gets retried, and how?

Coding agents made scaffolding cheap. Architecture still isn’t.AI is very good at continuing strong patterns.
A new repository has no patterns to continue.

02 / Local precedent

The prompt should describe the feature. Not reinvent the application.

Blank reporails new my_saas
  • ? tenancy
  • ? authorization
  • ? billing boundary
  • ? service conventions
  • ? public IDs
  • ? frontend ownership
  • ? jobs
  • ? admin
  • ? testing patterns

Every feature request is also an architecture prompt.

Rails Baselineexisting patterns found
  • Account + Membership
  • Pundit policies
  • billing boundary
  • Entitlements
  • Limits
  • tenant-aware jobs
  • public-ID pattern
  • Hotwire conventions
  • tests

The feature request can mostly remain a feature request.

03 / More than boilerplate

What comes next is part of the product.

Traditional Rails starter kits primarily answer: “What code can I avoid writing?” Rails Baseline also answers: “How should the code that comes next fit this application?”

Traditional starter
  • Authentication
  • Billing
  • Teams
  • Dashboard
  • UI primitives

Features you don’t have to build.

Rails Baseline
  • Working SaaS primitives
  • Canonical Rails patterns
  • Architectural contracts
  • Agent instructions
  • Extension recipes
  • Machine-readable starter context

A codebase worth continuing.

Most starter kits optimize for how much code they include.
Rails Baseline optimizes for how well the next 100,000 lines get written.

04 / Stable contracts

Stable answers for the decisions that repeat.

Boolean capability
Entitlements.enabled?(
  account: Current.account,
  key: :advanced_exports
)

Can this account use exports? Ask Entitlements.

Quantitative limit
Limits.value(
  account: Current.account,
  key: :projects
)

How many projects may it create? Ask Limits.

Authorization
authorize project

Can this user modify this project? Ask Pundit.

Tenant lookup
Current.account.projects.find_by!(
  public_id: params[:id]
)

Scope the record before deciding permission.

Which Stripe object exists underneath all of that? Ordinary product code should not care.

Billing

StripePayBilling boundaryEntitlements + LimitsProduct behavior

Identity & access

UserMembershipAccountTenant-owned data

05 / Pattern density

Your agent needs examples, not another vague prompt.

Rails Baseline provides strong local precedent for the architectural problems a SaaS application keeps encountering.

Search repository context…

⌘ K

  1. 01Need a tenant-owned resource

    follow an existing account-scoped lookup

  2. 02Need authorization

    follow the existing Pundit policy

  3. 03Need a paid capability

    use Entitlements

  4. 04Need a plan quantity

    use Limits

  5. 05Need background work

    follow a tenant-aware Solid Queue job

  6. 06Need a sensitive operation

    follow AuditEvent

  7. 07Need billing

    follow the supported Pay pattern

  8. 08Need client-heavy UI

    use the React-island recipe

The goal isn’t maximum code. It’s enough high-quality precedent that the next feature has something local to imitate.

06 / Familiar by design

It’s still a Rails app.

Rails Baseline does not hide Rails behind another framework. It looks familiar to an experienced Rails developer — and recognizable to coding agents already fluent in conventional Rails code.

Rails owns
  • routing
  • HTML
  • forms
  • navigation
  • authentication
  • CRUD
  • server state
  • Turbo interactions
React, when enabled, owns
  • complex client state
  • visualizations
  • editors
  • application-like islands
Optional, not foundational

Rails first. Hotwire first. React when you actually need React.

07 / Shipping in the founding release

Inspect the baseline.

A conventional Rails 8 SaaS foundation, with the operating context that keeps its conventions coherent as the application grows.

Core

  • Rails 8.1
  • PostgreSQL
  • ERB
  • Hotwire
  • Turbo
  • Stimulus
  • Tailwind
  • Minitest

Identity & tenancy

  • Devise
  • email confirmation
  • password recovery
  • multi-account architecture
  • Memberships
  • owner / admin / member roles
  • account switching
  • first-party account invitations
  • Pundit

Billing & access

  • Pay
  • Stripe
  • account-level billing
  • application billing boundary
  • Entitlements
  • Limits

Operations

  • Solid Queue
  • Solid Cache
  • Solid Cable
  • Mission Control Jobs
  • AuditEvent
  • health checks
  • query/request context
  • Rails error-reporting boundary
  • CSP
  • rate limiting

Production

  • Docker
  • Kamal
  • GitHub Actions
  • RuboCop
  • Brakeman
  • PostgreSQL-backed tests

Agent context

  • AGENTS.md
  • ARCHITECTURE.md
  • contracts
  • recipes
  • vendor guidance
  • starter.yml
  • canonical working examples

08 / Explicitly optional

Complexity is optional.

The baseline ships with the core SaaS foundation and documents extension paths for what comes next. Contract and recipe indexes keep those paths discoverable; documentation guides a derived application, but does not mean a capability is installed.

  • React islands
  • API keys + public JSON APIs
  • social authentication
  • notifications
  • one-time payments
  • staging with Kamal
  • internationalization
  • impersonation
  • usage billing
  • inbound webhooks
  • external error reporting

A baseline, not a kitchen sink.

09 / Repository-native context

The architecture lives in the repo.

No proprietary Rails Baseline agent is required. The repository itself carries the architecture.

Codex, Claude Code, Cursor, and other capable coding agents can consume the same local patterns and instructions.

Agent sessionrepository context enabled

Add CSV exports to projects.
Require advanced_exports.
Run it asynchronously.

  1. ReadAGENTS.mdcomplete
  2. Readdocs/contracts/entitlements.mdcomplete
  3. Foundexisting tenant-aware jobcontext
  4. Foundexisting Pundit patterncontext
  5. Foundexisting export-style side effectcontext

Implement against existing contracts

10 / Who it’s for

For people who intend to keep building.

Experienced Rails developer

You know how to build these pieces. You just don’t need to make the same infrastructure decisions for every new product.

AI-heavy builder

Your coding agent writes meaningful implementation. You want it extending a codebase instead of inventing one.

Technical founder

You want to start quickly without owning an opaque generated pile of abstractions afterward.

Indie SaaS developer

You want the next few days spent on the thing customers might pay for.

11 / Clear boundaries

Opinionated without becoming another framework.

Not a Rails engine.
A Rails application.

Not an AI wrapper.
Agents consume the architecture; they are not the architecture.

Not a React SPA with Rails underneath.
Hotwire owns the default app.

Not 80 speculative features.
Optional capabilities stay optional.

Not generated code you’re afraid to touch.
The code is intended to be read and changed.

Built by Rob Race

Built from real Rails scar tissue.

Rails Baseline is built by Rob Race, a long-time Rails developer, senior software engineer, SaaS builder, and author of Build a SaaS App in Rails 8 .

The architecture draws from patterns that survived actual applications, along with the places those applications accumulated complexity that a new baseline can avoid.

Founding license

Start from the baseline.

Available now. One purchase gives you immediate access to the complete Rails foundation and the context to keep extending it.

Founding price$129one-time

Standard price after purchase #20: $179

Founding price progress17 / 20

The $129 price ends after purchase #20.

  • Rails Baseline source code
  • Use for products you own
  • Current 1.x updates
  • Architecture and agent guidance
  • Extension recipes
  • Production deployment baseline
Get Rails Baseline — $129

Purchase terms

Refund policy

Rails Baseline provides immediate access to the complete source code, so purchases are generally non-refundable once access has been granted.

If Rails Baseline materially differs from what was described, you encounter a problem that prevents you from reasonably using it, or you were charged incorrectly, contact me within 14 days. I’ll work with you to resolve the issue, and if the problem is with Rails Baseline and can’t reasonably be resolved, I’ll issue a refund.

Refunds aren’t offered for change of mind, deciding not to use the product, or expecting functionality that wasn’t included in the product description.

12 / Questions

Before you start.

Is this just another Rails SaaS starter kit?

It includes the SaaS primitives you expect, but the emphasis is different. Rails Baseline gives humans and coding agents enough architecture and working precedent that new features can extend the codebase consistently.

Why not ask Codex or Claude to build it from scratch?

You can. Code generation is no longer the expensive part. A blank repository still provides little local precedent for the dozens of architectural decisions a real SaaS application requires.

Do I have to use an AI coding agent?

No. Rails Baseline is a conventional Rails application first. Its contracts, recipes, and explicit patterns are useful to humans too.

Does it require React?

No. Rails views, Hotwire, Turbo, and Stimulus are the default. React is an optional island capability for interfaces with substantial client-side state.

Why Pay?

Pay provides a conventional Rails billing integration for Stripe while Rails Baseline keeps product capabilities and limits as application-owned concepts. The repository also documents the supported Pay API.

Is Rails Baseline a framework or Rails engine?

No. It is deliberately a normal Rails application.

Can I remove or replace parts?

Yes. The architecture distinguishes foundational concepts from optional capabilities so the application can evolve without depending on a proprietary Baseline runtime.

What does the founding license cover?

The initial founding license is intended for products you own.

Rails Baseline

Your agent can generate the code.
Give it a better place to start.

Start from a Rails application whose architecture, working patterns, and agent context already agree with each other.

Get Rails Baseline — $129Founding price · $129 through purchase #20