Agent skill

Phoenix Auth Customization

by j-morgan6 in j-morgan6/elixir-phoenix-guide

A skill your agent uses when extending phx.gen.auth — adding registration fields, custom user attributes, extra migrations alongside generated auth, fixture updates.

MITAuto-check passedAI & LLM Engineering

Install Phoenix Auth Customization

skills CLI
$ npx skills add j-morgan6/elixir-phoenix-guide --skill phoenix-auth-customization -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install j-morgan6/elixir-phoenix-guide phoenix-auth-customization --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/j-morgan6/elixir-phoenix-guide.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/phoenix-auth-customization .claude/skills/phoenix-auth-customization && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
phoenix-auth-customization
GitHub stars
166
Token cost
~2k tokens
SKILL.md length
271 words
Files
1
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when extending phx.gen.auth — adding registration fields, custom user attributes, extra migrations alongside generated auth, fixture updates.

  • Works in 3 steps: Create a Separate Migration → Update the Schema → Update the Registration LiveView
  • Extending phx.gen.auth — adding registration fields
  • SKILL.md covers RULES — Follow these with no…, Running phx.gen.auth, Adding Custom Fields and Updating Test Fixtures, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Phoenix Auth Customization is an agent skill from j-morgan6/elixir-phoenix-guide. Use when extending phx.gen.auth — adding registration fields, custom user attributes, extra migrations alongside generated auth, fixture updates.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering LLM observability. The licence is MIT.

When your agent uses it

  • Extending phx.gen.auth — adding registration fields
  • Custom user attributes
  • Extra migrations alongside generated auth
  • Fixture updates

Example prompts

  • “/phoenix-auth-customization”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Create a Separate Migration
  2. Update the Schema
  3. Update the Registration LiveView

What it can do on your machine

Read from SKILL.md and the folder at commit cdfddac. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are elixir and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Phoenix Auth Customization loads about 2k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 271 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from j-morgan6/elixir-phoenix-guide at commit cdfddac, republished under its MIT licence (© j-morgan6). 271 words, ~1,963 tokens.

