alba-inertia
Alba-Inertia pairs Alba serializers with Typelizer to generate TypeScript types automatically from your Rails models and resources. Define entity, page, and shared props resources once, then render them convention-based in controllers—no manual type declarations needed.
Alba-Inertia lets you serialize Inertia props with Alba resources and auto-generate their TypeScript types.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-02-13
Alba-Inertia lets you serialize Inertia props with Alba resources and auto-generate their TypeScript types. Alba-Inertia pairs Alba serializers with Typelizer to generate TypeScript types automatically from your Rails models and resources. Define entity, page, and shared props resources once, then render them convention-based in controllers—no manual type declarations needed.
Use it when
- Alba-Inertia lets you define Alba resources for your entities, pages, and shared props.
- Yes.
Verify before relying
Read SKILL.md below before installing (2 files). Open directory: indexed for reading, not audited.
Install
inertia-rails/skills/alba-inertia
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is alba-inertia and how does it work with Rails?
Alba-Inertia pairs Alba serializers with Typelizer to generate TypeScript types automatically from your Rails models and resources. Define entity, page, and shared props resources once, then render them convention-based in controllers—no manual type declarations needed. It eliminates the friction of keeping Ruby responses and TypeScript types in sync.
How do I set up type-safe Inertia props using Alba serializers?
Alba-Inertia lets you define Alba resources for your entities, pages, and shared props. Once configured, Typelizer auto-generates matching TypeScript types from your Ruby models. In your controller, render Inertia responses using these resources, and your frontend receives both serialized data and type safety without manual type declarations.
Can alba-inertia replace as_json with structured Alba resources?
Yes. Alba-Inertia is designed to replace as_json with structured Alba resources for Inertia responses. Instead of ad-hoc serialization, you define reusable Alba resources that handle both serialization and type generation, giving you consistency and type safety across your entire Rails-Inertia stack.
How does Typelizer generate TypeScript types from Ruby models?
Typelizer scans your Alba resources and Ruby models to auto-generate TypeScript type definitions. Alba-Inertia integrates this process so your resource definitions become the source of truth. Run the generator once, and your frontend has fully typed props matching your backend serializers—no manual syncing required.
What Inertia prop options does alba-inertia support?
Alba-Inertia lets you configure Alba resources with Inertia prop options including defer, once, merge, and scroll. These options control how props are lazy-loaded, cached, merged with existing state, or scroll behavior—all defined declaratively in your Alba resource configuration.
How do I troubleshoot alba-inertia type generation issues?
Alba-Inertia troubleshooting typically involves checking your Alba resource definitions match your model structure, ensuring Typelizer is configured correctly, and verifying your controller renders resources using the expected convention. Check that resource inheritance and shared props are properly declared so type generation captures your full data shape.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
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
(truncated - see the full file via the links below)
File tree — 2 files
skills/alba-inertia/SKILL.md
skills/alba-inertia/references/prop-options.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Set up type-safe Inertia props using Alba serializers with auto-generated TypeScript”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
Master server-side Inertia patterns in Rails controllers. Learn when to use render inertia with explicit props, how to defer expensive queries, share data across pages, and handle validation errors correctly. Covers prop types, flash messages, and the critical inertia_location rule for external redirects.
Inertia Rails Setup detects your frontend framework (React, Vue, or Svelte) and serialization layer from your project files, then recommends and installs complementary libraries like alba-inertia, js-routes, pagy, and shadcn components. It generates a CLAUDE.md configuration block that tells Claude which skill patterns apply to your specific stack.
Configure type-safe shared props, flash messages, and error handling across Inertia Rails with React, Vue, or Svelte using InertiaConfig module augmentation. Define your shared data types once in globals.d.ts and index.ts, then access them globally via usePage() with full TypeScript support. Avoid common pitfalls like interface vs. type constraints and incorrect destructuring patterns.
Master the server-driven mental model behind Inertia Rails: the server owns routing, data, and auth while React renders UI only. This skill routes you to the right pattern for pages, forms, navigation, and data refresh through a decision matrix covering data sources, state ownership, and common anti-patterns to avoid.
Inertia Coder guides you through building modern single-page applications that combine Inertia.js with Rails and your choice of React, Vue, or Svelte. It covers controller setup, page component patterns, form handling with the useForm hook, shared data management, and client-side routing—all without the complexity of separate APIs.
Test Inertia Rails controller actions with RSpec matchers that verify rendered components, props, flash messages, and deferred data. Always use matchers like `render_component` and `have_props` instead of direct property access, and remember to call `follow_redirect!` after POST/PATCH/DELETE before asserting flash or props.
More skills inertia-rails-pages (MIT)