SKILL.md
Scope
Use this skill when adding new pages, flows, or interactions in LiveView.
Checklist
- Create a LiveView under
lib/web/liveand pick the correct layout macro:
- use Web, :liveviewapplayout (authenticated app pages) - use Web, :liveviewnarrowlayout (narrow forms/settings) - use Web, :liveviewmarketing_layout (public/marketing)
- Keep render templates focused on page content; layout handles nav + flash (
<.flash_group>stays inWeb.Layouts). - Add routes in
lib/web/router.exunder the properlivesessionandscope, usingonmountfromWeb.UserAuth. - Use
~pfor routes and<.link navigate>/<.link patch>withpushnavigate/pushpatch. - Forms: build changesets or params, assign with
to_form, use<.form id="...">and<.input field={@form[:field]}>. - Lists: use LiveView streams with
phx-update="stream"and@streams. - Add LiveView tests in
test/sartask_web/liveusingPhoenix.LiveViewTest, targeting the element IDs you added.