| name | magi-analysis |
| description | Multi-perspective agent analysis system inspired by the MAGI supercomputers from Evangelion. Spawns three sub-agents (Melchior, Balthasar, Caspar) that evaluate the same problem from different angles and reach a consensus by majority vote. Use this skill for decisions with genuine uncertainty, significant consequences, or real trade-offs. Trigger phrases: "MAGI", "three perspectives", "multi-perspective analysis", "MAGI review", or explicit requests for multi-angle evaluation. NOT suitable for trivial questions, simple bugs, or decisions with obvious answers.
|
MAGI System — Multi-Perspective Analysis Skill
Overview
The MAGI system uses three specialized sub-agents to analyze problems from
complementary perspectives, then synthesizes their verdicts into a final
consensus. Each agent has a distinct analytical lens:
| Agent | Codename | Lens |
|---|
| Melchior | Scientist | Technical rigor & correctness |
| Balthasar | Pragmatist | Practicality & maintainability |
| Caspar | Critic | Risk, edge cases & failure modes |
Workflow
Step 1: Evaluate complexity and detect mode
Complexity gate: Before launching three sub-agents, assess whether the request
warrants multi-perspective analysis. If the request is simple (single function review,
obvious bug fix, straightforward question with one clear answer), respond directly
without invoking the full MAGI system. MAGI adds value when there is genuine
uncertainty, multiple valid approaches, or significant consequences for a wrong decision.
If the request warrants MAGI, classify into one of three modes:
code-review — The user provides code or a diff to evaluate.
design — The user asks about architecture, approach selection, or solution design.
analysis — General problem analysis, debugging, trade-offs, or decisions.
If ambiguous, default to analysis.
Step 2: Prepare the prompt payload
Construct a single PROMPT_PAYLOAD variable containing:
MODE: <code-review | design | analysis>
CONTEXT: <user's full question, code, or description>
If the user provided files, include their contents (or relevant excerpts) in the CONTEXT block.
Step 3: Launch the three agents
Model selection: The default model for all agents is pro (mapped to gemini-2.5-pro).
Valid short names: pro, flash, lite. If the user explicitly requests
a different model (e.g., "use flash", "use lite"), use that short name.
Parallel mode (preferred): Use the run_shell_command tool to execute the Python orchestrator.
The orchestrator launches all three agents in parallel, applies timeouts, validates
outputs using a JSON schema, and runs synthesis automatically:
python skills/magi/scripts/run_magi.py <mode> <input_file_or_text> [--model pro] [--timeout 900]
The orchestrator handles everything: agent launching, schema-driven output parsing,
failure alerting, consensus synthesis, and report generation.
Native sub-agent mode: If shell execution is unavailable, use the invoke_agent tool (generalist)
to launch three sub-agents in parallel, each with its respective system prompt and the
shared PROMPT_PAYLOAD.
Read each agent's system prompt from the agents/ directory:
agents/melchior.md
agents/balthasar.md
agents/caspar.md
Step 4: Synthesize the consensus (only for native sub-agent mode)
Skip this step if you used the Python orchestrator in Step 3 — it runs synthesis
automatically and outputs the full canonical report to stdout.
If you used native sub-agent mode, you must run the synthesis script or logic to calculate
the verdict using the weights: approve=1, conditional=0.5, reject=-1.
Step 5: Present the results
⚠ MANDATORY FINAL OUTPUT CONTRACT
Every MAGI invocation MUST end with the canonical output generated by the orchestrator.
- Parallel mode: Copy the stdout of
run_magi.py verbatim into your reply. Do not paraphrase, summarize, or strip sections.
- Do not prepend a "here are the results" preamble that displaces the ASCII banner.
Canonical output template (example)
+==================================================+
| MAGI SYSTEM -- VERDICT |
+==================================================+
| Melchior (Scientist): APPROVE (95%) |
| Balthasar (Pragmatist): CONDITIONAL (85%) |
| Caspar (Critic): REJECT (70%) |
+==================================================+
| CONSENSUS: GO WITH CAVEATS (2-1) |
+==================================================+
## Key Findings
[!!!] **[CRITICAL]** Security risk in... _(from caspar)_
[!!] **[WARNING]** Performance bottleneck... _(from melchior)_
## Dissenting Opinion
**Caspar (Critic)**: Risk of X outweighs speed...
## Conditions for Approval
- **Balthasar**: Add tests for Y
## Recommended Actions
- **Melchior** (Scientist): Optimize loop...
- **Balthasar** (Pragmatist): Ship with conditions...
- **Caspar** (Critic): Re-evaluate security...
Security & Auth
- The system uses the native Gemini CLI authentication.
- No
GOOGLE_API_KEY is required in the environment for basic usage.
- Never log or share the content of analyzed files outside the session.