Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

inertia-rails-architectureinertia Rails 架构

Agent Skill

inertia-rails-architecture 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,941

周安装

161

GitHub Stars

44

下载量

1,275
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:inertia-rails-architecture(inertia Rails 架构)
来源仓库:https://github.com/inertia-rails/skills
仓库路径:skills/inertia-rails-architecture
安装命令:
npx skills add https://github.com/inertia-rails/skills --skill inertia-rails-architecture
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/inertia-rails/skills --skill inertia-rails-architecture

简介

inertia-rails-architecture 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。

  • 适用于 Rails 架构相关研究和信息检索场景,支持基于任务需求的信息筛选与组织。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和维护状态。
  • 使用前建议核实是否会触发联网、命令执行或文件读写操作,确保符合安全边界。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Inertia Rails Architecture

Server-driven architecture for Rails + Inertia.js + React when building pages, forms, navigation, or data refresh. Inertia is NOT a traditional SPA — the server owns routing, data, and auth. React handles rendering only.

The Core Mental Model

The server is the source of truth. React receives data as props and renders UI. There is no client-side router, no global state store, no API layer.

Before building any feature, ask:

  • Where does the data come from? → If server: controller prop. If user interaction: useState.
  • Who owns this state? → If it's in the URL or DB: server owns it (use props). If it's ephemeral UI: React owns it.
  • Am I reaching for a React/SPA pattern? → Check the decision matrix below first — Inertia likely has a server-driven equivalent.

Decision Matrix

NeedSolutionNOT This
Page data from serverController propsuseEffect + fetch
Global data (auth, config)inertia_share + usePage()React Context / Redux
Flash messages / toastsRails flash + usePage().flashinertia_share / React state
Form submission<Form> componentfetch/axios + useState
Navigate between pages<Link> / router.visitreact-router / window.location
Refresh specific datarouter.reload({only: [...]})React Query / SWR
Expensive server dataInertiaRails.deferuseEffect + loading state
Infinite scrollInertiaRails.scroll + <InfiniteScroll>Client-side pagination
Stable reference dataInertiaRails.onceCache in React state
Real-time updates (core)ActionCable + router.reloadPolling with setInterval
Simple polling (MVP/prototyping)usePoll (auto-throttles in background tabs)setInterval + router.reload
URL-driven UI state (dialogs, tabs)Controller reads params → prop, router.get to updateuseEffect + window.location
Ephemeral UI stateuseState / useReducerServer props
External API callsDedicated API endpointMixing with Inertia props

Rules (by impact)

#ImpactRuleWHY
1CRITICALNever useEffect+fetch for page dataInertia re-renders the full component on navigation; a useEffect fetch creates a second data lifecycle that drifts from props and causes stale UI
2CRITICALNever check auth client-sideAuth state in React can be spoofed; server-side checks are the only real gate. Client-side "guards" give false security
3CRITICALUse <Form>, not fetch/axios<Form> handles CSRF, redirect-following, error mapping, file detection, and history state — fetch duplicates or breaks all of this
4HIGHUse <Link> and router, not <a> or window.location<a> triggers a full page reload, destroying all React state and layout persistence
5HIGHUse partial reloads, not React Query/SWRReact Query adds a second cache layer that conflicts with Inertia's page-based caching and versioning
5bHIGHUse usePoll only for MVPs; prefer ActionCable for production real-timeusePoll is convenient but wastes bandwidth — every interval hits the server even when nothing changed. ActionCable pushes only on actual changes
6HIGHUse inertia_share for global data, not React ContextContext re-renders consumers on every change; shared props are per-request and integrated with partial reloads
7HIGHUse Rails flash for notifications, not shared propsFlash auto-clears after one response; shared props persist until explicitly changed, causing stale toasts
8MEDIUMUse deferred/optional props for expensive queriesBlocks initial render otherwise — user sees blank page until slow query finishes
9MEDIUMUse persistent layouts for state preservationWithout persistent layout, layout remounts on every navigation — scroll position, audio playback, and component state are lost
10MEDIUMKeep React components as renderers, not data fetchersMixing data-fetching into components makes them untestable and breaks Inertia's server-driven model

Skill Map

Common workflows span multiple skills — load all listed for complete coverage:

WorkflowLoad these skills
New page with propsinertia-rails-controllers + inertia-rails-pages + inertia-rails-typescript
Form with validationinertia-rails-forms + inertia-rails-controllers
shadcn form inputsinertia-rails-forms + shadcn-inertia
Flash toastsinertia-rails-controllers + inertia-rails-pages + shadcn-inertia
Deferred/lazy datainertia-rails-controllers + inertia-rails-pages
URL-driven dialog/tabsinertia-rails-controllers + inertia-rails-pages
Alba serializationalba-inertia + inertia-rails-typescript
Testing controllersinertia-rails-testing + inertia-rails-controllers

References

MANDATORY — READ ENTIRE FILE before building a new Inertia page or feature: references/AGENTS.md (~430 lines) — full-stack examples for each pattern in the decision matrix above.

MANDATORY — READ ENTIRE FILE when unsure which Inertia pattern to use: references/decision-trees.md (~70 lines) — flowcharts for choosing between prop types, navigation methods, and data strategies.

Do NOT load references for quick questions about a single pattern already covered in the decision matrix above.

When You DO Need a Separate API

Not everything belongs in Inertia's request cycle. Use a traditional API endpoint when:

SignalWhyExample
Non-browser consumerInertia's JSON envelope (component, props, url, version) is designed for the frontend adapter — other consumers can't use itMobile API, CLI tools, payment webhooks
Large-dataset searchDataset is too big to load as a prop; each input needs per-keystroke server filtering. Use raw fetch for the search, let Inertia handle post-selection side effects via props.City/address autocomplete, postal code lookup
Binary/streaming responseInertia can only deliver JSON props. Use a separate route with a standard download response.PDF/CSV export, file downloads

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.24%
按下载量换算475

Claude

30.8%
按下载量换算393

Cursor

20%
按下载量换算255

Gemini CLI

8.6%
按下载量换算110

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills