一键导入
e11y-debug
Use when debugging LiveView issues - timeline analysis shows state at each event, snapshots show rendered HTML, analyzers suggest root causes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when debugging LiveView issues - timeline analysis shows state at each event, snapshots show rendered HTML, analyzers suggest root causes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Reference guide for fixing axe-core/WCAG errors in Phoenix LiveView - maps common violations to Phoenix-specific fixes
Use when implementing Phoenix LiveView features - TDD with html_snapshot for state inspection and axe-core for accessibility. Sprinkle snapshots to see what's rendered, delete when done.
基于 SOC 职业分类
| name | e11y-debug |
| description | Use when debugging LiveView issues - timeline analysis shows state at each event, snapshots show rendered HTML, analyzers suggest root causes |
Debug LiveView issues by inspecting state evolution and rendered HTML.
Add temporary html_snapshot(view) calls around the problem area:
test "debugging problematic feature" do
{:ok, view, _html} = live(conn, "/page")
html_snapshot(view) # before the problem
view |> element("button") |> render_click()
html_snapshot(view) # after - what changed?
end
Run with telemetry capture:
mix excessibility.debug test/failing_test.exs
Read test/excessibility/timeline.json:
{
"test": "test debugging problematic feature",
"duration_ms": 142,
"timeline": [
{
"sequence": 1,
"event": "mount",
"timestamp": "2024-01-15T10:30:00Z",
"memory_size": 1024,
"key_state": {"user": null, "items": []},
"changes": {}
},
{
"sequence": 2,
"event": "handle_event:click",
"timestamp": "2024-01-15T10:30:00.050Z",
"memory_size": 4096,
"key_state": {"user": null, "items": ["a", "b", "c"]},
"changes": {"items": "changed"}
}
]
}
Look for:
Read captured HTML files in test/excessibility/html_snapshots/:
# List all snapshots
ls test/excessibility/html_snapshots/
# Open in browser
open test/excessibility/html_snapshots/MyModule_42.html
Check for:
mix excessibility# Basic debug run
mix excessibility.debug test/my_test.exs
# With specific analyzers
mix excessibility.debug test/my_test.exs --analyze=memory,hypothesis
# Verbose output (detailed stats)
mix excessibility.debug test/my_test.exs --verbose
# Full assigns (no filtering)
mix excessibility.debug test/my_test.exs --full
# Highlight specific assigns
mix excessibility.debug test/my_test.exs --highlight=user,cart,items
| Analyzer | What it finds |
|---|---|
memory | Memory bloat, leaks (default, enabled) |
hypothesis | Suggested root causes |
code_pointer | Source locations for issues |
accessibility_correlation | State changes affecting a11y |
For axe-core/WCAG issues specifically:
mix excessibility.debug test/file.exs --analyze=accessibility_correlation
This correlates:
{
"sequence": 5,
"event": "handle_event:load_more",
"memory_size": 102400, // 100KB - growing!
"key_state": {"items": "[1000 items]"}
}
Red flag: Memory growing across events suggests unbounded list accumulation.
{
"changes": {
"user": "changed", // user assign was modified
"form": "added", // new assign appeared
"error_message": "removed" // assign was deleted
}
}
Normal flow: mount → handle_params → handle_event:* → render
Suspicious patterns:
render events without handle_event (component re-rendering)handle_event without state change (noop handlers)handle_params after navigationchanges - is the assign modified?# Problem: No change in timeline
def handle_event("click", _params, socket) do
# Forgot to assign!
{:noreply, socket}
end
# Fix: Assign the change
def handle_event("click", _params, socket) do
{:noreply, assign(socket, :clicked, true)}
end
--analyze=memorymemory_size across events--highlight=suspects to focus on likely culpritsThis skill works well with: