phoenix-liveview
Installation
SKILL.md
Phoenix LiveView Patterns
LiveView Lifecycle
A LiveView goes through two phases:
- Static Mount: Initial HTTP request (connected?: false)
- Connected Mount: WebSocket upgrade (connected?: true)
def mount(_params, _session, socket) do
if connected?(socket) do
# Subscribe to topics, start timers, etc.
Phoenix.PubSub.subscribe(MyApp.PubSub, "topic")
end
{:ok, assign(socket, :data, [])}
end
Related skills
More from j-morgan6/elixir-claude-optimization
phoenix-uploads
MANDATORY for file upload features. Invoke before implementing upload or file serving functionality.
14elixir-essentials
MANDATORY for ALL Elixir code changes. Invoke before writing any .ex or .exs file.
14phoenix-liveview-essentials
MANDATORY for ALL LiveView work. Invoke before writing LiveView modules or .heex templates.
10elixir-patterns
INVOKE BEFORE writing any Elixir code. REQUIRED for pattern matching, pipe operators, with statements, guards, list comprehensions, and naming conventions. Use this skill to ensure idiomatic Elixir patterns.
6testing-essentials
MANDATORY for ALL test files. Invoke before writing any _test.exs file.
6ecto-essentials
MANDATORY for ALL database work. Invoke before modifying schemas, queries, or migrations.
5