跳到正文
Skillpedia
智能体5.4k · #14958

subagents

它能做什么

这项技能说明如何使用 devspace 命令行把工作委派给 DevSpace 子智能体。它适用于希望为有界任务使用单独工作者,或与同一工作者进行后续沟通的用户。

适用场景

  • ✓当任务需要独立的上下文时,例如对代码进行第二意见。
  • ✓当你希望由专门角色(如审查员)处理某项工作时。
  • ✓当你需要就已委派的任务与同一工作者继续沟通时。

技能链接

https://github.com/Waishnav/devspace/blob/main/skills/subagents/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/Waishnav/devspace/blob/main/skills/subagents/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“能把这次代码审查交给一个独立的 DevSpace 审查子智能体处理,并把它的发现发给我吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会用 devspace 命令列出可用目标,选择一个提供方或指定角色,然后发送一个有界任务。它会读取子智能体返回的简洁输出。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

DevSpace subagents

Subagents are optional. Use your normal tools for routine work; delegate only when a separate worker materially helps through independent context, specialization, or follow-up.

Run the devspace CLI through your shell tool from the project the subagent should work in (the git root of the current directory). Commands print compact XML fragments by default. Read that output directly. Add --json only when a program, not a model, parses the output.

Choose a target

Discover usable targets instead of guessing names:

devspace agents targets

Each line is one of:

  • <provider name="codex" .../>: an installed coding agent you can run directly.
  • <profile name="..." provider="...">description</profile>: a named role (instructions plus provider) defined in .devspace/agents/ or ~/.devspace/agents/.
  • <unavailable name="cursor">reason</unavailable>: a provider that cannot run on this machine, with the reason. Do not use it.
  • <disabled>: subagents are switched off in the DevSpace config; tell the user instead of retrying.

Pass the name as <profile-or-provider>. Prefer a matching profile; otherwise use a provider. Keep the default model and effort unless the task needs an override (--model, --effort).

Never guess model names. List the exact --model values (and supported efforts) a provider accepts:

devspace agents models <provider>

Start work

Give the subagent a self-contained brief with the objective, relevant paths, constraints, context it cannot infer, and the expected result. It receives this brief (and its profile instructions), not your conversation.

devspace agents run <profile-or-provider> "<brief>"
devspace agents run <profile-or-provider> --model <model> --effort <effort> "<brief>"

The command returns <agent id="agt_..." status="running" turn="trn_..."/> immediately. Keep the id for waiting, inspection, or follow-up. The agent keeps running if your command or session ends.

Add --request-id <key> when a retry is possible (a flaky network, a scheduled job). Running again with the same key, project, and arguments returns the existing agent instead of starting a duplicate; the key (letters, digits, . _ : -, up to 128 characters) becomes the agent id. The same key with a different brief is an AGENT_CONFLICT error.

Isolate writing agents

Agents run in your checkout by default. When you start more than one agent that writes at the same time, or you are editing the same checkout yourself, add --worktree so each agent gets its own git worktree and branch instead of overwriting the others:

devspace agents run <profile-or-provider> --worktree "<brief>"
devspace agents run <profile-or-provider> --worktree --branch <name> "<brief>"

Output then carries worktree="<path>" and branch="<name>". The worktree starts from the committed HEAD; uncommitted changes in your checkout are not copied, so commit first if the agent needs them. continue reuses the same worktree. Nothing is merged or deleted for you: review with git -C <worktree> diff and git log, commit the agent's changes if it left them uncommitted, merge the branch, then git worktree remove <worktree>. Read-only agents do not need --worktree.

Write modes

--write-mode limits what the subagent may change:

Mode Meaning
read_only Reads and searches only. Use for review, research, and verification.
allowed (default) May edit files inside the project, sandboxed where the provider supports it.
full_access No sandbox. Use only when the user explicitly asks for it.

A follow-up can lower the mode but never raise it. Providers differ in what they can enforce; if one cannot honor a mode, the command fails with an error that says so. Subagents run with the local user's authority, so choose the narrowest mode that fits the task.

Wait

When you need the result before continuing:

devspace agents wait <id>
devspace agents wait <id> <id> --timeout 60

Without --timeout it blocks until every named agent finishes. Many agent hosts cap how long one shell command may run, so always pass --timeout (60 to 120 seconds is safe) and call wait again while the agent is still running. Do not poll show when wait can express the dependency.

For a short task, start and wait in one command:

devspace agents run <profile-or-provider> --wait --timeout 90 "<brief>"

On timeout the a

常见问题

总是需要子智能体吗?

不需要。技能说明,常规工作应使用普通工具,只有在独立工作者确实有帮助时才委派。

它如何选择工作者?

它会先列出可用目标,然后优先选择匹配的指定角色,否则选择编码提供方。

如果子智能体被关闭了怎么办?

技能说明,应告诉用户子智能体在配置中已被关闭,而不是反复重试。

详情

作者的原始描述

Delegate focused coding, research, review, or verification work to a bounded DevSpace subagent. Use when a task benefits from separate context, a specialist perspective, or a follow-up with the same worker.

repo: Waishnav/devspace

热度

GitHub 星标
5.4k
排名
#14958
许可证
MIT
更新时间
2026/11/1

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能