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
Use this skill when writing RSpec request specs for Hanami 2.x Actions.
Follow these steps in order, treating each as a checkpoint:
Place it under spec/requests/:
# spec/requests/users_spec.rb
RSpec.describe "Users", type: :request do
it "returns user JSON" do
get "/users/1"
expect(last_response).to be_successful
expect(json_body).to include(:id, :email, :name)
expect(json_body[:id]).to eq(1)
expect(json_body[:email]).to be_a(String)
end
endRun RSpec and confirm the spec fails because the route or action is unimplemented:
bundle exec rspec spec/requests/users_spec.rbWrite only the minimal code in the action and routing to make the spec pass.
Verify all specs pass green:
bundle exec rspec spec/requests/users_spec.rbSend JSON request bodies — serialize parameters with .to_json and set CONTENT_TYPE header explicitly:
it "creates a user" do
post "/users",
{ user: { email: "alice@example.com", first_name: "Alice" } }.to_json,
{ "CONTENT_TYPE" => "application/json" }
expect(last_response.status).to eq(201)
expect(json_body[:id]).not_to be_nil
endTest error responses — cover both 404 (not found) and 422 (validation errors) states:
it "returns 404 for missing user" do
get "/users/99999"
expect(last_response.status).to eq(404)
expect(json_body[:error]).to eq("User not found")
endIsolate database state — wrap specs that touch the database in transactions to ensure clean tests:
around do |example|
Hanami.app["db.rom"] do |rom|
rom.gateways[:default].transaction do |t|
example.run
t.rollback
end
end
end| Related Skill | When to chain |
|---|---|
| create-action | Action definition precedes request spec implementation. |
| validate-params | Test validation contract parameters (422 responses). |
| create-repository | Database interactions are verified using real repositories. |
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