dtyq/magic/subagents

Claude Code and agent skill by dtyq/magic

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when the user asks to find, select, call, or delegate work to an Agent/智能体, digital employee/数字员工, or Crew; when the target is unknown or must be selected by capability; when independent tasks can run in parallel; or when isolated research or a specialized Agent would improve the result.

Install

npx vskill@latest install dtyq/magic/subagents

SKILL.md

The same SKILL.md was published earlier as dtyq/magic/subagents.

Subagent Dispatch Skill

Use call_subagent to delegate tasks to other agents, and wait_for_subagents to collect results from background runs. These tools are Code Mode tools: run the snippets below with run_sdk_snippet, where sdk.tool.call(...) is available.

Agent is the generic technical term. Crew is the product term for a marketplace custom Agent presented as a digital employee (数字员工). Users may say Agent, 智能体, digital employee, 数字员工, or Crew. Do not call built-in Agents Crew.

When To Use

Delegate when at least one is true:

  • The task is large enough to benefit from an isolated execution context
  • Multiple independent tasks can run in parallel
  • You need a specialized agent type (read-only explore, shell-heavy work)

Do not delegate when:

  • The task is small and can be done directly
  • The work requires constant access to the current conversation state
  • Multiple sub-agents would write to the same file with no merge plan
  • You cannot summarize the full context into a self-contained prompt

Depth limit: sub-agents cannot call call_subagent. Only the root agent may dispatch.

Selecting The Target Agent

  • If the user provides a built-in name, local .agent name, or SMA-... code, skip discovery and call that Agent directly.
  • If the target is unknown or must be selected by capability, call find_agents to search marketplace custom Agents presented as Crew digital employees.
  • Built-in Agents (magic, explore, shell, search) do not require discovery.
python
from sdk.tool import tool
result = tool.call("find_agents", {
"keywords": [
"<core term in the user's language>",
"<distinct variant in the user's language>",
"<optional common term from another relevant language>",
],
"query": "<the user's complete requirement in the user's language>",
"limit": 5,
})
print(result.content)
  • keywords: build the complete recall list before the first call and submit it once.
  • Infer the user's language from the request and use that language for the main terms.
  • Usually use two to four high-information words or phrases with distinct recall value.
  • Add a term from another language only when candidate names, common industry terminology, or the target search source is likely to use it. English is often useful for product names and technical acronyms, but it is not mandatory.
  • English requests normally use English terms only. Japanese requests should use Japanese terms first, Korean requests should use Korean terms first, and the same rule applies to every other language. Preserve relevant terms when the user mixes languages.
  • Prefer short terms that may appear directly in candidate names.
  • For short names or acronyms, include common case forms when search sources may treat them differently.
  • Do not enumerate case forms for ordinary phrases, add overlapping synonyms only to increase the count, put the complete requirement in an item, or call find_agents once per keyword.
  • query: the user's complete requirement in the user's language, used to select more relevant candidates.
  • limit: choose based on the task. The default is 5; valid values are 1 through 20.

Read result.content, choose by code, name, and description, then pass the selected SMA-... code as call_subagent.agent_code (or agent_name when using the direct runtime interface). Do not automatically split or retry the same search intent when no candidates are returned.

Browsing The Full Agent List

When the user asks which Agents are available rather than asking to get something done, browse instead of searching: pass keywords=[] and query=None. Results come back in a stable order with no relevance filtering, so the first entry is not necessarily the best fit.

python
from sdk.tool import tool
result = tool.call("find_agents", {
"keywords": [],
"query": None,
"limit": 20,
})
print(result.content)

Read has_more and next_page from result.content. To read the following page, keep every other argument unchanged and set page to next_page. Page order is stable and pages do not overlap.

Do not page through the whole directory to see everything — each page costs context. Read further pages only when the user asked for the complete list, or when the current page contains no suitable Agent.

Paging is not available for keyword search, because ranked order is not stable across pages. When a keyword search returns too few results, raise limit or change keywords instead.

Tool: call_subagent

python
from sdk.tool import tool
result = tool.call("call_subagent", {
"agent_name": str, # optional runtime Agent name; use "" when agent_code identifies the target or fork=True
"agent_code": str, # optional normalized target code from an Agent mention
"session_id": str, # optional session base for new runs, exact final session ID when resuming
"task_label": str, # required; user-facing label in the user's language
"prompt": str, # required
"model_id": str, # optional, defaults to inheriting the caller's model
"background": bool, # optional, default False
"fork": bool, # optional, default False
"resume": bool, # optional, default False
})
agent_name

Target agent to call. Accepted values:

  • Built-in names or aliases: magic, explore, shell, search, ppt, data_analysis
  • Marketplace custom Agent codes returned by find_agents, such as SMA-... (Crew digital employees)
  • Local .agent filenames

For marketplace custom Agent codes, call_subagent prepares the Agent automatically before dispatch.

