SKILL.md--- name: orchestration-native-invoke description: "Invoke external AI CLIs via native Task agents (Claude, Codex, Gemini, Cursor). Primary mode for multi-provider orchestration with fork-terminal fallback for auth." type: documentation --- # Purpose > **Note**: This is a documentation/guide skill. It provides instructions for invoking > external AI CLIs using Claude Code's native Task agents. Read this skill to learn > the patterns, then use the Task tool manually with `subagent_type="general-purpose"`. Invoke external AI coding CLIs using Claude Code's native Task agents. This is the primary mode for multi-provider orchestration, with fork-terminal as fallback for authentication. ## Variables | Variable | Default | Description | |----------|---------|-------------| | DEFAULT_AGENT | gemini | Agent to use when not explicitly specified | | ENABLED_CODEX | true | Enable OpenAI Codex via native agent | | ENABLED_GEMINI | true | Enable Google Gemini via native agent | | ENABLED_CURSOR | true | Enable Cursor Agent via native agent | | RUN_IN_BACKGROUND | true | Run agents asynchronously | | PARALLEL_EXECUTION | true | Launch multiple agents in parallel | | AUTO_RETRY_ON_AUTH | true | Auto-retry with fork-terminal on auth failure | | READ_ONLY_MODE | true | Prevent agents from modifying codebase | | CLEANUP_AGENT_FILES | true | Clean up any files agents write to repo | ## Prerequisites ### CLI Permissions for Subagents Native Task agents (subagents) require pre-approved permissions to execute CLI commands. Without these, the Bash tool will be "auto-denied (prompts unavailable)". **Required in `.claude/settings.json`**: ```json { "permissions": { "allow": [ "Bash(codex:*)", "Bash(gemini:*)", "Bash(cursor-agent:*)" ] } } ``` **Setup**: Run `/ai-dev-kit:setup` to configure permissions automatically. **Manual**: Add permissions via Claude Code settings or approve when prompted. **Fallback**: If permissions are denied, use fork-terminal for interactive execution. ## Instructions **MANDATORY** - You MUST follow the Workflow steps below in order. Do not skip steps. ### Agent Selection 1. **Explicit request**: If user specifies an agent, use that agent 2. **No agent specified**: Use DEFAULT_AGENT 3. **Check enabled**: Verify the ENABLED_* flag is true before proceeding ### Reading Cookbooks - Based on the selected agent, read the appropriate cookbook from `../spawn/agent/cookbook/` - You MUST run `--help` on the CLI before constructing the command - Follow cookbook instructions for non-interactive flags ## Red Flags - STOP and follow Cookbook If you're about to: - Launch a native agent without reading the cookbook first - Execute a CLI command without running --help - Skip steps because "this is simple" - Use interactive flags in non-interactive context **STOP** -> Read the appropriate cookbook file -> Check --help -> Then proceed > **Critical**: Native agents