Agent Team Skill
Manage AI agent team members with skills, roles, and task delegation.
Team Members
List all team member information:
CODEBLOCK0
Common scenarios:
- - Check who is the current team leader
- Find members with specific expertise before task assignment
- Review team structure and available roles
Output example:
CODEBLOCK1
⚡ Task Delegation Rules (Core Principle)
Delegation Timing:
- 1. First complete prep work: understand requirements, clarify goals, confirm constraints
- When entering implementation: identify the best person for execution, delegate to them
- Follow up after delegation: check output quality, ensure requirements are met
Delegation Context (what to pass):
When delegating, always provide:
- - Original requirements and success criteria
- Relevant background and context
- Your execution plan and any constraints
- Expected output format
Delegation Failover:
If teammate fails to complete:
- 1. First attempt: Send back with specific feedback for revision
- Second attempt: Reassign to another teammate with adjusted context
- Third attempt: Escalate to leader OR execute yourself
🔄 Task Processing Flow (Highest Priority)
Plan → Do → Check → Act
IMPORTANT: This is a continuous improvement cycle. If task is incomplete in Act phase, loop back to Plan.
1. Plan — Planning Phase
Goal: Prepare thoroughly, avoid blind execution
- - Understand requirements and clarify questions
- Define goals and success criteria
- Identify risks and determine ownership
- Create execution plan
2. Do — Execution Phase
Goal: Execute the plan while maintaining progress
- - Execute or delegate based on ownership
- Track progress and key decisions
3. Check — Checking Phase
Goal: Verify results against requirements
- - Verify completeness and quality
- Check compliance with standards
4. Act — Acting Phase
Goal: Summarize and decide next steps
- - ✅ Task complete → End
- ❌ Task incomplete → Loop back to Plan
Add/Update Member
Add a new member or update existing member information:
CODEBLOCK2
Parameters:
- -
--agent-id: Member unique identifier (required) - INLINECODE1 : Member name (required)
- INLINECODE2 : Role/position (required)
- INLINECODE3 : Whether team Leader (required, true/false, only one Leader per team)
- INLINECODE4 : Enable status true/false (required)
- INLINECODE5 : Tags, comma-separated (required)
- INLINECODE6 : Expertise skills, comma-separated (required)
- INLINECODE7 : Weak areas, comma-separated (required)
- INLINECODE8 : Whether to load workflow prompts (optional, true/false, default: true for leader, false for others)
- INLINECODE9 : Group name for categorization (optional, used for organizing team members)
Reset Data
Clear all team data and reset to initial state:
CODEBLOCK3
Output:
CODEBLOCK4
⚠️ Warning: This operation is irreversible. All data in ~/.agent-team/team.json will be permanently deleted.
Data Storage
Team data is stored in ~/.agent-team/team.json, shared globally. Directory is auto-created if it doesn't exist.
Common Use Cases
Finding the right person for a task
CODEBLOCK5
Changing team leader
Setting a new leader automatically removes leader status from the previous one:
CODEBLOCK6
Temporarily disabling a member
Set
--enabled "false" to disable without removing:
CODEBLOCK7
Adding a new team member
CODEBLOCK8
Error Handling
Data file not found
If
~/.agent-team/team.json doesn't exist, the script returns an empty team state (no error raised).
Invalid JSON
If the data file is corrupted, the script logs an error and returns an empty state:
CODEBLOCK9
Missing required parameters
Running
update without required parameters:
CODEBLOCK10
Single leader constraint
Only one leader can exist. Setting a new leader automatically removes leader status from the previous one:
CODEBLOCK11
References
Agent Team Skill
管理具备技能、角色和任务委派能力的AI智能体团队成员。
团队成员
列出所有团队成员信息:
bash
python3 scripts/team.py list
常见场景:
- - 查看当前团队负责人是谁
- 在分配任务前寻找具备特定专长的成员
- 审查团队结构和可用角色
输出示例:
markdown
团队成员
Alice ⭐ 负责人 - 协调、规划、决策
- - agent_id: alice
- 专长:任务分解、综合决策、智能体协调
- 不擅长:代码开发、投资分析
Bob - 后端开发 - 后端、API、数据库
- - agent_id: bob
- 专长:Python、Go、PostgreSQL
- 不擅长:前端、设计
共 2 名成员,负责人:Alice (alice)
⚡ 任务委派规则(核心原则)
委派时机:
- 1. 首先完成准备工作:理解需求、明确目标、确认约束条件
- 进入实施阶段时:确定最佳执行人选,进行委派
- 委派后跟进:检查输出质量,确保满足需求
委派上下文(需传递的内容):
委派时,始终提供:
- - 原始需求和成功标准
- 相关背景和上下文
- 你的执行计划和任何约束条件
- 预期输出格式
委派故障转移:
如果团队成员未能完成任务:
- 1. 第一次尝试:返回具体反馈要求修改
- 第二次尝试:调整上下文后重新分配给其他成员
- 第三次尝试:上报给负责人或自行执行
🔄 任务处理流程(最高优先级)
计划 → 执行 → 检查 → 行动
重要提示:这是一个持续改进的循环。如果在行动阶段任务未完成,则循环回到计划阶段。
1. 计划 — 规划阶段
目标:充分准备,避免盲目执行
- - 理解需求并澄清问题
- 定义目标和成功标准
- 识别风险并确定责任人
- 制定执行计划
2. 执行 — 执行阶段
目标:按计划执行并保持进度
3. 检查 — 检查阶段
目标:对照需求验证结果
4. 行动 — 行动阶段
目标:总结并决定后续步骤
- - ✅ 任务完成 → 结束
- ❌ 任务未完成 → 循环回到计划阶段
添加/更新成员
添加新成员或更新现有成员信息:
bash
python3 scripts/team.py update \
--agent-id agent-001 \
--name Alice \
--role 后端开发 \
--is-leader true \
--enabled true \
--tags 后端,API,数据库 \
--expertise python,go,postgresql \
--not-good-at 前端,设计 \
--load-workflow true \
--group 后端团队
参数:
- - --agent-id:成员唯一标识(必填)
- --name:成员名称(必填)
- --role:角色/职位(必填)
- --is-leader:是否为团队负责人(必填,true/false,每个团队仅限一名负责人)
- --enabled:启用状态 true/false(必填)
- --tags:标签,逗号分隔(必填)
- --expertise:专长技能,逗号分隔(必填)
- --not-good-at:薄弱领域,逗号分隔(必填)
- --load-workflow:是否加载工作流提示(可选,true/false,默认:负责人为true,其他为false)
- --group:分组名称(可选,用于组织团队成员)
重置数据
清除所有团队数据并重置为初始状态:
bash
python3 scripts/team.py reset
输出:
团队数据已重置。
⚠️ 警告:此操作不可逆。~/.agent-team/team.json 中的所有数据将被永久删除。
数据存储
团队数据存储在 ~/.agent-team/team.json 中,全局共享。如果目录不存在,将自动创建。
常见用例
为任务寻找合适人选
bash
列出团队以查找具备相关专长的成员
python3 scripts/team.py list
在输出中查找匹配的标签/专长
更换团队负责人
设置新负责人会自动移除原负责人的负责人状态:
bash
python3 scripts/team.py update --agent-id alice --name Alice --role 团队主管 --is-leader true --enabled true --tags 协调,规划 --expertise 管理,决策 --not-good-at 专业开发
临时禁用成员
设置 --enabled false 以禁用而不删除:
bash
python3 scripts/team.py update --agent-id bob --name Bob --role 后端开发 --is-leader false --enabled false --tags 后端,API --expertise Python,Go --not-good-at 前端
添加新团队成员
bash
python3 scripts/team.py update --agent-id charlie --name Charlie --role 前端开发 --is-leader false --enabled true --tags 前端,UI --expertise React,TypeScript --not-good-at 后端,数据库
错误处理
数据文件未找到
如果 ~/.agent-team/team.json 不存在,脚本返回空团队状态(不引发错误)。
JSON格式无效
如果数据文件损坏,脚本记录错误并返回空状态:
[agent-team] 加载团队数据时出错:<错误信息>
缺少必填参数
运行 update 时缺少必填参数:
错误:需要以下参数:--agent-id, --name, --role, --is-leader, --enabled, --tags, --expertise, --not-good-at
单一负责人约束
只能存在一名负责人。设置新负责人会自动移除原负责人的负责人状态:
注意:已移除 <原负责人名称> 的负责人状态
参考