zdenham/anvil/orchestrate

Claude Code and agent skill by zdenham/anvil

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Orchestrate multiple agents programmatically using anvil-repl

Install

npx vskill@latest install zdenham/anvil/orchestrate

SKILL.md

Agent Orchestration

You can programmatically spawn and coordinate child agents using the anvil-repl command. This runs TypeScript/JavaScript code with an injected anvil SDK object.

Usage

Call the Bash tool with a anvil-repl heredoc:

bash
anvil-repl <<'ANVIL_REPL'
// your code here — `anvil` object is available
ANVIL_REPL

API Reference

anvil.spawn({ prompt, contextShortCircuit? }) — Spawn a child agent

Spawns a new agent process and waits for it to complete. Returns the child's last assistant message as a string.

javascript
const result = await anvil.spawn({ prompt: "Fix the failing auth tests" });
// result is a string — the child's last assistant message content

Optional: contextShortCircuit nudges the child to save progress when context pressure gets high:

javascript
await anvil.spawn({
prompt: "Implement the auth module",
contextShortCircuit: {
limitPercent: 80,
message: "You are running low on context. Save progress to plans/auth-progress.md, then stop.",
},
});
anvil.log(message) — Log a message
javascript
anvil.log("Starting parallel test fixes...");
anvil.context — Parent context (read-only)
javascript
anvil.context.threadId // parent thread ID
anvil.context.repoId // repository ID
anvil.context.worktreeId // worktree ID
anvil.context.workingDir // parent working directory
anvil.context.permissionModeId // current permission mode

Patterns

Parallel spawning
bash
anvil-repl <<'ANVIL_REPL'
const [authResult, apiResult] = await Promise.all([
anvil.spawn({ prompt: "Fix auth module tests" }),
anvil.spawn({ prompt: "Fix API endpoint tests" }),
]);
return `Auth: ${authResult.slice(0, 200)}\nAPI: ${apiResult.slice(0, 200)}`;
ANVIL_REPL
Sequential with conditional logic
bash
anvil-repl <<'ANVIL_REPL'
const analysis = await anvil.spawn({ prompt: "Analyze test failures and list them" });
const fix = await anvil.spawn({ prompt: `Fix these issues:\n${analysis}` });
return fix;
ANVIL_REPL
Loop over items
bash
anvil-repl <<'ANVIL_REPL'
const files = ["auth.ts", "api.ts", "db.ts"];
const results = await Promise.all(
files.map(f => anvil.spawn({ prompt: `Review ${f} for security issues` }))
);
return results.map((r, i) => `${files[i]}: ${r.slice(0, 100)}`).join("\n");
ANVIL_REPL

Notes

  • Do NOT use `run_in_background: true` when invoking anvil-repl. The REPL manages long-running execution internally. Always run in the foreground.
  • The result of your code is returned as the Bash tool output. Use return to send data back.
  • anvil.spawn() returns a string — the child's last assistant message content.
  • Spawned agents appear in the sidebar immediately and stream output in real-time.
  • Each spawned agent is a fully independent process with its own conversation.
  • anvil.spawn() blocks until the child completes — use Promise.all for parallelism.
  • Results over 50KB are truncated. The child's threadId is logged for full output.
  • TypeScript type annotations are supported (stripped at runtime via ts.transpileModule).
  • Keep REPL code minimal. REPL scripts should be thin orchestration glue — primarily anvil.spawn() calls with Promise.all. Avoid writing business logic, file parsing, or complex algorithms in REPL code. If you need to read files, reason about data, or edit files, do that as the agent using your normal tools (Read/Edit/Write), not programmatically in the REPL.

Security

  • Security scanPassed, 96 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/zdenham/anvil/orchestrate/badge)](https://verified-skill.com/skills/zdenham/anvil/orchestrate)

Something wrong with this skill or its page? Tell us.