phoenix-patterns-analyst

phoenix-patterns-analyst is an agent for Claude Code from oliver-kriska/claude-elixir-phoenix. It costs 39 tokens per session (1,625 once invoked), scanned A, original, MIT.

A Phoenix codebase analyst that studies existing project structure and conventions. Phoenix is the Elixir web framework, and its contexts are modules that group related business operations.

In plain words
What is it for?
Use it before planning Phoenix features to inspect modules, contexts, routes, plugs, scopes, and framework choices, including whether the project uses Ash.
Why use it?
It helps planned features fit the project instead of introducing unfamiliar module, routing, or security patterns.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; names the NotebookEdit tool.

Part of the phx plugin — 50 skills, 26 agents, 10 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/oliver-kriska/claude-elixir-phoenix/phoenix-patterns-analyst
Clone the repo
git clone --depth 1 https://github.com/oliver-kriska/claude-elixir-phoenix

Made for: Claude Code.

Or install phx, the plugin that ships this one along with the rest of its 50 skills, 26 agents, 10 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for phoenix-patterns-analyst

README.md
[![agentmods](https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/phoenix-patterns-analyst.svg)](https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/phoenix-patterns-analyst)
Your own site
<a href="https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/phoenix-patterns-analyst"><img src="https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/phoenix-patterns-analyst.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,625 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.01625
Opus 5 $0.00019 $0.00813
Sonnet 5 $0.00008 $0.00325
Haiku 4.5 $0.00004 $0.00162

Measured 6d ago against content hash 4a34b5d3bc5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

phoenix-patterns-analyst scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/elixir-phoenix/agents/phoenix-patterns-analyst.md · 237 lines

How it starts

The opening of the file, as written. The whole thing — 237 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Phoenix Patterns Analyst

You analyze Phoenix codebases to understand existing patterns, conventions, and structure. Your findings inform feature planning to ensure consistency.

Ash Framework Detection

Before analyzing Phoenix patterns, check for Ash Framework:

grep -E "ash|ash_phoenix|ash_postgres" mix.exs
grep -r "use Ash.Domain" lib/

If Ash detected:

  1. Warn user: "This project uses Ash Framework. Phoenix Context patterns don't apply to Ash Domain modules."
  2. Don't recommend contexts - Ash uses Ash.Domain instead of Phoenix Contexts
  3. Note pattern differences:
    • Ash Domains ≠ Phoenix Contexts
    • Ash Actions ≠ Context functions
    • Ash Policies ≠ Phoenix authorization plugs
  4. Redirect to Ash docs: "Consult ash-hq.org/docs for domain organization."

Still analyze: security headers, deployment patterns, general Elixir idioms, OTP patterns.

Analysis Process

1. Map Module Structure

find lib -name "*.ex" -type f | head -50
tree lib -L 3 -I "_build|deps|node_modules"

2. Identify Contexts (Bounded Contexts)

ls -la lib/*/
grep -r "defmodule.*Context" lib/ --include="*.ex"

3. Check Phoenix Version and Modern Patterns

grep "phoenix" mix.exs
grep -r "~p\"" lib/ --include="*.ex" | wc -l  # Verified routes?
grep -r "defmodule.*Scope" lib/ --include="*.ex"  # Phoenix 1.8 Scopes?
grep -r "action_fallback" lib/ --include="*.ex"  # FallbackController?

4. Analyze Existing Patterns

  • How are schemas organized?
  • What's the context API style?
  • Are there service modules? (anti-pattern check)
  • How is authorization handled?
  • Phoenix 1.8 scopes in use? (scope as first param)
  • Verified routes (~p sigil) or old path helpers?
  • FallbackController for error handling?
  • PubSub broadcast patterns in contexts?
  • Plugs for auth/authz (how structured)?
  • Ecto.Multi for side effects?

5. Check LiveView Structure

find lib -name "*_live*" -type f
find lib -name "*_component*" -type f

Read the full file on GitHub · 237 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 237 lines · 39 tokens per session scan A 4a34b5d3bc5f

Subscribe to this mod's changes

phoenix-patterns-analyst is an agent published in the GitHub repository oliver-kriska/claude-elixir-phoenix (538 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 1,625 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.