parallel_agents
Run test-first development as a graph of parallel agents: decomposes tasks, writes failing tests, implements to pass, and iterates quality checks until threshold or max iterations.
Instructions
Run a test-first development workflow as a graph of parallel agents: a decomposer splits the task into atomic subtasks, RED-phase agents write failing tests, GREEN-phase agents implement to pass them, then a quality reviewer iterates the cycle until a threshold is met or max_iterations runs out. Use for self-contained features that benefit from test-first discipline and can be parallelized. For a single agent on a single task, use spawn_subagent. For a generate→review→fix loop on one code blob (no test infrastructure), use dual_iterate. ⚠️ DESTRUCTIVE when write_files:true (default): generated tests, implementation, and refactor outputs are written under work_directory in red/, green/, refactor/ subdirectories (defaults to /tmp/parallel-agents-<timestamp>). Returns: {success, task, decomposition (decomposer's plan), execution:{groups_executed, tasks_completed, tasks_failed, max_parallel_used, files_written, write_files_enabled}, router_info:{slots, model, status}, quality:{verdict, score, iterations}, synthesis (combined output), files:[absolute paths written], work_directory, processing_time_ms, metrics}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | High-level task to decompose and execute via TDD workflow | |
| max_parallel | No | Maximum parallel agents (matches GPU slots, default: 2) | |
| iterate_until_quality | No | Whether to iterate on failed quality checks | |
| max_iterations | No | Maximum quality gate iterations (prevents infinite loops) | |
| write_files | No | Write generated code to files in work_directory (default: true). Files are organized by phase (red/green/refactor subdirectories). | |
| work_directory | No | Optional directory for generated files (default: /tmp/parallel-agents-{timestamp}) |