spawn
/spawn
Section titled “/spawn”Purpose
Section titled “Purpose”Launch background tasks for parallel execution. Enables concurrent work on independent tasks with result aggregation.
Launch a background task or manage running tasks.
Spawn Operations
Section titled “Spawn Operations”Launch Task
Section titled “Launch Task”Start a new background task:
/spawn "[task description]"Process:
- Analyze task for parallelizability
- Launch subagent with task
- Return task ID for tracking
- Continue main conversation
Output:
Spawned: Task #1- Description: Research authentication patterns- Status: Running- Agent: researcher
Continue working. Use `/spawn --list` to check status.List Tasks
Section titled “List Tasks”Show running and completed tasks:
/spawn --listOutput:
## Active Tasks
| ID | Description | Status | Duration ||----|-------------|--------|----------|| #1 | Research auth patterns | Running | 2m || #2 | Analyze security | Complete | 5m |
## Completed Tasks (last hour)| #2 | Analyze security | ✅ Complete | Results ready |Collect Results
Section titled “Collect Results”Gather results from completed tasks:
/spawn --collectOutput:
## Collected Results
### Task #1: Research auth patterns**Status**: Complete**Findings**:- Pattern A: JWT with refresh tokens- Pattern B: Session-based with Redis- Recommendation: JWT for stateless API
### Task #2: Analyze security**Status**: Complete**Findings**:- 2 high-priority issues found- See detailed report belowCancel Task
Section titled “Cancel Task”Stop a running task:
/spawn --cancel [id]Task Types
Section titled “Task Types”| Type | Best For | Agent Used |
|---|---|---|
| Research | Information gathering | researcher |
| Analysis | Code analysis | scout |
| Review | Code review | code-reviewer |
| Test | Test generation | tester |
| Scan | Security scanning | security-auditor |
| Flag | Description |
|---|---|
--list | Show all tasks |
--collect | Gather completed results |
--cancel [id] | Cancel running task |
--wait | Wait for all tasks to complete |
--agent=[type] | Specify agent type |
--priority=[high|normal] | Task priority |
Usage Examples
Section titled “Usage Examples”/spawn "Research OAuth2 best practices"/spawn "Analyze user service for performance issues"/spawn "Review security of auth module" --agent=security-auditor/spawn --list/spawn --collect/spawn --wait # Block until all completeArguments
Section titled “Arguments”$ARGUMENTS
If quoted text: spawn that task If flag: execute that operation
Parallel Workflow
Section titled “Parallel Workflow”Pattern: Research Phase
Section titled “Pattern: Research Phase”/spawn "Research authentication approaches"/spawn "Analyze current auth implementation"/spawn "Review competitor auth patterns"# Continue other work.../spawn --wait/spawn --collect# Synthesize findingsPattern: Multi-File Review
Section titled “Pattern: Multi-File Review”/spawn "Review src/auth/ for security"/spawn "Review src/api/ for performance"/spawn "Review src/db/ for SQL injection"/spawn --collect# Address findingsBest Practices
Section titled “Best Practices”- Independent Tasks: Only spawn truly independent work
- Clear Descriptions: Specific task descriptions get better results
- Regular Collection: Don’t let results pile up
- Resource Awareness: Don’t spawn too many concurrent tasks
Limitations
Section titled “Limitations”- Tasks cannot communicate with each other
- Results are collected, not streamed
- Heavy tasks may take time
- Some tasks benefit from sequential execution
Combines With
Section titled “Combines With”- Orchestration mode: Manages multiple spawned tasks
/plan: Plan tasks, then spawn parallel execution/execute-plan: Orchestrated task execution
Gap Analysis Rule
Section titled “Gap Analysis Rule”Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.