Curated library of atomic AI agent skills for Hanami, dry-rb, and ROM Ruby development. Covers actions, slices, repositories, relations, changesets, providers, DI, operations, TDD, CLI, views, routing, and validation. Shared Ruby process skills have moved to ruby-core-skills. Uses Markdown + Front-matter architecture.
92
94%
Does it follow best practices?
Impact
92%
1.33xAverage score across 35 eval scenarios
Passed
No known issues
# spec/slices/api/slice_helper.rb
require "hanami/rspec"
RSpec.configure do |config|
config.before(:suite) do
Hanami.app.prepare(:api)
end
endRSpec.configure do |config|
config.before(:suite) do
Hanami.app.prepare(:api)
end
config.around(:each, :db) do |example|
# Wrap each test in a transaction and rollback
Hanami.app["api.rom"].gateways[:default].transaction(rollback: :always) do
example.run
end
end
endconfig.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning { example.run }
end# spec/slices/api/actions/users/create_spec.rb
RSpec.describe Api::Actions::Users::Create, :slice do
let(:create_user) { instance_double(Users::CreateUser) }
let(:action) { described_class.new(create_user:) }
before do
allow(create_user).to receive(:call).and_return(result)
end
context "success" do
let(:user) { double(id: 1, email: "test@example.com") }
let(:result) { Dry::Monads::Success(user) }
it "returns 201" do
response = action.call(email: "test@example.com")
expect(response.status).to eq(201)
end
end
context "failure" do
let(:result) { Dry::Monads::Failure(email: ["is invalid"]) }
it "returns 422" do
response = action.call(email: "bad")
expect(response.status).to eq(422)
end
end
endRSpec.describe Users::CreateUser do
let(:user_repo) { instance_double(Api::Repositories::UserRepo) }
let(:operation) { described_class.new(user_repo:) }
endTest the full slice workflow without mocking internal dependencies:
RSpec.describe "User registration", :slice, :db do
it "creates a user through the full stack" do
action = Api::Actions::Users::Create.new
response = action.call(
email: "test@example.com",
name: "Test User"
)
expect(response.status).to eq(201)
body = JSON.parse(response.body.first)
expect(body["email"]).to eq("test@example.com")
end
endWhen Slice A needs Slice B's data in a test:
# Good: Stub the public interface
let(:payment_action) { instance_double(Payments::Actions::GetStatus) }
before do
allow(payment_action).to receive(:call).and_return(status_response)
end
# Bad: Reach into another slice's internals
# let(:payment_repo) { Payments::Repositories::PaymentRepo.new }Tag all slice tests for easy selective execution:
RSpec.configure do |config|
config.define_derived_metadata(file_path: %r{spec/slices/}) do |metadata|
metadata[:slice] = true
end
endRun only slice tests: bundle exec rspec --tag slice
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20
scenario-21
scenario-22
scenario-23
scenario-24
scenario-25
scenario-26
scenario-27
scenario-28
scenario-29
scenario-30
scenario-31
scenario-32
scenario-33
scenario-34
scenario-35
skills
actions
build-json-api
create-action
handle-errors
validate-params
context
load-context
db
create-changeset
create-repository
define-relation
write-migration
dry-monads
handle-result-pattern
dry-rb
create-operation
create-validation-contract
providers
configure-providers
implement-di
review-security
routing
define-routes
slices
configure-slice
create-slice
extract-slice
review-slice-boundaries
test-slice