Agent skill
liveview-lifecycle
Stars
0
Forks
1
Install this agent skill to your Project
npx add-skill https://github.com/layeddie/ai-rules/tree/main/tools/claude/skills/liveview-lifecycle
SKILL.md
Skill: liveview-lifecycle
INVOKE BEFORE creating or changing LiveView modules, components, or uploads.
Use when
- Working in
lib/*_web/live/orlib/*_web/components/. - Handling events, params, or uploads.
Checklist
- Mount: guard for connected?; load minimal assigns; defer heavy loads to
handle_params. - Handle params: use pattern matching on params; push_patch for navigation.
- Events: validate input; throttle noisy events; use PubSub for cross-process updates.
- Assigns: always use
assign/3orstream_insert; avoid direct map updates. - Uploads: configure
allow_uploadwith size limits; useconsume_uploaded_entries. - Navigation: prefer
push_navigatefor live redirects;redirectonly when leaving LV.
Gotchas
- Avoid Repo calls in render/handle_info without rate-limiting.
- Ensure components use
attr :id, :stringwhere needed. - Include
static_paths/0entries for assets referenced in hooks.
Didn't find tool you were looking for?