Rust off Rails: The opinionated web stack for the AI era
Rust off Rails: The Opinionated Web Stack for the AI Era
Rust off Rails is a revolutionary approach to web development: a framework that ships zero lines of actual code. Instead, it provides a comprehensive set of Markdown specifications that instruct AI coding agents on exactly how to construct a full-stack Rust application. It enforces a "blessed" stack, a standardized layout, and a singular, definitive way to implement every feature.
🚀 Quick Start
To get the system running, you can use the following methods:
- Shell:
curl -fsSL https://rustoffrails.org/install.sh | sh - Claude Code:
/plugin marketplace add rust-off-rails/rustoffrails
[!IMPORTANT] Before piping scripts to your shell, always review the
INSTALL.mddocumentation.
Example: A live Kanban board created by an AI in just 7 prompts.
🛠️ The Agent Experience: A Case Study
Imagine initializing a project called bookshelf for tracking and reviewing books with a future-proof API.
/offrails:new bookshelf: people track and review books, with an API for a mobile app later
The AI's internal process:
- Analysis: Reads
AGENTS.mdconducts interview defines doctrine sets structure. - Interview:
- Auth method?
a) magic link (Recommended) - API style?
b) REST + OpenAPI
- Auth method?
- Planning:
- Stack: Inertia + Svelte | Postgres (Prod) / SQLite (Local).
- Schema:
UserBook(title, author, rating 1–5)Review(body, stars 1–5). - Endpoints:
/api/v1/books,/api/v1/reviewsusing bearer tokens.
- Execution:
-
migration/src/m20261013_120000_create_books.rs -
src/models/book.rs -
src/controllers/books.rs -
web/src/pages/Books/Index.svelte(+ 71 other files)
-
- Verification:
cargo clippy --all-targets -- -D warningsPasspnpm --dir web typecheckPasscargo nextest run(SQLite) 142 Passedcargo nextest run(Postgres 18) 142 Passed
Definition of Done: Everything is green. Run bin/setup then bin/dev.
🧠 The Philosophy: Decisions as Code
Rust off Rails is a framework composed of decisions, not libraries. It eliminates the "hallucination" or improvisation phase of AI coding by providing the judgment already written down.
The Founding Rule
All code is written by AI. Every single line of Rust, SQL, HTML, CSS, TypeScript, and every Dockerfile is generated by an agent.
Humans are relegated to providing intent:
- Writing specifications in
product/ - Answering interview questions
- Providing conversational feedback
By making boilerplate "free" and enforcing conventions via the agent, the product specifications remain the ultimate source of truth.
Markdown as the Framework
Instead of shipping a binary library, Off Rails ships a precise specification.
- Owned Code: Components like session management, job queues, and Inertia adapters are rendered directly into your codebase.
- Agent-Centric Opinions: Crate selection, naming conventions, and error handling are decided once and for all.
- Batteries Included: Guides and recipes exist for auth, caching, email, uploads, and real-time features.
🔄 The Development Lifecycle
- Interview: AI asks product-focused questions with recommended defaults.
- Plan: A concise blueprint (resources, pages, jobs) is saved to
product/with clear acceptance criteria. - Generate: The agent follows "Generator Recipes": .
- Green: The code must pass
fmt,clippy, and tests on both SQLite and Postgres.
The Agent's Toolkit
| Command | Purpose |
|---|---|
/offrails:new | Full pipeline: Interview Plan Skeleton Features. |
/offrails:feature | Spec-first implementation of changes in product/. |
/offrails:scaffold | Generates a full resource for the frontend. |
/offrails:generate | Creates specific components (Jobs, Mailers, Auth, etc.). |
/offrails:check | Validates the "Definition of Done" (Clippy, Tests, DBs). |
/offrails:doctor | Audits the app against official convention docs. |
/offrails:deploy | Configures and verifies a production-ready image. |
/offrails:upgrade | Updates vendored framework logic and conventions. |
🛠️ Technical Specifications
The Stack
- Backend:
AxumTokioSeaORM - Database: SQLite (Local) / Postgres (Production)
- Templating/CSS:
AskamaTailwind - Utilities:
lettre(Email)tracing(Logging) - Deployment: Single binary, single Docker image.
Frontend Modes (FRONTEND_MODE)
- htmx (Default): Askama templates (compile-time checked) + htmx.
- inertia: Server-side routing with React or Svelte pages.
- spa: A decoupled JSON API and a standalone single-page app.
- api (In Progress): Pure backend with versioned APIs for external partners.
UI Library Options: react (default) or svelte.
API Options: none, rest (OpenAPI + tokens), graphql, or both.
Built-in Observability
The system includes a development dashboard featuring:
- Traces & Hot Functions
- Mailbox & Jobs Dashboard
- Live Presence
Performance Note: The dashboard overhead is approximately per request in release builds.
⚖️ The Paradigm Shift
| Old Way (Human-Centric) | New Way (Agent-Centric) |
|---|---|
| 60 Markdown files | |
| Binary generators | generators/scaffold.md (AI recipes) |
| Convention over configuration | Convention over deliberation |
| Optimized for programmer happiness | Optimized for agent correctness |
| Magic to save keystrokes | No magic; compiler-checked everything |
The Heritage: Rust off Rails takes the best elements of two beloved frameworks—specifically the "Convention over Configuration" and "Generators" of Ruby on Rails—and reshapes them for the Rust ecosystem and AI agents.