Token导航 LogoToken导航

Agent Skill · 前端设计

inertia-rails-controllers(inertia Rails controllers 命令行)

inertia-rails-controllers 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

inertia-rails-controllers 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 1,873。

总安装 3,476周安装 142GitHub Stars 44下载 1,125核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

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

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

inertia-rails-controllers 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态进行整理时使用。适用于 Rails 控制器相关代码协作事项管理,可辅助处理开发流程中的协作问题。

通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和维护状态。使用前建议核实是否会触发联网、命令执行或文件读写操作,确保符合安全边界。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/inertia-rails-controllers

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/inertia-rails/skills --skill inertia-rails-con…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

inertia-rails-controllers 怎么安装?

在终端执行 npx skills add https://github.com/inertia-rails/skills --skill inertia-rails-controllers。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

inertia-rails-controllers 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

inertia-rails-controllers 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

inertia-rails-controllers 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

inertia-rails-controllers 用的人多吗?

公开数据是累计安装 3,476 次,近一周安装 142 次,下载 1,125 次,GitHub 44 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

inertia-rails-controllers 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
inertia-rails-controllers

inertia Rails controllers 命令行 · 本页

3,47644需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Inertia Rails Controllers

Server-side patterns for Rails controllers serving Inertia responses.

Before adding a prop, ask:

  • Needed on every page? → inertia_share in a base controller (InertiaController), not a per-action prop
  • Expensive to compute? → InertiaRails.defer — page loads fast, data streams in after
  • Only needed on partial reload? → InertiaRails.optional — skipped on initial load
  • Reference data that rarely changes? → InertiaRails.once — cached across navigations

NEVER:

  • Use redirect_to for external URLs (Stripe, OAuth, SSO) — it returns 302 but the Inertia client tries to parse the response as JSON, causing a broken redirect. Use inertia_location (returns 409 + X-Inertia-Location header).
  • Use errors.full_messages for validation errors — it produces flat strings without field keys, so errors can't be mapped to the corresponding input fields on the frontend. Use errors.to_hash(true).
  • Use inertia.defer, Inertia.defer, or inertia_rails.defer — the correct syntax is InertiaRails.defer {...}. All prop helpers are module methods on the InertiaRails constant.
  • Assume instance variables are auto-passed as props — they are NOT (unless alba-inertia gem is configured). Every action that passes props to the frontend MUST call render inertia: {key: data}.
  • Use success/error as flash keys without updating config.flash_keys — Rails defaults to notice/alert. Custom keys must be added to both the initializer config and the FlashData TypeScript type.

Render Syntax

default_render: true TRAP: This setting only auto-infers the component name from controller/action — it does NOT auto-pass instance variables as props. Writing @posts = Post.all in an action with default_render: true renders the correct component but sends zero data to the frontend. Instance variables are only auto-serialized as props when alba-inertia gem is configured — check Gemfile before relying on this. Without it, you MUST use render inertia: {posts: data} to pass any data to the page. Empty actions (def index; end) are correct ONLY for pages that need no data (e.g., a static dashboard page, a login form). If the action queries the database, it MUST call render inertia: with data.
SituationSyntaxComponent path
Action loads datarender inertia: {users: data}Inferred from controller/action
Action loads NO data (static page)Empty action or render inertia: {}Inferred from controller/action
Rendering a different pagerender inertia: 'errors/show', props: {error: e}Explicit path

Rule of thumb: If your action touches the database, it MUST call render inertia: with data. If the action body is empty, the page receives only shared props (from inertia_share).

# CORRECT — data passed as props
def index
  render inertia: { users: users_data, stats: InertiaRails.defer { ExpensiveQuery.run } }
end

# CORRECT — static page, no data needed
def index; end

# WRONG — @posts is NEVER sent to the frontend (without alba-inertia)
def index
  @posts = Post.all
end
Note: If the project uses the alba-inertia gem (check Gemfile), instance variables are auto-serialized as props and explicit render inertia: is not needed. See the alba-inertia skill for that convention.

Prop Types

InertiaRails.defer — NOT inertia.defer, NOT Inertia.defer. All prop helpers are module methods on InertiaRails.

TypeSyntaxBehavior
Regular{key: value}Always evaluated, always included
Lazy-> {expensive_value}Included on initial page render, lazily evaluated on partial reloads
OptionalInertiaRails.optional {...}Only evaluated on partial reload requesting it
DeferInertiaRails.defer {...}Loaded after initial page render
Defer (grouped)InertiaRails.defer(group: 'name') {...}Grouped deferred — fetched in parallel
OnceInertiaRails.once {...}Resolved once, remembered across navigations
MergeInertiaRails.merge {...}Appended to existing array (infinite scroll)
Deep mergeInertiaRails.deep_merge {...}Deep merged into existing object
AlwaysInertiaRails.always {...}Included even in partial reloads
ScrollInertiaRails.scroll {...}Scroll-aware prop for infinite scroll
def index
  render inertia: {
    filters: filter_params,
    messages: -> { messages_scope.as_json },
    stats: InertiaRails.defer { Dashboard.stats },
    chart: InertiaRails.defer(group: 'analytics') { Dashboard.chart },
    countries: InertiaRails.once { Country.pluck(:name, :code) },
    posts: InertiaRails.merge { @posts.as_json },
    csrf: InertiaRails.always { form_authenticity_token },
  }
end

Deferred Props — Full Stack Example

