{"repo": "chrisliu298/relay", "files": {"peers.json": {"a1f370bbfb60d798fe3aaa8e3479c4331866de18": {"t": 1785674165.9964442, "n": 1125, "h": "3543d3ad48b5bcf0", "c": "{\n \"codex\": {\n \"transport\": \"codex\",\n \"model\": \"gpt-5.5\",\n \"effort_values\": [\"medium\", \"xhigh\"],\n \"default_effort\": \"medium\",\n \"template\": \"codex\"\n },\n \"deepseek\": {\n \"transport\": \"claude-env\",\n \"base\": \"https://api.deepseek.com/anthropic\",\n \"key_env\": \"DEEPSEEK_API_KEY\",\n \"model\": \"deepseek-v4-pro\",\n \"extra_env\": { \"CLAUDE_CODE_EFFORT_LEVEL\": \"max\" },\n \"template\": \"costar\"\n },\n \"mimo\": {\n \"transport\": \"claude-env\",\n \"base\": \"https://api.xiaomimimo.com/anthropic\",\n \"key_env\": \"MIMO_API_KEY\",\n \"model\": \"mimo-v2.5-pro[1m]\",\n \"template\": \"costar\"\n },\n \"glm\": {\n \"transport\": \"claude-env\",\n \"base\": \"https://api.z.ai/api/anthropic\",\n \"key_env\": \"GLM_API_KEY\",\n \"model\": \"glm-5.2\",\n \"extra_env\": { \"CLAUDE_CODE_EFFORT_LEVEL\": \"max\" },\n \"template\": \"costar\"\n },\n \"grok-build\": {\n \"transport\": \"grok\",\n \"model\": \"grok-build\",\n \"effort_values\": [\"medium\", \"high\"],\n \"default_effort\": \"medium\",\n \"template\": \"costar\"\n },\n \"grok-composer\": {\n \"transport\": \"grok\",\n \"model\": \"grok-composer-2.5-fast\",\n \"template\": \"costar\"\n }\n}\n"}}, "SKILL.md": {"a1f370bbfb60d798fe3aaa8e3479c4331866de18": {"t": 1785747213.723808, "n": 19028, "h": "3c53300f431d70ba", "c": "---\neffort: medium\nname: relay\ndescription: |\n The ONLY way to call Codex, DeepSeek, MiMo, GLM, or Grok. Use whenever the user\n wants to ask, delegate to, or get a second opinion from Codex, DeepSeek,\n MiMo, GLM, or Grok. Do NOT run the codex, deepseek (ds), mimo (mm), glm, or grok\n CLI directly — from the main agent or a subagent; always use this skill's relay\n call command. Triggers on \"ask/have/send to/get/delegate to codex\" or the same with\n \"deepseek\"/\"mimo\"/\"glm\"/\"grok\", \"second opinion\", \"relay\".\nallowed-tools: Read, Write, Bash(relay:*), Bash(find:*), Bash(printf:*)\nuser-invocable: true\n---\n\n# Relay\n\n**Claude-only.** If `ANTHROPIC_BASE_URL` contains `deepseek`, `xiaomimimo`, or `z.ai`, this skill is unavailable — stop and tell the user: \"relay is Claude-only; a non-Claude session cannot orchestrate other models.\" The relay script also refuses at the shell layer.\n\nCall Codex, DeepSeek, MiMo, GLM, or Grok like a function: one command generates the request, invokes the peer, and prints the response.\n\n> **The peer is a full agent in the Claude Code harness — not a stateless API call.** Relay invokes each peer through its registered transport (DeepSeek/MiMo/GLM via `claude -p` with the model weights swapped — V4-Pro, MiMo-V2.5-Pro, GLM-5.2; Codex via `codex exec`; Grok via its own `grok` CLI), so the peer has your core tools — Bash, file read/write, Grep/Glob, subagents, multi-step agentic loops. It can see this repo, run commands, and verify its own work; delegate file I/O and shell work directly. Do **not** treat it as a one-shot completion that \"can't see the codebase.\" Web tools (WebFetch/WebSearch) are registered on every peer and broadly work — verified 2026-06-06: Codex and both Grok tiers do both; the only gaps are DeepSeek's WebFetch (400 `thinking options ... reasoning_effort` under its forced `max` effort) and MiMo's WebSearch (no live search), and each of those two still has the *other* web tool. So every peer can reach the web — treat browsing as available, not a per-call unknown to re-verify. The only constant difference from you is the model behind the harness.\n\n```\nrelay call --name [--to ] [--effort ] [--body-only] <<'BODY'\ntask\nBODY\n```\n\n`relay` is in PATH. The caller is always Claude (this is a Claude-only skill); the peer defaults to Codex. Pass `--to deepseek`, `--to mimo`, `--to glm`, `--to grok-build`, or `--to grok-composer` to route elsewhere.\n\nIf a bare `relay` ever returns \"command not found\" (a sandboxed/non-zsh/reset-env shell that didn't inherit the PATH entry), re-run the **identical** command with the absolute install path — `~/.claude/skills/relay/scripts/relay call …`. That is the whole recovery; do not reconstruct the call by hand.\n\n**All Codex, DeepSeek, MiMo, GLM, and Grok interactions go through `relay call`.** Do not invoke `codex exec`, the `grok` CLI, or the `ds`/`mm`/`glm` aliases directly, do not spawn agents to run the codex, grok, or claude CLI for these purposes, and do not pass model flags (`-m`, `--model`) — the model and invocation method come from the peer registry (`peers.json`), not the call.\n\n## Peer selection\n\n| Peer | When to pick | How to invoke |\n|---|---|---|\n| **Codex** (default) | Code review, security review, refactoring, agentic coding. GPT-5.5 lineage. Two effort tiers (`medium`/`xhigh`). | `relay call --name ...` (no `--to` needed) |\n| **DeepSeek** | Independent model family for true cross-vendor diversity, frontier reasoning, multi-step analysis. Open-weight V4-Pro (1.6T MoE). Always runs at `max` (DeepThink). Text-only (no image input via relay). | `relay call --to deepseek --name ...` |\n| **MiMo** | Another independent open-weight lineage (Xiaomi MiMo-V2.5-Pro, 1.02T MoE / 42B active, 1M context). Use for a third cross-vendor perspective. No effort knob. Text-only (no image input via relay). | `relay call --to mimo --name ...` |\n| **GLM** | A fourth independent lineage (Zhipu/z.ai GLM-5.2), reached through z.ai's Anthropic-compatible endpoint. Use for another cross-vendor perspective. Pinned to `max` reasoning via the registry (like DeepSeek); ignores `--effort`. Text-only (no image input via relay). | `relay call --to glm --name ...` |\n| **Grok Build** | An independent xAI lineage (`grok-build`), xAI's agentic coding model. Runs via grok's own CLI in headless mode (not Anthropic-compatible). Effort `medium`/`high` (default `medium`). | `relay call --to grok-build --name ...` |\n| **Grok Composer** | xAI's fast model (`grok-composer-2.5-fast`) — same lineage as Grok Build, lighter/cheaper. Use as a faster xAI option (not a distinct cross-vendor perspective). No effort knob. | `relay call --to grok-composer --name ...` |\n\nPick Codex by default — it's the strongest general-purpose coding agent and integrates cleanly with the relay protocol. Pick DeepSeek, MiMo, GLM, or Grok Build for a perspective from a model trained outside both the Anthropic and OpenAI lineages, or when running `/prism` Parallax (Grok Composer is a faster xAI variant, not a distinct lineage from Grok Build). Of these, only Grok Build has an effort knob (`medium`/`high`); DeepSeek, MiMo, GLM, and Grok Composer ignore `--effort`, so omit it for them. DeepSeek requires `DEEPSEEK_API_KEY`, MiMo requires `MIMO_API_KEY`, and GLM requires `GLM_API_KEY` in the environment; Grok uses its own cached login (no key var).\n\n### Peer registry\n\nEvery model-family fact — transport (`codex` CLI vs a generic `claude-env` Anthropic-compatible envelope), endpoint, key variable, model id, effort knob, per-peer extras, and launcher template style — lives once in `peers.json` next to the script. `relay` and `prism-launch` both read it, so **adding a peer that reuses an existing transport is one stanza** there, not edits across the script, the prism launcher, and the docs. The `claude-env` peers share one code path that differs only by registry data; Codex and Grok each have their own transport. Two deliberate exceptions stay in code, not data: a brand-new *transport* needs its own script branch (this is how `grok` was added — its own headless-CLI invocation), and a new `claude-env` peer should also get its endpoint added to the inbound Claude-only refusal at the top of the script (a one-line safety guard that must run before the registry is loaded). Grok needs no refusal entry — it sets no `ANTHROPIC_BASE_URL`, and the transport-agnostic `RELAY_PEER` guard already blocks a dispatched grok peer from recursing. The interactive `ds`/`mm`/`glm` launchers in `shell/.functions` are a separate consumer and still carry their own copy — keep them in sync.\n\n### Common Mistakes\n- **Premature failure diagnosis**: If a relay call was launched with `run_in_background: true`, do not inspect `.relay` files or enter the failure flow until the background task's completion notification arrives. No notification means the peer is still running.\n- **Wrapping relay in a subagent**: Do not spawn an Agent that then calls `relay` inside. When the subagent completes, the platform kills its child processes — including the still-running peer CLI. Call `relay` directly from the main conversation with `run_in_background: true` instead.\n- **Empty heredoc body**: The `<<'BODY'` ... `BODY` block must contain text — an empty body causes an immediate error.\n- **Missing `--name`**: Every call requires `--name` — omitting it is a script error, not a peer failure.\n\n## Example\n\n```bash\nrelay call --name auth-review --effort medium <<'BODY'\nReview src/auth.py for security issues. Run pytest to verify.\nBODY\n```\n\n## Effort Levels\n\n`--effort` applies to Codex and Grok Build. Codex accepts `medium`/`xhigh`; Grok Build accepts `medium`/`high` (default `medium`). DeepSeek and GLM always run at `max` reasoning (DeepSeek via DeepThink; GLM via `reasoning_effort: max`, pinned in the registry), and MiMo and Grok Composer have no effort knob — the flag is silently ignored or omitted on those calls.\n\n| Level | When to use |\n|-------|-------------|\n| `medium` | **Default for Codex and Grok Build.** Balanced starting point for code review, tests, bug fixes, and most refactoring. |\n| `xhigh` | Codex only. Hard architecture work, deep security review, or eval-bound tasks worth the extra latency. |\n| `high` | Grok Build only — its deeper reasoning tier. Use for hard analysis where the extra latency is worth it. |\n\nBefore raising effort, improve the prompt first — add outcome-first success criteria, stop rules, verification steps, and completeness criteria.\n\n## Prompting Codex\n\n**Before composing the prompt body, read the prompt-engineer references** — `~/.claude/skills/prompt-engineer/references/gpt.md` for cross-cutting GPT-5.5 prompt patterns and `~/.claude/skills/prompt-engineer/references/codex.md` for Codex coding agent patterns. If those symlinks are unavailable, use the repo copies at `agents/extensions/skills/prompt-engineer/references/`. This is not optional — the guides contain model-specific patterns that materially affect output quality.\n\nLead with the outcome, not the procedure. GPT-5.5 responds best to outcome-first prompts — state the goal, success criteria, and stop rules, then let Codex pick the path. Use XML scaffolding only when a specific failure mode needs it:\n\n- `` — when format precision matters\n- `` — when the task has discrete items that must all be covered\n- `` — when post-change validation is required\n\n**Example:**\n\n```bash\nrelay call --name pool-refactor --effort medium <<'BODY'\nAdd connection timeouts and stale-connection recovery to src/db/pool.py.\n\nSuccess criteria:\n- ConnectionPool accepts a timeout_seconds parameter at construction\n- stale connections are auto-reconnected on use\n- a reclaim_stale() method exists for explicit cleanup\n- existing callers keep working without changes\n\n\nRun pytest tests/test_pool.py — all tests must pass. No new lint errors.\n\n\n\nSummary of changes, one per line, with file path and description.\n\nBODY\n```\n\n## Prompting DeepSeek, MiMo, GLM, and Grok\n\nThese are all independent (non-Anthropic/OpenAI) models that respond well to XML-scaffolded, structured prompts. **Before composing a DeepSeek prompt body, read `~/.claude/skills/relay/references/deepseek.md`** (symlinked to the prompt-engineer reference) — it covers the CO-STAR framework, XML scaffolding conventions, thinking-mode quirks, and DeepThink failure modes. This is not optional — the guide contains model-specific patterns that materially affect output quality. MiMo-V2.5-Pro, GLM-5.2, and Grok (both models) have no dedicated reference; treat them like DeepSeek.\n\nDefault to XML scaffolding (DeepSeek V4 was trained heavily on XML-tagged data; MiMo, GLM, and Grok behave similarly). The CO-STAR sections — ``, ``, `