Interroger un agent IA

VérifiéPrudence

Permet d'interroger un autre agent d'IA (Claude, Codex) en mode non interactif et d'obtenir sa réponse. Utile pour obtenir un second avis ou une perspective différente sur un problème, en exécutant la requête via une commande synchrone.

Spar Skills Guide Bot
DeveloppementDébutant
5002/06/2026
Claude CodeCodex
#ask-agent#subagent-pattern#agent-query#second-opinion

Recommandé pour

Notre avis

Permet d'interroger un autre agent IA (Claude ou Codex) de manière non interactive et d'obtenir sa réponse.

Points forts

  • Obtention rapide d'un second avis depuis un autre modèle
  • Utilisation synchrone avec blocage minimal
  • Support de répertoire de travail et de modèle spécifiques

Limites

  • Dépend de la disponibilité des agents cibles
  • Pas de streaming, réponse complète uniquement
  • Nécessite une configuration préalable des agents
Quand l'utiliser

Quand vous souhaitez confronter une idée ou un morceau de code avec un autre agent IA.

Quand l'éviter

Si l'agent cible n'est pas installé ou si une interaction asynchrone est préférable.

Analyse de sécurité

Prudence
Score qualité92/100

The skill runs a bash script that passes user input to external AI agent commands. While the allowed-tools is restricted, there remains risk of shell injection if the script does not robustly sanitize arguments. Additionally, the external AI agents' own safety is out of control. The skill itself does not instruct destructive actions, but caution is warranted.

Points d'attention
  • The skill executes shell commands based on user-supplied prompt and arguments; if the agent-query.sh script does not properly sanitize inputs, it could be vulnerable to command injection.
  • Invoking external AI agents could lead to unpredictable or potentially harmful responses, though the skill only returns the response text without executing it.

Exemples

Second opinion on authentication approach
/ask-agent codex "What do you think of using JWT for this auth flow?"

name: ask-agent description: Ask another AI agent a question and get the response back (subagent pattern) argument-hint: <agent> [options] <prompt> allowed-tools: Bash(~/.codex/skills/ask-agent/scripts/*)

ask-agent

Query another AI agent non-interactively and get the response back. Use this when you want a second opinion from a different agent (Claude, Codex, etc.).

Usage

/ask-agent <agent> [options] <prompt>

Arguments

  • <agent>: The agent to query (claude, codex)
  • <prompt>: The question or request for the agent

Options

  • -d, --dir <dir>: Set working directory for the agent
  • -m, --model <model>: Specify model (agent-specific)

Instructions

When this skill is invoked, run the agent-query.sh script:

~/.codex/skills/ask-agent/scripts/agent-query.sh <agent> [options] <prompt>

The script will:

  1. Run the specified agent in non-interactive/print mode
  2. Return the agent's response

Report the response back to the user.

Examples

# Get Codex's opinion on an approach
/ask-agent codex "What do you think of using JWT for this auth flow?"

# Ask Claude with a specific model
/ask-agent claude -m opus "Review this error handling pattern"

# Query from a specific directory
/ask-agent codex -d ./src "Explain what the auth module does"

Agent CLI Mappings

| Agent | Non-interactive command | |--------|------------------------| | claude | claude -p "<prompt>" | | codex | codex exec "<prompt>" |

Notes

  • Response is synchronous - the calling agent waits for the response
  • Useful for getting a second opinion or different perspective
  • Each agent has different training data and reasoning patterns
Skills similaires