Phoenix Patterns Analyst
Analyzes codebase for existing Phoenix patterns, contexts, module structure, scopes, plugs, and routing. Use proactively when planning features to understand current conventions.
- Type
- Subagent
- Repository
- oliver-kriska/claude-elixir-phoenix
- GitHub stars
- 556
- License
- MIT
- Repo last updated
- Sep 25, 2026
- Model
- sonnet
What Phoenix Patterns Analyst is
Phoenix Patterns Analyst is a subagent published in the oliver-kriska/claude-elixir-phoenix repository on GitHub, which has about 556 stars. The repository describes itself as: “Claude Code plugin for Elixir/Phoenix/LiveView — 26 specialist agents, Iron Laws enforcement, and Tidewave MCP integration. Plan features with parallel research agents, execute with automatic verification, review with 4-agent parallel audits, and capture learnings as reusable knowledge.”
A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.
Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Phoenix Patterns Analyst and get back a compact result.
It is set up to use these tools: Read, Write, Grep, Glob, Bash. Limiting tools is a good sign: the subagent can only do what those tools allow.
How to install Phoenix Patterns Analyst
Claude Code
- Download phoenix-patterns-analyst.md from the repository.
- Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
- Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Claude Cowork
- Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
- Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/elixir-phoenix/agents/phoenix-patterns-analyst.md, shared under the repository's MIT license. Read the full file on GitHub.
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:
- Warn user: "This project uses Ash Framework. Phoenix Context patterns don't apply to Ash Domain modules."
- Don't recommend contexts - Ash uses Ash.Domain instead of Phoenix Contexts
- Note pattern differences:
- Ash Domains ≠ Phoenix Contexts
- Ash Actions ≠ Context functions
- Ash Policies ≠ Phoenix authorization plugs
- 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 fWhat to Document
Write findings to the path specified in the orchestrator's prompt (typically .claude/plans/{slug}/research/codebase-patterns.md):
# Codebase Analysis
## Project Structure
- **Web module**: `{AppName}Web`
- **Business logic**: `{AppName}.{Context}`
- **Naming convention**: {snake_case/PascalCase patterns}
## Phoenix Version & Modern Patterns
- **Phoenix version**: {1.7/1.8+}
- **Scopes**: {yes/no, how implemented}
- **Verified routes**: {~p sigil or path helpers}
- **FallbackController**: {yes/no}
- **PubSub in contexts**: {yes/no, pattern used}
## Contexts Identified
…Example from codebase showing how contexts expose functions
Note: Does it use scopes? Does it broadcast via PubSub?
### Plug Patterns
- **Authentication**: {plug pattern, where defined}
- **Authorization**: {resource-level/action-level}
- **Scope fetching**: {API token/session}
### Schema Patterns
- Timestamps: {utc_datetime_usec/naive_datetime}
- Soft deletes: {yes/no, how}
- Associations: {preload style}
- Primary keys: {:binary_id/:id}
### LiveView Patterns
- Mount pattern: {assigns style, async usage}
- Event handling: {handle_event patterns}
…Red Flags to Report
Rails/Non-Elixir Patterns
- Service objects (lib/*/services/)
- Repository pattern (lib/*/repositories/)
- Concerns (lib/*/concerns/)
- Decorators (lib/*/decorators/)
- Presenters (lib/*/presenters/)
- Interactors/Commands (lib//interactors/, lib//commands/)
Phoenix Anti-patterns
- Direct Repo calls in controllers/LiveViews
- Schema callbacks with side effects (prepare_changes with emails, etc.)
- Missing scopes (Phoenix 1.8+)
- Path helpers instead of ~p sigil (Phoenix 1.7+)
- God contexts (> 400 lines)
- Business logic in controllers/LiveViews
- Reaching across context boundaries (querying other schemas)
Security Issues
- Missing scope filtering on queries
- No authorization plugs
- Unauthenticated API endpoints
- No CSRF protection
Memory
Consult your memory before analyzing to skip redundant discovery. After analysis, save stable findings:
- Project structure and context boundaries (rarely change)
- Phoenix version and key framework patterns in use
- Testing conventions (factory style, async patterns)
- Anti-patterns already reported (avoid re-flagging)
Only update when you discover something NEW. Don't re-save unchanged info.
Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Phoenix Patterns Analyst?
Phoenix Patterns Analyst is a subagent for Claude Code and Claude Cowork from the oliver-kriska/claude-elixir-phoenix repository on GitHub. Analyzes codebase for existing Phoenix patterns, contexts, module structure, scopes, plugs, and routing. Use proactively when planning features to understand current conventions.
How do I install Phoenix Patterns Analyst in Claude Code?
Download phoenix-patterns-analyst.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.
Can I use Phoenix Patterns Analyst in Claude Cowork?
Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.
Is Phoenix Patterns Analyst safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Verification Runner Run project-aware verification loop. Reads mix.exs to discover tools (credo, dialyzer, sobelow, ex_check), test commands, and custom aliases. Use proactively after code changes. Subagent · oliver-kriska/claude-elixir-phoenix
- Workflow Orchestrator Orchestrates the full agentic workflow cycle (plan → work → review). Internal use by /phx:full command. Subagent · oliver-kriska/claude-elixir-phoenix
- Requirements Verifier Cross-check implementation against task requirements (Linear issue, GitHub issue, plan, spec). Use proactively during /phx:review when a task ID or plan file is detected. Subagent · oliver-kriska/claude-elixir-phoenix
- Xref Analyzer Analyze module dependencies and context boundaries using mix xref. Use proactively before major refactors or when reviewing architectural changes. Subagent · oliver-kriska/claude-elixir-phoenix
- Planning Orchestrator Fans out and compresses parallel Elixir/Phoenix planning research (codebase patterns, libraries, schema/OTP/LiveView design) into one digest. Use when /phx:plan needs 3+ research agents; returns findings only, never plans or asks the user. Subagent · oliver-kriska/claude-elixir-phoenix
- Parallel Reviewer Parallel code review using 4 specialist agents (elixir-reviewer, security-analyzer, testing-reviewer, verification-runner). Use for thorough review of significant changes. Subagent · oliver-kriska/claude-elixir-phoenix
- Otp Advisor OTP patterns specialist - GenServer, Supervisor, Agent, Task, Registry, ETS. Use proactively when deciding if you need OTP abstractions or simpler solutions. Subagent · oliver-kriska/claude-elixir-phoenix
- Security Analyzer Security audit specialist for Elixir/Phoenix - authentication, authorization, input validation, OWASP vulnerabilities. Use proactively when implementing auth or handling user input. Subagent · oliver-kriska/claude-elixir-phoenix