hwc-stimulus-fundamentals

Installation
SKILL.md

Stimulus Fundamentals

Implement robust Stimulus controllers with clear lifecycle and state boundaries.

Core Workflow

  1. Define controller contract first: targets, values, outlets, actions, and expected lifecycle.
  2. Keep state transitions in value callbacks when reactive updates are required.
  3. Guard callbacks that can run before connect() completes.
  4. Use connect()/disconnect() for setup and teardown symmetry.
  5. Isolate DOM event handling from business rules; keep controllers composable.

Guardrails

  • Prefer declarative action parameters over manual dataset parsing.
  • Use outlets for controller-to-controller communication instead of private internals.
  • Keep target callbacks idempotent; account for repeated connect/disconnect cycles.
  • Use MutationObserver only when DOM-driven reactivity is required.
  • Feature-detect browser APIs before exposing UI affordances.
Related skills
Installs
136
GitHub Stars
118
First Seen
Feb 13, 2026