phoenix-authentication
Skill4 starsChanged 4 months agoMITView on GitHub
Use when adding or changing Phoenix authentication, phx.gen.auth integration, LiveView session identity, or migration between current_user and Phoenix 1.8 Scope.
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-authorization-patternsSkill
- phoenix-channels-essentialsSkill
- phoenix-json-apiSkill
- phoenix-liveview-essentialsSkill
- 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
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
Follow the generated authentication code and Phoenix version in the project.
- Distinctive: line 22
Keep password/session verification in the generated auth boundary.
- Distinctive: line 24
Test unauthenticated redirect, valid session, invalid session, registration validation, and the changed flow.
- Very specific: line 26
Keep authorization rules in policies or phoenix-authorization-patterns.
≈ “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 Authentication
Follow the generated authentication code and Phoenix version in the project. Keep authentication (who is signed in) separate from authorization (what that identity may do).
Version path
- Phoenix 1.7 projects commonly store
user_tokenin the session and derivecurrent_userfor request and LiveView assigns. Preserve this token-to-assign flow unless the task migrates it. - Phoenix 1.8 projects may use a
Scopestruct. Follow the project's generatedcurrent_scopeplumbing; do not mix both models in one request path without a migration plan. - Confirm generator output and APIs against
mix.lockand the checked-out source.
Change flow
- Trace router pipelines, session plugs,
on_mount, generated user schema, and existing tests. - Keep password/session verification in the generated auth boundary. Add custom registration fields through a separate migration and explicit changeset allowlists.
- Derive LiveView identity from the verified session. Never trust a client-supplied user ID or socket param as identity.
- Test unauthenticated redirect, valid session, invalid session, registration validation, and the changed flow.
Keep authorization rules in policies or phoenix-authorization-patterns. Authentication changes require focused tests; schema or session changes need an explicit migration/compatibility checkpoint when they affect existing users.
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.

