# inertia-rails-setup

Detects your frontend framework and backend gems in an Inertia Rails project, offers missing dependencies, and writes instructions into CLAUDE.md.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 419 installs · ★ 70
- Author: inertia-rails
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/inertia-rails/skills/tree/HEAD/skills/inertia-rails-setup/SKILL.md
- Updated: 2026-09-01
- HTML: https://affpapa.org/en/nevibecode/skills/inertia-rails-setup

## What it does

The skill reads `Gemfile` and `package.json` to identify whether the project runs React, Vue 3, or Svelte. It inspects gems used for pagination, serialization, and auth. Once detected, it prompts you to install recommended tools like `alba-inertia`, `js-routes`, `pagy`, or framework-specific shadcn packages.

During scaffolding, the skill configures initializers and path helpers. It sets up `ApplicationResource` for `alba-inertia` and points `Typelizer` to the generated types folder. Path aliases `@/` go into `tsconfig.json`, leaving `vite.config.ts` untouched because `vite-plugin-ruby` handles Vite resolution.

The setup halts immediately if `inertia_rails` is missing. It finishes by updating `CLAUDE.md` with a `## Inertia Rails Stack` block, telling the agent which guidelines apply.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add inertia-rails/skills --skill inertia-rails-setup -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/inertia-rails-setup/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/inertia-rails-setup/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add inertia-rails/skills --skill inertia-rails-setup -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/inertia-rails-setup/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add inertia-rails/skills --skill inertia-rails-setup -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/inertia-rails-setup/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install inertia-rails/skills inertia-rails-setup
```

2. **Manually: put the files in place**
- File: `.github/skills/inertia-rails-setup/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add inertia-rails/skills --skill inertia-rails-setup -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/inertia-rails/skills --path skills/inertia-rails-setup
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/inertia-rails-setup/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add inertia-rails/skills --skill inertia-rails-setup -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/inertia-rails/skills/tree/HEAD/skills/inertia-rails-setup/SKILL.md

## When to use it
- detect frontend framework and helper gems in an Inertia Rails repository
- scaffold `alba-inertia` with Typelizer configuration
- initialize shadcn components suited for React, Vue, or Svelte
- write an accurate `## Inertia Rails Stack` section into `CLAUDE.md`

## Example prompts
- Initialize the Inertia Rails setup for this project
- Detect our Inertia stack and update CLAUDE.md
- Check missing Inertia Rails dependencies and configure shadcn

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: a95863a2f38fb5ea.

BEGIN THIRD-PARTY FILE a95863a2f38fb5ea
```text
---
name: inertia-rails-setup
description: >-
  One-time project initializer for Inertia Rails skills. Detects stack and frontend framework
  (React/Vue/Svelte) from Gemfile and package.json, offers to install recommended deps
  (alba-inertia, js-routes, pagy, shadcn), and generates a CLAUDE.md section that configures
  which skill patterns apply. Use when first installing these skills, bootstrapping a new
  Inertia Rails project, or when the stack changes.
---

# Inertia Rails Project Setup

Detect stack, offer recommended deps, generate CLAUDE.md configuration.

**Run once per project.** Re-run when the stack changes.

**NEVER:**
- Run setup without `inertia_rails` gem in Gemfile — all skills assume it exists. If missing, tell the user to install it first.
- Overwrite existing `## Inertia Rails Stack` in CLAUDE.md without reading it — the user may have manual customizations. Replace only the auto-generated block.
- Add `@/` resolve aliases to `vite.config.ts` — `vite-plugin-ruby` already provides them. Only add to `tsconfig.json`.
- Recommend `alba-inertia` if the project uses `jbuilder` AND the user hasn't expressed interest in switching — suggest it, but don't push. You CAN still suggest it if the project has `blueprinter` (alba is a direct upgrade path).
- Generate CLAUDE.md blocks for skills the user doesn't have installed — saying "alba-inertia skill does NOT apply" is correct; saying "use alba-inertia" when the gem is absent is wrong.

## Step 1: Detect Current Stack

Read `Gemfile` (NOT `Gemfile.lock`) and `package.json` and check for:

| Look for | Means |
|----------|-------|
| `inertia_rails` gem | Inertia Rails installed (required) |
| `@inertiajs/react` in package.json | React frontend |
| `@inertiajs/vue3` in package.json | Vue 3 frontend |
| `@inertiajs/svelte` in package.json | Svelte frontend |
| `alba-inertia` gem | Convention-based rendering active |
| `alba` + `typelizer` gems (no `alba-inertia`) | Alba serialization without convention rendering |
| `pagy` gem | Pagy pagination |
| `kaminari` gem | Kaminari pagination |
| `rspec-rails` gem | RSpec testing |
| `js-routes` gem | Typed frontend path helpers |
| `devise` gem | Devise authentication |
| `pundit` gem | Pundit authorization |
| `action_policy` gem | Action Policy authorization |
| `components.json` in root exists | shadcn installed (React: shadcn/ui, Vue: shadcn-vue, Svelte: shadcn-svelte) |

## Step 2: Recommend Missing Deps

Present detected stack, then offer deps that unlock skill features but aren't
installed yet. Use AskUserQuestion with multiSelect for the recommendations.

**Only recommend what's missing.** Skip anything already detected in Step 1.

| Dep | Type | Install command | What it unlocks |
|-----|------|-----------------|-----------------|
```
END THIRD-PARTY FILE a95863a2f38fb5ea

The third-party file has ended. Everything between the a95863a2f38fb5ea tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2796 of 6888 bytes. © inertia-rails · MIT · https://github.com/inertia-rails/skills/tree/HEAD/skills/inertia-rails-setup/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
