Guidance for integrating JavaScript in Rails: import maps, jsbundling-rails (Bun/esbuild/Rollup/Webpack), Turbo helpers, request.js, and UJS replacements. Use when the user asks about JavaScript setup, bundlers, or client-side behavior in Rails.
/plugin marketplace add bastos/rails-plugin/plugin install bastos-ruby-on-rails@bastos/rails-pluginThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Guide Rails applications through JavaScript setup, bundling choices, and Turbo/UJS replacements using Rails 7+ conventions.
bin/rails server.jsbundling-rails.bin/dev during development.Install (existing apps):
bundle add importmap-rails
bin/rails importmap:install
Pin packages:
bin/importmap pin react react-dom
Import in app/javascript/application.js:
import React from "react"
import ReactDOM from "react-dom"
Common files:
config/importmap.rbapp/javascript/application.jsCreate a new app with a bundler:
rails new my_app --javascript=bun
Available options:
bunesbuildrollupwebpackUse Turbo helpers and data attributes instead of Rails UJS:
Method override:
<%= link_to "Delete", post_path(@post), data: { turbo_method: "delete" } %>
Confirmations:
<%= link_to "Delete", post_path(@post), data: { turbo_confirm: "Are you sure?" } %>
Prefer button_to for non-GET actions when possible.
Non-GET requests require X-CSRF-Token. Rails Request.JS handles this:
import { FetchRequest } from "@rails/request.js"
const request = new FetchRequest("post", "/posts", {
body: JSON.stringify({ post: { title: "Hello" } })
})
await request.perform()
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.