关于 cursor-agent-supervisor
通过 `cursor-agent` 管理 Cursor 子 Agent 的技能,涵盖创建和恢复特定任务的 Agent、准备上下文,以及完成后的检查。
主要功能
- 01创建并恢复子 Agent 对话
- 02为 Agent 任务选择模型
- 03准备聚焦的任务说明
- 04检查改动并运行验证
适用场景
- 01委派范围明确的代码修改
- 02分配 JJ 修订相关工作
- 03检查子 Agent 完成的实现
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ ypares/ agent-skills --skill cursor-agent-supervisor安装后在 Claude Code 中输入/cursor-agent-supervisor确认已加载。
详细介绍
Agent 主管
你可以启动子 Agent(例如,让它处理特定的 JJ 修订版本):
# Create a conversation with a sub-agent:
cursor-agent --print --model <model-name> create-chat # Prints a conversation uuid
# Give a task to the sub-agent: (command will finish when sub-agent is done)
cursor-agent --print --resume <conversation-uuid> "...description of the subagent's task..."
模型选择
cursor-agent --print --model unknown-model 会打印一条错误,其中列出可用模型。
除非你知道哪个模型最适合这项任务,否则默认使用 sonnet-4.5。
调用
**重要:**子 Agent 任务可能需要几分钟。务必使用较长的超时时间:
# In your Shell tool call, set timeout to 10 minutes
timeout: 600000
--print 标志会让子 Agent 独立运行,并且只在完成后回复。
为子 Agent 做好准备
提前做好准备,让 Agent 能专注于自己的任务(例如,如果使用 JJ,除非确有必要,否则不要让它运行 jj 命令。
特别是,你应该先自行运行 jj edit,进入应该进行工作的修订版本)。
理想情况下,子 Agent 只需阅读你的指示、修改代码、运行构建和测试、修改代码等,
直到完成你的指示,然后给出最终答复。
你负责记录和跟进,而不是它。你掌握全局,它不了解。
编写清晰的指示
提供子 Agent 完成任务所需的指示,但不要让它不堪重负。
应该:
- 明确说明具体目标
- 列出需要阅读或修改的关键文件
- 说明完成的标准
- 提供相关模式或参考实现
- 必要时告知需要加载哪些技能
不应该:
- 在它只需要部分内容时,倾倒或链接完整的技能资料
- 提供无关背景
- 让成功标准含糊不清
任务描述模板
Work on [specific task] in [repo/directory].
**Setup:**
- Skills to load or files to read IN FULL
- Summarized instructions from skills or files, tailored to the task
**Goal:**
[Clear description of what to implement/fix]
**Key files:**
- path/to/main/file.ts - [why it matters]
- path/to/reference.ts - [pattern to follow]
**Requirements:**
- [Specific requirement 1]
- [Specific requirement 2]
**Done when:**
- [Testable criterion 1]
- [Testable criterion 2]
- [e.g., "pnpm -F @pkg lint passes"]
子 Agent 完成后
务必验证子 Agent 的工作:
- **检查更改内容:**查看提交或修订版本差异,并确认更改与任务相符
- 审查实际代码(如果更改并非简单改动)
- 运行验证命令(测试、类型检查、代码检查)
- 根据结果更新任务状态(如果使用 jj-todo-workflow)
出现问题时
如果子 Agent:
- **失败或出错:**阅读输出、解决阻塞问题,然后补充更多上下文并重试
- **产出不完整:**自行继续工作,或启动另一个子 Agent 并明确说明
- **偏离方向:**检查发生了什么,必要时还原更改,并收紧要求后重试
- **卡在工具使用上:**可能需要提供明确的命令或路径
评论
支持 Markdown