mcpField
H
hwc-stimulus-fundamentals

hwc-stimulus-fundamentals

github.com/thehotwireclubDevelopment152253 installsUpdated 3w ago
Repository

About hwc-stimulus-fundamentals

A skill for building Stimulus controllers with clear lifecycle and state boundaries. It offers implementation guidance, guardrails, and selective reference material for developers working with Hotwire.

Key features

  1. 01Define controller contracts
  2. 02Manage reactive state with value callbacks
  3. 03Structure setup and teardown
  4. 04Use outlets for controller communication
  5. 05Consult focused Stimulus references

Use cases

  1. 01Designing a new Stimulus controller
  2. 02Handling repeated connect and disconnect cycles
  3. 03Coordinating behavior across controllers

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/thehotwireclub/hotwire_club-skills --skill hwc-stimulus-fundamentals

After installing, type/hwc-stimulus-fundamentalsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
references/
2023-08-29-stimulus-value-changed-callbacks.md
2023-10-24-stimulus-keyboardevent-101.md
2023-12-05-stimulus-auto-sorting.md
2023-12-19-stimulus-outlets-api.md
2024-05-07-stimulus-target-callbacks.md
2024-06-18-fundamentals-core-web-vitals.md
2025-11-25-stimulus-web-share-api.md
2026-07-22-stimulus-promise-returning-outlet-methods.md
INDEX.md

Details

From the project README

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.

Load References Selectively

Open only the file needed for the current request.

  • Value changed callbacks: references/2023-08-29-stimulus-value-changed-callbacks.md
  • Keyboard action filters and hotkeys: references/2023-10-24-stimulus-keyboardevent-101.md
  • MutationObserver-based sorting: references/2023-12-05-stimulus-auto-sorting.md
  • Outlets API communication: references/2023-12-19-stimulus-outlets-api.md
  • Target callback orchestration: references/2024-05-07-stimulus-target-callbacks.md
  • Web Share API integration: references/2025-11-25-stimulus-web-share-api.md
  • Core Web Vitals and lazy-loading fundamentals: references/2024-06-18-fundamentals-core-web-vitals.md
  • Promise-returning outlet methods (await-able controller APIs): references/2026-07-22-stimulus-promise-returning-outlet-methods.md

Use references/INDEX.md for the full catalog.

Escalate to Neighbor Skills

  • Form-centric behavior: use hwc-forms-validation
  • Navigation/history/cache with Turbo: use hwc-navigation-content
  • Turbo Stream/WebSocket orchestration: use hwc-realtime-streaming
  • Media integrations and playback concerns: use hwc-media-content
  • UX feedback/transitions/progress concerns: use hwc-ux-feedback

Comments

Markdown supported