Codex Design Phoenix Context Boundaries and Public Functions
Define data ownership, context APIs, and a clean call direction between Phoenix controllers and business logic.
中文Install in Codex
Use a Phoenix workspace and check its version. The exercise uses a local Phoenix 1.8 fixture.
- Copy the pinned `skills/elixir-phoenix-phoenix-contexts/` directory into `.agents/skills/elixir-phoenix-phoenix-contexts/` in the project.
- Read the pinned `references/context-patterns.md` and `references/scopes-auth.md`, then identify the project's Scope shape.
Example task
In a fixture, let `Catalog` own products and `Listings` own presentation. Map the calls and replace a page-level Repo query with `Catalog.list_products(scope)`.What to check
The page uses the public context API, the call chain exposes data ownership, and tests verify the result with fixed input.
Original SKILL.md on GitHub · Updated
Frequently asked question
Does the same Scope structure apply to Phoenix 1.7?
Check the actual version and authorization context. The built-in Scope convention in this exercise targets Phoenix 1.8.