CtrlK
BlogDocsLog inGet started
Tessl Logo

igmarin/hanakai-yaku

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

1.33x
Quality

94%

Does it follow best practices?

Impact

92%

1.33x

Average score across 35 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

SKILL.mdskills/cli/generate-components/

name:
generate-components
license:
MIT
description:
Use when generating Hanami 2.x components via CLI. Covers hanami generate action, view, slice, migration with output paths and naming conventions.
metadata:
{"ecosystem_sources":["hanami/hanami-cli"],"tags":["cli","generators","scaffolding"],"version":"1.0.0"}

generate-components

Use this skill when generating Hanami 2.x components via the CLI.

Core principle: Generators follow naming conventions. The command name determines the file path and class name.


Quick Reference

CommandGeneratesPath
hanami generate action <name>Action classapp/actions/{path}.rb
hanami generate view <name>View class + templateapp/views/{path}.rb + app/templates/{path}.html.erb
hanami generate slice <name>Slice directory structureslices/{name}/
hanami generate migration <name>Migration filedb/migrate/{timestamp}_{name}.rb
hanami generate relation <name>Relation classapp/relations/{name}.rb
hanami generate repo <name>Repository classapp/repos/{name}.rb
hanami generate entity <name>Entity classapp/entities/{name}.rb

Core Rules

  1. Generate an Action:

    hanami generate action users.index

    Generates:

    • app/actions/users/index.rb
    • Class: MyApp::Actions::Users::Index

    With a Slice:

    hanami generate action api.users.index

    Generates:

    • slices/api/actions/users/index.rb
    • Class: MyApp::Slices::Api::Actions::Users::Index
  2. Generate a View:

    hanami generate view users.index

    Generates:

    • app/views/users/index.rb
    • app/templates/users/index.html.erb
  3. Generate a Slice:

    hanami generate slice api

    Generates:

    • slices/api/config/routes.rb
    • slices/api/config/slice.rb
    • slices/api/actions/
    • slices/api/views/
    • slices/api/templates/
  4. Generate a migration:

    hanami generate migration create_users

    Generates:

    • db/migrate/{timestamp}_create_users.rb
  5. Always verify generated files: Generators will fail if target files already exist. Always check:

    • File paths match the expected pattern.
    • Class names align with module nesting (e.g. users.indexMyApp::Actions::Users::Index).
    • Slices are correctly prefixed: <slice>.<resource>.<action> (omitting this places components in the default app/ folder).

Common Mistakes & Troubleshooting

Problem / MistakeResolution
Using underscores instead of dotsCLI commands require dot notation: users.index, not users_index.
Omitting the slice prefixUse api.users.index to generate in the api slice.
Singular names for ActionsActions should use plural resource names: users.index, not user.index.
File conflicts / stale filesGenerators never overwrite. Manually delete conflicting files before re-generating.

Integration

Related SkillWhen to chain
create-app (../create-app/SKILL.md)Generators are used after creating the app.
create-action (../create-action/SKILL.md)Generated Actions need to be filled with logic.
create-view (../create-view/SKILL.md)Generated Views need exposures defined.
create-slice (../create-slice/SKILL.md)Generated Slices need routes and configuration.
write-migration (../write-migration/SKILL.md)Generated migrations need schema definitions.

skills

cli

generate-components

README.md

tile.json