golemcloud/golem/golem-parallel-workers-ts
Claude Code and agent skill by golemcloud/golem
- community
Checking that the SKILL.md file is still in the repository.
Fan out work to multiple parallel agents and collect results in a TypeScript Golem project. Use when the user asks about parallel execution, fan-out/fan-in, spawning child agents for parallel work, forking, or aggregating results from multiple agents.
Install
npx vskill@latest install golemcloud/golem/golem-parallel-workers-tsSKILL.md
The same SKILL.md was published earlier as golemcloud/golem/golem-parallel-workers-ts.
Parallel Workers — Fan-Out / Fan-In (TypeScript)
Overview
Golem agents process invocations sequentially. Async I/O can overlap cooperatively within one invocation, but it does not provide CPU-thread parallelism. Distribute work across multiple agent instances for parallel invocation execution. This skill covers two approaches:
- Child agents via `await AgentDef.client.create(id)` — create separate agent instances, dispatch work, and collect results
- `fork()` — clone the current agent at the current execution point for lightweight parallel execution
Approach 1: Child Agent Fan-Out
Spawn child agents, call them concurrently with Promise.all, and aggregate results.
Basic Pattern
Chunked Fan-Out
When spawning many children, batch them to limit concurrency:
Fire-and-Forget with Promise Collection
For long-running work, trigger children with .trigger() and collect results via Golem promises. A PromiseId is a nested record that holds bigints (the agent ID, the fingerprint of the agent incarnation that created it, and the oplog index), so ship it across the agent boundary as a bigint-aware JSON string:
Error Handling
Use Promise.allSettled to handle partial failures:
Approach 2: fork()
fork() clones the current agent at the current execution point, creating a new agent instance with the same state, a new agent ID, and no key. Both sides receive the forked agent's ID in result.val.forkedAgentId. Only a durable agent can fork, and the forked agent is durable too. Use Golem promises to synchronize between the original and forked agents.
Basic Fork Pattern
Multi-Fork Fan-Out
Fork multiple times for N-way parallelism:
When to Use Which Approach
| Criteria | Child Agents | fork() | |
|---|---|---|---|
| Work is independent and stateless | ✅ Best fit | Works but overkill | |
| Need to share current state with workers | ❌ Must pass via args | ✅ Forked copy inherits state | |
| Need a caller-selected key | ✅ Use client.upsert(id) with a coordinator/job namespace | New agent ID and no key; durable and addressable with client.getById(result.val.forkedAgentId) | |
| Number of parallel tasks is dynamic | ✅ Spawn as many as needed | ✅ Fork in a loop | |
| Need simple error isolation | ✅ Child failure doesn't crash parent | ⚠️ Forked agent shares oplog lineage |
Key Points
- No threads: Golem is single-threaded per agent — parallelism is achieved by distributing across agent instances
- Durability: All RPC calls, promises, and fork operations are durably recorded — work survives crashes
- Deadlock avoidance: Never have two agents awaiting each other synchronously — use
.trigger()to break cycles - Identity: These examples create new durable agents without a key with
create(...). Retainawait client.agentId()to address one later withgetById. If usingupsert(id)instead, namespace the id records by coordinator and job to avoid sharing children unintentionally. - Cleanup: Durable children and forks persist after the coordinator finishes. Delete only instances the coordinator owns and no caller still needs; never delete shared workers merely because one job finished.
Security
- Security scanPassed, 100 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
- SKILL.md in the repositoryCheckinggolem-skills/skills/ts/golem-parallel-workers-ts/SKILL.md
Popularity
- Repository stars
- 1,522
- Repository forks
- 210
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. 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
[](https://verified-skill.com/skills/golemcloud/golem/golem-parallel-workers-ts)