<< All versions

Skill v1.0.0

currentLLM-judged scan90/100
jakelevirne/pi-relay/pi-fanout
──Details
PublishedOctober 24, 2026 at 09:26 AM
Content Hashsha256:122fb25455a5b6c6...
Git SHA937695f502dc
──Files
Files (1 file, 4.4 KB)
SKILL.md4.4 KBactive
SKILL.md · 95 lines · 4.4 KB

version: "1.0.0" name: pi-fanout description: Fan Claude Code work out to a non-Claude model (Kimi K3 by default, or any model pi supports such as GLM, MiniMax, DeepSeek) through the pi-relay plugin. Use when the user says "fan out to kimi", "run this on kimi/glm/pi", "use cheap workers", "have pi do the design/implementation", or wants a Workflow where some or all steps run on a different model while Claude orchestrates and reviews.


pi-fanout

The pi-relay plugin gives every Claude Code session a relay subagent, pi-relay:pi-runner, that runs one headless pi job and returns pi's output verbatim. Claude keeps the orchestration and the judgment steps; pi does the generation.

Before the first run on a machine

Run "${CLAUDE_PLUGIN_ROOT}/bin/pi-doctor". It checks that pi is installed, the model is in pi's catalog, credentials exist, and a three-second smoke test passes. If it fails, stop and show the user the output; nothing below will work until it passes.

The relay task format

A relay task is plain text. MODE and PROMPT are required; the rest are optional.

MODE: text | build
CWD: <directory for build mode; default: current working directory>
MODEL: <pi model id> e.g. accounts/fireworks/models/kimi-k3
PROVIDER: <pi provider> e.g. fireworks
THINKING: off|minimal|low|medium|high
PROMPT:
<the prompt, verbatim, to the end>

text mode gives pi no tools: use it for answers, plans, reviews, JSON. build mode gives pi its read/bash/edit/write tools inside CWD: use it when pi should create or change files. Defaults come from env PI_RELAY_PROVIDER, PI_RELAY_MODEL, PI_RELAY_THINKING.

Using it from the Agent tool

Agent({ subagent_type: 'pi-relay:pi-runner',
prompt: 'MODE: text\nPROMPT:\nSummarize the tradeoffs of ...' })

Using it inside a Workflow script

Define one helper and choose per step who does the work:

js
const kimi = (mode, prompt, opts = {}) => agent(
`MODE: ${mode}\nPROMPT:\n${prompt}`,
{ agentType: 'pi-relay:pi-runner', model: 'haiku', effort: 'low', ...opts })
const design = await kimi('build', 'Read the spec below and write DESIGN.md ...') // pi
const impl = await parallel(files.map(f => () =>
kimi('build', `Read DESIGN.md. Write only ${f} ...`, { label: `impl:${f}` }))) // pi, parallel
const review = await agent('Review DESIGN.md against the files ...', { schema }) // Claude

Rules that matter:

  • Keep the relay cheap: always model: 'haiku', effort: 'low'. The relay only copies text

and runs a command.

  • Every step is stateless, exactly like a Claude subagent. Pass context through prompts or

files on disk. A shared contract file (DESIGN.md) is the usual way to let parallel pi runs agree on names.

  • Structured output works: put schema on the relay call and tell pi in the prompt to answer

with JSON in that shape. The relay copies it into the schema.

  • Parallel build steps must write disjoint files, or give each relay

isolation: 'worktree' (pi inherits the relay's cwd).

  • Keep judgment on Claude: reviews, adversarial verification, synthesis, and anything that

decides what happens next. Send generation and mechanical work to pi.

  • Two limits stack: the workflow's concurrency cap and the provider's rate limit. A handful

of parallel pi runs is fine; dozens will queue at the provider.

  • Never put a prompt into a shell command yourself. The relay writes it to a file and

pi-run pipes the file into pi.

Ready-made workflow

Workflow({ name: 'pi-relay:design-build-review', args: {...} }) runs the pattern above end to end: pi writes a design contract, pi implements each file in parallel, Claude reviews for cross-file mismatches, pi applies any blocker/major findings. Args:

js
{
spec: 'one paragraph describing what to build', // required
files: [{ file: 'index.html', note: 'markup only ...' }], // required, one parallel pi run each
designFile: 'DESIGN.md', // optional
skipDesign: false, // true if designFile already exists
model: 'accounts/fireworks/models/kimi-k3', // optional, any pi model id
provider: 'fireworks', // optional
thinking: 'medium', // optional
reviewEffort: 'medium', // optional, Claude review effort
}
All versions