inertia

📁 sailscastshq/boring-stack 📅 1 day ago
1
总安装量
1
周安装量
#44314
全站排名
安装命令
npx skills add https://github.com/sailscastshq/boring-stack --skill inertia

Agent 安装分布

amp 1
opencode 1
kimi-cli 1
codex 1
github-copilot 1
claude-code 1

Skill 文档

Inertia.js for The Boring JavaScript Stack

Inertia.js is the bridge between Sails.js and your frontend framework (React, Vue, or Svelte) in The Boring JavaScript Stack. It lets you build modern single-page apps using classic server-side routing and controllers — no API required. The inertia-sails package implements the full Inertia.js v2 protocol as a Sails hook.

When to Use

Use this skill when:

  • Rendering pages with Inertia (responseType: 'inertia')
  • Handling form submissions and redirects (responseType: 'redirect' vs 'inertiaRedirect')
  • Sharing data globally across all pages (sails.inertia.share(), once(), refreshOnce())
  • Working with flash messages (sails.inertia.flash())
  • Handling validation errors (responseType: 'badRequest', form.errors)
  • Using advanced props: deferred, optional, always, merge, scroll
  • Building frontend components with useForm, usePage, Link, Head, router
  • Setting up createInertiaApp and persistent layouts
  • Handling server errors with the Inertia error modal
  • Working with partial reloads, history encryption, or asset versioning

Rules

Read individual rule files for detailed explanations and code examples:

Framework-Specific APIs

  • rules/react.md – React: useForm, usePage, Link, Head, Deferred, WhenVisible, usePoll, layouts
  • rules/vue.md – Vue: useForm, usePage, Link, Head, Deferred, WhenVisible, usePoll, defineOptions layouts
  • rules/svelte.md – Svelte: useForm (stores), page store, Link, inertia action, svelte:head, layouts