بنقرة واحدة
lv-inspect
Inspect LiveView state (assigns, components) via Phoenix.LiveView.Debug in project_eval
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Inspect LiveView state (assigns, components) via Phoenix.LiveView.Debug in project_eval
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Create or manage Architecture Decision Records (ADRs) in docs/decisions/
Use this skill working with Ash Framework or any of its extensions. Always consult this when making any domain changes, features or fixes.
Record a development session summary in the project devlog
Run E2E browser tests via Tidewave browser_eval against the running Phoenix dev server
Morning briefing — where we left off, what to work on today. Fast, compact report from canonical sources.
Manage plan lifecycle — list plans, mark completed/abandoned, move between directories
| name | lv-inspect |
| description | Inspect LiveView state (assigns, components) via Phoenix.LiveView.Debug in project_eval |
| argument-hint | [pid_tuple | 'list' | 'assigns' | 'assign:key' | 'components' | 'summary'] |
Inspect runtime state of LiveView processes using Phoenix.LiveView.Debug (Phoenix core) via project_eval.
No LiveDebugger dependency needed — these are built into Phoenix LiveView.
The current page's LiveView PID is in the <framework-details> context block.
Example: Main LiveView #phx-GKR3k4n7RrVOhbBh with PID #PID<0.1378068.0>
Extract the three numbers → pid(0, 1378068, 0) in project_eval.
PID changes on page reload/reconnect — always use the PID from current context.
/lv-inspect list — All active LiveViewsPhoenix.LiveView.Debug.list_liveviews()
|> Enum.map(fn lv -> %{pid: lv.pid, view: lv.view, topic: lv.topic} end)
/lv-inspect assigns — Assign key list{:ok, socket} = Phoenix.LiveView.Debug.socket(pid(0, PID2, 0))
keys = socket.assigns |> Map.keys() |> Enum.sort()
{length(keys), keys}
/lv-inspect assign:KEY — Specific assign value{:ok, socket} = Phoenix.LiveView.Debug.socket(pid(0, PID2, 0))
Map.get(socket.assigns, :KEY)
/lv-inspect assign:KEY1,KEY2 — Multiple assigns{:ok, socket} = Phoenix.LiveView.Debug.socket(pid(0, PID2, 0))
Map.take(socket.assigns, [:KEY1, :KEY2])
/lv-inspect components — LiveComponents in page{:ok, components} = Phoenix.LiveView.Debug.live_components(pid(0, PID2, 0))
Enum.map(components, fn c -> %{cid: c.cid, module: c.module, id: c.id} end)
/lv-inspect summary — Assigns overview (types + sizes, avoids context pollution){:ok, socket} = Phoenix.LiveView.Debug.socket(pid(0, PID2, 0))
socket.assigns
|> Map.drop([:__changed__, :flash])
|> Enum.map(fn {k, v} ->
summary = cond do
is_list(v) -> {:list, length(v)}
is_map(v) and Map.has_key?(v, :__struct__) -> {:struct, v.__struct__}
is_map(v) -> {:map, map_size(v)}
is_binary(v) and byte_size(v) > 100 -> {:string, byte_size(v)}
is_pid(v) -> {:pid, inspect(v)}
true -> v
end
{k, summary}
end)
|> Enum.sort_by(&elem(&1, 0))
<framework-details> contextpid(0, PID2, 0) with actual valuesproject_eval{:list, length(list)}{:map, Map.keys(map)}{:struct, mod, Map.keys(Map.from_struct(s))}All functions are from Phoenix.LiveView.Debug (Phoenix core, always available):
| Function | Returns |
|---|---|
list_liveviews() | [%{pid, view, topic, transport_pid}] |
socket(pid) | {:ok, %Phoenix.LiveView.Socket{}} or {:error, term} |
live_components(pid) | {:ok, [%{id, cid, module, assigns, private, children_cids}]} |
liveview_process?(pid) | boolean |
For lower-level OTP inspection (rarely needed):
:sys.get_state(pid) # Raw GenServer state
:erlang.process_info(pid) # Memory, message queue, stack
Process.info(pid, :messages) # Pending messages
socket/1 reads state directly from the LiveView process (real-time, most reliable)