⚡
Check on every commit
archspec check reads your code with Prism, with no app boot and no database. Fast enough for CI, a git hook, and every change an agent makes.
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 Prism.
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
archspec check reads your code with Prism, with no app boot and no database. Fast enough for CI, a git hook, and every change an agent makes.
Allowed and forbidden references between layers and packs, dependency direction and cycles, controller APIs kept out of models, method protocols, and one-shot command objects.
Start from one that is already written: Rails, vanilla Rails, layered, hexagonal, clean, modular monolith, CQRS, event-driven. Or compose your own rules in plain Ruby.