skills/smithery.ai/state-safety-action-creator-guard

state-safety-action-creator-guard

Installation
SKILL.md

State Safety & Action Creator Guard

Ensure global state remains consistent, immutable, and valid.

Workflow

  1. Use Action Creators

    • Rule: Never dispatch raw objects (dispatch({ type: 'FOO' })).
    • Fix: Import from src/context/actionCreators.js.
    • Cross-check: Verify reducer handling in gameReducer.js.
    • Why: Centralizes logic and ensures payload shape.
  2. Enforce Invariants

    • Money: Must be >= 0.
    • Harmony: Must be > 0 (or triggers Game Over).
    • Inventory: Items must be unique IDs.
Installs
1
First Seen
Apr 29, 2026