module ArchSpec

ArchSpec turns your application’s architecture into executable checks.

You describe components, dependencies, and boundaries in an Archspec.rb file written in the ArchSpec::DSL, then run archspec check to verify every change. ArchSpec reads Ruby source with Prism and never boots the app.

The DSL is the public API. An Archspec.rb file is evaluated directly:

architecture :rails

component :services, in: "app/services/**/*.rb"
services.cannot_call :render, :redirect_to, receiver: :none

See ArchSpec::DSL::Context for the top-level DSL and ArchSpec::DSL::ComponentProxy for per-component rules. See ArchSpec::Architectures for the bundled architecture presets.

You can also build a definition in plain Ruby with ArchSpec.define.