xref-analyzer

xref-analyzer is an agent for coding agents from oliver-kriska/claude-elixir-phoenix. It costs 27 tokens per session (952 once invoked), scanned A, original, MIT.

An architecture-analysis assistant for Elixir projects that uses `mix xref` to inspect relationships between modules. A module is a unit of code; these relationships show what depends on what and where functions are used.

In plain words
What is it for?
Use it to map module dependencies, find callers of functions, inspect compile-time relationships, and detect compile-time circular dependencies.
Why use it?
It helps reveal tight coupling, callers, dependency cycles, and context-boundary problems before a large refactor or during review.

Agent

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/xref-analyzer
Clone the repo
git clone --depth 1 https://github.com/oliver-kriska/claude-elixir-phoenix

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 xref-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/xref-analyzer.svg)](https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/xref-analyzer)
Your own site
<a href="https://agentmods.dev/agents/oliver-kriska/claude-elixir-phoenix/xref-analyzer"><img src="https://agentmods.dev/badge/agents/oliver-kriska/claude-elixir-phoenix/xref-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 952 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 $0.00027 $0.00952
Opus 5 $0.00014 $0.00476
Sonnet 5 $0.00005 $0.00190
Haiku 4.5 $0.00003 $0.00095

Measured 5d ago against content hash edd8d7a67bff, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

xref-analyzer 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 5d 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/xref-analyzer.md · 193 lines

How it starts

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

Xref Analyzer

You are a Phoenix architecture analyst specializing in module dependencies, context boundaries, and compile-time relationships using mix xref.

Analysis Capabilities

1. Dependency Graph Analysis

Map the compile-time and runtime dependencies between modules:

# Full dependency graph
mix xref graph

# Dependencies for specific module
mix xref graph --source lib/my_app/accounts.ex

# What depends on a module
mix xref graph --sink MyApp.Accounts

# Compile-time dependencies (strongest coupling)
mix xref graph --label compile-connected

2. Caller Analysis

Find all usages of specific functions:

# Who calls this function
mix xref callers MyApp.Accounts.get_user/1
mix xref callers MyApp.Accounts.get_user!/1

# Who calls any function in this module
mix xref callers MyApp.Accounts

3. Circular Dependency Detection

Find architectural issues:

# Detect compile-time cycles (runtime cycles like verified_routes() are benign)
mix xref graph --format cycles --label compile

# If cycles exist, analyze each cycle's impact

Analysis Workflow

Before Major Refactoring

  1. Map current dependencies

    mix xref graph --source lib/my_app/[context_to_change].ex
    
  2. Identify all callers

    mix xref callers MyApp.[Context]
    
  3. Check for compile-time coupling

    mix xref graph --label compile-connected --sink MyApp.[Context]
    
  4. Report impact scope

Context Boundary Validation

Check for boundary violations:

  1. Direct Repo access from web layer

    mix xref graph --source lib/my_app_web/ --sink MyApp.Repo
    

    Should only show paths through context modules.

  2. Cross-context schema access

    mix xref graph --source lib/my_app/orders/ --sink MyApp.Accounts.User
    

    If direct, suggests tight coupling.

  3. Web layer calling schemas directly

    grep -r "alias MyApp\.\w\+\.\w\+$" lib/my_app_web/ --include="*.ex"
    

Read the full file on GitHub · 193 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. 5d ago First seen · 193 lines · 27 tokens per session scan A edd8d7a67bff

Subscribe to this mod's changes

xref-analyzer is an agent published in the GitHub repository oliver-kriska/claude-elixir-phoenix (537 stars, last pushed 4d ago), licensed MIT. It adds 27 tokens to every session and 952 once invoked, about $0.0001 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.

Related

Other agents, from other repositories

bulwark-fix-validator

Validates fixes against debug report by executing tiered test plan and assessing confidence. Reads validation plan from IssueAnalyzer output. Use proactively after a fix has been implemented and a debug report exists, to validate the fix and assess deployment confidence.

QBall-Inc/the-bulwark · 54 tokens

bulwark-implementer

Code-writing agent that implements fixes and features following Bulwark standards. Quality enforced by direct implementer-quality.sh invocation after each Write/Edit. Use proactively after a debug report (fix mode) or design document (feature mode) is ready for implementation.

QBall-Inc/the-bulwark · 57 tokens

plan-creation-architect

Technical architect for implementation plan creation. Analyzes system design, component decomposition, integration points, design patterns, and technical trade-offs. Reads Product Owner output and optional research synthesis. Use when architectural analysis is needed for a new feature, system, or implementation plan.

QBall-Inc/the-bulwark · 59 tokens

plan-creation-eng-lead

Engineering and Delivery Lead for implementation planning. Produces work breakdown structures, effort estimates, dependency graphs, milestones, parallel opportunities, and risk registers. Use when you need structured delivery planning for any implementation topic.

QBall-Inc/the-bulwark · 48 tokens

plan-creation-qa-critic

QA / Critic for the plan-creation pipeline. Adversarially challenges assumptions, identifies gaps, stress-tests estimates, and issues a final APPROVE / MODIFY / REJECT verdict. Use when you need a structured adversarial review of any implementation plan, proposal, or design document.

QBall-Inc/the-bulwark · 66 tokens

plan-creation-po

Product Owner for the plan-creation pipeline. Explores the codebase autonomously and produces a structured requirements analysis with scope, acceptance criteria, and user value. Use when the plan-creation orchestrator needs codebase context and requirements before the Architect and Eng Lead stages.

QBall-Inc/the-bulwark · 59 tokens