What problem does it solve?
LiveView development often suffers from inconsistent patterns, missing lifecycle best practices, and subtle bugs that arise from mounting, rendering, and event handling in the wrong order. This Skill provides a vetted, opinionated set of rules and examples to standardize Phoenix LiveView code across projects.
Core Features & Use Cases
- A mandatory RULES section with 6-11 non-negotiable patterns that must be followed when writing LiveView modules, ensuring consistent use of @impl, assigned state, and error handling.
- Lifecycle clarity covering mount/3, handle_params/3, and two-phase rendering to prevent common static vs connected render mistakes.
- Event handling and info flow guidance for handle_event, handle_info, and safe navigation of PubSub and timers.
- PubSub and presence best practices to subscribe only when connected and to handle broadcasts safely.
- Performance and safety patterns like temporary assigns, avoiding heavy work in every phase, and proper component usage.
Quick Start
Read and apply the LiveView essentials before creating mount/handle_event handlers and templates to ensure correct lifecycle usage.