AgentSkillsCN

ask-agent

向另一位 AI 代理提问,并获取其回复(子代理模式)

SKILL.md
--- frontmatter
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(~/.claude/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

code
/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:

bash
~/.claude/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

bash
# 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

AgentNon-interactive command
claudeclaude -p "<prompt>"
codexcodex 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