quatermain

quatermain

Hello,

I’m sharing my plugin here in forum after some time so it has time to mature and proof yourself.

I use Claude Code daily on a production Phoenix app (319K lines of Elixir). Claude is good, but it doesn’t know Elixir the way it needs to. So I built a plugin that enforces the rules it keeps breaking. This post is less about the feature list and more about the method behind it, because most of what I built first turned out to be dead weight, and I only know that because I measured it, across 1,800+ of my own sessions.

Why I built it

My main project is a production Phoenix app, some stats:

  • ~ 319K lines of Elixir in lib,
  • ~ 251K lines of tests,
  • 77 contexts,
  • 44 LiveViews,
  • ~140 LiveComponents,
  • 938 migrations.

At that scale you hit the edges of generic AI tooling quickly, token usage goes to sky, subscription to hell.

Claude will use :float for a money field. It will skip authorization in handle_event because mount already checked. It will query the database in mount and not care that mount runs twice. Not always. Sometimes the code is very good. That inconsistency is the actual problem, and I can’t fix the model.

What I can fix is everything around the model. Rules that stop known mistakes before they ship. Compile and test checks after every change. Review that doesn’t depend on my energy level at 11pm.

Jose Valim wrote on the Tidewave blog that the future of coding agents is vertical integration. That’s the bet here: a general agent plus deep Elixir rails beats a general agent alone.

The embarrassing part

v1.0.0 shipped on February with skills for LiveView, Ecto, Oban, OTP, testing and security. I was quite proud of it.

Then I analyzed 160 of my own sessions with ccrider by Neil Berkman (read-only MCP server that lets Claude read its own session history) and findings:

  • Skill auto-loading fired zero times in 160 sessions. The knowledge existed. It was never delivered.
  • My PostToolUse hooks were silently broken for a full month. Hook stdout goes to verbose mode only in Claude Code, so every security reminder and format check I wrote did nothing.
  • I ran mix compile --warnings-as-errors manually 11 to 27 times per session. Every session. The plugin was supposed to do that for me.

Anyone can generate a pile of skills in an afternoon, and reading them tells you nothing. Mine looked complete and never fired. You have to measure.

What it became

Five months and +30 releases later, the plugin is organized around one workflow:

brainstorm → plan → work → review → compound

The filesystem is the state machine. Plans are markdown files with checkboxes, progress survives session crashes, and the compound phase captures every solved problem as a searchable solution doc, so the same bug never gets investigated twice.

Enforcement lives in hooks, not prose. There are 26 Iron Laws that stop the code before it ships:

# Iron Law #4: NEVER use :float for money
field :price, :float                    # STOP, use :decimal or :integer

# Iron Law #11: AUTHORIZE in every handle_event
def handle_event("delete", %{"id" => id}, socket) do
  delete_item(id)                       # STOP, where is the authorization?
end

# Iron Law #15: no implicit cross joins
from(a in A, b in B, select: {a, b})    # STOP, Cartesian product

Current state:

  • 51 skills,
  • 26 specialist agents,
  • 139 reference docs,
  • 31 hooks.

That is more surface area than I planned, and it only stays trustworthy because of the feedback loops below. Recent additions go beyond code generation: a Hex supply-chain audit (/phx:deps-auditchecks dependency tarballs for Trojan Source bidi characters, compile-time exec and typosquats), first-class Ash Framework support, and an optional cross-model review where OpenAI’s Codex acts as an external critic on Claude’s work.

The part I actually care about: feedback loops

The plugin improves through three loops, and this is what I would defend as the real work:

1. Session retrospectives. The pipeline kept running after those first 160 sessions: 400 more deep-analyzed in June, and by the July audit the corpus it sweeps had grown to 1,853 sessions (the earlier batches are subsets of it). The question is always the same: how did this skill actually behave in my real sessions? Did it fire, did it help, did I have to correct it afterwards? Some answers hurt:

  • My CLAUDE.md routing rules had a 0% firing rate across all 400 deep-analyzed sessions. Pages of routing documentation I was proud of, and the model never acted on them once. Routing moved into hooks, which fire deterministically.
  • /phx:work had a 0.61 correction rate. I was redirecting it in more than half of its runs. It now has to read the plan scratchpad and verify intent before touching code.
  • One orchestrator agent was spawned exactly zero times across the whole corpus. I rewrote it into a research fan-out the workflow actually uses.

2. Deterministic evals. Every skill is scored on 8 dimensions (structure, triggering, safety, clarity…) in CI. Every change must pass before it lands. This is also the tripwire for the next silent breakage, because after the hooks story I assume there will be one.

