Under active development. Star us on GitHub

The opinionated web stack for the AI era.

Rails' conventions, without Rails. Your agent writes the code, and the checks keep it on the tracks.

You describe a web app in plain words. Your coding agent (Claude Code, Codex, opencode, Muse or any other) builds it in Rust from our conventions, a tested app template and optional parts, and it isn't done until the tests pass on SQLite and Postgres. The convention lives in the prose. The agent writes the code.

  • Small and fast. One Rust binary in one Docker image. This site typically runs in under 20 MB of memory.
  • Decided once. One stack and one layout, so the agent builds instead of debating crates.
  • Tested by default. Every app runs its tests on SQLite and Postgres before anything counts as done.
  • Batteries you can skip. Mail, jobs, sign-in, realtime and dev tools, as tested code copied into your app.
Watch the intro 4:13 · Watch on YouTube
~/code/bookshelf, claude
An illustrated agent session: the /offrails:new command, the interview, the plan, the generated files and the tests passing on SQLite and Postgres.
  1. > /offrails:new bookshelf: people track and review books, with an API for a mobile app later
  2. ● Reading AGENTS.md → interview · doctrine · structure · stack · workflow
  3. ? Accounts? a) magic link (Recommended) b) email + password c) invite-only d) none
  4. › a
  5. ? Who owns data? a) each user (Recommended) b) teams c) shared
  6. › you decide
  7. ? Frontend? a) htmx (Recommended) b) inertia c) spa d) api
  8. › b
  9. ? UI library? a) React (Recommended) b) Svelte
  10. › b
  11. ? API for other programs? a) none b) REST + OpenAPI c) GraphQL d) both
  12. › b
  13. ◆ Plan: inertia + Svelte · API rest · Postgres in prod (SQLite locally)
  14. Book title, author, rating 1–5 · belongs to User
  15. Review body, stars 1–5 · belongs to Book
  16. API /api/v1/books, /api/v1/reviews · bearer tokens
  17. › yes
  18. + migration/src/m20261013_120000_create_books.rs
  19. + src/models/book.rs · src/controllers/books.rs
  20. + web/src/pages/Books/Index.svelte (+ 71 more)
  21. ✓ cargo clippy --all-targets -- -D warnings
  22. ✓ pnpm --dir web typecheck · svelte-check
  23. ✓ cargo nextest run · SQLite · 142 passed
  24. ✓ cargo nextest run · Postgres 18 · 142 passed
  25. Definition of Done: green. Run bin/setup && bin/dev
curl -fsSL https://rustoffrails.org/install.sh | sh

or in Claude Code: /plugin marketplace add rust-off-rails/rustoffrails

Read before you pipe: the install script · INSTALL.md

Why I built this

  • 10 + 8 tested parts and snippets
  • 60 Markdown files
  • 2 databases, same code

What you get

Four things your coding agent uses to build a full-stack Rust web app. All of it is copied into your app, so it's yours to read and change.

Conventions, in Markdown

AGENTS.md and the guides tell the agent how to do each thing: the stack, the layout, naming, security and tests. Your agent reads them, so you don't have to. Browse the guides.

A tested app template

A complete app that compiles and passes its tests on SQLite and Postgres on day one: sessions, security headers, CSRF, Docker and CI. The template.

Optional parts and snippets

Mail and a dev mailbox, a job queue and its dashboard, sign-in, realtime and a dev dashboard: tested code to copy, one command each. Read them first in the samples repo or on the parts page.

Checks that fail the build

offrails-check and one command, cargo offrails verify, decide when the agent is done: tests on both databases, every acceptance criterion tested. The checks.

The rule behind it: agents write the code. You say what you want, in plain words or in specs; the agent writes the rest. Read §0.

Field tests

Real apps, ported by agents.

Agents port well-loved open-source apps to Rust off Rails. Every rough edge they hit goes back into the framework.

  • from Fizzy In progress

    fizzyer

    Fizzy's boards and cards, rebuilt in Rust by agents.

    About 20x less memory than the original Fizzy, measured by the maintainer.

  • from FreeScout In progress

    A FreeScout port

    A shared-inbox help desk, built by agents on another machine.

  • from Uptime Kuma Built

    uptime-offrails

    1,556 tests green on SQLite and Postgres.

    About 7x less memory than Uptime Kuma on one machine.

