phoenix-liveview-essentials
Skill4 starsChanged 4 months agoMITView on GitHub
Use when building or changing a Phoenix LiveView, event handler, form, navigation flow, or LiveView test.
In this repository34 other files it gives its agents.
- AGENTS.mdAGENTS.md
- apply-phoenix-controller-conventionsSkill
- ash-frameworkSkill
- benchee-profilingSkill
- broadway-data-pipelinesSkill
- cachex-cachingSkill
- code-qualitySkill
- code-reviewSkill
- deployment-gotchasSkill
- ecto-changeset-patternsSkill
- ecto-essentialsSkill
- ecto-migrationSkill
- ecto-nested-associationsSkill
- elixir-essentialsSkill
- gettext-i18nSkill
- liveview-streamsSkill
- mix-tasks-generatorsSkill
- oban-essentialsSkill
- otp-essentialsSkill
- phoenix-authenticationSkill
- phoenix-authorization-patternsSkill
- phoenix-channels-essentialsSkill
- phoenix-json-apiSkill
- phoenix-pubsub-patternsSkill
- phoenix-uploadsSkill
- property-based-testingSkill
- refactor-codeSkill
- req-http-clientSkill
- respond-to-reviewSkill
- security-essentialsSkill
- swoosh-emailsSkill
- telemetry-essentialsSkill
- testing-essentialsSkill
- typespec-dialyzerSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Keep the LiveView as the UI edge.
- Very specific: line 16
Put route-dependent loading in handle_params/3.
- Distinctive: line 17
Keep assigns limited to data needed by the render.
- Distinctive: line 22
Treat all event params as untrusted strings/maps.
- Distinctive: line 25
Use tagged results to render expected failures.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Phoenix LiveView Essentials
Keep the LiveView as the UI edge. Parse events and params, call domain/context functions, then assign results or show errors. Keep business rules out of callbacks.
Lifecycle and data
mount/3may run for the disconnected HTTP render and again for the connected socket. Keep it safe to repeat; subscribe or start live work only whenconnected?/1is true.- Put route-dependent loading in
handle_params/3. Usepush_patchfor same-LiveView state andpush_navigatefor a new LiveView. - Keep assigns limited to data needed by the render. Use streams for large or frequently updated collections.
- Load records through the application's authorization boundary; a guessed ID is not proof of access.
Events and forms
- Treat all event params as untrusted strings/maps. Validate with a changeset or domain parser before writing.
handle_event/3should coordinate work and update the socket. Move multi-step rules into a context or pure module.- For forms, use
to_form/1and the project's current form conventions. Preserve changeset errors and keep validation behavior in the changeset. - Use tagged results to render expected failures. Let unexpected failures surface to normal error reporting.
Tests
Cover initial render, relevant events, invalid input, authorization, and navigation that changes behavior. Use Phoenix.LiveViewTest and the existing ConnCase/DataCase setup. Avoid duplicating assertions already covered by component or context tests.
For large lists use liveview-streams; for auth flows use phoenix-authentication and phoenix-authorization-patterns.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

