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
Define write rules for a relation. Every data mutation goes through a changeset — never call relation.insert directly.
slices/<slice>/changesets/ROM::Changeset::Create, ROM::Changeset::Update, ROM::Changeset::Delete.repo.create(attrs) internally calls the changeset.Changeset Constraints:
DO NOT call relation.command(:create).call(...) directly. Use a changeset.
DO NOT put business logic in changesets. Changesets validate and map input only.module Api
module Changesets
class CreateUser < ROM::Changeset::Create
map do |attrs|
attrs.merge(
created_at: Time.now,
status: "active"
)
end
# Validate before persistence
def default_contract = UserContract.new
end
end
endbundle exec rspec spec/changesets/create_user_spec.rb
# Confirm map block and contract behave as expectedcreate method delegates to the changeset:
class UserRepo < ROM::Repository[:users]
def create(attrs)
users.changeset(CreateUser, attrs).commit
end
endclass UpdateUser < ROM::Changeset::Update
map do |attrs|
attrs.merge(updated_at: Time.now)
end
# Restrict which fields can be updated
def allowed_keys = [:name, :email, :role]
end.data for multi-step writes:
class UserRepo < ROM::Repository[:users]
def create_with_profile(user_attrs, profile_attrs)
user_cs = users.changeset(CreateUser, user_attrs)
profile_cs = profiles.changeset(CreateProfile, profile_attrs)
# Pass transformed data from the first changeset into the second
user_cs.data.then { |data| profile_cs.data.merge(owner_id: data[:id]) }
user_cs.commit
profile_cs.commit
end
endLoad these files only when needed:
| Skill | When to chain |
|---|---|
| define-relation | Define the relation schema before creating its changeset |
| create-repository | Use the changeset in the repository's write methods |
| create-operation | Operations call repositories which use changesets |
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