/superpowers-rails:rails-stimulus-conventionsfrom superpowers-rails
Defines conventions for Stimulus controllers in Rails: Turbo-first, thin controllers with DOM-only logic, proper cleanup, and preferred naming.
Ships in superpowers-rails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The best Stimulus controller is one you don't write because Turbo handles it. When JS is needed, keep it thin — DOM interaction only.
disconnect() must undo what connect() createsimport { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = ["output"]
static values = { url: String }
connect() { /* setup */ }
disconnect() { /* cleanup timers, observers, listeners */ }
handleClick(event) {
event.preventDefault()
Turbo.visit(this.urlValue) // Prefer Turbo over fetch
}
}
static targets and static values at topconnect() for setup, disconnect() for cleanuphandle* (e.g., handleClick)# prefix// WRONG - manual fetch
async load() {
const html = await fetch(this.urlValue).then(r => r.text())
this.outputTarget.innerHTML = html
}
// RIGHT - let Turbo handle it
handleClick() { Turbo.visit(this.urlValue) }
Or use lazy Turbo frames: <%= turbo_frame_tag "content", src: path, loading: :lazy %>
| Do | Don't |
|---|---|
| DOM manipulation only | Business logic in JS |
| Turbo for updates | Fetch + manual DOM |
static targets/values | Query selectors |
disconnect() cleanup | Memory leaks |
handle* naming | Inconsistent names |
disconnect()Remember: Turbo first. Stimulus only for what HTML can't express.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
23 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./diagnosing-superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness./dispatching-parallel-agentsUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesnpx claudepluginhub fryga-io/superpowers-rails --plugin superpowers-railsOther plugins' skills for the same job