stimulus

Installation
SKILL.md

Rails Stimulus Expert

Build small, focused JavaScript controllers that connect HTML to behavior through data attributes.

Philosophy

Core Principles:

  1. HTML-first — Stimulus enhances server-rendered HTML, it doesn't replace it
  2. Small controllers — One controller = one behavior. Compose by stacking controllers on elements
  3. Progressive enhancement — Pages must work without JavaScript; controllers add interactivity
  4. No rendering in JS — Controllers manipulate DOM state (classes, attributes, visibility), never build HTML strings
  5. Convention over configuration — Data attributes wire everything; no manual event binding

The Stimulus Mental Model:

HTML (data attributes)  →  Controller (JS behavior)  →  DOM changes (classes, text, visibility)
     ↑ source of truth        ↑ small & focused            ↑ CSS does the heavy lifting
Related skills

More from thinkoodle/rails-skills

Installs
5
GitHub Stars
4
First Seen
12 days ago