with one click
task-bg
// Launch and manage background tasks for parallel droid execution using background-manager.py. Factory Droid has no native run_in_background, so this uses manual Python-based background management.
// Launch and manage background tasks for parallel droid execution using background-manager.py. Factory Droid has no native run_in_background, so this uses manual Python-based background management.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | task-bg |
| description | Launch and manage background tasks for parallel droid execution using background-manager.py. Factory Droid has no native run_in_background, so this uses manual Python-based background management. |
<Use_When>
<Do_Not_Use_When>
ultrawork which manages task-bg internally
</Do_Not_Use_When><What_You_MUST_Do>
python3 hooks/background-manager.py launch ...~/.factory/.omd/background-tasks/list for summary or status <id> for specific taskoutput <id> to read stdout/stderr<What_You_MUST_NOT_Do>
<Why_Manual_Python>
Factory Droid CLI does not support run_in_background: true like some other platforms. Instead, we use background-manager.py which:
droid exec --auto <autonomy> -- "<prompt>" as a background process~/.factory/.omd/background-tasks/ as JSON files (task state) and .out files (output)SubagentStop hook via hook-complete for automatic completion tracking
</Why_Manual_Python><Background_Manager_CLI>
python3 hooks/background-manager.py launch "<description>" "<prompt>" <droid> <parent_session_id> [autonomy_level] [model]
description: Short task label (3-5 words)prompt: Full task instructions for the droiddroid: Droid name (e.g., executor-med, explorer)parent_session_id: Current session ID (use "main" if unknown)autonomy_level: low | medium (default) | highmodel: Optional model override# Search task (low autonomy - read only)
python3 hooks/background-manager.py launch "Find auth patterns" "Find all authentication implementations in src/" explorer "main" low
# Implementation task (medium autonomy - default)
python3 hooks/background-manager.py launch "Fix API errors" "Fix all validation errors in src/api/" executor-med "main" medium
# Complex task (high autonomy + model override)
python3 hooks/background-manager.py launch "Refactor auth" "Refactor auth module to support OAuth2" executor-high "main" high opus
# Multiple tasks in parallel
python3 hooks/background-manager.py launch "Fix auth" "Fix auth module errors" executor-med "main"
python3 hooks/background-manager.py launch "Fix API" "Fix API route errors" executor-med "main"
python3 hooks/background-manager.py launch "Fix UI" "Fix frontend type errors" executor-med "main"
# List all tasks with status summary (total, running, queued, completed, error)
python3 hooks/background-manager.py list
# Check specific task status (returns full task JSON)
python3 hooks/background-manager.py status <task_id>
# Get task stdout/stderr output from .out file
python3 hooks/background-manager.py output <task_id>
python3 hooks/background-manager.py complete <task_id> "<result>" [error_message]
# Prune stale/timed-out tasks (marks as ERROR, respects TTL of 30 min)
python3 hooks/background-manager.py prune
# Reset all tasks from memory (does NOT delete .json files)
python3 hooks/background-manager.py cleanup
# Reads session_id from stdin JSON, finds matching task, marks complete with transcript result
python3 hooks/background-manager.py hook-complete
</Background_Manager_CLI>
<Autonomy_Levels>
| Level | Droid exec flag | Use Case |
|---|---|---|
low | --auto low | Read-only analysis, search, documentation |
medium | --auto medium | Most development tasks (DEFAULT) |
high | --auto high | Complex refactoring, broad file access |
| </Autonomy_Levels> |
<Available_Droids>
| Droid | Best For |
|---|---|
basic-searcher | Simple file/pattern search |
explore / explorer | Codebase exploration |
librarian | External documentation research |
oracle | Debugging and root cause analysis |
executor-low | Simple changes, config edits |
executor-med | Standard implementation (DEFAULT) |
executor-high | Complex multi-file changes |
hephaestus | Architecture-level work |
code-reviewer | Code quality review |
security-auditor | Security analysis |
test-engineer | Test creation and coverage |
| </Available_Droids> |
<Task_Lifecycle>
launch() -> RUNNING -> complete() -> COMPLETED
-> error -> ERROR
-> prune() -> ERROR (timeout/stale)
Files per task:
~/.factory/.omd/background-tasks/<task_id>.json - Task state (status, progress, metadata)~/.factory/.omd/background-tasks/<task_id>.out - Stdout/stderr from droid execHook: SubagentStop event calls background-manager.py hook-complete which reads transcript and auto-completes the matching task.
</Task_Lifecycle>
<Output_Format>
| Task ID | Droid | Status | Result |
|---|---|---|---|
| [id] | executor-med | completed | [summary] |
| [id] | test-engineer | running | 50% |