3. Trigger tournaments. Skill descriptions are tested against held-out prompts that real users type. Four weak skills went from 50.5% to 78% activation accuracy.

And one number I find funny: even with all this, the plugin actually gets used in about 16.5% of my own sessions. Most sessions simply don’t need it. I consider that correct behavior. Tooling that intervenes when you don’t need help is worse than no tooling.

A small thing that made my month: the author of the recent bluez library announcement here wrote that they’d mainly been building its features with this plugin, with manual and AI reviews on top. Seeing it help ship a real library was worth more to me than any star counter (486 currently), because star = one click, actual usage and telling others “I use it” require more effort than one click.

Honest limitations

  • Orchestrated phases cost tokens. /phx:full spawns research, implementation and review agents. /phx:quick exists for a reason.
  • It’s strongest with Tidewave running (live process state, runtime eval, SQL). Without it you get static analysis only or try to run mix run/eval
  • The model stays the model. Iron Laws catch known mistake patterns. They don’t turn Claude into a senior Elixir engineer, and I still review everything it writes.
  • Every number in this post is me measuring my own sessions on my own projects and mostly processed by Claude Code

Try it

/plugin marketplace add oliver-kriska/claude-elixir-phoenix
/plugin install elixir-phoenix

/phx:intro     # guided tour, ~5 minutes

Site with docs:

Source code:

Showing Posts 1 to 10

rogerleite

rogerleite

I would just like to thank you.

I have been using this plugin for some time and it’s helping a lot. The plan → work steps are great, and the *brainstorm *helps me a lot to build artifacts with alternatives to discuss with the team.
The review command is also good, but I don’t use it all the time because of the token costs.

Just wanted to say thank you!

quatermain

quatermain OP

Thanks for using, happy it’s helping people.

I can look into review, maybe we can achieve some light version. It’s already heavy optimized so be sure you have the latest version, in early days it was really huge hole for tokens. But still it starts multiple sub agents and sometimes it works for 30 minutes for bigger changes so …

rogerleite

rogerleite

Nice! I’m going to update it and try again to see if is using less tokens. :+1:

quatermain

quatermain OP

Plugin got upgrade to V3 and now support Claude Code, Codex, AMP, Pi and OpenCode and some improvements.

See changelog

[3.0.0] - 2026-07-25

Major release: keep Claude Code as the full canonical plugin while adding
generated, runtime-native skills distributions for Amp, Codex, Pi, and
OpenCode. Each target is explicit about supported workflows and deferred
capabilities rather than claiming cross-runtime feature parity.

Added

  • LiveView client-boundary guidance — documents that phx-value-*, form,
    and hook payloads are user-controlled; clarifies that exposed IDs are not an
    authorization flaw by themselves and must be checked against server-side
    state in every event.

  • Generated multi-runtime skills distributions — all 51 canonical skills,
    complete resource subtrees, non-Markdown bytes, and executable modes now ship
    as deterministic targets for Amp, Codex, Pi, and OpenCode. Target generators
    normalize names and invocation syntax, validate references and manifests,
    reject collisions and escaping resources, build through staging directories,
    preserve prior output on failure, and provide read-only drift checks. Claude
    Code remains the canonical source and retains its full native hooks, agents,
    MCP, permissions, and instructions.

  • Canonical multi-runtime support matrix — documents native invocation,
    distribution, supported and deferred capabilities, generated-target
    acceptance requirements, and isolated Amp, Codex, Pi, and OpenCode smoke-test
    contracts.

  • All-runtime generated skills sync command — contributors can run
    make generated-skills-sync to regenerate and validate Amp, Codex, Pi, and
    OpenCode in sequence, then validate the reviewed golden snapshots.
    Target-specific sync and validation commands remain the authoritative
    implementation and keep failures attributable.

  • Codex native destructive-command safeguard — the generated Codex plugin
    now includes one trust-gated, synchronous PreToolUse hook that reuses the
    canonical audited blocker for destructive Ecto operations, unguarded force
    pushes, and accidental production Mix commands. The broad Claude hook set,
    async hooks, custom agents, and Tidewave MCP remain deferred.

  • Optional runtime smoke harnessmake amp-runtime-smoke,
    make codex-runtime-smoke, make pi-runtime-smoke, and
    make opencode-runtime-smoke validate locally
    generated targets, native installation or discovery, all 51 installed skills,
    retained resources and modes, and fresh-process removal in isolated temporary
    homes without requiring credentials or making model calls.

  • Generated-target golden snapshots — CI now pins aggregate path, byte, and
    executable-mode digests for Amp, Codex, Pi, and OpenCode before shared
    generator refactoring. Target changes require an explicit reviewed snapshot
    update instead of silently redefining the baseline.

  • Package-specific /phx:learn-from-fix routing — verified fixes and
    explicit user-taught rules can now be saved as native background skills with
    --library <package> --scope personal|project. The workflow reads locked
    versions, checks both scopes for shadowing, merges safely, and never writes to
    cached plugin files. General cross-project rules route to personal
    ~/.claude/CLAUDE.md. Description-based activation remains model-selected.

  • Amp target drift pre-commit guard — canonical changes under
    plugins/elixir-phoenix/skills/ now trigger make amp-skills-validate and
    require regenerated targets/amp/skills/ changes to be staged. CI retains
    the same drift check as the authoritative fallback. Contributors can run
    make amp-skills-sync to regenerate and verify the complete target in one
    command.

