SuperAPI AI Directory

subagent-consultation

Agents & models

View repository

Updated 10-16 07:23

About this skill

subagent Consultation Procedure

Overview

Seek a second opinion from the consultation destination Agent (subagent), and summarize and report the result to the user. The user does not need to directly see the subagent's raw output. The consulting Agent digests the subagent's answer, compares it with its own view, and reports.

Characters

Three parties appear in this procedure:

  • User: The human who requests the consultation
  • Consulting Agent: The Agent itself executing this procedure. Upon the user's request, it consults with the consultation destination Agent and reports the result to the user
  • Consultation Destination Agent (subagent): The subagent launched by the Agent tool. It provides a second opinion

When reporting to the user, use your own Agent name in the heading (e.g., "Claude Code's View", "Cline's View", etc.).

1. Confirming the Depth of Consultation

If the user has not explicitly specified the depth of consultation (if there is no specification such as "with full effort", "deeply", "thoroughly", "lightly", etc.), present the following three options using the AskUserQuestion tool:

Option Number of Round Trips Consulting Agent's Tentative View Degree of Pursuing Omissions and Gaps
Consult casually(Recommended) 2 round trips as needed Determined by the consulting Agent Check for omissions and gaps and report
Consult deeply with full effort In principle, carry out 2 round trips (skip only when clearly unnecessary) Always include it, and if there is anything considered but not adopted, write the reason as well, and prompt verification of its validity Actively rebut, supplement, and pursue further
Consult lightly 1 round trip only Determined by the consulting Agent Organize the subagent's points and report

If the user has explicitly specified the depth, omit this confirmation and follow the specification.

2. Designing the Prompt

The consulting Agent designs the prompt to pass to the subagent. Follow the guidelines below:

Prompt Design Guidelines

  • Determine "what should be consulted about now" from the conversation context
  • If the user has explicitly specified a theme, follow it
  • If there is no specification, choose an appropriate theme from the immediately preceding discussion or work content

Prompt Examples by Context

When you want to review uncommitted changes

"Please review the uncommitted changes in this repository. Point out code quality, design validity, potential bugs, and improvement points."

When you want to consult about design

"Please give your opinion on the following design. [Summary of the design]. If there are alternatives or trade-offs, please suggest them."

When you want to consult about the implementation approach

"I want to implement [summary of the task]. Based on this repository's codebase, please suggest the optimal implementation approach."

Prompt structure

  1. Project background (briefly)
  2. Specific content you want to consult about
  3. The consulting source Agent's current tentative view. Always include it in "full power" mode, and include it depending on the situation in other modes
  4. Request to explore broadly beyond the specified perspectives (always include)
  5. Request to report the running model ID (always include)

Template for when including the consulting source Agent's tentative view

In the tentative view, write the current view and its reasons. If there are things you considered but decided not to adopt, write their content and the reasons for not adopting them, and make them targets for verification by the consultee. Do not write things you have not considered as things you decided not to adopt.

なお相談元Agent([自分のAgent名])は現時点で以下のように考えている:
- 現時点の見解: [見解とその理由]
- 検討したが採用しない事: [採用しない事とその理由]

見解に漏れや誤りが無いか、採用しない判断の理由・根拠・前提が妥当かを検証し、反論があれば示してほしい。
相談元Agentが検討していない選択肢があれば挙げてほしい。
指定した観点以外にも気になる点があれば積極的に報告してほしい。

Request for broad exploration (always include in the prompt)

The specified perspectives are merely a starting point and not a constraint. Always include in the prompt a statement to the effect that if you find anything of concern by exploring the repository yourself, you should actively report it.

Request to report the model ID (always include in the prompt)

At the end of the response, model: <ID> Request that the running model ID be written on one line in the format .

3. Running the subagent

Launch a subagent with the Agent tool in the following format:

  • prompt: The prompt designed in section 2
  • description: A summary of the consultation content in 3-5 words

Deciding on additional rounds

In "full power" mode, after receiving the result of the first round, in principle carry out a second round. Skip only when additional deep digging is clearly unnecessary (when a sufficiently comprehensive answer was obtained in the first round).

In "frequently" mode, after receiving the result of the first round, carry out a second round if any of the following applies:

  • The subagent's feedback contains important points that should be explored further
  • The consulting source Agent has something to rebut or supplement regarding the subagent's feedback
  • The consulting source Agent can determine that there are areas that have not been sufficiently explored

Before deciding on a second round, check the output of the first round for signs of execution failure. If a failure is detected, first have the consulting source Agent obtain and correct the accurate information, and then decide whether a second round is necessary (for details, see section 4, "When a subagent execution failure is detected").

Prompt structure for the second round:

Note: Since the Agent tool runs as a one-shot execution, the subagent on the second round does not have the memory of the first round. It is necessary to include all context from the start.

  1. Re-presentation of the original consultation content (include it in a structured way without omitting the background/purpose/constraints/evaluation perspectives)
  2. Summary of the first-round subagent's response
  3. Counterarguments, supplements, and additional questions from the consulting Agent
  4. Perspectives you want explored further

In principle, rounds are limited to 2. For 3 or more, confirm with the user before proceeding.

4. Summarizing and reporting the results

Read the subagent's output and report to the user with the following structure:

Report structure

Content of the consultation with the subagent

State the subagent's execution environment in the format subagent (claude-fable-5-1) on one line, then explain the outline of the prompt sent to the subagent in 1-2 sentences.

Summary of the subagent's response

Summarize the subagent's main points and suggestions in bullet points.

[Your own Agent name]'s view

  • Points from the subagent's remarks that you agree with
  • Points from the subagent's remarks that you have a different opinion on (with reasons)
  • Points you believe the subagent has overlooked
  • If a second round was conducted, the reason for it and what became clear in the second round

Stance on the view:

  • Do not readily accept the subagent's remarks. Report only after attempting verification as the consulting Agent
  • Consciously look for areas the subagent may not have explored
  • If the views of the subagent and the consulting Agent differ, actively communicate that discrepancy as valuable information

Proposed next actions

Indicate matters to discuss with the user and recommended next steps.

Reporting style

  • Keep it concise. Avoid redundant quotations
  • If the views of the subagent and the consulting Agent differ, explain both reasons so the user can make a judgment
  • Make clear what the user should do next

When a subagent execution failure is detected

When reading the subagent's output, carefully check for signs of execution failure. Examples of signs: error messages, "could not retrieve", "failed", "permission denied", "not found", etc.

If a failure is detected, follow the procedure below:

  1. First, the consulting Agent retrieves the correct information itself. Run the command that the subagent failed at (e.g., gh pr view) with the Bash tool and check the result
  2. Next, correct the subagent's analysis using the retrieved information. Identify remarks that became off-target due to insufficient information and re-evaluate them in the correct context
  3. Finally, make the information shortage explicit in the view section of the report. Concretely explain the missing information and the remarks affected by it

5. Improvement suggestions

When recognizing a pattern in which a subagent has made some kind of failure, advise the user on improvement measures for subsequent times.