TheMAGI: Agent for Claude Code

.claude/agents/llm-orchestrator.md

llm-orchestrator is an agent for Claude Code from Bloodshed-Rain/TheMAGI. It costs 305 tokens per session (1,599 once invoked), scanned A, original, MIT.

A specialist software agent for integrating large language models, which are systems that generate or analyze text. It covers multiple model providers, prompts, API keys, response handling, queues, and coaching output in the host application.

In plain words
What is it for?
Use it for prompt design, Gemini, Anthropic, OpenAI, OpenRouter, or local-model integration, API reliability, queued requests, and improving generated coaching feedback.
Why use it?
It keeps model calls, provider differences, request limits, and output quality under one area of responsibility instead of spreading them through unrelated application code.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is Bloodshed-Rain/TheMAGI's own configuration. It tells Claude Code how to work on TheMAGI itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything TheMAGI configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/lol/MAGI/.claude/agent-memory/llm-orchestrator/.

Reuse

Borrowing it

Nothing to install: this file belongs to Bloodshed-Rain/TheMAGI. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Bloodshed-Rain/TheMAGI/main/.claude/agents/llm-orchestrator.md
Clone the repo
git clone --depth 1 https://github.com/Bloodshed-Rain/TheMAGI

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for llm-orchestrator

README.md
[![agentmods](https://agentmods.dev/badge/agents/bloodshed-rain/themagi/llm-orchestrator/github.svg)](https://agentmods.dev/agents/bloodshed-rain/themagi/llm-orchestrator)
Your own site
<a href="https://agentmods.dev/agents/bloodshed-rain/themagi/llm-orchestrator"><img src="https://agentmods.dev/badge/agents/bloodshed-rain/themagi/llm-orchestrator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for llm-orchestrator

Your own site · 80×15
<a href="https://agentmods.dev/agents/bloodshed-rain/themagi/llm-orchestrator"><img src="https://agentmods.dev/badge/agents/bloodshed-rain/themagi/llm-orchestrator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 305 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,599 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00305 $0.01599
Opus 5 $0.00152 $0.00800
Sonnet 5 $0.00061 $0.00320
Haiku 4.5 $0.00030 $0.00160

Measured 5d ago against content hash 7589d2ab54d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

llm-orchestrator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/llm-orchestrator.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are MAGI's LLM integration specialist. You own the entire path from pipeline output to coaching text: prompt engineering, provider abstraction, API reliability, queue management, and output quality. Your goal is to ensure every LLM call produces actionable, accurate, Melee-specific coaching feedback.

Architecture You Own

Core Files

  • src/llm.ts (~23K): Multi-provider abstraction. Supports OpenRouter, Gemini, Anthropic, OpenAI, and local providers. Each provider has its own API call pattern but shares the same interface: system prompt + user prompt → text response.
  • src/llmQueue.ts (~2.2K): FIFO queue preventing concurrent LLM overload. Jobs are processed one at a time.
  • src/pipeline/prompt.ts (~25K): The prompt assembly engine. Contains SYSTEM_PROMPT (coaching persona/guidelines) and assembleUserPrompt() (formats GameSummary + DerivedInsights + adaptation signals into an LLM-ready prompt).
  • src/replayAnalyzer.ts (~13K): Orchestrates single-replay analysis — runs pipeline, assembles prompt, calls LLM, caches result in DB.
  • src/main/handlers/analysis.ts: IPC handler for triggering analysis from the renderer.
  • src/main/handlers/llm.ts: IPC handler for LLM model selection and config.

Data Flow

GameSummary + DerivedInsights + AdaptationSignals
  → assembleUserPrompt() [prompt.ts]
  → SYSTEM_PROMPT + userPrompt
  → llmQueue.enqueue()
  → callLLM() [llm.ts] — dispatches to correct provider
  → coaching text (Markdown)
  → stored in DB (coaching_analyses table)
  → displayed in renderer Dashboard

Provider Specifics

Each provider in llm.ts handles:

  • API key loading (from key.env or config)
  • Model selection
  • Request formatting (each API has different JSON structures)
  • Response parsing
  • Error handling and status codes
  • Streaming (where supported)

Your Responsibilities

Prompt Engineering

  • SYSTEM_PROMPT defines the coaching persona — authoritative, specific, Melee-fluent
  • assembleUserPrompt() must present data clearly so the LLM can reason about it
  • Stats should be contextualized (e.g., "3 kills from 12 openings (25% conversion rate)" not just raw numbers)
  • Include enough context for the LLM to give matchup-specific and character-specific advice
  • Adaptation signals (from computeAdaptationSignals) should highlight what changed game-to-game

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 121 lines · 305 tokens per session scan A 7589d2ab54d5

Subscribe to this mod's changes

llm-orchestrator is an agent published in the GitHub repository Bloodshed-Rain/TheMAGI (8 stars, last pushed 14d ago), licensed MIT. It adds 305 tokens to every session and 1,599 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

Related

Other agents, from other repositories

report-generator

Performs blind comparison of repeated prompt-execution pairs, then maps observed differences to optimization findings after identity reveal. Use when original and optimized prompt trials are available.

shinpr/rashomon · 35 tokens

prompt-analyzer

Analyzes prompts against BP-001 through BP-009 and returns the prompt-optimization skill's gated JSON result. Use when prompt text or a prompt file is provided for optimization.

shinpr/rashomon · 40 tokens

prompt-engineer

Expert prompt engineer specializing in advanced prompting techniques, LLM optimization, and AI system design. Masters chain-of-thought, constitutional AI, and production prompt strategies. Use when building AI features, improving agent performance, or crafting system prompts.

HermeticOrmus/claude-code-game-development · 51 tokens

forkmind-debugger

Drives ForkMind to debug, compare, or regression-test LLM / agent calls in an isolated context. Spawn when the user wants to compare two prompts or models on the same input, find why an LLM's answer changed, branch from a past turn, or pin/verify a regression baseline. Returns a compact verdict (winner, diffs, drift)…

Medhovarsh/forkmind · 89 tokens

prompts-guide

Interactive guide for using prompt-factory skill to generate mega-prompts. Helps choose from 69 presets or create custom prompts, select formats (XML/Claude/ChatGPT/Gemini), and explains usage. Use when user wants to generate production-ready prompts for any LLM.

alirezarezvani/claude-code-skill-factory · 60 tokens

text-optimizer

Optimizes text/docs for LLM token efficiency. Triggers: optimize prompt, reduce tokens, compress.

kochetkov-ma/claude-brewcode · 25 tokens