Built with GPT-6 Luna Claude Sonnet 5.5 Meta's Muse Wonder 1 GLM 5.3 Flash via opencode The goal: small, cheap agents that get real work done too.

Read the field tests

"I love Ruby on Rails and Phoenix. I built this as an experiment, and I loved it."

Read more about why I built this

Tools we highly recommend, all optional.

These are optional parts, and we highly recommend them: traces, a profiler, a local mailbox, a jobs dashboard and live presence. With them you see what your app is doing from the first run, and your agent reads the same data as JSON, so it can check its own work. Take the ones you want, skip the rest.

The dashboard costs about 1 µs per request in a release build, and is development only by default.

Take the tour

Not a wish list: checks that fail the build.

Markdown carries the conventions. A checker, offrails-check, runs on every app, this site included, and says no when an agent breaks one. The rules come from mistakes agents actually made.

  • header The AGENTS.md header is complete and consistent with the vendored framework version.
  • ac Every acceptance criterion in the specs is cited by a test.
  • security Every feature has a security table, and every test it names exists.
  • env Every environment variable the app reads is listed in .env.example.
  • ids No id column is a 32-bit integer. One of them once made every Postgres write a 500 behind a green SQLite suite.
  • postgres The test suite can run on Postgres, not only SQLite.
  • bind Development listens on this machine only, and foreign Host names are refused.
  • routes docs/routes.md lists every route.

Then the test suites must pass on both databases before anything counts as done. The Definition of Done

Done means tested, and upgrades are tested too.

An agent isn't done until one command, cargo offrails verify --full, passes: the tests on SQLite and Postgres, every acceptance criterion cited by a test, at least 80% line coverage (90% for models and policies), no unwrap outside startup, migrations that roll back, dependency and secret scans, no accessibility violations in light or dark, and a screenshot of every page. The rules come from years of shipping and upgrading apps on other stacks.

  • This site was upgraded through every release from 0.4 to 0.7.3 by agents following the upgrade guide; the last upgrade took 43 minutes and ended at 93% line coverage.
  • Bookshelf, 0.2 to 0.3: 217 of 217 tests on SQLite and Postgres, and a ZAP security scan with no failures and no warnings.
  • uptime-offrails, 0.7.1 to 0.7.2: 1,530 of 1,530 tests on both databases.
  • Railboard: 817 tests on SQLite and 603 on Postgres, and 53 pages checked in real Chrome.

Measured by the agents that ran them. How upgrades work

Secure and accessible by default.

Every app starts with the same protections and the same accessibility checks, and its tests prove them.

Security

  • A strict Content Security Policy and a full set of security headers, from one middleware.
  • CSRF protection, HttpOnly session cookies, only hashed tokens in the database, and rate limits on sign-in.
  • A threat model in every feature spec, with a test for each row that offrails-check verifies exists.
  • In CI: cargo-deny for vulnerable dependencies, gitleaks for secrets anywhere in history, and an OWASP ZAP scan of the production image.

Accessibility

  • axe checks every page against WCAG 2.2 AA, in light and dark, on desktop and phone. Zero violations allowed.
  • Every control reachable by keyboard, with a visible focus ring and a skip link.
  • Contrast checked in both themes, code blocks included, and no animation for people who ask for reduced motion.
  • This site runs the same checks.

The security guide

How it works

Interview. Plan. Generate. Green.

The agent asks only what a human can answer, writes the answers down, and is done only when the compiler and the test suite on both databases agree.

