Thanks to visit codestin.com
Credit goes to archspecrb.dev

Skip to content

ArchSpec Executable architecture specifications for Ruby and Rails

Guarantee your agents and your team follow your conventions. ArchSpec turns them into static analysis checks that run in CI on every change. No AI involved, just static analysis.

Archspec.rb Boundaries
controllers.can_only_use :models, :services
models.cannot_use :controllers
services.cannot_call :render, :redirect_to
[error] services must not call #render [methods.forbid]

app/services/create_user.rb:7:5

  → 7 │     render :new
      │     ^~~~~~~~~~~

  note: CreateUser calls render
architecture :rails

jobs.cannot_reference_constants "Current"
component :commands, in: "app/commands/**/*.rb"

commands.must_implement :call
component :queries, in: "app/queries/**/*.rb"

queries.cannot_call :save!, :update!, :destroy!
component :services, in: "app/services/**/*.rb"

services.must_be_empty because: "rich models"
component :billing, in: "packs/billing/**/*.rb"
component :catalog, in: "packs/catalog/**/*.rb"

billing.can_only_use :catalog