quatermain

quatermain

Plugin for Claude Code - specialist agents and an enforced Elixir/Phoenix development workflow

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:
```elixir

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:

Where Next?

Popular in Announcing Top

zorbash
I created Kitto a framework for dashboards inspired by Dashing. The distributed characteristics of Elixir and the low memory footprint...
New
wmnnd
Hi there, for my project DBLSQD, I needed a file storage solution that is a bit more flexible than Arc. Because I thought others might f...
New
Eiji
ExApi is a library that I’m developing now and hope release soon This library will allow to: list all apis list all api implementation...
New
OvermindDL1
I created a new library (rather I pulled out a couple files from my big project), it manages an operating system PID file for the BEAM. ...
New
bryanjos
Hi, I wanted share a small library we at Revelry Labs made for rendering react components from the server side. There are instructions fo...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
144 10483 141
New
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 43657 311
New
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New

Other popular topics Top

johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 52774 488
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39523 209
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New

We're in Beta

About us Mission Statement