Overview
This skill implements a fully customizable admin panel in Ruby on Rails using Hotwire (Turbo + Stimulus). It builds a production-ready admin panel, including E2E test design and implementation.
When to use this skill
Claude uses this skill in the following situations:
- When the user requests implementation of an admin panel using Hotwire
- When adding an admin panel to an existing Rails application
- When implementing E2E tests for the admin panel
- When building a custom admin panel without using ActiveAdmin or Administrate
Tech stack
| Item | Technology |
|---|---|
| Framework | Ruby on Rails 8.x |
| Frontend | Hotwire (Turbo + Stimulus) |
| Styling | Tailwind CSS |
| E2E test | Playwright + Capybara |
| Authentication | Devise / custom authentication |
Steps
For details on each step, see the steps/ files in the directory.
1. Setup and routing
Details: @steps/01_setup_and_routing.md
Claude sets up the namespace, routing, and base controller for the admin panel.
2. Layout and navigation
Details: @steps/02_layout_and_navigation.md
Claude creates a layout file dedicated to the admin panel and a sidebar navigation.
3. CRUD screen implementation
Details: @steps/03_crud_views.md
Claude implements index, show, new, and edit screens. It also includes form helpers supporting various data types.
4. Turbo-compatible actions
Details: @steps/04_turbo_actions.md
Claude implements actions such as delete, publish, and unpublish with Turbo support.button_toとdata-turbo-confirmImplement secure actions using
5. Stimulus controllers
Details: @steps/05_stimulus_controllers.md
Claude implements Stimulus controllers for confirmation dialogs, flash messages, dynamic forms, etc.
6. E2E test design
Details: @steps/06_e2e_test_design.md
Claude systematically identifies test cases for the admin panel and creates a test plan.
7. E2E test implementation
Details: @steps/07_e2e_test_implementation.md
Claude implements E2E tests using Playwright + Capybara. It proceeds with tests and implementation using a TDD approach.
8. Troubleshooting
Details: @steps/08_troubleshooting.md
Claude refers to common issues and solutions to resolve problems during implementation.
File structure
implementing-hotwire-admin/
├── SKILL.md # このファイル
├── references/
│ └── turbo_patterns.md # Turboパターンのリファレンス
└── steps/
├── 01_setup_and_routing.md # セットアップとルーティング
├── 02_layout_and_navigation.md # レイアウトとナビゲーション
├── 03_crud_views.md # CRUD画面
├── 04_turbo_actions.md # Turbo対応アクション
├── 05_stimulus_controllers.md # Stimulusコントローラ
├── 06_e2e_test_design.md # E2Eテスト設計
├── 07_e2e_test_implementation.md # E2Eテスト実装
└── 08_troubleshooting.md # トラブルシューティング
Important notes
Turbo-compatible delete link
In the Rails 8 Turbo environment,link_toのmethod:the option does not work. Be sure tobutton_touse:
<%# NG: Turbo環境では機能しない %>
<%= link_to '削除', path, method: :delete, data: { confirm: '削除しますか?' } %>
<%# OK: Turbo対応 %>
<%= button_to '削除', path, method: :delete, data: { turbo_confirm: '削除しますか?' } %>
Notes on E2E testing
- When testing the Turbo confirmation dialog,
click_linkinstead ofclick_buttonuse - For responsive testing,
page.driver.with_playwright_pagechange the viewport size with - Use Playwright's headless mode in CI environments