The boxes show an example app, a bookshelf, in the formats the framework really uses.

  1. 01

    Interview

    Product questions only, each with a recommended default. "Who can see this?" yes; "which ORM?" never. Say "you decide" and it takes the defaults.

    ? Accounts? a) magic link (Recommended) b) email + password c) invite-only d) none

  2. 02

    Plan

    A compact plan (resources, pages, jobs, assumptions) written into product/ specs with acceptance criteria. The spec is the durable record; chat is not.

    product/features/books.md - [ ] AC-books-1: a signed-in user can add a book

  3. 03

    Generate

    Generator recipes, run by the agent: migration, model, failing tests, controller, views, one vertical slice at a time.

    tests/app/books_test.rs cites AC-books-1 src/controllers/books.rs

  4. 04

    Green

    fmt, clippy, tests on SQLite and Postgres, every acceptance criterion traced to a test, coverage gates. Green or it didn't happen.

    ok [ac] 12 criteria, all cited offrails-check: 0 error(s), 0 warning(s) nextest: SQLite pass, Postgres pass

Red at any station? The failure goes back to the agent, and nothing counts as done until it is green on both databases.

Eight skills, one per job

SkillWhat it does
/offrails:newInterview → plan → app skeleton → planned features, green
/offrails:featureSpec first, then code. With no argument: build what changed in product/
/offrails:scaffoldA full resource in the app's frontend mode
/offrails:generateJobs, mailers, channels, authentication, models, migrations, tasks
/offrails:checkThe Definition of Done: fmt, clippy, tests on SQLite and Postgres
/offrails:doctorAudits the app against every convention in the docs
/offrails:deployDeploy config and a verified image; confirms before anything outward-facing
/offrails:upgradeMoves the app's vendored framework forward and migrates conventions

How you'll use it

You write intent. The agent writes everything else.

  1. 1

    Say what you want, or write it in product/features/*.md. Plain English.

  2. 2

    The agent writes the spec, then the code: migrations, models, views, tests.

  3. 3

    Done means green on SQLite and Postgres, every acceptance criterion tested.

Read the guide

The deal

What changes when typing is free.

A library with hundreds of thousands of lines
60 Markdown files
A code generator binary
generators/scaffold.md: a recipe the agent runs
Convention over configuration
Convention over deliberation: the agent never debates which crate to use
Optimized for programmer happiness
Optimized for agent correctness: compiler-checked everything
Magic, to save keystrokes
No magic. Explicit code is cheap when you don't type it.

The stack in one breath

One crate per job. Substitutions are not taken at the table.

Axum·Tokio·SeaORM SQLite locally, Postgres in production, same code·Askama·Tailwind·lettre·tracing·one binary, one Docker image

FRONTEND_MODE, chosen once in the interview

htmx default

Askama templates, checked at compile time, plus htmx. No Node. For CRUD apps, dashboards, content sites (like this one).

inertia

React or Svelte pages with server-side routing and controllers, through a generated Inertia adapter. The pick when you want a JS UI.

spa

A separate single-page app plus a JSON API, for when the UI must be a standalone app. Types flow from Rust via ts-rs.

api in progress

No UI at all: a backend and a versioned API for mobile apps, partners and scripts.

UI_LIBRARY
react (default) or svelte, for inertia, spa and htmx islands
API
none, rest (OpenAPI + tokens), graphql or both: a public, versioned API, independent of the UI

And in the database: a job queue, a cache and pub/sub. The database is the only infrastructure.

Standing on giants

The best of Rails and Phoenix, together.

None of the good ideas here are new. We took the ones that aged best from two frameworks we love, gave each a Rust shape, and wrote them down for agents.

From Ruby on Rails

Get started

Install the plugin. Describe the app. Watch.

1 With Claude Code (recommended)

/plugin marketplace add rust-off-rails/rustoffrails
/plugin install offrails@offrails

Then, in an empty directory:

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

The agent interviews you, confirms a plan, then builds. Skills also trigger on plain requests ("make me a new Rust web app…").

2 With Codex, opencode, Cursor, Muse, or any agent that reads AGENTS.md

Read /path/to/rustoffrails/AGENTS.md and make me a new app called "bookshelf".

Generated apps carry AGENTS.md and a vendored .offrails/, so later sessions need no setup.

3 Then

Describe features in plain language, or write them as specs in product/:

Scaffold Book with title:string, author:string, published_on:date, rating:integer.
Users must be logged in to create books.

The full walkthrough How you'll use it Read the docs Star on GitHub