Download SKILL.mdSave it as .claude/skills/phoenix-auth-customization/SKILL.md (or your agent's skills folder).
name
phoenix-auth-customization
description
Use when extending phx.gen.auth — adding registration fields, custom user attributes, extra migrations alongside generated auth, fixture updates.
file_patterns
**/accounts.ex, **/accounts/*.ex, **/user.ex, **/user_registration_live.ex, **/user_live/registration.ex
auto_suggest
true

Phoenix Auth Customization

RULES — Follow these with no exceptions

  1. Never modify generated auth migrations — create separate migrations for custom fields; generated migrations are tested and correct
  2. Update registration_changeset to cast and validate new fields — don't create a separate changeset for initial registration
  3. Update test fixtures when adding required fields — missing fixture fields cause cryptic test failures across the entire test suite
  4. Confirm users in test fixtures for password-based auth — set confirmed_at: DateTime.utc_now(:second) or tests requiring authenticated users will fail
  5. Update both the registration form AND the save/2 handler — the form must send the field, and the handler must pass it to the context
  6. Use unique_constraint + database unique index for uniqueness — never validate uniqueness in application code alone

Running phx.gen.auth

Start with the generator, then extend. Never hand-roll auth.

bash
# Generate auth with LiveView (recommended)
mix phx.gen.auth Accounts User users

# This creates:
# - Migration: priv/repo/migrations/*_create_users_auth_tables.exs
# - Schema: lib/my_app/accounts/user.ex
# - Scope: lib/my_app/accounts/scope.ex
# - Context: lib/my_app/accounts.ex
# - LiveViews: lib/my_app_web/live/user_live/registration.ex, login.ex,
#              confirmation.ex, settings.ex
# - Controller: lib/my_app_web/controllers/user_session_controller.ex
# - Plugs: lib/my_app_web/user_auth.ex
# - Tests: test/my_app/accounts_test.exs, test/my_app_web/live/user_live/*_test.exs

Phoenix 1.8's phx.gen.auth defaults to magic-link (passwordless) auth — registration has no password field unless you pass options — and generates a MyApp.Accounts.Scope module consumed as @current_scope.


Adding Custom Fields

Step 1: Create a Separate Migration
bash
mix ecto.gen.migration add_username_to_users
elixir
defmodule MyApp.Repo.Migrations.AddUsernameToUsers do
  use Ecto.Migration

  def change do
    alter table(:users) do
      add :username, :string, null: false
    end

    create unique_index(:users, [:username])
  end
end
Step 2: Update the Schema
elixir
defmodule MyApp.Accounts.User do
  schema "users" do
    field :email, :string
    field :username, :string  # Add new field
    field :password, :string, virtual: true, redact: true
    field :hashed_password, :string, redact: true
    field :confirmed_at, :utc_datetime

    timestamps()
  end

  # Update registration_changeset to include username
  def registration_changeset(user, attrs, opts \\ []) do
    user
    |> cast(attrs, [:email, :username, :password])
    |> validate_required([:username])
    |> validate_username()
    |> validate_email(opts)
    |> validate_password(opts)
  end

  defp validate_username(changeset) do
    changeset
    |> validate_required([:username])
    |> validate_format(:username, ~r/^[a-zA-Z0-9_]+$/,
      message: "only letters, numbers, and underscores"
    )
    |> validate_length(:username, min: 3, max: 30)
    |> unsafe_validate_unique(:username, MyApp.Repo)
    |> unique_constraint(:username)
  end
end
Step 3: Update the Registration LiveView
elixir
# In lib/my_app_web/live/user_live/registration.ex — update the form
def render(assigns) do
  ~H"""
  <%!-- Phoenix 1.8 removed the old simple-form component; use <.form> --%>
  <.form for={@form} id="registration_form" phx-submit="save" phx-change="validate">
    <.input field={@form[:email]} type="email" label="Email" required />
    <.input field={@form[:username]} type="text" label="Username" required />
    <.input field={@form[:password]} type="password" label="Password" required />
    <:actions>
      <.button phx-disable-with="Creating account..." class="w-full">
        Create an account
      </.button>
    </:actions>
  </.form>
  """
end

# Update the save handler to pass username
def handle_event("save", %{"user" => user_params}, socket) do
  case Accounts.register_user(user_params) do
    {:ok, user} ->
      # ... existing logic
    {:error, %Ecto.Changeset{} = changeset} ->
      {:noreply, assign_form(socket, Map.put(changeset, :action, :validate))}
  end
end

Updating Test Fixtures

This is the most commonly missed step. Every test that creates a user will break if fixtures don't include new required fields.

elixir
defmodule MyApp.AccountsFixtures do
  def unique_user_email, do: "user#{System.unique_integer()}@example.com"
  def unique_user_username, do: "user#{System.unique_integer([:positive])}"

  def valid_user_attributes(attrs \\ %{}) do
    Enum.into(attrs, %{
      email: unique_user_email(),
      username: unique_user_username(),  # Add new required field
      password: "hello world!"
    })
  end

  def user_fixture(attrs \\ %{}) do
    {:ok, user} =
      attrs
      |> valid_user_attributes()
      |> MyApp.Accounts.register_user()

    # Confirm user for password-based auth
    {:ok, user} =
      user
      |> Ecto.Changeset.change(%{confirmed_at: DateTime.utc_now(:second)})
      |> MyApp.Repo.update()

    user
  end
end
Why Confirmation Matters

Without confirmed_at, the generated auth code treats the user as unconfirmed. Tests that log in users will silently fail or return unexpected redirects.

elixir
# Bad — user is unconfirmed, login tests may fail
def user_fixture(attrs \\ %{}) do
  {:ok, user} =
    attrs
    |> valid_user_attributes()
    |> MyApp.Accounts.register_user()

  user  # Missing confirmation!
end

# Good — user is confirmed and ready for auth tests
def user_fixture(attrs \\ %{}) do
  {:ok, user} =
    attrs
    |> valid_user_attributes()
    |> MyApp.Accounts.register_user()

  {:ok, user} =
    user
    |> Ecto.Changeset.change(%{confirmed_at: DateTime.utc_now(:second)})
    |> MyApp.Repo.update()

  user
end

Adding Profile Fields Later

For non-auth fields (bio, avatar, display name), create a separate profile_changeset:

elixir
# In user.ex
def profile_changeset(user, attrs) do
  user
  |> cast(attrs, [:bio, :display_name, :avatar_url])
  |> validate_length(:bio, max: 500)
  |> validate_length(:display_name, max: 50)
end

# In accounts.ex
def update_user_profile(user, attrs) do
  user
  |> User.profile_changeset(attrs)
  |> Repo.update()
end

Testing Auth Customization

elixir
describe "register_user/1" do
  test "requires username" do
    {:error, changeset} = Accounts.register_user(%{
      email: "test@example.com",
      password: "validpassword123"
    })

    assert "can't be blank" in errors_on(changeset).username
  end

  test "validates username format" do
    {:error, changeset} = Accounts.register_user(%{
      email: "test@example.com",
      username: "has spaces",
      password: "validpassword123"
    })

    assert "only letters, numbers, and underscores" in errors_on(changeset).username
  end

  test "enforces unique username" do
    %{username: username} = user_fixture()

    {:error, changeset} = Accounts.register_user(%{
      email: "other@example.com",
      username: username,
      password: "validpassword123"
    })

    assert "has already been taken" in errors_on(changeset).username
  end
end

See ecto-changeset-patterns skill for advanced changeset composition. See phoenix-liveview-auth skill for on_mount and auth redirect patterns. See testing-essentials skill for comprehensive testing patterns.

© j-morgan6, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/phoenix-auth-customization of j-morgan6/elixir-phoenix-guide.

Open the folder on GitHubat commit cdfddac

Compare with similar skills

Phoenix Auth Customization next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Phoenix Auth Customization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Phoenix Auth Customization this skillj-morgan6/elixir-phoenix-guide166—~2kAutomated safety check: PassMIT
Langfuse Codebase Navigatorlangfuse/langfuse36k—~1.4kAutomated safety check: PassCustom licence
LLM Trace Review Interfaceai-evals-course/evals-skills1.5k—~1.4kAutomated safety check: PassApache-2.0
Langfuse Integration Pagelangfuse/langfuse-docs246—~3.7kAutomated safety check: PassMIT
Langfuselangfuse/skills299—~2.1kAutomated safety check: NotesMIT
Livetablegurujada/live_table211—~1.9kAutomated safety check: PassMIT

Similar skills

  • Navigate Langfuse repositories, code areas, and agent skills.

    36k GitHub stars~1.4k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • LLM Trace Review Interface

    ai-evals-course/evals-skills

    Builds a browser-based annotation page for reviewing LLM traces one at a time with pass/fail labels, notes and saved results, tailored to your data.

    1.5k GitHub stars~1.4k tokensUpdated 14 days ago
    AI & LLM EngineeringAuto-check passed
  • Langfuse Integration Page

    langfuse/langfuse-docs

    Create a new Langfuse integration page in the langfuse-docs repo.

    246 GitHub stars~3.7k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Langfuse

    langfuse/skills

    Interact with Langfuse and access its documentation: tracing, monitoring, creating datasets, running experiments, and evaluating AI applications.

    299 GitHub stars~2.1k tokensUpdated 7 days ago
    AI & LLM EngineeringAuto-check: notes
  • Livetable

    gurujada/live_table

    A skill your agent uses when building, modifying, or reviewing Phoenix LiveView tables with LiveTable, including schema-backed tables, context-owned data providers, joined queries, filters…

    211 GitHub stars~1.9k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Langsmith Online Eval Engineering

    langchain-ai/langsmith-skills

    Official

    Design, test, create, and attach LangSmith online evaluators for production traces or conversation threads.

    159 GitHub stars~1.4k tokensUpdated 6 days ago
    AI & LLM EngineeringAuto-check passed

More from j-morgan6/elixir-phoenix-guide

All 19 skills in this repo
  • Code Quality

    j-morgan6/elixir-phoenix-guide

    A skill your agent uses when refactoring for duplication, complexity, or dead code — includes the plugin's on-demand analysis scripts.

    166 GitHub stars~1.4k tokensUpdated 3 mo ago
    Auto-check passed
  • Deployment Gotchas

    j-morgan6/elixir-phoenix-guide

    A skill your agent uses when preparing releases or deployment config — runtime.exs vs compile-time config, release migrations, PHXHOST/PHXSERVER, assets, health checks.

    166 GitHub stars~2.6k tokensUpdated 3 mo ago
    Auto-check passed
  • Ecto Changeset Patterns

    j-morgan6/elixir-phoenix-guide

    A skill your agent uses when a resource needs multiple changesets (registration vs update), conditional validation, field transforms, or uniqueness validation — changeset composition.

    166 GitHub stars~2.1k tokensUpdated 3 mo ago
    Auto-check passed
  • Ecto Essentials

    j-morgan6/elixir-phoenix-guide

    A skill your agent uses when defining schemas, writing queries, or creating migrations — schema design, Repo usage, indexes, query composition.

    166 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Ecto Nested Associations

    j-morgan6/elixir-phoenix-guide

    A skill your agent uses when a form or operation manages parent and child records together — castassoc/castembed, onreplace, Ecto.Multi across tables, FK cascade design.

    166 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed
  • Elixir Essentials

    j-morgan6/elixir-phoenix-guide

    A skill your agent uses when writing or refactoring core Elixir — pattern matching, case/cond/with, pipes, {:ok, }/{:error, } contracts.

    166 GitHub stars~2.2k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Phoenix Auth Customization

What does Phoenix Auth Customization do?

A skill your agent uses when extending phx.gen.auth — adding registration fields, custom user attributes, extra migrations alongside generated auth, fixture updates. Phoenix Auth Customization is an agent skill from j-morgan6/elixir-phoenix-guide.auth — adding registration fields, custom user attributes, extra migrations alongside generated auth, fixture updates.

When should I use Phoenix Auth Customization?

Phoenix Auth Customization fits situations like: extending phx.gen.auth — adding registration fields; custom user attributes; extra migrations alongside generated auth; fixture updates.

How do I install Phoenix Auth Customization in Claude Code?

Run `npx skills add j-morgan6/elixir-phoenix-guide --skill phoenix-auth-customization -a claude-code`. Or copy the skill folder (skills/phoenix-auth-customization in j-morgan6/elixir-phoenix-guide) into .claude/skills/phoenix-auth-customization in your project. Claude Code loads it when a task matches its description.

How do I install Phoenix Auth Customization in Codex?

Run `npx skills add j-morgan6/elixir-phoenix-guide --skill phoenix-auth-customization -a codex`. Or copy the skill folder (skills/phoenix-auth-customization in j-morgan6/elixir-phoenix-guide) into .agents/skills/phoenix-auth-customization in your project. Codex loads it when a task matches its description.

Can I use Phoenix Auth Customization in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add j-morgan6/elixir-phoenix-guide --skill phoenix-auth-customization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/phoenix-auth-customization, .gemini/skills/phoenix-auth-customization, .github/skills/phoenix-auth-customization and .opencode/skills/phoenix-auth-customization in your project.

What does Phoenix Auth Customization need to run?

SKILL.md names no scripts, command-line tools or credentials: Phoenix Auth Customization is instructions for the agent only.

Does Phoenix Auth Customization access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Phoenix Auth Customization safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Phoenix Auth Customization use?

Phoenix Auth Customization is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Phoenix Auth Customization use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Phoenix Auth Customization?

Skills that share tags, products or a category with Phoenix Auth Customization: Langfuse Codebase Navigator (langfuse/langfuse, 36k stars), LLM Trace Review Interface (ai-evals-course/evals-skills, 1.5k stars), Langfuse Integration Page (langfuse/langfuse-docs, 246 stars) and Langfuse (langfuse/skills, 299 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Phoenix Auth Customization?

j-morgan6 (a GitHub user) maintains it in j-morgan6/elixir-phoenix-guide, which has 166 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on July 6, 2026.

Source: j-morgan6/elixir-phoenix-guide on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.