Skip to content

ArchSpec Executable architecture specifications for Ruby and Rails

Guarantee your agents and your team follow your conventions. ArchSpec turns them into checks that run in CI on every change.

Archspec.rb Boundaries
controllers.can_use :models, :services
models.cannot_use :controllers
services.cannot_call :render, :redirect_to
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_use :catalog