Built-in types:

  • magic: general-purpose, full tool access (web, files, code). Use for complex multi-step tasks.
  • explore: read-only. Searches files, reads code, answers structural questions. Cannot modify anything.
  • shell: shell command specialist. Runs scripts, installs deps, performs system operations.
  • search: web research specialist. Searches the web and reads pages to gather external information. Cannot modify local files.

Other .agent files (e.g. data-analyst) can also be used by name.

session_id

For a new session, session_id is optional. Omit it to let the runtime generate a unique session address. You may provide a human-readable base such as market-research when a stable base is useful.

  • With resume=False, the tool always creates a new session and returns the final session ID, such as market-research-2.
  • The requested base is not the session address. Read the exact final ID from result.data["session_id"]; result.data["agent_id"] is retained only for backward compatibility.
  • With resume=True, pass the exact final session ID returned by the earlier call. The session must already exist.
  • Never infer that a repeated base should resume an old session.
  • The session_id is unrelated to the agent_id inside an agent:// mention.
  • Name by responsibility, not by sequence: ppt-outline, shell-install-ffmpeg — not task1, worker-a
Session lifecycle
  • New blank session: fork=False, resume=False
  • New session inheriting the current context: fork=True, resume=False
  • Continue an existing session: fork=False, resume=True
  • fork=True, resume=True is invalid

Completed sub-agent histories can be inspected later with the chat-history skill. Parent identity is stored explicitly in each new sub-agent's .session.json; do not infer parent-child relationships from directory nesting.

Fork creates a new independent session and never overwrites an existing one. Resume is always explicit because the caller may not know that an older session used the same name.

task_label

User-facing label shown directly in the UI for this delegated task. It is not the agent's name and not agent_id.

  • Must use the same language as the user's request so the label is understandable. Do not default to English.
  • Make it concise and distinct in multi-agent runs.
  • It may change between calls even when session_id stays the same.
prompt

With fork=False, resume=False, the sub-agent has no access to the parent's conversation history. Write the prompt as a self-contained task brief:

  • Objective: one sentence, the single outcome you want.
  • Background: the minimum facts needed to act, such as what already exists and which decisions are made. Do not assume shared context.
  • In scope: the concrete targets or steps.
  • Out of scope: the adjacent things the sub-agent must not touch. Be specific.
  • Deliverable: the exact output path or object and its format.
  • Constraints: for example read-only, or nothing created besides the deliverable.
  • Done when: the check that proves the task is finished.
  • Report: what the final reply must contain.

Naming what is out of scope matters most. A sub-agent told only what to do invents adjacent work: extra tool directories, rebuilds of files it does not own, cleanup nobody asked for. A sub-agent told what not to touch reports the problem instead.

Bad:

text
Find out what competitors are doing and summarize.

Bad, specific about the work but silent about the boundary:

text
Write the analysis section of report.md. Make sure the whole report is consistent.

Good:

text
Objective: write the competitor analysis section of an existing report.
Background: reports/market.md already has an approved structure, an intro, and a data section written by another agent.
In scope: replace the placeholder under "## Competitor analysis" in reports/market.md.
Out of scope: do not edit other sections, restructure the report, touch reports/data.md, or create any file or directory.
Deliverable: that section, 400-600 words of Markdown.
Done when: the section is written and every claim has a source URL.
Report: word count, source URLs, and any inconsistency you noticed elsewhere without fixing it.
background
  • False (default): run synchronously, block until the sub-agent finishes, return result immediately. The parent agent is completely blocked with no progress visibility — only suitable for quick tasks that finish in seconds.
  • True: dispatch as a background task and return immediately. Must follow with wait_for_subagents to collect the result.

Use background=True in two scenarios:

  1. Parallel workloads: sequential call_subagent(..., background=True) calls result in concurrent execution regardless of whether the model supports parallel tool calls.
  2. Long-running tasks: even a single sub-agent should use background=True when the task may take more than a few seconds. This gives the parent progress visibility via wait_for_subagents (timeout snapshots, pattern matching for checkpoint-based interleaving), and keeps the sandbox alive during long waits.
Parallel context in the prompt

When several sub-agents work on the same plan, every prompt must include a parallel context line:

text
Parallel context: N sub-agents are working on this plan at the same time. You own <this slice>. The others own <their slices>. Do not edit, regenerate, or clean up their slices, and do not build shared tooling for them. <who> merges the results.

Only you can write this. Sub-agents are dispatched one at a time and cannot discover or message each other, so you hold the only complete picture of the split. The runtime already tells every sub-agent that siblings may exist and that their work is not its to fix; you add how many there are, who owns what, and who merges.

fork
  • False (default): sub-agent starts with empty conversation history. The prompt must be fully self-contained.
  • True: creates a new sub-agent that inherits the parent's full conversation history and uses the same Agent as the parent. Set agent_name="" and keep resume=False. The prompt is a directive, not a briefing, because the fork already has full context.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
4,819
Repository forks
522
7-day trend score
42

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 14 May 2026, 6 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dtyq/magic/subagents/badge)](https://verified-skill.com/skills/dtyq/magic/subagents)

Something wrong with this skill or its page? Tell us.