Agent-native SaaS infrastructure. Build, modify, and operate production backends safely with AI agents.
Project description
Rook
Agent-native SaaS infrastructure. Build, modify, and operate production backends safely with AI agents.
Zero to running multi-tenant backend in 15 minutes — generated by agents via MCP, scoped by capability tokens, checkpointed for safe rollback.
pip install rook-framework
rook init my-app
rook resource generate Invoice --fields "client_id:fk(Client) status:enum(draft,sent,paid) amount:int"
rook dev
What you get in one command
rook init generates a complete production backend:
- Multi-tenant with RLS — row-level security at the database level, not just application filtering
- FastAPI + SQLAlchemy 2.0 + PostgreSQL — async, typed, production-ready
- Auth (JWT + Clerk), billing (Stripe), email (Resend), webhooks (HMAC + retry)
- Background jobs (ARQ), rate limiting, idempotency, feature flags
- CI pipeline — ruff, mypy, migration safety, schema drift, N+1 detection, security audit
- Deploy pipeline — snapshot → migrate → deploy → health gate → auto-rollback
- CLAUDE.md — AI agent context for every generated project
- MCP server — 30+ tools for AI agents to build, deploy, and operate your backend
Code generation
rook resource generate Order --fields "customer_id:fk(Customer) status:enum(pending,paid) total:decimal"
One command creates 7 files: model (with FK relationships + enum binding), schemas, service, controller, tests, factory, and migration (with RLS policies). Routes auto-registered. Migration auto-chained.
Production patterns included
| Pattern | What it does |
|---|---|
| Row-Level Security | Database-enforced tenant isolation |
| TxnManager | Auto-commit, auto-rollback, RLS via SET LOCAL |
| Outbox pattern | Reliable webhook delivery |
| Expand/contract migrations | Zero-downtime schema changes |
| N+1 detection | Per-request query counting with warnings |
| Schema drift detection | rook db doctor catches model/DB mismatches |
| Migration linting | rook db lint catches dangerous patterns |
| Idempotency middleware | Dedup POST/PUT/PATCH by Idempotency-Key |
| Health-gated deploys | Auto-rollback if deploy fails health check |
Agent-native
Rook is designed from the ground up to be operated by AI agents:
rook mcp serve
Exposes 30+ tools via Model Context Protocol. An AI agent can:
- Generate resources and wire them up
- Run migrations safely
- Deploy with checkpoints and rollback
- Detect schema drift and fix it
- Monitor query performance
Stack
| Layer | Default |
|---|---|
| Backend | FastAPI + SQLAlchemy 2.0 (async) |
| Database | PostgreSQL + pgvector |
| Auth | JWT (Clerk optional) |
| Billing | Stripe |
| Resend | |
| Jobs | Redis + ARQ |
| Storage | Cloudflare R2 |
| Monitoring | Sentry + structlog |
| CI/CD | GitHub Actions (generated) |
Documentation
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rook_framework-0.2.0.tar.gz.
File metadata
- Download URL: rook_framework-0.2.0.tar.gz
- Upload date:
- Size: 558.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5239bb5279b20069723ae1469605e426cde757c484afa719738576cbff996f49
|
|
| MD5 |
63f81b07eb9d7042fcef2f8c2cf155e3
|
|
| BLAKE2b-256 |
0c8d2ed10912dd38a74c342e6c73277e64117af41d03c0f970e719f16ff5a534
|
File details
Details for the file rook_framework-0.2.0-py3-none-any.whl.
File metadata
- Download URL: rook_framework-0.2.0-py3-none-any.whl
- Upload date:
- Size: 314.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c939c7531b17c4a0aa0633c0316356d704a8b0c7278559e06f953a434a6c9451
|
|
| MD5 |
ec94bf4ba7b6a5ff11e3521fdb6b3ac2
|
|
| BLAKE2b-256 |
dfe2cef4b50e4d875f32b08afac0d85ce41d201a7ba2e83a87c5a484803083c5
|