No slash command · from Elixir Rewrite Architect
Maps mechanisms from any language or framework (Rails, Django, PHP, Node, Go, JVM, .NET) to idiomatic Elixir. Guides rewrite/port decisions with verdicts, targets, guarantee checks, and translationese review.
Ships in Elixir Rewrite Architect. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Shared vocabulary and defaults for every rewrite agent and command.
A rewrite ports goals and contracts, not files. Every legacy mechanism
existed for a reason, and the reason decides the Elixir target. The method is
stack-agnostic; stack packs in references/stacks/ only speed up discovery.
historicalUNDECIDED with the missing evidence; out-of-scope areas are listed as coverage gaps| Field | Values |
|---|---|
| Reason tags (one or more) | business product rule · reliability survive crash, retry, order · contract someone outside the code depends on it · platform works around the legacy runtime, framework or host · historical choice nobody relies on any more · unknown |
| Evidence | documented comment, doc, ADR · observed test or behavior · inferred · disputed · unknown |
| Contract surface | data schema, files, encrypted values · wire URLs, cookies, JSON, webhooks, socket protocol · operational env vars, CLI, backups, ports |
| Contract class | contract consumer evidenced · incidental framework default with no identified consumer · defect legacy bug or security hole |
| Contract disposition | keep · change (consumers + approval) · retire |
| Feature triage | preserve · redesign (approved behavior change) · drop |
Ask two separate questions per mechanism: why did it exist, and which present obligation fails if it disappears. An accidental origin does not license removal when consumers now rely on it.
| Verdict | Meaning | Example |
|---|---|---|
MAP | Same responsibility on the conventional Elixir abstraction | ORM models → Ecto schemas and context queries |
REPLACE | Different mechanism or topology, named guarantees preserved | Redis fan-out → Phoenix.PubSub |
KEEP | Existing component or protocol stays for the declared phase | legacy app remains the session issuer |
SHIM | Translation at a named boundary, linked to its internal target | Action Cable adapter over Phoenix internals |
DELETE | Obligations absent, met elsewhere, or explicitly retired; consumers checked | Puma worker tuning on the BEAM |
UNDECIDED | Evidence missing; blocks only the slices that depend on it | purpose of a nightly SQL job unknown |
pending · implemented · retirednot-run · pass · fail · blocked · stale (source or target changed since)none · AR-NN accepted-risk recordretired and accepted risks never count toward the verified numerator.
AR-NN is a ## AR-NN — <title> section in .claude/rewrite/verify/accepted-risks.md with
- Owner:, - Scope: (ledger IDs), - Rationale:, - Review: (the condition that reopens it) and
- Approved: (who, when, where). Only the user creates or approves one; without Approved it is not a departure.
| ID | Mechanism (anchor) | Purpose (evidence) | Tags | Guarantees | Verdict | Elixir target | Contract | Impl | Evidence | Departure |
|----|--------------------|--------------------|------|------------|---------|---------------|----------|------|----------|-----------|
| M-07 | `post_save` signal orders/signals.py:12 | stock update + email on order save (observed: test_orders.py:88) | business | observed save-time stock/email effects; transaction and retry semantics `unknown` | REPLACE | stock update + Oban insert in one `Ecto.Multi` committed with `Repo.transact/2`; the worker emails after commit, idempotent per order (strengthening) | — | pending | not-run | none |
| M-12 | BullMQ queue in Redis (src/queues/invoice.ts) | async invoice PDFs (documented: README) | reliability | durable, retried | REPLACE | Oban job inserted in the same `Ecto.Multi` | — | pending | not-run | none |
| M-19 | PM2 cluster mode (ecosystem.config.js) | use all CPUs (inferred) | platform | — | DELETE | BEAM schedulers | operational: `PM2_INSTANCES` | pending | not-run | none |
| Legacy mechanism | Elixir default | Translationese to avoid |
|---|---|---|
| ORM model + callbacks/signals | Ecto schema + context function; callbacks become explicit Ecto.Multi steps | side effects hidden in changesets |
| Sidekiq, Resque, Celery, BullMQ, Hangfire | Oban worker, inserted transactionally | Task.start, GenServer queue, Redis list |
| Cron (whenever, beat, node-cron, Quartz) | Oban top-level cron: (Oban.Cron, 2.24+) | :timer.send_interval loops |
| Action Cable, Socket.IO, SignalR, Redis pub/sub | Phoenix.PubSub + Channels or LiveView | re-implemented legacy socket framing (unless SHIM) |
| Redis cache, memoization | ETS or Cachex with complete keys, errors never cached | Redis kept "because it was there" |
| Redis rate limits, locks | Hammer; unique constraints; advisory or row locks every contender honors | SETNX re-implementations; Oban unique as a lock (it only dedupes inserts) |
Request globals (Current, thread-locals, AsyncLocalStorage) | explicit scope argument (Phoenix 1.8 scopes) | process dictionary |
Middleware, before_action, filters, guards | Plug pipelines, on_mount hooks | per-action copy-pasted checks |
| Service objects, managers, repositories | context functions over Repo | Service.call/1 modules everywhere |
| HTTP clients (Faraday, axios, requests, OkHttp) | Req behind a project-owned module | client chosen by habit |
| Mailers | Swoosh, delivered from an Oban job | synchronous send in the request |
| Hotwire, Livewire, HTMX, server views + JS | LiveView when the UI contract may change | hand-written Turbo protocol without coexistence need |
| SPA + REST/GraphQL | keep the SPA on Phoenix JSON or Absinthe; LiveView only if redesign is approved | rewriting the frontend inside the backend port |
| App-server pools (Puma, Gunicorn, PM2, thread pools) | DELETE — BEAM schedulers and Task.async_stream/3 | pools sized per request |
Write these for every mechanism tagged business, reliability or contract.
Record only what the source shows; when it is silent (does a callback share
the caller's transaction?), write unknown and ask, never the stronger guarantee.
A target stronger than the evidence is labelled a strengthening:
Repo.transact/2, Ecto.Multi)executing reruns only with lifeline: configured; PubSub persists nothingunique only dedupes inserts, and queue limits are per nodeIdiomatic Elixir is a design outcome, not a dependency checklist: a tiny Plug API or a CPU-bound CLI need not adopt Ecto, Oban or LiveView. Flag these:
app/models/x.rb → lib/app/models/x.ex) with no contextscontract with a named consumer; a defect never becomes domain logic{:error, _}Probes in the KB are rg one-liners. Without rg on PATH, run the identical
pattern with the Grep tool (output_mode: "content"); never change the regex.
Agents cannot read plugin files reliably, so /rewrite:analyze copies these
into .claude/rewrite/kb/. Always read app-shapes.md; then the stack pack,
or stacks/generic.md when no pack matches:
${CLAUDE_SKILL_DIR}/references/app-shapes.md — web, API, worker, pipeline, CLI, daemon, IoT, ML${CLAUDE_SKILL_DIR}/references/stacks/generic.md — method for any other language or framework${CLAUDE_SKILL_DIR}/references/stacks/rails.md — Rails, Sinatra, Hanami${CLAUDE_SKILL_DIR}/references/stacks/django.md — Django, Flask, FastAPI${CLAUDE_SKILL_DIR}/references/stacks/laravel.md — Laravel, Symfony, PHP${CLAUDE_SKILL_DIR}/references/stacks/node.md — Express, Nest, Next${CLAUDE_SKILL_DIR}/references/stacks/go.md — net/http, Gin, Echo${CLAUDE_SKILL_DIR}/references/stacks/jvm-dotnet.md — Spring, ASP.NET Core${CLAUDE_SKILL_DIR}/references/ui-strategy.md — keep, coexist or LiveView${CLAUDE_SKILL_DIR}/references/infrastructure.md — Redis by role, queues, search, storage${CLAUDE_SKILL_DIR}/references/data-compat.md — legacy schema, crypto, cutover recipes${CLAUDE_SKILL_DIR}/references/sqlite-on-beam.md — write serialization, reader Repo, Oban Lite${CLAUDE_SKILL_DIR}/references/translationese-checks.md — grep probes for audits${CLAUDE_SKILL_DIR}/references/performance-gates.md — baselines and claimsreferences/app-shapes.md (opens in a new tab)references/data-compat.md (opens in a new tab)references/infrastructure.md (opens in a new tab)references/performance-gates.md (opens in a new tab)references/sqlite-on-beam.md (opens in a new tab)references/stacks/django.md (opens in a new tab)references/stacks/generic.md (opens in a new tab)references/stacks/go.md (opens in a new tab)references/stacks/jvm-dotnet.md (opens in a new tab)references/stacks/laravel.md (opens in a new tab)references/stacks/node.md (opens in a new tab)references/stacks/rails.md (opens in a new tab)references/translationese-checks.md (opens in a new tab)references/ui-strategy.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
mediumThree short reads, in order
6 skills in this plugin
/analyzeAnalyze a legacy app in any language before rewriting it in Elixir: inventory, features as goals, why each mechanism exists, runtime topology, external contracts. Use to start or refresh a rewrite./architectDesign the idiomatic Elixir architecture for a rewrite: set the compatibility bar (ADR-000), consult phx specialists on open questions, then build contexts, ledger and ADRs. Use after /rewrite:analyze./roadmapPlan a rewrite as vertical slices and hand each one to /phx:plan as a requirements seed with binding decisions, contracts and acceptance criteria. Use after /rewrite:architect, or for the next slice.npx claudepluginhub oliver-kriska/claude-elixir-phoenix --plugin rewriteOther plugins' skills for the same job