Changed

  • Optional release-service configuration — deployment guidance now gates
    optional S3, Redis, and similar credentials behind their feature switch so
    unrelated release commands such as bin/migrate can start without them.

  • Portable Amp investigation and review workflows — generated Amp
    phx-investigate and phx-review now preserve evidence-first investigation,
    read-only review, optional native workers, and complete same-session sequential
    fallbacks without Claude task APIs, named agents, hooks, or MCP identifiers.

  • Portable PR-review/full workflow overlays — generated Amp, Codex, Pi, and
    OpenCode phx-pr-review now use available GitHub connectors or authenticated
    gh, preserve read-only triage and explicit mutation approval, and never infer
    replies or resolution. Generated phx-full now preserves user phase gates,
    bounded retries/cycles, explicit verification, read-only review, and compound
    completion through portable skill invocation or sequential same-session
    execution. Canonical Claude output remains unchanged; other workflows are not
    claimed portable.

  • Portable plan/work workflow overlays — generated Amp, Codex, Pi, and
    OpenCode phx-plan and phx-work skills now use scratchpad research checklists, plan
    checkboxes, and progress.md instead of Claude-only named agents, task APIs,
    question tools, hooks, or MCP identifiers. Optional native subagents and
    Tidewave retain complete same-session sequential fallbacks. Canonical Claude
    skills are unchanged; this does not claim parity for other generated workflows.

  • Codex skill descriptions now preserve routing signal within a compact
    budget
    — generated descriptions are capped at 120 characters while retaining
    key capability and trigger cues. Route-sensitive skills keep explicit negative
    routing rules to avoid collisions. This reduces pressure on Codex’s shared
    skills context without changing canonical Claude descriptions, explicit skill
    bodies, or other generated runtimes.

  • Amp installation no longer requires cloning this repository — the primary
    project-local and global instructions now install all 51 generated skills
    directly from the GitHub targets/amp/skills tree. Update instructions also
    clarify that Amp copies skills and requires an explicit --overwrite install.

