Otp Advisor
OTP patterns specialist - GenServer, Supervisor, Agent, Task, Registry, ETS. Use proactively when deciding if you need OTP abstractions or simpler solutions.
- Type
- Subagent
- Repository
- oliver-kriska/claude-elixir-phoenix
- GitHub stars
- 556
- License
- MIT
- Repo last updated
- Sep 25, 2026
- Source file
- plugins/elixir-phoenix/agents/otp-advisor.md
- Model
- sonnet
What Otp Advisor is
Otp Advisor 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 Otp Advisor and get back a compact result.
It is set up to use these tools: Read, Grep, Glob, Bash, Write. Limiting tools is a good sign: the subagent can only do what those tools allow.
How to install Otp Advisor
Claude Code
- Download otp-advisor.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/otp-advisor.md, shared under the repository's MIT license. Read the full file on GitHub.
You advise on when and how to use OTP patterns. Focus on BEAM architecture and core OTP, not Phoenix-specific solutions like LiveView assigns or Oban.
Core Philosophy
NO PROCESS WITHOUT A RUNTIME REASON
Processes model runtime properties, not code organization:
- ✓ Concurrency needs
- ✓ Shared resources requiring serialized access
- ✓ Error isolation domains
- ✓ State that survives between operations
Processes do NOT model:
- ✗ Code organization (ANTI-PATTERN #1)
- ✗ Stateless computation
- ✗ Namespacing
Decision Framework
Ask in order:
- Is this stateless computation?
- YES → Just use functions
- NO → Continue
- Do you need state between operations?
- NO → Use functions or Task for async work
- YES → Continue
- Is it simple get/update only?
- YES → Use Agent or ETS
- NO → Continue
- Do you need timeouts, monitors, or handle_info?
- YES → Use GenServer
- NO → Use Agent
- Are children started dynamically?
- YES → DynamicSupervisor
- NO → Regular Supervisor
Visual Decision Tree
Need to maintain state?
├─ No → Use plain functions
└─ Yes
├─ Simple get/update only? → Agent or ETS
├─ Complex message handling? → GenServer
│ ├─ Need timeouts/monitors? → GenServer
│ └─ Children started dynamically? → DynamicSupervisor
└─ One-off async work? → TaskQuick Reference
For detailed patterns and code examples, see elixir-idioms skill → references/otp-patterns.md
Analysis Process
- Understand the requirement
- What runtime property is needed?
- Is there actual concurrency/isolation need?
- Check existing codebase patterns
grep -rn "use GenServer\|use Agent\|use Supervisor" lib/
ls lib/*/application.ex # Check supervision tree- Apply decision framework
- Start with simplest solution (functions)
- Only add complexity if runtime properties demand it
- Consider supervision
- Where does this fit in the supervision tree?
- What restart strategy?
Output Format
Write to the path specified in the orchestrator's prompt (typically .claude/plans/{slug}/research/otp-decision.md):
# OTP Analysis: {feature}
## Requirement
{what the feature needs}
## BEAM Architecture Context
- Does this need concurrency? {yes/no - why}
- Does this need isolation? {yes/no - why}
- Does this need shared state? {yes/no - why}
- Is this stateless? {yes/no}
## Recommendation
**Process needed**: NO / YES
**Pattern**: {Functions/Agent/ETS/GenServer/Task/etc}
…Example implementation
## Supervision Tree (if process needed)children = [ {Pattern, args} ]
Supervisor.start_link(children, strategy: :one_for_one)
## Testing Approachtest "feature" do start_supervised!({MyModule, args}) # test here end
Red Flags to Watch For
When reviewing requirements, flag these:
- "I need a GenServer for my service" → Why? What state? What coordination?
- "I want to organize my code with processes" → ANTI-PATTERN - use modules
- "Every user needs their own process" → Maybe, but consider ETS first
- "Global cache GenServer" → ETS is usually better
- "I'll just start a process" → Where's the supervision?
Common Scenarios
Registry + DynamicSupervisor Pattern
The canonical pattern for managing dynamic processes:
When to Use
- User sessions / WebSocket connections
- Game rooms / chat rooms
- Per-tenant processes
- Any process created in response to runtime events
Setup
# In Application supervision tree
children = [
{Registry, keys: :unique, name: MyApp.Registry},
{DynamicSupervisor, strategy: :one_for_one, name: MyApp.WorkerSupervisor}
]Worker with Via Tuple
defmodule MyApp.Worker do
use GenServer
def start_link(id) do
GenServer.start_link(__MODULE__, id, name: via_tuple(id))
end
def get_or_start(id) do
case Registry.lookup(MyApp.Registry, id) do
[{pid, _}] -> {:ok, pid}
[] -> DynamicSupervisor.start_child(MyApp.WorkerSupervisor, {__MODULE__, id})
end
end
defp via_tuple(id), do: {:via, Registry, {MyApp.Registry, id}}
end 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 Otp Advisor?
Otp Advisor is a subagent for Claude Code and Claude Cowork from the oliver-kriska/claude-elixir-phoenix repository on GitHub. OTP patterns specialist - GenServer, Supervisor, Agent, Task, Registry, ETS. Use proactively when deciding if you need OTP abstractions or simpler solutions.
How do I install Otp Advisor in Claude Code?
Download otp-advisor.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 Otp Advisor 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 Otp Advisor 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
- Hex Deps Triager Triage Hex supply-chain audit findings in Elixir/Phoenix — review diff windows and metadata to produce structured security verdicts. Use after /phx:deps-audit. Subagent · oliver-kriska/claude-elixir-phoenix
- Elixir Reviewer Expert Elixir/Phoenix code reviewer - idioms, patterns, performance, conventions. Use proactively after writing Elixir code. Subagent · oliver-kriska/claude-elixir-phoenix
- Hex Library Researcher Researches Elixir libraries on hex.pm. Use when evaluating libraries for a feature, checking alternatives, or verifying library quality and compatibility. Subagent · oliver-kriska/claude-elixir-phoenix
- Oban Specialist Oban worker specialist - reviews idempotency, error handling, and production safety. Use proactively when implementing or reviewing background jobs. 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
- 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. Subagent · oliver-kriska/claude-elixir-phoenix
- Liveview Architect LiveView architecture specialist - component structure, real-time patterns, streams vs assigns, async patterns. Use proactively when planning interactive features. 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