skills/consiliency/orchestration-native-invoke/SKILL.md
Invoke external AI CLIs via native Task agents (Claude, Codex, Gemini, Cursor). Primary mode for multi-provider orchestration with fork-terminal fallback for auth.
npx skillsauth add aiskillstore/marketplace orchestration-native-invokeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
| 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 |
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:
{
"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.
MANDATORY - You MUST follow the Workflow steps below in order. Do not skip steps.
../spawn/agent/cookbook/--help on the CLI before constructing the commandIf you're about to:
STOP -> Read the appropriate cookbook file -> Check --help -> Then proceed
Critical: Native agents cannot handle TTY input. Always use non-interactive flags:
- Codex:
codex exec --full-auto- Cursor:
cursor-agent --force -p- Gemini: Use positional prompt (not
-i)
MANDATORY CHECKPOINTS - Verify each before proceeding:
../spawn/agent/cookbook/<cli> --help to verify available flagsrun_in_background: trueDefault: READ_ONLY_MODE = true
When READ_ONLY_MODE is enabled, agents should only analyze and report - not modify files.
| Provider | Read-Only Command | Write Mode Command |
|----------|------------------|-------------------|
| Codex | codex exec --sandbox read-only --full-auto | codex exec --sandbox workspace-write --full-auto |
| Gemini | gemini --sandbox --yolo | gemini --yolo |
| Cursor | cursor-agent -p (no --force) | cursor-agent --force -p |
Always include in prompt when READ_ONLY_MODE is true:
"Do NOT modify any files. Only analyze and report findings.
If you would normally write to a file, instead return the content in your response."
When agents need write access, use git worktrees for true isolation:
# Create isolated worktree for agent work
git worktree add /tmp/agent-workspace-<id> -b agent/<provider>-<task>
# Run agent in worktree
cd /tmp/agent-workspace-<id>
<agent-command>
# Review changes
git diff
# If approved, merge back
git checkout main
git merge agent/<provider>-<task>
# Cleanup
git worktree remove /tmp/agent-workspace-<id>
git branch -d agent/<provider>-<task>
| Scenario | Approach | |----------|----------| | Analysis/review only | READ_ONLY_MODE + CLI flags | | Single file edit | Write mode with cleanup | | Multi-file refactor | Worktree isolation | | Experimental changes | Worktree (easy to discard) | | Parallel agent work | Separate worktrees per agent |
When CLEANUP_AGENT_FILES is true (default) and NOT using worktrees:
*_REVIEW_OUTPUT.md, *_analysis.json)# Cleanup pattern
cleanup_patterns = [
"*_REVIEW_OUTPUT.md",
"*_analysis.json",
"*_findings.md",
"agent_output_*.txt"
]
../spawn/agent/cookbook/codex-cli.mdcodex exec --sandbox read-only --full-auto --model gpt-5.2-codex "<prompt>"
codex exec --sandbox workspace-write --full-auto --model gpt-5.2-codex "<prompt>"
codex login../spawn/agent/cookbook/gemini-cli.mdgemini --model gemini-3-pro --sandbox --yolo "<prompt>"
gemini --model gemini-3-pro --yolo "<prompt>"
gemini auth"gemini auth login../spawn/agent/cookbook/cursor-cli.mdcursor-agent --model claude-sonnet-4.5 -p "<prompt>"
cursor-agent --model claude-sonnet-4.5 --force -p "<prompt>"
cursor-agent loginWhen a native agent reports an authentication failure:
# Auth recovery flow
def handle_auth_failure(provider: str, original_prompt: str):
login_commands = {
"codex": "codex login",
"gemini": "gemini auth login",
"cursor": "cursor-agent login"
}
# Fork terminal for interactive login
fork_terminal(login_commands[provider], wait_for_close=True)
# After terminal closes, retry native invocation
return invoke_native(provider, original_prompt)
To invoke multiple agents in parallel, use a single message with multiple Task tool calls:
# Launch Gemini, Codex, and Cursor in parallel
Task(subagent_type="general-purpose", run_in_background=true, prompt="gemini ...")
Task(subagent_type="general-purpose", run_in_background=true, prompt="codex ...")
Task(subagent_type="general-purpose", run_in_background=true, prompt="cursor ...")
Collect results:
TaskOutput(task_id="...", block=false) # Check progress
TaskOutput(task_id="...", block=true) # Wait for completion
Native agents return results via TaskOutput tool:
| Parameter | Value | Behavior |
|-----------|-------|----------|
| block=false | Check status | Non-blocking progress check |
| block=true | Wait for completion | Blocks until agent finishes |
| timeout | milliseconds | Max wait time before timeout |
# Check progress (non-blocking)
TaskOutput(task_id="abc123", block=false)
# Wait for completion (blocking)
TaskOutput(task_id="abc123", block=true, timeout=120000)
| Aspect | Native Task Agent | Fork-Terminal | |--------|-------------------|---------------| | Parallel execution | Excellent | Good | | Result collection | TaskOutput (clean) | File parsing | | TTY/Interactive | NO | YES | | Auth handling | Reports failure | Interactive login | | Resume capability | YES (agent ID) | NO |
Use Native when:
Use Fork-Terminal when:
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.