Agent Skillszzatpku/AgentFactory › run_subagent

run_subagent

GitHub

用于执行子代理,支持从工作区运行新建文件或从历史会话加载已保存的技能。通过指定文件名或技能名称及查询内容,协调多步任务分解与执行。

skills/meta/run_subagent/SKILL.md zzatpku/AgentFactory

Trigger Scenarios

需要执行已创建的工作区子代理文件 需要调用之前保存的子代理技能

Install

npx skills add zzatpku/AgentFactory --skill run_subagent -g -y
More Options

Non-standard path

npx skills add https://github.com/zzatpku/AgentFactory/tree/master/skills/meta/run_subagent -g -y

Use without installing

npx skills use zzatpku/AgentFactory@run_subagent

指定 Agent (Claude Code)

npx skills add zzatpku/AgentFactory --skill run_subagent -a claude-code -g -y

安装 repo 全部 skill

npx skills add zzatpku/AgentFactory --all -g -y

预览 repo 内 skill

npx skills add zzatpku/AgentFactory --list

SKILL.md

Frontmatter
{
    "name": "run_subagent",
    "description": "Run a subagent - either a newly created one from workspace or a saved subagent from previous sessions."
}

Run Subagent

Run a subagent file from either the workspace (newly created) or from saved skills (previous sessions).

Unified Command

run_subagent now handles BOTH types of subagents:

  • Newly created subagents: Use filename parameter
  • Saved subagents: Use skill_name parameter

Usage

For newly created subagents (workspace files):

<action>run_subagent</action>
<params>{"filename": "subagent.py", "query": "your focused sub-question"}</params>

For saved subagents (from previous sessions):

<action>run_subagent</action>
<params>{"skill_name": "multi_hop_biographical_researcher", "query": "your focused sub-question"}</params>

Parameters

Parameter Type Default Description
filename str "subagent.py" Name of the file you created with create_subagent (for workspace files)
skill_name str - Name of a saved subagent from list_saved_subagents (for saved skills)
query str original question The focused query to pass to the subagent

Note: Provide either filename OR skill_name, not both. If skill_name is provided, it takes priority.

Returns

On success:

{
    "success": True,
    "answer": "the subagent's answer",
    "summary": "reasoning trace with key evidence"
}

On failure:

{
    "success": False,
    "error": "error message..."
}

Important Notes

  • CRITICAL: For workspace files, you MUST provide the filename parameter matching the exact filename you used in create_subagent. If you created with "filename": "visualizer.py", you must run with "filename": "visualizer.py" — omitting it will default to "subagent.py" and fail.
  • For saved skills: First check list_saved_subagents to see available names
  • Use the query parameter to pass focused sub-questions
  • The query is passed to the subagent's main(query) function as a parameter
  • If the subagent fails, check the error message and use modify_subagent to fix (workspace files only)

Examples

<!-- After create_subagent with filename="subagent.py" -->
<action>run_subagent</action>
<params>{"filename": "subagent.py", "query": "What year was the Sapphire Jubilee?"}</params>

<!-- Using a saved subagent -->
<action>run_subagent</action>
<params>{"skill_name": "entity_researcher", "query": "Who is Kwesi Arthur?"}</params>

<!-- Call again with different query -->
<action>run_subagent</action>
<params>{"filename": "subagent.py", "query": "Who created Linux?"}</params>

Version History

  • df92287 Current 2026-07-25 08:38

Same Skill Collection

skills/meta/create_subagent/SKILL.md
skills/meta/finish/SKILL.md
skills/meta/list_saved_subagents/SKILL.md
skills/meta/modify_subagent/SKILL.md
skills/meta/view_subagent_code/SKILL.md
skills/tools/google_search/SKILL.md
skills/tools/jina_reader/SKILL.md
skills/tools/mask/local_search/SKILL.md
skills/tools/mask/open_page/SKILL.md
skills/tools/playwright/SKILL.md
skills/tools/shell_command/SKILL.md

Metadata

Files
0
Version
df92287
Hash
7bd4f0b5
Indexed
2026-07-25 08:38

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 05:27
浙ICP备14020137号-1 $mapa de visitantes$