Agent skill
codex-parallel-subagents
[DEPRECATED] Run multiple AI agent threads in parallel with bounded concurrency. Use evolving-workflow instead.
Install this agent skill to your Project
npx add-skill https://github.com/moonbit-community/codex-sdk/tree/main/skills/codex-parallel-subagents
SKILL.md
Codex Parallel Subagents
DEPRECATED: This skill is deprecated. Use evolving-workflow instead, which provides a declarative workflow API with built-in parallel execution support via
.concurrency(n).
Run multiple AI agent threads concurrently with bounded parallelism and collect results safely.
When to use this skill
- Running multiple agent tasks in parallel
- Fan-out work across files, packages, or repositories
- Batch processing with rate limiting
- Streaming progress from concurrent tasks
- Collecting structured outputs from multiple agents
Quick navigation
| Need | Resource |
|---|---|
| New to Codex SDK | references/codex-basics.md |
| Advanced options | references/codex-advanced.md |
| Async patterns | references/async-basics.md |
| Troubleshooting | references/troubleshooting.md |
Production-ready assets
Copy these to jumpstart your implementation:
| Asset | Description | Run |
|---|---|---|
| parallel_batch | Reentrant batch processing with stdin/file input, offset/limit, JSON output | moon run -C assets/parallel_batch assets/parallel_batch |
| package_analyzer | Discover and summarize all MoonBit packages | moon run -C assets/package_analyzer assets/package_analyzer |
How to use these assets
- Copy the asset directory to your project
- Customize
run_task()(or the main processing function) for your use case - Adjust structs (
TaskInput, etc.) if you need additional fields - Set environment variables as needed (
CODEX_WORKDIR,PARALLELISM)
See each asset's README for detailed usage and options.
Key rules
- One thread per task - never share threads across concurrent tasks
- Use semaphores - guard parallel runs with
@async.Semaphore::new(n)to avoid rate limits - Set working directory - use
ThreadOptions::new(working_directory=...)for task isolation - Allow failures - use
allow_failure=trueand capture errors per task - Avoid conflicts - for tasks that modify shared resources (e.g., building software, editing same files), use git worktrees or separate directories to isolate each agent
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
evolving-workflow
Templates for building parallel AI agent workflows in MoonBit. Includes patterns for simple fan-out processing and multi-phase orchestration with automatic retry and validation.
mbt-wasip1-tools
Build small MoonBit WASIp1 CLI tools using the peter-jerry-ye/wasi library, focused on simple read/write tasks (echo, cat, wc, simple file ops). Use when creating or updating CLI examples, scripts, or skills for this repo.
portable-safe-skills
Create portable, safe Codex skills focused on file or I/O operations under WASIp1 constraints. Use when authoring skills that must be portable across environments and avoid unsafe assumptions about paths, preopens, or stdio.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
Didn't find tool you were looking for?