phoenix-contexts
Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers
Install / Use
npx skills add oliver-kriska/claude-elixir-phoenix --skill phoenix-contextsInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of phoenix-contexts
phoenix-contexts scores 82/100 on our quality scale, 3289th of 4,716 Development & Engineering skills we index.
Its SKILL.md is 3.4 KB long, well organised into 13 sections with 3 code examples: a solid amount of guidance for an agent.
It has 574 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated 13 days ago, so phoenix-contexts is actively maintained.
- Our last check on 2026-11-07 found the source still online.
- 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.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-06. Automated pattern scan on 2026-10-06. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
phoenix-contexts compared with similar skills
All 4 of these similar skills score higher than phoenix-contexts; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| phoenix-contexts (this skill)by oliver-kriska | 82 | 574 | 13d ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 118.9k | 11d ago | CLAUDE.md |
| hyperframesby heygen-com | 100 | 87.1k | today | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.6k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 47.5k | 5d ago | CLAUDE.md |
Frequently asked questions
- How do I install phoenix-contexts?
- Run
npx skills add oliver-kriska/claude-elixir-phoenix --skill phoenix-contexts. The install tabs above show the steps for each supported agent. - Which AI agents does phoenix-contexts 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 phoenix-contexts safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. 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 phoenix-contexts still maintained?
- The repository was last updated 13 days ago, so phoenix-contexts is actively maintained.
Skill content
View source on GitHubname: phoenix-contexts description: "Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers. Use when editing contexts, routers, or designing boundaries." effort: medium user-invocable: false
Phoenix Contexts Reference
Ash projects:
Ash.Domainreplaces Phoenix contexts for data access — use theash-frameworkskill. Context boundary and PubSub patterns still apply.
Reference for designing and implementing Phoenix contexts (bounded contexts).
Iron Laws — Never Violate These
- CONTEXTS OWN THEIR DATA — Never query another context's schema directly via Repo
- SCOPES ARE MANDATORY (Phoenix 1.8+) — Every context function MUST accept scope as first parameter
- THIN CONTROLLERS/LIVEVIEWS — Controllers translate HTTP, business logic stays in contexts
- NO SIDE EFFECTS IN SCHEMAS — Use
Ecto.Multifor transactions with side effects
Context Structure
lib/my_app/
├── accounts/ # Context directory
│ ├── user.ex # Schema
│ ├── scope.ex # Scope struct (Phoenix 1.8+)
├── accounts.ex # Context module (public API)
Phoenix 1.8+ Scopes (CRITICAL)
Context functions take the scope as their first parameter, so queries are filtered to the caller:
def list_posts(%Scope{} = scope) do
from(p in Post, where: p.user_id == ^scope.user.id)
|> Repo.all()
end
def create_post(%Scope{} = scope, attrs) do
%Post{user_id: scope.user.id}
|> Post.changeset(attrs)
|> Repo.insert()
|> broadcast(scope, :created)
end
Quick Decisions
When to SPLIT contexts?
- Module exceeds ~400 lines
- Functions don't share domain language
- Could theoretically be a separate microservice
- Team member could own it independently
When to KEEP together?
- Resources share vocabulary and domain concepts
- Functions frequently operate on same data together
- Splitting would create excessive cross-context calls
Cross-Context References
# ✅ Reference by ID, convert at boundary
def create_order(%Scope{} = scope, user_id, product_ids) do
with {:ok, user} <- Accounts.fetch_user(scope, user_id) do
do_create_order(scope, user.id, product_ids)
end
end
# ❌ Reaching into other context's internals
alias MyApp.Accounts.User # Don't do this
Repo.all(from o in Order, join: u in User, ...) # Don't query other schemas
Anti-patterns
| Wrong | Right |
|-------|-------|
| Service objects (UserCreationService) | Context functions (Accounts.create_user/2) |
| Repository pattern wrapping Repo | Repo IS the repository |
| Direct Repo calls in controllers | Delegate to context |
| Schema callbacks with side effects | Use Ecto.Multi |
Version Notes
- Phoenix 1.8+: Uses built-in
%Scope{}struct for authorization context - Phoenix 1.7: Requires manual authorization context (see
${CLAUDE_SKILL_DIR}/references/scopes-auth.md"Pre-Scopes Patterns")
References
For detailed patterns, see:
${CLAUDE_SKILL_DIR}/references/context-patterns.md- Full context module, PubSub, Multi, cross-boundary${CLAUDE_SKILL_DIR}/references/scopes-auth.md- Scope struct, multi-tenant, authorization, plugs${CLAUDE_SKILL_DIR}/references/routing-patterns.md- Verified routes, pipelines, API auth${CLAUDE_SKILL_DIR}/references/plug-patterns.md- Function/module plugs, placement, guards${CLAUDE_SKILL_DIR}/references/json-api-patterns.md- JSON controllers, FallbackController, API auth
Related Skills
taste-skill
118.9kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
hyperframes
87.1kAI video you can actually edit. HyperFrames is a free, open-source AI video editor. Describe any video and get a real project you can change down to the frame.
ai-job-search
72.6kThe 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
47.5kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
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.
