关于 collaboration
为多 Agent 协作提供角色分工、任务委派、沟通交接和冲突处理模式,适用于需要协调多个 Agent 的工作。还涵盖共享上下文与进度同步。
主要功能
- 01定义专责角色
- 02委派并跟踪任务
- 03规定消息与交接格式
- 04处理意见冲突
- 05同步上下文和进度
适用场景
- 01将功能需求拆分给不同 Agent
- 02把开发工作从规划者交接给开发者
- 03记录审查期间的阻塞与进度
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ alicoder001/ agent-skills --skill collaboration安装后在 Claude Code 中输入/collaboration确认已加载。
附带文件agents/openai.yaml
详细介绍
多 Agent 协作
高效协调 Agent 的模式。
说明
1. Agent 角色定义
## Specialist Roles
| Role | Responsibility | Skills |
|------|----------------|--------|
| **Planner** | Decompose tasks | reasoning, planning |
| **Researcher** | Gather information | search, analysis |
| **Developer** | Write code | implementation |
| **Reviewer** | Quality check | testing, review |
| **Documenter** | Write docs | documentation |
2. 任务委派
## Delegation Protocol
1. **Assess**: What expertise is needed?
2. **Assign**: Match task to specialist
3. **Brief**: Provide clear context
4. **Monitor**: Track progress
5. **Integrate**: Combine results
### Delegation Template
TASK: [描述] ASSIGNED TO: [角色] CONTEXT: [需要了解的信息] DELIVERABLE: [预期输出] DEADLINE: [需要完成的时间]
3. 通信协议
## Message Format
### Request
{
"from": "planner",
"to": "developer",
"type": "task",
"content": {
"action": "implement",
"file": "UserService.ts",
"requirements": ["..."]
}
}
### Response
{
"from": "developer",
"to": "planner",
"type": "result",
"status": "complete",
"content": {
"files_changed": ["UserService.ts"],
"summary": "Added user validation"
}
}
4. 交接模式
## Clean Handoff Checklist
When passing work to another agent:
- [ ] Summarize what was done
- [ ] Explain current state
- [ ] List remaining tasks
- [ ] Note any blockers
- [ ] Provide relevant context
### Example
交接:规划者 → 开发者
已完成
- 分析了需求
- 确定了 3 个主要组件
当前状态
- 已在 types/user.ts 中定义类型
- 尚未开始实现
后续步骤
- 在 services/ 中创建 UserService
- 实现 CRUD 操作
- 添加验证
上下文
- 使用 Prisma 作为数据库
- 遵循 OrderService 中的现有模式
5. 冲突解决
## When Agents Disagree
1. **Identify**: What is the conflict?
2. **Evidence**: Gather supporting facts
3. **Evaluate**: Compare approaches
4. **Decide**: Choose best option
5. **Document**: Record decision and reasoning
### Common Conflicts
| Conflict | Resolution Strategy |
|----------|---------------------|
| Architecture choice | Evaluate trade-offs |
| Implementation approach | Prototype both |
| Priority disagreement | Align with user goal |
| Resource contention | Schedule or parallelize |
6. 工作流编排
sequenceDiagram
participant User
participant Planner
participant Developer
participant Reviewer
User->>Planner: Request feature
Planner->>Planner: Analyze & decompose
Planner->>Developer: Assign implementation
Developer->>Developer: Write code
Developer->>Reviewer: Request review
Reviewer->>Developer: Feedback
Developer->>Planner: Complete
Planner->>User: Deliver result
7. 共享上下文
## Context Sharing Rules
### Must Share
- Project constraints
- User preferences
- Critical decisions
- Error states
### May Share
- Implementation details
- Intermediate results
- Research findings
### Don't Share
- Internal reasoning
- Failed attempts
- Verbose logs
8. 进度同步
## Status Updates
### Format
| Agent | Task | Status | Blockers |
|-------|------|--------|----------|
| Developer | API endpoints | 🟢 Done | None |
| Reviewer | Code review | 🟡 WIP | Waiting for tests |
| Documenter | API docs | 🔴 Blocked | Need API specs |
### Sync Points
- After each phase completion
- When blocked
- When priorities change
- Before final delivery
参考资料
评论
支持 Markdown