Under active development. Star us on GitHub

0. Agents write the code

By default, an agent writes the code: the Rust, the SQL, the templates, the CSS, the Dockerfile. You say what you want, in plain words or in short specs like this one, and answer the agent's questions about the product.

# Feature: Reading list

People save books they want to read. Only they can see their list.

- [ ] AC-list-1: A signed-in reader can add a book to their list
- [ ] AC-list-2: Another reader gets a 404 for it

The other pillars rest on this one. When an agent writes the code, boilerplate costs nothing, so the code can be explicit. The conventions are written for the agent, which reads them on every task. And the spec stays the source of truth, because every change starts there.

You can still write code by hand. That's fine; ideally a model reviews it so it matches the rest, and the agent keeps it working from then on. If you had to step in because the agent got something wrong, I'd like to hear about it, because that's usually a doc I can fix.

1. Optimize for agent correctness

was programmer happiness

Rails optimized for short, pleasant code, because a person typed it. An agent doesn't get tired of typing. It gets things subtly wrong. So every choice here favors code whose mistakes show up before production: typed queries instead of SQL strings, templates checked at compile time, routes and forms as typed structs.

// A misspelled column is a compile error, not a 500 in production.
let posts = post::Entity::find()
    .filter(post::Column::Published.eq(true))
    .order_by_desc(post::Column::CreatedAt)
    .all(&db)
    .await?;

What the types can't prove, the tests do, on both SQLite and Postgres. When the agent gets something wrong, cargo check or the test run tells it in seconds, and it fixes the mistake before you see the diff.

2. Convention over deliberation

was convention over configuration

Configuration was never the expensive part. Decisions are. Left to choose, an agent reconsiders the ORM, the template engine and the folder layout on every task, and picks differently each time. Here those choices are made once and written down.

Which ORM?             SeaORM
Which templates?       Askama, checked at compile time
Where do jobs run?     in the app, queued in the database
Where does a file go?  the same place in every app

The worst outcome is inconsistency, not a choice you'd have made differently.

3. Ask about the product, decide about the code

The agent should ask you what only you can answer: who can see this, what happens when it's deleted, what it costs. It shouldn't ask which crate to use, because that's already decided. A new app starts with a short interview made of exactly these questions.

Asked:      Can readers see each other's lists, or only their own?
Asked:      When a book is deleted, do its reviews go too?
Not asked:  Should I use Diesel or SeaORM?

4. The menu is omakase

still

One crate per job, picked once: Axum for HTTP, SeaORM for the database, Askama for templates, and so on down the stack. Substitutions aren't on the menu. The one choice you make, once per app, is how the frontend works, and it's written at the top of the app's instructions for the agent:

FRONTEND_MODE: htmx      # or inertia, spa, api
API: none                # or rest, graphql, both

5. One shape

Data lives in the database, rules live in model functions, HTTP lives in handlers, and the UI lives in templates or React pages. Every resource has the same shape, so an agent that has seen one has seen them all, and so has the person reviewing.

src/models/book.rs          the data and its rules
src/controllers/books.rs    HTTP: parse, call the model, respond
templates/books/            the pages
tests/app/books_test.rs     the proof, one test per acceptance criterion

6. Explicit is cheap now

was exalt beautiful code

Rails hid boilerplate behind metaprogramming because typing was expensive. Typing is free now. Reading is what costs, for the next agent and for you reviewing the diff. So there are no callbacks: if saving a post sends an email, the code that saves it queues the email, where you can see it.

# Rails: the email is sent from somewhere you have to know about
after_create_commit :notify_subscribers
// Off Rails: it's on the next line
let post = post::create(&db, form).await?;
jobs::enqueue(&db, NotifySubscribers { post_id: post.id }).await?;

Repetition across resources is fine, and easy to grep. Code gets abstracted only when there's a third copy and a reason in the spec.

7. Markdown is the spec; the template is its rendering

The guides say what each part must do and why. Where Rails would ship a gem, like sessions, a job queue or a mailer, Rust off Rails ships that description plus working, tested code, which you copy into your app with one command.

cargo offrails add jobs

There's no library to keep up with and nothing linking back. Once copied, the code is your app's, and your agent maintains it like code it wrote. When a guide and the tested code disagree, the code wins and the guide gets fixed.

8. Sharp knives, labeled

Raw SQL is allowed, behind one clearly labeled escape hatch. unsafe isn't allowed at all, and neither is unwrap(), outside tests and startup.

let book = book::find(&db, id).await.unwrap(); // fails the check
let book = book::find(&db, id).await?;         // an error becomes a proper response

9. Value integrated systems

One binary serves the pages, runs the background jobs, sends the mail, pushes live updates and runs its own migrations. One database holds the data, the jobs, the cache, the sessions and pub/sub. The database is the only infrastructure: SQLite on your laptop, Postgres in production, same code. Rails 8 got there with its Solid trifecta. Rust off Rails starts there.

web   the app: pages, jobs, mail, live updates, migrations
db    Postgres (SQLite on your laptop)

10. Progress over stability, but only through the docs

The stack changes when the docs change, not when an agent improvises. If a chosen crate turns out to be wrong, the docs are updated first, and then each app upgrades, with one command that walks its agent through the changes.

/offrails:upgrade

11. Push up a big tent

You don't need to know Rust. You need to know what you want. The specs are plain English, and they're how you steer the app.

/offrails:new bookshelf: people track the books they've read and review them

Agents read the full doctrine (also as Markdown), with the rules they have to follow.