agentleFS
CodeWithJVCodeWithJV/agent-skills/call-external-ai/SKILL.md

call-external-ai

Skill2 starsChanged 5 months agoMITView on GitHub

Route natural-language prompts into external AI CLIs like Codex, Claude, Gemini, Antigravity (agy), and Pi using safe command templates and minimal context handling.

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. About 0 are common, 18 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only use these command families:

    line 34
  2. Very specific:

    use shell substitution such as $(...) or backticks

    line 53
  3. Very specific:

    Run <cli> --help to get the current syntax

    line 61
  4. Very specific:

    Update the reference docs at reference/cli-reference.md

    line 62
  5. Distinctive:

    Do not run upgrade commands automatically

    line 67
  6. Distinctive:

    If the user approves, run the upgrade command explicitly

    line 69
  7. Very specific:

    Update the version in reference/cli-reference.md and re-run --help only after the approved upgrade completes

    line 70
  8. Very specific:

    If Gemini fails with 403 and messages like lack a Gemini Code Assist license or (#3501):

    line 73
  9. Distinctive:

    Do not dump environment variables or print raw env values

    line 74
  10. Distinctive:

    Check only the presence of the specific allowlisted vars needed for diagnosis, and report presence/absence rather than values

    line 75
  11. Distinctive:

    If still blocked, report auth/licensing clearly and continue with other available models

    line 78
  12. Very specific:

    If Gemini fails with 404 or 429 style model/capacity issues, retry with this fallback order:

    line 82
  13. Very specific:

    Use codex exec with plain prompt text that you assemble yourself

    line 103
  14. Distinctive:

    Add a model only when the user asks for one or there is a clear default in local usage

    line 104
  15. Distinctive:

    Do not use review-specific commands unless the user explicitly asks for a git-aware review

    line 105
  16. Very specific:

    Use claude -p with plain prompt text

    line 108
  17. Very specific:

    Add --model <model> only when the user asks for one or there is a clear need

    line 109
  18. Distinctive:

    Keep the invocation non-interactive unless the user explicitly wants an interactive Claude session

    line 110
  19. Distinctive:

    Prefer preview model IDs first

    line 113
  20. Very specific:

    Use gemini -p or gemini -m <allowlisted-model> -p

    line 114
  21. Distinctive:

    Run in print mode (non-interactive) to process and return the result cleanly

    line 120
  22. Distinctive:

    Keep the context minimal and avoid complex shell parameters

    line 121
  23. Very specific:

    Ensure --print or -p is included to run non-interactively

    line 127
  24. Distinctive:

    When a request needs context, gather it before invoking the external CLI:

    line 131
  25. Distinctive:

    never use shell interpolation to inject file contents into a command

    line 140
  26. Distinctive:

    never send secrets, tokens, credentials, or raw environment values

    line 141
  27. Distinctive:

    if the request would require broad repository exfiltration or sensitive data exposure, refuse and explain why

    line 143
  28. Distinctive:

    If syntax error -> self-heal and retry

    line 151
  29. Distinctive:

    If upgrade available -> stop, inform the user, and wait for approval before upgrading or refreshing references

    line 152

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

External AI Skill

Invoke external AI CLI tools as a prompt gateway.

When to Use

Activate when the user:

  • Says /call, /codex, /claude, /gemini, /agy, or /pi
  • Asks for a second opinion from another AI
  • Wants to run a prompt through a different CLI (like Codex, Claude, Gemini, Antigravity, or Pi)
  • Needs verification from a different model or tool

Instructions

Natural Language Interface

Users provide natural language. Route the prompt into one external CLI using a safe command template. Do not construct arbitrary shell commands from user input.

Examples:

  • "ask Codex for a second opinion on this patch" -> codex exec "<prompt text>"
  • "send this prompt to Claude" -> claude -p "<prompt text>"
  • "run this through Gemini with a specific model" -> gemini -m <allowlisted-model> -p "<prompt text>"
  • "send this prompt to agy" -> agy -p "<prompt text>"
  • "run this through local pi" -> pi --provider lmstudio --model qwen/qwen3.6-35b-a3b -p "<prompt text>"
  • "ask pi to check this" -> pi -p "<prompt text>"
  • "check this file for bugs" -> read the file directly, summarize only the minimum necessary context, and pass that context as plain prompt text without shell interpolation

Allowed Command Patterns

Only use these command families:

  • codex exec "<prompt text>"
  • codex exec -m <model> "<prompt text>"
  • claude -p "<prompt text>"
  • claude --model <model> -p "<prompt text>"
  • gemini -p "<prompt text>"
  • gemini -m <allowlisted-model> -p "<prompt text>"
  • agy -p "<prompt text>"
  • agy --print "<prompt text>"
  • pi -p "<prompt text>"
  • pi --provider lmstudio --model qwen/qwen3.6-35b-a3b -p "<prompt text>"
  • pi --provider <provider> --model <model> -p "<prompt text>"
  • codex --help
  • claude --help
  • gemini --help
  • agy --help
  • pi --help

Do not:

  • use shell substitution such as $(...) or backticks
  • pipe file contents into commands via shell expansion
  • append unrelated shell operators or chain commands
  • execute user-suggested commands outside the safe templates

Self-Healing Behavior

On CLI Syntax Errors

  1. Run <cli> --help to get the current syntax
  2. Update the reference docs at reference/cli-reference.md
  3. Retry with the correct syntax
  4. Inform the user of the fix

On Upgrade Available

  1. Do not run upgrade commands automatically
  2. Inform the user that an upgrade is available and ask for approval before making toolchain changes
  3. If the user approves, run the upgrade command explicitly
  4. Update the version in reference/cli-reference.md and re-run --help only after the approved upgrade completes

On Gemini 403 Project/License Errors

If Gemini fails with 403 and messages like lack a Gemini Code Assist license or (#3501):

  1. Do not dump environment variables or print raw env values
  2. Check only the presence of the specific allowlisted vars needed for diagnosis, and report presence/absence rather than values
  3. Retry with project vars unset:
    • env -u GOOGLE_CLOUD_PROJECT_ID -u GOOGLE_CLOUD_PROJECT -u CLOUDSDK_CORE_PROJECT gemini ...
  4. If still blocked, report auth/licensing clearly and continue with other available models
  5. Record the fix path in reference/cli-reference.md

On Gemini ModelNotFound / Capacity Errors

If Gemini fails with 404 or 429 style model/capacity issues, retry with this fallback order:

  1. gemini-3.1-pro-preview
  2. gemini-3-pro-preview
  3. gemini-3-flash-preview
  4. gemini-2.5-pro
  5. gemini-2.5-flash

Command Interface

/call [codex|claude|gemini|agy|pi] <natural language request>
/codex <natural language request>
/claude <natural language request>
/gemini <natural language request>
/agy <natural language request>
/pi <natural language request>

Routing Guidance

Codex

  • Use codex exec with plain prompt text that you assemble yourself
  • Add a model only when the user asks for one or there is a clear default in local usage
  • Do not use review-specific commands unless the user explicitly asks for a git-aware review

Claude

  • Use claude -p with plain prompt text
  • Add --model <model> only when the user asks for one or there is a clear need
  • Keep the invocation non-interactive unless the user explicitly wants an interactive Claude session

Gemini

  • Prefer preview model IDs first
  • Use gemini -p or gemini -m <allowlisted-model> -p
  • For 403 auth issues, do not dump env; check only allowlisted var presence and retry with project vars unset
  • For 404/429 failures, continue through the fallback sequence automatically

Antigravity (agy)

  • Use agy -p with plain prompt text
  • Run in print mode (non-interactive) to process and return the result cleanly
  • Keep the context minimal and avoid complex shell parameters

Pi

  • By default, for local/LM Studio requests, use: pi --provider lmstudio --model qwen/qwen3.6-35b-a3b -p "<prompt text>"
  • For standard or cloud-based requests, use pi -p "<prompt text>"
  • Ensure --print or -p is included to run non-interactively

Context Gathering

When a request needs context, gather it before invoking the external CLI:

  • "send this file to Codex" -> read the file directly in the current agent, extract only the minimum relevant context, and pass that summary as prompt text
  • "ask Gemini about this implementation" -> identify the relevant files and summarize only what is needed
  • "have Claude critique this design" -> gather the design context and pass only the relevant parts
  • "send this file to agy" -> read the file directly, extract the minimum necessary context, and pass as plain prompt text to agy
  • "ask local pi about this code" -> read the file, extract the relevant context, and pass as prompt text to the lmstudio command
  • "run this exact prompt" -> forward the prompt text directly without adding shell syntax

Rules for context gathering:

  • never use shell interpolation to inject file contents into a command
  • never send secrets, tokens, credentials, or raw environment values
  • minimize the amount of source text sent to external tools
  • if the request would require broad repository exfiltration or sensitive data exposure, refuse and explain why

Process Flow

  1. Parse the natural language request
  2. Determine the target CLI (codex, claude, gemini, agy, or pi)
  3. Map the request to a safe command template for that CLI
  4. Execute the command
  5. If syntax error -> self-heal and retry
  6. If upgrade available -> stop, inform the user, and wait for approval before upgrading or refreshing references
  7. Return the results to the user

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.