--- name: semantics-frontend description: Core protocol for Svelte 5 (Runes) Components, UX State Machines, and Visual-Interactive Validation. --- # [DEF:Std:Semantics:Frontend] # @COMPLEXITY: 5 # @PURPOSE: Canonical GRACE-Poly protocol for Svelte 5 (Runes) Components, UX State Machines, and Project UI Architecture. # @RELATION: DEPENDS_ON ->[Std:Semantics:Core] # @INVARIANT: Frontend components MUST be verifiable by an automated GUI Judge Agent (e.g., Playwright). # @INVARIANT: Use Tailwind CSS exclusively. Native `fetch` is forbidden. ## 0. SVELTE 5 PARADIGM & UX PHILOSOPHY - **STRICT RUNES ONLY:** You MUST use Svelte 5 Runes for reactivity: `$state()`, `$derived()`, `$effect()`, `$props()`, `$bindable()`. - **FORBIDDEN SYNTAX:** Do NOT use `export let`, `on:event` (use `onclick`), or the legacy `$:` reactivity. - **UX AS A STATE MACHINE:** Every component is a Finite State Machine (FSM). You MUST declare its visual states in the contract BEFORE writing implementation. - **RESOURCE-CENTRIC:** Navigation and actions revolve around Resources. Every action MUST be traceable. ## I. PROJECT ARCHITECTURAL INVARIANTS You are bound by strict repository-level design rules. Violating these causes instant PR rejection. 1. **Styling:** Tailwind CSS utility classes are MANDATORY. Minimize scoped `