Fixed

  • Examples skill routing — clarify that requests for sample code, proper
    implementations, walkthroughs, and expected workflow output should load the
    examples skill alongside the relevant domain skill.

  • Accurate Tidewave MCP setup boundary — update the maintained Phoenix
    dependency requirement and repository link, distinguish exposing Tidewave’s
    HTTP server from registering it with a client, and document external
    registration for Claude Code, Codex, and OpenCode.

  • Claude Code 2.1.217–2.1.220 nested-agent compatibility — flagship
    workflows account for the depth-1 default in 2.1.217–2.1.218 and the restored
    depth-3 default in 2.1.219+. Explicit lower-depth configurations keep
    orchestration in the main conversation while spawning leaf specialists
    directly, preserving the plan/work/verify/review contracts. Nested
    investigation tracks apply tracing directly to avoid a depth-4 chain.

  • Claude Code 2.1.212 Agent invocation compatibility — removed the ignored,
    deprecated Task/Agent mode parameter from workflow instructions. Subagents
    inherit the parent session’s permission mode.

  • Fork-session continuity on Claude Code 2.1.214+ — resume, scratchpad, and
    branch-freshness SessionStart checks now also run for source fork.

  • Claude Code 2.1.218 agent validation compatibility — declared agent names
    remain unqualified while concrete runtime invocations use the phx: plugin
    namespace. Regression coverage rejects colons in declared agent names and
    unrecognized agent tool names.

  • Claude Code slash-command compatibility remains stable in v3 — the
    marketplace package keeps its elixir-phoenix install identity while the
    plugin namespace now explicitly registers /phx:*; auto-installed ecto
    and lv compatibility plugins preserve /ecto:* and /lv:*. The call
    tracing skill directory now matches /phx:trace, and regression coverage
    checks effective namespace-plus-frontmatter command names. Canonical
    frontmatter names contain only the final command segment because Claude Code
    2.1.216+ retains the plugin prefix when a skill declares name.

  • v2 → v3 upgrade path preserves newly added compatibility dependencies
    install the new ecto and lv compatibility plugins from the updated
    marketplace before updating elixir-phoenix. This avoids a temporary
    missing-dependency state on existing installations. Restart Claude Code
    before relying on the updated hooks and agents.

  • Generated freeze is now honest about its safety boundary — Amp, Codex,
    Pi, and OpenCode receive an advisory current-session edit scope instead of a
    sentinel that falsely claimed enforcement by an uninstalled Claude hook.

  • Generated nested resource links now resolve from their containing file
    Amp, Codex, Pi, and OpenCode projections compute skill-relative paths from
    each Markdown resource directory instead of the skill root, fixing broken
    cross-skill and sibling links under nested references/ directories.

  • Pre-release test and docs-site consistencynpm test now includes the
    scripts/tests/ port suite, matching make test and CI, and the docs-site
    rebuild workflow triggers on all five runtime guides instead of only
    docs/amp.md.

  • Pi Git-package metadata now matches the generated distribution — the
    repository-root manifest used by the documented Pi installation reports the
    same pi-elixir-phoenix name, 3.0.0 version, and Pi-focused description as
    targets/pi/package.json.

  • Amp generation now rejects source symlinks and preserves Markdown modes
    generated resources can no longer dereference links outside the canonical
    skill tree, and transformed Markdown permissions no longer depend on the
    invoking process’s umask.

  • Runtime support and security claims now match operational boundaries
    the flagship portability contract is scoped to adapted Codex, Pi, and
    OpenCode workflows; Codex documents and surfaces its Bash/jq hook
    prerequisites; and security documentation distinguishes absent telemetry or
    covert egress from visible, user-authorized external service calls.

  • Codex dependency-vetting routing metadata stays complete — the generated
    phx-deps-vet description now preserves both its post-audit trigger and its
    distinction from dependency scanning instead of ending mid-clause.

  • Reliable behavioral trigger gates and routing boundaries — deterministic
    structural evals no longer depend on ignored local result caches, while
    make eval-full runs a fresh Claude Haiku 4.5 gate requiring every skill to
    reach 75% accuracy. The judge now receives complete descriptions, validates
    the exact skill/fixture set, retries infrastructure failures, rejects malformed
    output, and writes results atomically. Generalized routing fixes brought all
    51 skills above the threshold in the final full run (95.74% aggregate).

  • Generated-runtime install lifecycle guidance — Amp now documents native,
    target-scoped removal and exact-sync boundaries; Pi distinguishes configured
    Git refs from unpinned dependencies and includes both project and user clean
    reinstall flows; OpenCode uses its documented plural skills path and treats
    slash invocation as a tested 1.17.2 convenience rather than the portable API.

  • Codex plugin skill references now use their required runtime namespace
    explicit invocations and generated sibling references use
    $elixir-phoenix:phx-investigate rather than the non-resolving unqualified
    $phx-investigate form. README and Codex installation guidance now document
    the exact plugin-qualified syntax inserted by /skills.

  • Portable command rewriting now requires complete invocation tokens — Amp,
    Codex, Pi, and OpenCode projections leave filesystem paths, URLs, uppercase
    names, underscored suffixes, and malformed namespace wildcards unchanged. Pi
    now emits native /skill:* syntax directly instead of passing through a
    path-like intermediate form.

  • Learning destination and skill-loading documentation — project-keyed
    auto-memory is no longer described as applying to every Elixir project, and
    the intro now documents native paths: frontmatter as a file-path gate.

quatermain

quatermain OP

@AstonJ can you please update title of this post? Plugin now support Claude Code, AMP, Codex, Pi, OpenCode and not only Claude Code.

Thanks

AstonJ

AstonJ

You should be able to do it Oliver - is the edit option (pencil icon at the bottom of the post) not showing for you?

quatermain

quatermain OP

AstonJ

AstonJ

Ah right, I thought the setting would allow title edits too. Edited it for you - just let us know if you’d prefer something different (we usually use the format: Name - short description)

quatermain

quatermain OP

wonderful, thanks. It’s perfect.

quatermain

quatermain OP

Small beta update, for AMP user there is AMP’s plugin in development which allow to select specific skills from main plugin.

— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 11030 135
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New

Other Trending Topics Top

akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New
Herve37
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using. We’re particularly inte...
New
mudasobwa
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews