alba-inertia
Installation
SKILL.md
Alba + Typelizer for Inertia Rails
Requires: alba, typelizer, alba-inertia gems in Gemfile.
Alba serializers for Inertia props with auto-generated TypeScript types.
Replaces as_json(only: [...]) with structured, type-safe resources.
Before creating a resource, ask:
- Reusable data shape (user, course)? → Entity resource (
UserResource) — shared across pages - Page-specific props bundle? → Page resource (
UsersIndexResource) — one per controller action - Global data (auth, notifications)? → Shared props resource (
SharedPropsResource)
NEVER:
- Use
as_jsonwhen Alba is set up — it bypasses type generation and creates untyped props - Skip
typelize_fromwhen resource name differs from model — Typelizer can't infer column types and generatesunknown - Put
declare moduleaugmentations inserializers/index.ts— Typelizer-generated types go inserializers/index.ts, manual InertiaConfig goes inglobals.d.ts
Setup
Related skills