Agent skill · Design & Presentation

phoenix-contexts

Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers. Use when editing contexts, routers, or designing boundaries.

oliver-kriskagithub.com/oliver-kriskaGitHub ↗
claude-codeMIT
Install
npx skills add oliver-kriska/claude-elixir-phoenix --skill phoenix-contexts --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 6
SKILL.md size: 3 KB
Bundled scripts: none
Path: plugins/elixir-phoenix/skills/phoenix-contexts/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 515
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Phoenix Contexts Reference > **Ash projects**: `Ash.Domain` replaces Phoenix contexts for data access — use the `ash-framework` skill. Context boundary and PubSub patterns still apply. Reference for designing and implementing Phoenix contexts (bounded contexts). ## Iron Laws — Never Violate These 1. **CONTEXTS OWN THEIR DATA** — Never query another context's schema directly via Repo 2. **SCOPES ARE MANDATORY (Phoenix 1.8+)** — Every context function MUST accept scope as first parameter 3. **THIN CONTROLLERS/LIVEVIEWS** — Controllers translate HTTP, business logic stays in contexts 4. **NO SIDE EFFECTS IN SCHEMAS** — Use `Ecto.Multi` for 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) All context functions MUST accept scope as first parameter: ```elixir 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() |> broa

What's inside
Steps it walks through
  1. Iron Laws — Never Violate These
  2. Context Structure
  3. Phoenix 1.8+ Scopes (CRITICAL)
  4. Quick Decisions
  5. When to SPLIT contexts?
  6. When to KEEP together?
  7. Cross-Context References
  8. Anti-patterns
  9. Version Notes
  10. References
Ships with 5 files
  • references/context-patterns.md
  • references/json-api-patterns.md
  • references/plug-patterns.md
  • references/routing-patterns.md
  • references/scopes-auth.md
More from claude-elixir-phoenix
All skills →
About this skill
What does the phoenix-contexts skill do?

Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers. Use when editing contexts, routers, or designing boundaries.

How do I install it?

Run `npx skills add oliver-kriska/claude-elixir-phoenix --skill phoenix-contexts --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From oliver-kriska/claude-elixir-phoenix, a repository with 515 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going