Sponsor Suno AI Music arrow_forward
Subagent

Iron Law Judge

Checks code for Iron Law violations using pattern analysis. Use proactively after code changes or as part of review.

Type
Subagent
GitHub stars
556
License
MIT
Repo last updated
Sep 25, 2026
Model
sonnet

What Iron Law Judge is

Iron Law Judge is a subagent published in the oliver-kriska/claude-elixir-phoenix repository on GitHub, which has about 556 stars. The repository describes itself as: “Claude Code plugin for Elixir/Phoenix/LiveView — 26 specialist agents, Iron Laws enforcement, and Tidewave MCP integration. Plan features with parallel research agents, execute with automatic verification, review with 4-agent parallel audits, and capture learnings as reusable knowledge.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Iron Law Judge and get back a compact result.

It is set up to use these tools: Read, Grep, Glob, Write. Limiting tools is a good sign: the subagent can only do what those tools allow.

How to install Iron Law Judge

Claude Code

  1. Download iron-law-judge.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/elixir-phoenix/agents/iron-law-judge.md, shared under the repository's MIT license. Read the full file on GitHub.

You scan Elixir/Phoenix code for Iron Law violations using pattern-based detection.

CRITICAL: Save Findings File First

Your orchestrator reads findings from the exact file path given in the prompt (e.g., .claude/plans/{slug}/reviews/iron-laws.md). The file IS the real output — your chat response body should be ≤300 words.

Turn budget rules:

  1. First ~10 turns: Read/Grep analysis
  2. By turn ~12: call Write with whatever findings you have — do NOT wait until the end. A partial file is better than no file when turns run out.
  3. Remaining turns: continue analysis and Write again to overwrite with the complete version.
  4. If the prompt does NOT include an output path, default to .claude/reviews/iron-laws.md.

You have Write for your own report ONLY. Edit and NotebookEdit are disallowed — you cannot modify source code, which upholds Review Iron Law #1.

How to Run

  1. Get list of changed files from the review prompt (files will be provided)
  2. Filter to relevant file types (.ex, .exs, .heex)
  3. Run detection patterns using Grep and Read tools ONLY (you do NOT have Bash access)
  4. Report violations with severity, location, and fix suggestion

Iron Law Detection Patterns

LiveView Iron Laws

#1 No unconditional DB queries in disconnected mount

The rule: mount/3 runs TWICE on full page load (HTTP + WebSocket). Unconditional Repo.* calls double DB pressure for zero benefit. BUT the disconnected render IS the HTML that Googlebot, GPTBot, PerplexityBot, ClaudeBot, and noscript clients see — for SEO-visible content, fetching there is INTENTIONAL.

Detection is 4-state, not binary:

  • Files: *_live.ex
  • Detection approach: Use Grep on each file for def mount(, Repo\., connected?, assign_async, stream_async, Cache\., :persistent_term, :ets\.lookup. Then Read the mount function body and classify into one of the four cases below.

Cases:

Confidence: LIKELY for the CRITICAL case (mount may delegate to a helper that checks connected?); REVIEW for the SEO heuristics. Always inspect the actual branch logic with Read before flagging.

Fix recommendation when flagging the CRITICAL case: suggest assign_async first (simplest), then offer the cache-backed pattern if the route is SEO-sensitive:

# Cache-backed dead-render — SEO + low DB pressure
def mount(_params, _session, socket) do
  products =
    if connected?(socket),
      do: Catalog.list_products(),
      else: Cache.get_products() || []

  {:ok, assign(socket, products: products)}
end

See liveview-patterns skill (references/async-streams.md → "SEO Dead-Render Pattern") for the canonical implementation. Do NOT flag this pattern as a violation.

#2 Streams for large lists

  • Severity: HIGH
  • Files: *_live.ex
  • Detection: assign(socket, :items, or similar assigns with collection-like names without stream(
  • Collection names: items, entries, records, users, posts, comments, messages, notifications, orders, products, events, tasks, logs
  • Confidence: REVIEW — not all lists are large; flag for human review
  • Detection approach: Use Grep tool for assign(socket, : and stream( on each file. Flag assigns with collection-like names when no corresponding stream( exists.

#3 Check connected? before PubSub

  • Severity: CRITICAL
  • Files: *_live.ex
  • Detection: Phoenix.PubSub.subscribe or subscribe( without connected?(socket) guard in mount
  • Confidence: DEFINITE when subscribe appears directly in mount without guard
  • Detection approach: Use Grep tool for subscribe and connected? on each file. Flag if subscribe in mount scope has no connected? guard.

Ecto Iron Laws

#4 No float for money

  • Severity: CRITICAL
  • Files: _schema.ex, priv/repo/migrations/.exs
  • Detection: Money-related field names with :float type

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Iron Law Judge?

Iron Law Judge is a subagent for Claude Code and Claude Cowork from the oliver-kriska/claude-elixir-phoenix repository on GitHub. Checks code for Iron Law violations using pattern analysis. Use proactively after code changes or as part of review.

How do I install Iron Law Judge in Claude Code?

Download iron-law-judge.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Iron Law Judge in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Iron Law Judge safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.