j-morgan6/elixir-phoenix-guide
j-morgan6/elixir-phoenix-guide · 175 stars · 1 plugin
Marketplace A Claude Code plugin (with Codex support for the skills) that keeps Claude's Elixir and Phoenix code idiomatic and current. It ships 24 skills checked against Phoenix 1.8's generators, plugin-native hooks that catch dangerous commands and risky code as Claude writes it, and on-demand analysis scripts.
Install
/plugin marketplace add j-morgan6/elixir-phoenix-guideRun inside Claude Code, then install plugins from it. Check the repo's README before you run it.
Plugins 1
After adding the marketplace, install one with /plugin install <name>@elixir-phoenix-guide.
- 1elixir-phoenix-guideEssential Elixir and Phoenix LiveView development guide with enforced skills, hooks, and patterns for idiomatic code
/plugin install elixir-phoenix-guide@elixir-phoenix-guide
Files
Elixir Phoenix Guide for Claude Code and Codex
A Claude Code plugin (with Codex support for the skills) that keeps Claude's Elixir and Phoenix code idiomatic and current. It ships 24 skills checked against Phoenix 1.8's generators, plugin-native hooks that catch dangerous commands and risky code as Claude writes it, and on-demand analysis scripts.
v2.6.0 — five new skills, each verified against the library source and a generated Phoenix 1.8 app: Phoenix 1.8 scopes and generators, Tailwind v4 + daisyUI, zero-downtime Ecto migrations, Ecto query performance, and HTTP clients with Req. Codex installs the plugin directly with
codex plugin add. See CHANGELOG.md.
What's Included
Skills (24)
Each skill opens with a RULES section and a "Verified against" line naming the library versions it was checked against. Skills load on demand when Claude's task matches their description.
- elixir-essentials - Pattern matching,
with, error contracts, modern Elixir (1.18+): type checker,JSON,dbg; Phoenix project layout reference - phoenix-liveview-essentials - Lifecycle, forms (
to_form,phx-change), streams,assign_async/start_async, JS commands, colocated hooks; LiveView checklist and JS interop references - ecto-essentials - Scoped context functions, schemas, queries, migrations, upserts,
Repo.transact; Ecto reference - phoenix-uploads -
allow_upload, content-type allowlists, magic-byte checks, external uploads, authorized downloads - testing-essentials - DataCase/ConnCase, generated fixtures and scopes, LiveView helpers, Mox,
Req.Test; testing reference - otp-essentials - GenServer, Supervisor, Task, Registry, ETS, PartitionSupervisor, timeouts
- oban-essentials - Workers, uniqueness, transactional enqueue, Oban 2.24 plugin config, Lifeline, Oban.Testing
- code-quality - Compiler and Credo first, then on-demand duplication and branch-complexity scans
- phoenix-liveview-auth - The generated
UserAuth:on_mount,live_session,mount_current_scope, sudo mode, logout disconnects - ecto-changeset-patterns - Separate changesets per operation, password/email rules, never casting privileged fields
- phoenix-auth-customization - Adding fields to the phx.gen.auth user, registration changeset, fixtures
- phoenix-pubsub-patterns - Scoped topics, broadcasting from contexts, streams in
handle_info, Presence in LiveView - phoenix-authorization-patterns -
%Scope{}-first contexts, ownership checks, policies, mass-assignment safety - ecto-nested-associations -
cast_assoc/cast_embed,inputs_forsort/drop params,on_replace, cascades, Multi - security-essentials - Injection, XSS, SSRF, open redirects (
external:), CSP, safe deserialization, Sobelow - deployment-gotchas -
mix phx.gen.release --docker, runtime.exs, release migrations, SSL, rolling deploys, health checks - phoenix-channels-essentials - Socket auth and tokens, join authorization,
intercept/handle_out, Presence - telemetry-essentials - Logger metadata, telemetry handlers, metric tag cardinality, OpenTelemetry, LiveDashboard
- phoenix-json-api - phx.gen.json-style JSON views, FallbackController, keyset pagination, hashed API tokens, rate limits
New in 2.6.0:
- phoenix-scopes-and-generators - Phoenix 1.8 scopes: the generated %Scope{} and config :scopes keys, phx.gen.* with --scope/--no-scope, adding an org scope (config entry, plug + on_mount, test helpers), adopting scopes in pre-1.8 apps
- phoenix-tailwind-daisyui - Tailwind v4 in app.css (@source, @plugin, no tailwind.config.js), dynamic class names, daisyUI themes and dark mode, extending core_components (<.input>, <.button>, <.icon>, <.table>), Layouts.app/flash, accessibility
- ecto-migrations-safety - Zero-downtime PostgreSQL migrations: concurrent indexes, migration locks, lock_timeout, NOT NULL/foreign keys via NOT VALID, batched backfills, expand-and-contract renames
- ecto-queries-performance - N+1 and preload strategy, dynamic/subquery/exists composition, counting, Repo.stream, locking and optimistic locking, insert_all bulk upserts, EXPLAIN, query-driven indexes, prepare_query tenancy guards
- http-clients-req - Calling external APIs with Req 0.7: client modules, retries/Retry-After, timeouts, idempotency keys, JSON bodies, SSRF-safe redirects, Finch pools, Req.Test/Mox, telemetry and circuit breaking
Longer reference material lives next to the skill that uses it (skills/<skill>/*.md) and Claude reads it only when needed.
Hooks (ship inside the plugin)
Hooks live in hooks/hooks.json and activate when the plugin is installed. They need jq.
| Event | Check | Result |
|---|---|---|
| SessionStart | Project summary for Claude: Phoenix/LiveView versions (locked and required), scopes, Ecto adapter, Oban, umbrella apps; warns when jq is missing |
context |
| PreToolUse (Bash) | mix ecto.reset / mix ecto.drop unless MIX_ENV=test |
block |
| PreToolUse (Bash) | git push --force, -f, -uf, +refspec (--force-with-lease and --force-if-includes allowed) |
block |
| PostToolUse (Write/Edit) | Interpolated SQL in Repo.query/SQL.query or fragment(); redirect(external: params…); removed/deprecated APIs (form_for, live_redirect, live_patch, push_redirect) |
block |
| PostToolUse (Write/Edit) | String.to_atom/1, raw/1, Logger interpolating secrets, IO.inspect/dbg, timing-unsafe == on secrets, missing @impl true, migration FK without index or on_delete, @current_user in a scopes app |
review |
- block — exit 2 with the reason on stderr; Claude must deal with it (for Bash, the command doesn't run).
- review — an advisory note (
additionalContext); Claude decides, nothing is blocked. - File checks report only the lines that tool call changed, ignore comments and
@doctext, and skip tests,deps/,_build/andnode_modules/. - The Bash guard runs only in Elixir projects. To run a blocked command deliberately, prefix it with
EPG_ALLOW=force_push(orecto_reset,ecto_drop) or set that variable in Claude Code's environment.
See INSTALL-HOOKS.md for details and known limits.
Analysis Scripts
Shipped with the plugin under scripts/ and run on demand (the code-quality skill tells Claude how):
- code_quality.exs - Duplicate function bodies across the whole tree (names and variables ignored) and branch complexity. For unused code, use
mix compile --warnings-as-errorsandmix xref. - run_analysis.sh - Runs the scans over
lib/(orapps/*/libin an umbrella) - detect_project.sh - Project stack detection used by the SessionStart hook
Project Template
- CLAUDE.md.template - Project-specific instructions template
Installation
Note: Official marketplace publication is in progress. Once available, installation will be even simpler through the official Claude Code marketplace.
Installing for the First Time
In a Claude Code session:
# Step 1: Add the marketplace (first time only) /plugin marketplace add j-morgan6/elixir-phoenix-guide # Step 2: Install the plugin /plugin install elixir-phoenix-guide@elixir-phoenix-guide
Skills and hooks activate automatically — nothing else to configure. Optional extras (the CLAUDE.md project template, cleanup of legacy pre-2.4.0 installs) are available via ./install.sh from a checkout:
git clone https://github.com/j-morgan6/elixir-phoenix-guide.git cd elixir-phoenix-guide ./install.sh
Codex
The skills also work in OpenAI Codex (hooks are Claude Code only). Install them as a Codex plugin:
codex plugin marketplace add j-morgan6/elixir-phoenix-guide codex plugin add elixir-phoenix-guide@elixir-phoenix-guide
Codex reads the same marketplace as Claude Code and the manifest in .codex-plugin/plugin.json, and loads every skill with its reference files. To update, upgrade the marketplace (codex plugin marketplace upgrade elixir-phoenix-guide) and re-add the plugin.
Without the plugin system, ./install-codex.sh from a checkout copies the skill directories into ${CODEX_HOME:-~/.codex}/skills instead (keep the checkout: the code-quality skill runs its scripts from there).
Updating to Latest Version
If you already have the plugin installed:
# Open the interactive plugin manager /plugin # Select "Marketplaces" → "elixir-phoenix-guide" → "Update" # Then update the plugin from the menu
See CHANGELOG.md for full release notes and version history.
Usage
Once installed, Claude Code will automatically:
- Load skills when the task matches a skill's description
- Run hooks on Bash commands and file writes - blocking dangerous commands and flagging risky code
- Read a skill's reference files when a task needs the detail
- Follow CLAUDE.md (if present) - respecting project-specific conventions
Example Interactions
Before (without optimization):
def process(user) do
if user.status == :active do
if user.role == :admin do
:allowed
else
:denied
end
else
:inactive
end
end
After (with skills guiding idiomatic Elixir):
- Skill suggests pattern matching over nested conditionals
- Claude generates:
def process(%{status: :active, role: :admin}), do: :allowed
def process(%{status: :active}), do: :denied
def process(_), do: :inactive
Testing the Setup
- Open a Phoenix/Elixir project in Claude Code
- Ask Claude to create a LiveView
- Observe:
- Skills guide idiomatic implementation
- Hooks flag anti-patterns in the lines Claude wrote (missing @impl, security issues, Phoenix deprecations)
- The LiveView checklist is used before finishing
What This Optimizes
Code Quality
- Blocks destructive Bash commands (
mix ecto.reset/ecto.dropoutside test, force pushes) - Blocks near-certain bugs in written code: SQL built by interpolation,
redirect(external:)from params, removed Phoenix APIs - Flags for review:
String.to_atom/1,raw/1, secrets in Logger interpolation, timing-unsafe comparisons, debug calls, missing@impl true, migration FK indexes andon_delete,@current_userin scope-based apps - Scans on demand for duplicated function bodies and branch complexity
Developer Experience
- Proactive guidance on Elixir idioms
- Real-time feedback on code quality
- Detailed checklists for complex features
- Consistent conventions across projects
- Reduced iterations and corrections
Learning
- Clear explanations of "why" not just "what"
- Links to relevant patterns and best practices
- Progressive disclosure of complexity
- Examples of idiomatic vs non-idiomatic code
Why This Exists
This plugin was created to ensure Claude Code consistently produces idiomatic Elixir and Phoenix code by making best practices impossible to ignore, not just available. It combines enforced patterns, real-time validation, and comprehensive guidance for all Elixir development work.
Project-Specific Setup
For project-specific instructions, you can create a CLAUDE.md file in your project root with:
- Your app name and description
- Project-specific contexts
- Custom commands and workflows
- Team conventions
This file will be automatically loaded by Claude Code when working in your project.
File Structure
elixir-phoenix-guide/
├── README.md # This file
├── INSTALL-HOOKS.md # Hook behavior reference
├── CLAUDE.md.template # Project-specific instructions template
├── install.sh # Optional extras: CLAUDE.md template + legacy cleanup
├── install-codex.sh # Installs the skills for OpenAI Codex
├── .codex-plugin/plugin.json # Codex plugin manifest
├── VERSION # Plugin version (also in both plugin.json manifests)
├── skills/ # 24 skills; some carry reference files
│ ├── elixir-essentials/ # SKILL.md, project-structure.md
│ ├── phoenix-liveview-essentials/ # SKILL.md, checklist.md, js-interop.md
│ ├── ecto-essentials/ # SKILL.md, reference.md
│ ├── testing-essentials/ # SKILL.md, reference.md
│ └── … # 20 more (SKILL.md, some with reference.md)
├── hooks/
│ └── hooks.json # SessionStart + PreToolUse + PostToolUse config
├── scripts/ # Shipped with the plugin
│ ├── code_quality.exs # Duplication + branch complexity (on demand)
│ ├── detect_project.sh # Project stack detection (SessionStart)
│ ├── run_analysis.sh # Analysis runner (on demand)
│ ├── lib/common.sh # Shared shell helpers
│ └── hooks/
│ ├── bash_guard.sh # PreToolUse (Bash)
│ └── check_file.sh # PostToolUse (Write|Edit|MultiEdit)
├── tests/
│ ├── hooks/run_tests.sh # Hook test harness (fixture-based)
│ ├── code_quality/run_tests.sh # code_quality.exs test harness
│ └── packaging/run_tests.sh # Version agreement + install-codex.sh checks
└── dev/ # Maintainer tools (not used at runtime)
├── check_snippets.exs # Parses every elixir/heex block in skills/
└── sync_copilot.sh # Regenerates the GitHub Copilot port
Requirements
- Claude Code
jq(for the hooks)- Skills target Elixir 1.18+, Phoenix 1.8, LiveView 1.1+, Ecto 3.13+ and Oban 2.20+; most guidance still applies to Phoenix 1.7 apps, but the auth, scope and generator examples assume 1.8
Customization
The plugin manager keeps a copy of each installed version under
~/.claude/plugins/cache/<marketplace>/elixir-phoenix-guide/<version>/ and runs
skills, hooks and scripts from there (${CLAUDE_PLUGIN_ROOT}). It does not copy
files into ~/.claude/skills/ or merge anything into ~/.claude/settings.json.
Plugin updates replace that copy, so don't edit it by hand:
- Project-specific rules go in your project's
CLAUDE.md(see the template). - Extra hooks go in your project's
.claude/settings.json; they run alongside the plugin's. - Changing skills or the plugin's hooks: fork the repo and install from your fork.
Checking Your Version
In a Claude Code session:
/plugin # Navigate to your installed plugins; the version is shown there # (and in the cache path: ~/.claude/plugins/cache/<marketplace>/elixir-phoenix-guide/<version>/)
Troubleshooting
Plugin shows old version after update
The /plugin update command may not refresh its local cache automatically. If the version shown doesn't match the latest release, run:
cd ~/.claude/plugins/marketplaces/elixir-phoenix-guide && git pull
Then re-run /plugin and update the plugin from the menu.
Uninstall
In a Claude Code session:
/plugin # Navigate to installed plugins # Select elixir-phoenix-guide and choose "Uninstall"
Contributing
Contributions welcome! Areas for improvement:
- Additional Elixir patterns and anti-patterns
- More Phoenix-specific hooks
- OTP and GenServer guidance
- Testing patterns and best practices
- Real-world examples and case studies
License
MIT
Acknowledgments
Inspired by the Optimizing Claude Code article by Steven Mays.
Related Resources
Note: Once installed, the plugin is active in every project you open. Its skills only load for Elixir work, and the hooks do nothing outside Elixir projects (no mix.exs). For project-specific customizations, use the CLAUDE.md.template in your project root.
{
"name": "elixir-phoenix-guide",
"owner": {
"name": "Joseph Morgan",
"url": "https://github.com/j-morgan6"
},
"plugins": [
{
"name": "elixir-phoenix-guide",
"source": "./",
"description": "Essential Elixir and Phoenix LiveView development guide with enforced skills, hooks, and patterns for idiomatic code"
}
]
}Facts
- Kind
- Marketplace
- Repo
- j-morgan6/elixir-phoenix-guide
- Group
- Uncategorized
- Stars
- 175
- Marketplace name
- elixir-phoenix-guide
- Owner
- Joseph Morgan
- License
- MIT
- Language
- Shell
- Created
- 2026-01-23
- Last push
- 2026-10-16
- Forks
- 15
- Plugins
- 1
Next on this shelf
- 316TechDufus/oh-my-claudeTechDufus/oh-my-claudeAdd ultrawork to any prompt for maximum parallel execution174
- 317hjertefolger/cortexhjertefolger/cortexPersistent local memory for Claude Code. Longer sessions. Cross-session recall. Zero cloud.173
- 318team-attention/hoyeonteam-attention/hoyeonRequirements-first Harness — derive, verify, execute.173
- 319miroapp/miro-aimiroapp/miro-aiOfficial Miro AI developer tools and integrations. Includes MCP server configuration, Claude Code skills, and resources for building AI-powered experiences with Miro boards.172
- 320dfkai/xtquantaidfkai/xtquantai迅投 QMT 量化 AI 技能集(Agent Skills):研报因子回测脚本生成等,适用于 Claude Code / Cursor / Codex / Kimi 等 70+ AI 编程工具171
- 321molefrog/skillsmolefrog/skills❈ Claude skill for generating high-quality PDFs using react-pdf171