phx-boundaries
Analyze Phoenix context boundaries and module coupling via mix xref.
Install / Use
npx skills add oliver-kriska/claude-elixir-phoenix --skill phx-boundariesInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of phx-boundaries
phx-boundaries scores 82/100 on our quality scale, 3313th of 4,613 Development & Engineering skills we index.
Its SKILL.md is 4.4 KB long, well organised into 21 sections with 3 code examples: a solid amount of guidance for an agent.
It has 560 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 3 days ago, so phx-boundaries is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
phx-boundaries compared with similar skills
All 4 of these similar skills score higher than phx-boundaries; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| phx-boundaries (this skill)by oliver-kriska | 82 | 560 | 3d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 45.0k | 2d ago | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.8k | 5d ago | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 13d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 13d ago | SKILL.md |
Frequently asked questions
- How do I install phx-boundaries?
- Run
npx skills add oliver-kriska/claude-elixir-phoenix --skill phx-boundaries. The install tabs above show the steps for each supported agent. - Which AI agents does phx-boundaries work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is phx-boundaries safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is phx-boundaries still maintained?
- The repository was last updated 3 days ago, so phx-boundaries is actively maintained.
Skill content
View source on GitHubname: phx-boundaries description: Analyze Phoenix context boundaries and module coupling via mix xref. Use when checking cross-context calls, validating dependencies, before splitting modules, or reviewing architecture.
Phoenix Context Boundary Validation
Analyze module dependencies to ensure clean context separation and proper architectural boundaries.
Usage
phx-boundaries # Check for violations
phx-boundaries --assess # Score context health (0-100)
phx-boundaries --fix # Suggest fixes for violations
--assess Mode: Context Health Score
Evaluate overall boundary health with a quantified score.
Metrics Calculated
| Metric | Healthy Range | Red Flag | Weight | |--------|---------------|----------|--------| | Modules per context | 3-15 | >20 or <2 | 20% | | Public API surface | 5-30 funcs | >40 funcs | 15% | | Fan-out (contexts called) | 1-4 | >6 | 20% | | Fan-in (called by contexts) | 1-6 | >10 | 15% | | Circular dependencies | 0 | >0 | 15% | | Boundary violations | 0 | >0 | 15% |
Commands for Assessment
Use Glob to count .ex files per context directory under lib/my_app/*/.
Use Grep to count public function definitions per context file under lib/my_app/*.ex.
Run mix xref graph --format stats for dependency analysis.
Run mix xref graph --format cycles --label compile for compile-time circular dependencies.
Output Format
## Context Health Assessment
### Overall Score: 82/100 (Good)
| Context | Modules | API | Fan-Out | Fan-In | Score |
|---------|---------|-----|---------|--------|-------|
| Accounts | 5 | 12 | 2 | 4 | 95 |
| Orders | 18 | 45 | 8 | 3 | 62 |
| Shared | 2 | 8 | 0 | 12 | 78 |
### Issues Found
1. **Orders** - Too large (18 modules, 45 funcs)
- Consider: Extract Fulfillment, Invoicing sub-contexts
2. **Orders** - High fan-out (8 contexts)
- Consider: Review if all dependencies necessary
### Recommendations
- Split Orders into Orders + Fulfillment
- Review Accounts ← Billing dependency
Iron Laws - Never Violate These
- Controllers call only contexts - No direct Repo access from web layer
- Schemas are pure data - No side effects, no Repo calls in schema modules
- Contexts own their schemas - Don't import schemas from other contexts
- Explicit dependencies only - Cross-context calls must be intentional
- DO NOT refactor context boundaries without running
mix xreffirst — Refactoring without dependency data creates new violations; always map the dependency graph before moving modules
Dependency Rules
| Layer | Can Call | Cannot Call | |-------|----------|-------------| | Controllers | Contexts, Plug, Conn | Repo, Schemas directly | | LiveViews | Contexts, Components, PubSub | Repo, Schemas directly | | Contexts | Own schemas, Repo, other contexts | Web layer modules | | Schemas | Ecto types, validations | Contexts, Repo |
Analysis Commands
Check Compile Dependencies
Run mix xref graph --label compile-connected.
Find What Depends on a Context
Run mix xref graph --sink MyApp.Accounts --label compile.
Find What a Module Calls
Run mix xref callers MyApp.Accounts.get_user!/1.
Check for Circular Dependencies
Run mix xref graph --format cycles --label compile.
Red Flags to Detect
| Issue | Detection Command | Fix |
|-------|------------------|-----|
| Repo in web layer | grep -r "Repo\." lib/my_app_web/ | Move to context |
| Schema with queries | grep -r "import Ecto.Query" lib/my_app/**/schemas/ | Move queries to context |
| Cross-context schema import | grep -r "alias MyApp.Other.Schema" lib/my_app/ctx/ | Call context API |
| Business logic in LiveView | grep -r "Repo\.\|Ecto\.Multi" lib/my_app_web/live/ | Extract to context |
Boundary Verification Process
- Run
mix xref graph --label compile-connectedfor overview - Check for context cross-contamination
- Verify no direct Repo calls from web layer
- Ensure schemas have no side effects
- Validate explicit cross-context dependencies
Next Steps
Always end with actionable follow-up — findings without a plan get lost:
- `phx-plan` — Create a plan to fix violations (recommended for 3+ issues)
- `phx-quick` — Fix a single boundary violation directly
- `phx-review` — Review specific modules for deeper issues
References
For detailed patterns, see:
references/context-design.md- Context design principlesreferences/refactoring-boundaries.md- Fixing boundary violations
Related Skills
ai-job-search
45.0kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.8kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
