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 defining routes in Hanami 2.x.
Core principle: Routes map URLs to Actions. They are explicit, readable, and RESTful.
Define routes in config/routes.rb:
# config/routes.rb
module MyApp
class Routes < Hanami::Routes
root to: "home.index"
get "/users", to: "users.index"
get "/users/:id", to: "users.show"
post "/users", to: "users.create"
patch "/users/:id", to: "users.update"
delete "/users/:id", to: "users.destroy"
end
endUse resources for RESTful routes:
resources :users do
resources :posts
endGenerates:
GET /users → users.indexGET /users/:id → users.showPOST /users → users.createPATCH /users/:id → users.updateDELETE /users/:id → users.destroyUse resource for singular resources (no index):
resource :profileName routes for URL generation:
get "/users", to: "users.index", as: :users
get "/users/:id", to: "users.show", as: :userAccess in Views or Actions:
routes.path(:user, id: 1) # => "/users/1"
routes.url(:users) # => "http://example.com/users"Scope routes for versioning or grouping:
scope "api" do
scope "v1" do
resources :users
end
endMount slices at paths:
slice :api, at: "/api" do
resources :users
endOrder matters: Hanami matches routes top-to-bottom. Put specific routes before general ones (wildcards):
# CORRECT: specific first
get "/users/new", to: "users.new"
get "/users/:id", to: "users.show":id) before specific static paths (like new), which intercepts the request.resources.:param syntax for dynamic values.as: named parameters for routes that are referenced in views.resources automatically generates plural routing helper suffixes (users_path).| Related Skill | When to chain |
|---|---|
| create-action | Routes point to Actions. Define routes after Actions exist. |
| create-slice | Slices can define their own routes. Understand slices before nesting routes. |
| write-request-spec (testing) | Test routes by making requests to them. |
For developers transitioning from Rails routing syntax, see the RAILS_COMPARISON.md guide.
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