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 creating a new Hanami 2.x application.
Core principle: hanami new generates a production-ready application structure with slices, ROM, and dry-system preconfigured.
| Command | Generates |
|---|---|
hanami new my_app | Full Hanami 2.x application |
hanami new my_app --database=postgres | App with PostgreSQL configured |
hanami new my_app --database=sqlite | App with SQLite configured |
hanami new my_app --head | Uses latest (HEAD) versions of gems |
Generate the application:
hanami new my_app --database=postgres
cd my_appGenerated directory layout:
my_app/
├── app/ # Default application slice
│ ├── actions/ # Action classes (one class per endpoint)
│ ├── views/ # View classes
│ ├── templates/ # HTML/JSON templates
│ ├── relations/ # ROM Relations (SQL queries)
│ ├── repos/ # ROM Repositories (data access)
│ └── entities/ # ROM Entities (immutable data structs)
├── config/
│ ├── app.rb # Main application configuration
│ ├── routes.rb # Routing definitions
│ ├── settings.rb # Typed settings loaded from environment
│ └── providers/ # External dependency providers
├── db/
│ ├── migrate/ # Database migration files
│ └── seeds.rb # Seed data setup
├── slices/ # Modular slices (bounded contexts)
├── spec/
├── Gemfile
├── config.ru
└── README.mdKey generated files (non-obvious entries):
| File | Purpose |
|---|---|
config/app.rb | App class, slice registration, plugin config |
config/routes.rb | Root route and resource routing |
config/settings.rb | Typed environment variable declarations |
Environment detection:
Hanami detects the environment via HANAMI_ENV:
development (default) — code reloading enabledtest — used by RSpecproduction — code reloading disabled, logging to stdoutInitial configuration:
# config/app.rb
# frozen_string_literal: true
module MyApp
class App < Hanami::App
end
endDatabase configuration is read from DATABASE_URL:
DATABASE_URL=postgres://localhost/my_app_developmentInstall dependencies and set up the database:
bundle install
hanami db create # Creates the database
hanami db migrate # Applies migrationsRun the development server:
hanami dev| Mistake / Red Flag | Reality |
|---|---|
Business logic in config/app.rb | config/app.rb is for framework settings; business logic belongs in Actions, Repositories, or service objects. |
| Routes scattered across files without slice organization | Keep routing defined in config/routes.rb, dividing sections by slice or scope. |
Using hanami new without specifying a database | The default may not match your project requirements; choose --database=postgres or --database=sqlite. |
| Related Skill | When to chain |
|---|---|
| create-slice | create-slice — Create modular bounded contexts after establishing the base app. |
| manage-database | manage-database — Run migrations and seed files. |
| define-relation | define-relation — Establish ROM database schema connections. |
| create-repository | create-repository — Set up data query boundaries. |
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