# cli-delegation > Delegating tasks to specialized CLI tools with async/parallel execution support - Author: Claude Assistant - Repository: mfethe1/skills - Version: 20260123221508 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/mfethe1/skills - Web: https://mule.run/skillshub/@@mfethe1/skills~cli-delegation:20260123221508 --- --- name: cli-delegation description: Delegating tasks to specialized CLI tools with async/parallel execution support triggers: - auggie - gemini - codex - opencode - delegate - async - parallel allowed-tools: - Bash - Read - Write --- # CLI Delegation > Delegating tasks to specialized CLI tools with async/parallel execution support. ## Available Platforms (with YOLO Mode) | Platform | YOLO Command | Safe Command | Best For | |----------|--------------|--------------|----------| | **Claude** | `claude --dangerously-skip-permissions --print` | `claude --print` | Complex reasoning, code review | | **Gemini** | `gemini --yolo` | `gemini` | Research, large context (1M+ tokens) | | **Codex** | `codex --yolo` | `codex --full-auto` | Code generation, refactoring | | **OpenCode** | `opencode run` (config-based) | `opencode run` | Local execution, file ops | | **Augment** | `auggie` | `auggie` | Codebase-aware tasks | > **YOLO Mode**: Use YOLO commands for autonomous operation without permission prompts. > Run `python skills/multi-platform-async/scripts/async_dispatch.py yolo-info` for full setup details. ## Instructions 1. **Identify**: Choose the right tool for the job 2. **Prompt**: Construct clear, self-contained prompts 3. **Execute**: Run synchronously or asynchronously 4. **Integrate**: Parse output and integrate back into context ## Synchronous Execution (YOLO Mode) ```bash # Claude for reasoning (YOLO mode) claude --dangerously-skip-permissions --print "Analyze the architecture of this codebase" # Gemini for research (YOLO mode) gemini --yolo "Research best practices for microservices" # Codex for code generation (YOLO mode) codex --yolo "Generate unit tests for utils.py" # OpenCode for local execution (YOLO via config) opencode run "List all TODO comments in the project" ``` ## Async/Parallel Execution (YOLO Mode) ### Pattern 1: Fire-and-Forget Parallel ```bash # Start multiple tasks in background with YOLO mode claude --dangerously-skip-permissions --print "Analyze src/" > /tmp/claude.txt 2>&1 & gemini --yolo "Research X" > /tmp/gemini.txt 2>&1 & codex --yolo "Refactor Y" > /tmp/codex.txt 2>&1 & # Wait for all wait # Collect results cat /tmp/claude.txt /tmp/gemini.txt /tmp/codex.txt ``` ### Pattern 2: Fan-Out/Fan-In ```bash QUERY="How should we implement feature X?" # Fan out to multiple models (YOLO mode) claude --dangerously-skip-permissions --print "$QUERY" > /tmp/claude.txt & gemini --yolo "$QUERY" > /tmp/gemini.txt & wait # Fan in - compare and synthesize echo "=== Claude ===" && cat /tmp/claude.txt echo "=== Gemini ===" && cat /tmp/gemini.txt ``` ### Pattern 3: Pipeline (YOLO Mode) ```bash # Research → Generate → Review (all YOLO) gemini --yolo "Research: best patterns for X" > research.md codex --yolo "Based on research.md, implement solution" claude --dangerously-skip-permissions --print "Review the implementation for issues" ``` ## Error Handling ```bash if claude --print "task" > result.txt 2>&1; then echo "Success" cat result.txt else echo "Failed" cat result.txt fi ``` ## Verification ### Script Validation Verify scripts work correctly before using: 1. **Syntax Check** ```bash python -m py_compile scripts/.py ``` 2. **Help Test** ```bash python scripts/.py --help ``` 3. **Dry Run** (if supported) ```bash python scripts/.py --dry-run ``` ### Execution Verification After running scripts: - Check exit code (0 = success) - Review stdout/stderr for errors - Verify expected output files exist ### Failure Handling If script execution fails: 1. Check error message for root cause 2. Verify input parameters are correct 3. Check dependencies are installed 4. Retry with verbose flag if available ## See Also - `skills/multi-platform-async/SKILL.md` - Full async orchestration patterns - `skills/rlm/SKILL.md` - RLM chunking for large contexts