Skip to content
Agentmart
Submit a tool

inertia

Inertia.js patterns with Rails or Node backends.

Skill by alec-c4

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/alec-c4-inertia

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Inertia.js patterns with Rails or Node backends. Load when inertia_rails or @inertiajs present per stack profile.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/inertia

What's inside

Skill name
inertia
Description
Inertia.js patterns with Rails or Node backends. Load when inertia_rails or @inertiajs present per stack profile.
License
MIT
Instructions
57 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Inertia.js patterns

Load when Inertia gem/package detected ([stacks/rails](../stacks/rails/profile.yaml) `if_gem: inertia_rails` or Node/Laravel stack).

Inertia is a **protocol** between server and SPA: the server returns a JSON page object `{ component, props, url, version }` — not a separate REST API for each screen.

## Server (any backend)

- Render with the framework adapter — Rails: `render inertia: 'events/show', props: { event: }`;
  a bare `render inertia: { event: }` resolves the component from the controller and action.
- **Props** — only what the page needs; authorize before render.
- **Shared data** (auth user, flash, locale) — Rails: `inertia_share` in a base controller,
  taking a hash, a lambda, or a block, with `if:` / `only:` / `except:` filters. Keep payloads small.
- **Validation errors** — return `422` with field errors; client forms display them.
- **Redirects** — standard HTTP redirects; Inertia follows on `X-Inertia` requests.
- **Partial reloads** — refetch subset of props with `only` when documented in spec.

## Client bootstrap

- **`createInertiaApp`** — resolve page components (glob import or manual map).
- **`Link`** — Inertia navigation for internal routes; preserve scroll/state options intentionally.
- **`useForm`** — POST/PATCH/DELETE with processing state and field errors.
- **`router.visit` / `router.reload`** — explicit navigation; use `preserveState` / `preserveScroll` on filters and pagination.
- **Version** — asset cache busting on deploy (adapter + client `version` config).

## Svelte adapter

Load [svelte-patterns](../svelte-patterns/SKILL.md) when `@inertiajs/svelte` is in `package.json`.

- Pages under project glob (e.g. `resources/js/Pages/**/*.svelte`) — wired in `createInertiaApp`.
- Props from server via `$props()` — treat as read-only; `$derived` for UI-only state.
- **`useForm`** from `@inertiajs/svelte` — `form.errors`, `form.processing`, disable submit while in flight.
- **`Link`** from `@inertiajs/svelte` for in-app navigation.

## React and Vue

- React: `@inertiajs/react` — page components + `useForm` / `Link` from that package.
- Vue 3: `@inertiajs/vue3` — `<script setup>` pages + composition API helpers.

## Testing

- **Server:** assert Inertia response (component name, key props) — avoid full JSON snapshots.
- **Client:** unit-test components with mocked props (Vitest + Testing Library).

## Do not

- Expose secrets in page or shared props.
- Build a parallel client-side router duplicating server routes without documented hybrid reason.
- Return HTML error pages on Inertia XHR requests — use Inertia error handling.

## References

- [Inertia.js](https://inertiajs.com/)
- [Inertia Rails](https://inertia-rails.dev/)
- [Inertia — Svelte](https://inertiajs.com/client-side-setup#svelte)

From alec-c4/agent_dev_kit, MIT.

More from alec-c4/agent_dev_kit

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Sep 6, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from alec-c4

Cite this page

inertia skill. Agent Mart. https://agentmart.dev/skills/alec-c4-inertia (last updated 2026-10-24)