Curated library of atomic skills and personas for Hanami, dry-rb, and ROM Ruby development. Covers actions, slices, repositories, relations, changesets, providers, DI, operations, TDD, CLI, views, routing, validation, and 10 orchestration personas. Shared Ruby process skills have moved to ruby-core-skills. Uses Markdown + Front-matter architecture.
95
95%
Does it follow best practices?
Impact
96%
1.20xAverage score across 45 eval scenarios
Passed
No known issues
Use this workflow when integrating background jobs in Hanami 2.x.
Core principle: Background jobs are registered components. They are enqueued from Actions and executed asynchronously.
[Register Job Adapter] — Load skill: register-provider
config/providers/background_jobs.rbstart blockDeps["jobs.client"]# config/providers/background_jobs.rb
Hanami.app.register_provider(:background_jobs) do
start do
require "sidekiq"
Sidekiq.configure_client do |config|
config.redis = { url: target[:settings].redis_url }
end
register("jobs.client", Sidekiq::Client)
end
endValidation: Verify registration with MyApp::App["jobs.client"] in a Hanami console or container lookup spec. It should return Sidekiq::Client without raising Dry::Container::Error.
[Inject into Action] — Load skill: inject-dependencies
class Create < MyApp::Action
include Deps["jobs.client", "repos.user_repo"]
end[Enqueue from Action] — Load skill: create-action
# app/jobs/welcome_email.rb
module MyApp
module Jobs
class WelcomeEmail
include Sidekiq::Worker
def perform(user_id)
user = user_repo.by_id(user_id).one
mailer.deliver(to: user.email, subject: "Welcome!")
end
end
end
endclass Create < MyApp::Action
def handle(request, response)
result = create_user.call(request.params[:user])
case result
in Success(user)
jobs.client.push("class" => "MyApp::Jobs::WelcomeEmail", "args" => [user.id])
response.status = 201
in Failure(error)
response.status = 422
end
rescue => e
Hanami.logger.error("Job enqueue failed: #{e.message}")
response.status = 201 # Still succeed; enqueue failure is non-fatal
end
endValidation: Confirm jobs are being enqueued by checking the Sidekiq dashboard (/sidekiq) or inspecting the Redis queue directly (Sidekiq::Queue.new.size). In tests, use Sidekiq::Testing.fake! and assert on MyApp::Jobs::WelcomeEmail.jobs.
[Write Job Specs] — Load skill: write-action-spec
# spec/unit/my_app/jobs/welcome_email_spec.rb
RSpec.describe MyApp::Jobs::WelcomeEmail do
subject(:job) { described_class.new }
let(:user_repo) { instance_double(MyApp::Repos::UserRepo) }
let(:mailer) { instance_double(MyApp::Mailers::Welcome) }
let(:user) { instance_double(MyApp::Entities::User, id: 42, email: "user@example.com") }
before do
allow(user_repo).to receive(:by_id).with(42).and_return(double(one: user))
allow(mailer).to receive(:deliver)
job.instance_variable_set(:@user_repo, user_repo)
job.instance_variable_set(:@mailer, mailer)
end
it "delivers a welcome email to the user" do
job.perform(42)
expect(mailer).to have_received(:deliver).with(to: "user@example.com", subject: "Welcome!")
end
end
# spec/requests/users/create_spec.rb (enqueue assertion)
RSpec.describe "POST /users" do
before { Sidekiq::Testing.fake! }
after { Sidekiq::Worker.clear_all }
it "enqueues a WelcomeEmail job on success" do
expect {
post "/users", params: { user: { name: "Alice", email: "alice@example.com" } }
}.to change(MyApp::Jobs::WelcomeEmail.jobs, :size).by(1)
expect(last_response.status).to eq(201)
end
end.tessl-plugin
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
scenario-36
scenario-37
scenario-38
scenario-39
scenario-40
scenario-41
scenario-42
scenario-43
scenario-44
scenario-45
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
personas
providers
configure-providers
implement-di
review-security
routing
define-routes
slices
configure-slice
create-slice
extract-slice
review-slice-boundaries
test-slice