Seams
π Documentation site: davidslv.github.io/seams β the guides below, searchable and grouped by DiΓ‘taxis, with the API reference alongside.
A CLI framework that generates modular Rails engines.
Seams gives you the architectural benefits of microservices β clear boundaries, independent testing, team autonomy β without the operational cost. You ship a single Rails app. You think in independent engines.
Seams materialises the patterns David Silva teaches in Modular Rails: Architecture for the Long Game. The book is the artefact; this gem is the executable shorthand. See seams-example for a reference host that wires every canonical engine end-to-end.
Quick start
# Gemfile
gem "seams"bundle install
bin/rails generate seams:install
bin/seams core
bin/seams auth
bin/seams accounts
bin/seams notifications
bin/seams billing
bin/seams teams
bin/seams design --shell
bin/seams listThat's shared primitives, auth, the tenant boundary, transactional
email/SMS, Stripe subscriptions, multi-tenant teams, and a themeable
design system generated as real Rails engines under engines/. Every
file is yours to edit. Nothing is hidden behind the gem.
New to Seams? Start with doc/tutorials/GETTING_STARTED.md
β a step-by-step walkthrough from bundle install to a booting host.
What you get
Framework
-
bin/seams installβ adds the framework + CI workflow +bin/seamswrapper. Opt-out quality toolchain via--no-strong-migrations/--no-lefthook; opt-in herb (ERB lint) via--herb. -
bin/seams engine <name>β generic engine scaffold -
bin/seams remove <name>β clean removal + sibling cleanup + drop-table migration
Canonical engines
-
bin/seams coreβ Core engine (Current attributes, AuditLog, TenantScoped, EmailFormatValidator) -
bin/seams authβ Auth engine (Identity, Session, OAuth, API tokens, GDPR-encrypted PII) -
bin/seams accountsβ Accounts engine (Account tenant, Membership, AccountScoped, system actor) -
bin/seams notificationsβ Notifications engine (STI strategies, ActionCable bell, TypeRegistry).--channels in_app,email,sms(default: all) -
bin/seams billingβ Billing engine (official Stripe gem, 13-handler webhook router, Lifetime Deals).--gateway stripe(default) -
bin/seams teamsβ Teams engine (Team, Membership, Invitation, AccountScoped).--with invitations,roles(default: all) -
bin/seams adminβ Admin engine (Administrate dashboards, PunditPlatform/Tenantpolicy split, admin audit trail) β opt-in, see Wave 11A -
bin/seams designβ Design-system engine (33ui_*components, Tailwind v4@themetokens,Design::FormBuilder,/design/guidegallery).--shellalso generates an app layout + starter dashboard -
bin/seams permissionsβ host-editable role β ability grant map (config/initializers/seams_permissions.rb), see doc/reference/PERMISSIONS.md
Diagnostics & escape hatch
-
bin/seams listβ engines, the events they emit, and what they subscribe to -
bin/seams test <engine>β run one engine's specs (bin/rails seams:test[engine]) -
bin/seams quality <engine>β run rubocop on one engine -
bin/seams resolve --eject <engine>/<file>β mark a host file as host-owned (skipped on regenerate); also--list-markers <engine>and--list-ejected
Follow-up generators
-
bin/rails generate seams:auth:add_oauth_provider <name>β add an OAuth provider adapter to an installed Auth engine. Write your own: doc/how-to/WRITING_FOLLOW_UP_GENERATORS.md
Plus
- Four custom RuboCop cops that enforce cross-engine boundaries
- A GitHub Actions CI workflow that runs every engine's specs in parallel
Documentation
API reference is published per release at rubydoc.info/gems/seams (generated from YARD comments on the public Ruby API β the event bus, registries, adapters, and configuration).
Guides and explanation live under doc/:
Start here
- doc/tutorials/GETTING_STARTED.md β install β first engine β booting host
- doc/reference/ENGINE_CATALOGUE.md β every canonical engine in detail
- doc/explanation/ARCHITECTURE.md β short overview of why Seams is built this way
Architecture (by wave)
- doc/explanation/ARCHITECTURE_WAVE_9.md β full system walk-through (post-Wave-9)
- doc/explanation/ARCHITECTURE_WAVE_10.md β insertion points, follow-up generators, eject CLI
- doc/explanation/ARCHITECTURE_WAVE_11.md β the admin engine (Administrate, Pundit policy split, admin audit)
- doc/explanation/WAVE_11_PII_GDPR.md β PII encryption & GDPR handling
- doc/adr/ β Architecture Decision Records (MADR): the why behind hard-to-reverse calls
Building & extending
- doc/how-to/ADDING_AN_ENGINE.md
- doc/how-to/REMOVING_AN_ENGINE.md
- doc/how-to/WRITING_AN_ADAPTER.md β swap in Mailgun, Twilio, Paddle, etc.
- doc/how-to/WRITING_FOLLOW_UP_GENERATORS.md
- doc/reference/INSERTION_POINTS.md β marker format spec
- doc/reference/INSERTION_POINTS_CATALOGUE.md β the canonical 33 markers
Reference
- doc/reference/CURRENT_ATTRIBUTES.md β per-request namespaces (Auth::Current, Accounts::Current, Teams::Current, Core::Current)
-
doc/reference/PERMISSIONS.md β ability codes, role hierarchy, the grant map,
authorize_permission! - doc/reference/OBSERVABILITY.md β logging, tracing, metrics integration
- doc/reference/TESTING.md
- doc/how-to/DEPLOYING.md
Design system
- doc/design-system/DESIGN_SYSTEM.md β components, tokens, theming, FormBuilder (start here)
- doc/design-system/DESIGN_SYSTEM_FOUNDATIONS.md β tokens & scales
-
doc/design-system/DESIGN_SYSTEM_COMPONENTS.md β the 33
ui_*components -
doc/design-system/DESIGN_SYSTEM_FORMS.md β
Design::FormBuilder - doc/design-system/DESIGN_SYSTEM_THEMING.md β retheme via token override
- doc/design-system/DESIGN_SYSTEM_ACCESSIBILITY.md
Migrating & releasing
- doc/how-to/UPGRADING_FROM_WAVE_8.md β if you adopted seams pre-Wave-9
- RELEASING.md β for maintainers: how to cut a new gem release
Why Seams instead of...
| ... | Seams gives you |
|---|---|
| Bullet Train | The substrate, not a starter kit. Code is in your repo, not behind a gem. |
| Jumpstart Pro | Same. Plus the boundary cops. |
rails plugin new --mountable |
Engines come pre-wired with events, registry, observability, boundary enforcement, CI. |
| Hand-rolled microservices | One process. No HTTP between services. Synchronous events with explicit subscribers. |
Status
Active development, pre-1.0. The canonical engine set is built out through Wave 11:
- Waves 1β8 β foundation, auth (OAuth, API tokens, GDPR-encrypted PII), notifications (TypeRegistry, ActionCable bell, multipart mailers), billing (official Stripe gem, 13-handler webhook router, Lifetime Deals), teams (team scoping, role-based authz).
-
Wave 9 β added the
accountsengine and reworked the identity/account/team boundary:Auth::Identity(the human),Accounts::Account(the tenant),Teams::Team(the optional grouping) are now three peer engines with one responsibility each. (CHANGELOG Β· upgrade guide) -
Wave 10 β insertion points, follow-up generators, and the eject CLI (
bin/seams resolve). -
Wave 11A β the opt-in
adminengine. -
Wave 11B β the
permissionsgrant map. -
Design system β the
designengine (bin/seams design --shell).
See CHANGELOG.md for the full history and issue #5 for the live work tracker.
Suite: RuboCop clean, brakeman + bundle-audit clean. Run
bin/audit before any push.
Contributing
See CONTRIBUTING.md for the setup, the verification gates, and the pull-request workflow. Security issues: SECURITY.md. Community expectations: CODE_OF_CONDUCT.md.
Need help using Seams? Start with SUPPORT.md. How the project is run: GOVERNANCE.md and MAINTAINERS.md. AI coding agents working in this repo: AGENTS.md (and llms.txt for an LLM-friendly index). Citing Seams: CITATION.cff.
License
MIT β see LICENSE.