Server defers slow data, client shows fallback then swaps in content:

# Controller
def show
  render inertia: {
    basic_stats: Stats.quick_summary,
    analytics: InertiaRails.defer { Analytics.compute_slow },
  }
end
// Page component — child reads deferred prop from page props
import { Deferred, usePage } from '@inertiajs/react'

export default function Dashboard({ basic_stats }: Props) {
  return (
    <>
      <QuickStats data={basic_stats} />
      <Deferred data="analytics" fallback={<div>Loading analytics...</div>}>
        <AnalyticsPanel />
      </Deferred>
    </>
  )
}

function AnalyticsPanel() {
  const { analytics } = usePage<{ analytics: Analytics }>().props
  return <div>{analytics.revenue}</div>
}

Shared Data

Use inertia_share in controllers — it needs controller context (current_user, request). The initializer only handles config.* settings (version, flash_keys).

class ApplicationController < ActionController::Base
  # Static
  inertia_share app_name: 'MyApp'

  # Using lambdas (most common)
  inertia_share auth: -> { { user: current_user&.as_json(only: [:id, :name, :email, :role]) } }

  # Conditional
  inertia_share if: :user_signed_in? do
    { notifications: -> { current_user.unread_notifications_count } }
  end
end

Lambda and action-scoped variants are in references/configuration.md.

Evaluation order: Multiple inertia_share calls merge top-down. If a child controller shares the same key as a parent, the child's value wins. Block and lambda shares are lazily evaluated per-request — they don't run for non-Inertia requests.

Flash Messages

Flash is automatic. Configure exposed keys if needed:

# config/initializers/inertia_rails.rb
InertiaRails.configure do |config|
  config.flash_keys = %i[notice alert toast] # default: %i[notice alert]
end

Use standard Rails flash in controllers:

redirect_to users_path, notice: "User created!"
# or
flash.alert = "Something went wrong"
redirect_to users_path

Redirects & Validation Errors

After create/update/delete, always redirect (Post-Redirect-Get). Standard Rails redirect_to works. The Inertia-specific part is validation error handling:

def create
  @user = User.new(user_params)
  if @user.save
    redirect_to users_path, notice: "Created!"
  else
    redirect_back_or_to new_user_path, inertia: { errors: @user.errors.to_hash(true) }
  end
end

to_hash vs to_hash(true): to_hash gives {name: ["can't be blank"]}, to_hash(true) gives {name: ["Name can't be blank"]}. Keys must match input name attributes — mismatched keys mean errors won't display next to the right field.

NEVER use errors.full_messages — it produces flat strings without field keys, so errors can't be mapped to the corresponding input fields on the frontend.

Authorization as Props

Pass permissions as per-resource can hash — frontend controls visibility, server enforces access. See inertia-rails-controllers + inertia-rails-pages skills.

MANDATORY — READ ENTIRE FILE when implementing authorization props: references/authorization.md (~40 lines) — full-stack can pattern with Action Policy/Pundit/CanCanCan examples.

Do NOT load if not passing permission data to the frontend.

External Redirects (inertia_location)

CRITICAL: redirect_to for external URLs breaks Inertia — the client receives a 302 but tries to handle it as an Inertia response (JSON), not a full page redirect. inertia_location returns 409 with X-Inertia-Location header, which tells the client to do window.location = url.

# Stripe checkout — MUST use inertia_location, not redirect_to
def create
  checkout_session = Current.user.payment_processor.checkout(
    mode: "payment",
    line_items: "price_xxx",
    success_url: enrollments_url,
    cancel_url: course_url(@course),
  )
  inertia_location checkout_session.url
end

Use inertia_location for any URL outside the Inertia app: payment providers, OAuth, external services.

History Encryption

Encrypts page data in browser history state — config.encrypt_history = Rails.env.production?. Use redirect_to path, inertia: {clear_history: true} on logout/role change. Full setup with server-side and client-side examples is in references/configuration.md.

Configuration

See references/configuration.md for all InertiaRails.configure options (version, encrypt_history, flash_keys, etc.).

Troubleshooting

SymptomCauseFix
302 loop on Stripe/OAuth redirectredirect_to for external URLUse inertia_location — it returns 409 + X-Inertia-Location header
Errors don't display next to fieldsError keys don't match input nameto_hash keys must match input name attributes exactly
TS2305: postsPath not found in @/routesjs-routes not regenerated after adding routesRun rails js_routes:generate after changing config/routes.rb

Related Skills

  • Form error display → inertia-rails-forms
  • Flash toast UI → inertia-rails-pages (access) + shadcn-inertia (Sonner)
  • Deferred on client → inertia-rails-pages (<Deferred> component)
  • Type-safe props → inertia-rails-typescript or alba-inertia (serializers)
  • Testing → inertia-rails-testing

References

MANDATORY — READ ENTIRE FILE when using advanced prop types (merge, scroll, deep_merge) or combining multiple prop options: references/prop-types.md (~180 lines) — detailed behavior, edge cases, and combination rules for all prop types.

Do NOT load prop-types.md for basic defer, optional, once, or always usage — the table above is sufficient.

Load references/configuration.md (~180 lines) only when setting up InertiaRails.configure for the first time or debugging configuration issues. Do NOT load for routine controller work.

平台分布

Codex

37.4%
按下载量换算421

Claude

30.33%
按下载量换算341

Cursor

19.98%
按下载量换算225

Gemini CLI

9.76%
按下载量换算110

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills