From team-skills
This skill should be used when the user asks to "初始化团队", "创建开发团队", "team init", "create team", "build team", "组建团队", "启动项目团队", "添加扩展角色", "add extension roles". 通过交互式问答收集项目信息, 创建包含专业角色的 Agent 工程团队。支持 8 种团队类型和 153 个扩展专业角色(跨 12 领域)。
How this skill is triggered — by the user, by Claude, or both
Slash command
/team-skills:team-initThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
通过交互式问答,收集项目信息并创建由 Lead 领导的 Agent 工程团队。
references/ctf/roles/captain.mdreferences/ctf/roles/crypto.mdreferences/ctf/roles/forensics.mdreferences/ctf/roles/misc.mdreferences/ctf/roles/pwn.mdreferences/ctf/roles/reverse.mdreferences/ctf/roles/web.mdreferences/ctf/workflow.mdreferences/debug/roles/code-reviewer.mdreferences/debug/roles/debug-lead.mdreferences/debug/roles/fix-engineer.mdreferences/debug/roles/issue-analyst.mdreferences/debug/roles/regression-tester.mdreferences/debug/roles/root-cause-analyst.mdreferences/debug/workflow.mdreferences/dev/roles/acceptor.mdreferences/dev/roles/analyst.mdreferences/dev/roles/architect.mdreferences/dev/roles/auditor.mdreferences/dev/roles/developer.md通过交互式问答,收集项目信息并创建由 Lead 领导的 Agent 工程团队。
本 skill 中 references/ 和 scripts/ 路径均相对于 SKILL.md 所在目录(skill base directory)。执行时以 base directory 拼接绝对路径。不要硬编码 ~/.claude/skills/ — skill 可能安装在项目级 .claude/skills/ 或全局 ~/.claude/skills/ 下。
| # | 类型 | 领导角色 | 目录 | 适用场景 |
|---|---|---|---|---|
| 1 | 软件开发 | PM | dev | 全新项目开发、功能迭代 |
| 2 | 软件测试 | 测试经理 | testing | 系统测试、质量保障 |
| 3 | 逆向工程 | 逆向负责人 | reverse | 二进制分析、协议逆向、恶意软件分析 |
| 4 | 调试/Bug修复 | 调试负责人 | debug | 故障排查、性能问题定位 |
| 5 | 安全研究 | 安全负责人 | security | 漏洞挖掘、安全评估(需合法授权) |
| 6 | CTF 比赛 | 队长 | ctf | CTF 竞赛、安全挑战 |
| 7 | 运维 | 运维经理 | ops | 部署运维、基础设施管理 |
| 8 | 讨论/研讨 | 主持人 | discuss | 方案设计、技术选型、需求研讨、头脑风暴 |
各类型的详细角色列表见 references/role-catalog.md。
按顺序使用 AskUserQuestion 工具向用户提问。
AskUserQuestion:
question: "请选择要创建的团队类型"
header: "团队类型"
options:
- label: "软件开发"
description: "全新项目开发、功能迭代"
- label: "软件测试"
description: "系统测试、质量保障"
- label: "逆向工程"
description: "二进制分析、协议逆向"
- label: "调试/Bug修复"
description: "故障排查、性能定位"
- label: "安全研究"
description: "漏洞挖掘、安全评估(需合法授权)"
- label: "CTF 比赛"
description: "CTF 竞赛、安全挑战"
- label: "运维"
description: "部署运维、基础设施管理"
- label: "讨论/研讨"
description: "方案设计、技术选型、需求研讨、头脑风暴"
multiSelect: false
记录用户选择的 team_type,映射到对应目录名:
如果 $ARGUMENTS 非空,使用其作为项目名称,跳过此问题。
AskUserQuestion:
question: "请输入项目名称(英文,用作 team name,如 my-webapp)"
header: "项目名称"
options:
- label: "my-project"
description: "使用默认名称"
- label: "输入自定义名称"
description: "在「其他」中输入"
multiSelect: false
AskUserQuestion:
question: "{根据 team_type 调整措辞}"
header: "项目描述"
options: {根据 team_type 提供 2-4 个典型场景选项}
multiSelect: false
措辞映射:
AskUserQuestion:
question: "{根据 team_type 调整措辞}"
header: "技术栈"
options: {根据 team_type 提供 2-4 个典型选项}
multiSelect: true
措辞映射:
展示当前 team_type 的角色列表。Lead 角色自动包含,无需选择。
AskUserQuestion:
question: "选择需要的角色({lead_role} 默认包含)。多实例角色可在「其他」中用 'developer x2' 格式指定数量"
header: "团队角色"
options:
- label: "全部角色 (推荐)"
description: "包含该类型所有角色各 1 个"
- label: "核心团队"
description: "{该类型的核心角色子集}"
- label: "最小团队"
description: "{lead + 1-2 个核心角色}"
- label: "自定义"
description: "在「其他」中指定角色和数量"
multiSelect: false
核心团队映射:
最小团队映射:
AskUserQuestion:
question: "是否从扩展角色库添加专业角色?(153 个跨 12 领域的专家角色)"
header: "扩展角色"
options:
- label: "跳过"
description: "仅使用核心团队角色"
- label: "浏览并选择"
description: "从扩展角色库中挑选专业角色"
multiSelect: false
若选择「跳过」→ 若 team_type 为 discuss 则进入问题 4.6(讨论轮次);否则进入问题 5(确认)。 若选择「浏览并选择」→ 进入问题 4.3。
读取 references/extensions/extension-catalog.md 获取完整领域列表。
AskUserQuestion:
question: "选择要浏览的领域(可多选)"
header: "扩展角色领域"
options:
- label: "engineering"
description: "22个: 前端、后端、AI、DevOps、安全、嵌入式..."
- label: "design"
description: "8个: UI、UX、品牌、视觉叙事..."
- label: "marketing"
description: "29个: 小红书、抖音、微信、B站、SEO..."
- label: "game-development"
description: "19个: Unity、Unreal、Godot、Roblox..."
- label: "paid-media"
description: "7个: PPC、社交广告、程序化采买..."
- label: "product"
description: "11个: 产品发现、战略、执行、市场研究、数据分析、GTM、营销增长..."
- label: "project-management"
description: "6个: 制片人、项目协调、实验追踪..."
- label: "sales"
description: "8个: 赢单策略、售前工程、Pipeline分析..."
- label: "support"
description: "8个: 数据分析、法务合规、财务、招聘..."
- label: "spatial-computing"
description: "6个: visionOS、WebXR、Metal..."
- label: "specialized"
description: "21个: 编排、区块链安全、MCP、合规..."
- label: "testing"
description: "8个: 证据收集、无障碍、API测试..."
multiSelect: true
对用户选中的每个领域,从 references/extensions/extension-catalog.md 读取该领域的角色列表,展示给用户选择:
AskUserQuestion:
question: "选择要添加的 {department} 角色"
header: "{department} 扩展角色"
options:
{从 extension-catalog.md 读取对应领域角色列表,每个角色一个选项}
multiSelect: true
对每个选中领域重复此问题。记录所有选中的扩展角色 ext_roles[],每项包含 department 和 role_code。
完成所有领域的角色选择后:若 team_type 为 discuss → 进入问题 4.6(讨论轮次);否则 → 进入问题 4.5(远程角色)。
前置条件:检测 {work_dir}/.team-roles/roles-lock.json 是否存在且 roles 数组非空。若不存在或为空 → 跳过此步骤,直接进入问题 4.6(discuss 类型)或问题 5(工作目录)。
若存在,使用 AskUserQuestion 提问:
AskUserQuestion:
question: "是否从已安装的远程角色中添加团队成员?"
header: "远程角色"
options:
- label: "跳过"
description: "不添加远程角色"
- label: "浏览已安装的远程角色"
description: "从已安装的远程角色中选择要加入团队的成员"
- label: "现在安装新的远程角色"
description: "输入 GitHub repo URL 或 npx 包名,安装后选择"
multiSelect: false
选项处理:
{work_dir}/.team-roles/roles-lock.json,以表格展示所有角色(代号、来源、verified/unverified 状态、简述),使用 AskUserQuestion 让用户多选要加入的角色。选定后追加到 selected_extension_roles 列表,标记 source: remote。/team-roles add 的完整流程执行(参考 ../team-roles/SKILL.md 的 add 指令)。安装完成后回到本问题重新列出可选角色。远程角色选择展示格式:
| 代号 | 来源 | 状态 | 简述 |
|-------------------|-------------------|-------------|----------------|
| ai-engineer | user/my-roles | ✓ verified | AI 工程师... |
| vite-skill | antfu/skills@vite | ⚠ unverified | Vite 开发... |
| custom-reviewer | (单文件) | ✓ verified | 代码审查... |
AskUserQuestion:
question: "每个议题的最大讨论轮次?"
header: "讨论轮次"
options:
- label: "3 轮(默认)"
- label: "5 轮"
- label: "自定义"
multiSelect: false
max_rounds 写入配置和 prompt 的 <project_context> 中。
AskUserQuestion:
question: "项目工作目录在哪里?"
header: "工作目录"
options:
- label: "当前目录"
description: "使用当前工作目录"
- label: "指定路径"
description: "在「其他」中输入绝对路径"
multiSelect: false
输出汇总信息,然后确认:
团队配置汇总
--------------------
团队类型: {team_type_name}
项目名称: {project_name}
项目描述: {description}
技术栈: {tech_stack}
工作目录: {work_dir}
团队成员:
- {lead_role} x1 (Lead)
- {role_name} x{count}
...
{若有扩展角色}
扩展角色:
- {ext_role_name} ({department})
...
{若有远程角色}
远程角色:
- {role_code} ({source}) [verified/unverified]
...
预计创建 {N} 个 Agent
--------------------
若本次团队包含 unverified 远程角色,在确认步骤汇总信息后额外输出警告:
⚠ 本次团队包含 {N} 个未验证远程角色:{role1}, {role2}
未验证角色的内容未经 5-Block 格式校验,请确认已审阅其内容。
AskUserQuestion:
question: "确认以上配置并创建团队?"
header: "确认"
options:
- label: "确认创建"
description: "开始创建团队"
- label: "修改配置"
description: "重新开始问答"
- label: "取消"
description: "放弃创建"
multiSelect: false
用户确认后,执行以下步骤。
将角色定义文件复制到项目工作目录的 .teams/{project_name}/,供用户在团队启动前审阅和修改。
来源路径(相对于 skill base directory):
references/{type_dir}/roles/{role_code}.mdreferences/{type_dir}/workflow.md使用 Read 工具时,将以上相对路径拼接到 skill base directory 构建绝对路径。
写入目标:
{work_dir}/.teams/{project_name}/
├── team.yaml # 团队配置摘要
├── workflow.md # 工作流定义(从 references 复制)
└── roles/
├── {lead_role}.md # Lead 角色定义
├── {role_1}.md # 执行角色定义
└── ...
操作步骤:
mkdir -p "{work_dir}/.teams/{project_name}/roles".teams/{project_name}/roles/{role_code}.mdext_roles[] 非空):
references/extensions/{department}/{role_code}.md.teams/{project_name}/roles/ext-{department}-{role_code}.md(加 ext- 前缀)selected_extension_roles 中含 source: remote 条目):
{work_dir}/.team-roles/roles-lock.json,查找每个远程角色的 filePath{work_dir}/.team-roles/{filePath} 获取角色内容.teams/{project_name}/roles/{role_code}.md(直接用角色代号,不加前缀).teams/{project_name}/workflow.md.teams/{project_name}/team.yaml:# 团队配置 - 由 /team-init 准备
# 修改 roles/ 下的 .md 文件可自定义角色行为
# 确认后使用「开始创建」启动团队
team_type: "{type_dir}"
team_type_name: "{team_type_name}"
project_name: "{project_name}"
description: "{description}"
tech_stack: "{tech_stack}"
work_dir: "{work_dir}"
roles:
- role: "{lead_role_code}"
count: 1
is_lead: true
- role: "{role_code}"
count: {N}
# ... 核心角色
# 扩展角色(如有)
# - role: "ext-{department}-{role_code}"
# count: 1
# source: extension
# department: "{department}"
# 远程角色(如有)
# - role: "{role_code}"
# count: 1
# source: remote
# remote_source: "{source_from_lock}"
# verified: true/false
输出角色文件路径并提示用户审阅:
角色定义已准备就绪
--------------------
目录: {work_dir}/.teams/{project_name}/
文件列表:
workflow.md — 工作流定义
roles/{lead_role}.md — {lead_role_name}(Lead)
roles/{role_1}.md — {role_1_name}
roles/{role_2}.md — {role_2_name}
...
您可以在编辑器中打开并修改这些文件,自定义角色行为。
修改完成后选择「开始创建」启动团队。
--------------------
AskUserQuestion:
question: "准备好启动团队了吗?"
header: "审阅角色定义"
options:
- label: "开始创建"
description: "使用当前角色定义(含您的修改)创建团队"
- label: "打开目录"
description: "显示文件完整路径,方便在编辑器中打开"
- label: "取消"
description: "放弃创建,保留 .teams/ 目录供后续使用"
multiSelect: false
如果用户选择「打开目录」,输出每个文件的完整绝对路径,然后再次询问是否开始创建。 如果用户选择「取消」,输出提示后结束:
团队创建已取消。角色定义保留在:
{work_dir}/.teams/{project_name}/
后续可手动编辑后,使用 /team-init {project_name} 重新启动
(检测到 .teams/ 目录时将直接使用其中的角色定义)。
⚠ 关键步骤 — 不可跳过。 必须使用
TeamCreate工具注册团队。此步骤创建团队配置和共享 TaskList,是步骤 7 中Agent(team_name=...)生效的前提。若跳过此步骤直接调用 Agent,成员将成为独立 subagent 而非团队成员 — 无法共享 TaskList、无法通过 SendMessage 互相通信。
TeamCreate:
team_name: "{project_name}"
description: "{team_type_name} - {description}"
从 .teams/ 目录读取(而非直接从 references/ 读取),这样包含了用户的修改。
角色定义路径: {work_dir}/.teams/{project_name}/roles/{role_code}.md
工作流路径: {work_dir}/.teams/{project_name}/workflow.md
对每个选中的角色,使用 Read 工具读取其角色定义文件。 同时读取 workflow.md。
为每个成员组合 prompt。Lead 角色与执行角色使用不同的工作流注入策略,以控制 prompt 长度。
重要: 角色定义从
.teams/{project_name}/roles/读取(步骤 4),包含用户可能做的修改。
Lead 角色负责管理整个工作流,因此注入完整的 workflow.md 内容。
你是「{project_name}」项目的{role_name}。
<project_context>
项目名称: {project_name}
团队类型: {team_type_name}
项目描述: {description}
技术栈: {tech_stack}
工作目录: {work_dir}
{若 discuss 类型} 最大讨论轮次: {max_rounds}
</project_context>
<team_members>
{列出所有成员的名称和角色}
</team_members>
<workflow>
{workflow.md 的完整内容}
</workflow>
<your_role>
{对应角色 .md 文件的完整内容}
</your_role>
执行角色无需完整工作流,仅注入 workflow.md 中的阶段总览表格(即 ## 阶段总览 下的 Markdown 表格,通常 5-10 行),不包含各阶段的详细流程描述。
你是「{project_name}」项目的{role_name}。
<project_context>
项目名称: {project_name}
团队类型: {team_type_name}
项目描述: {description}
技术栈: {tech_stack}
工作目录: {work_dir}
{若 discuss 类型} 最大讨论轮次: {max_rounds}
</project_context>
<team_members>
{列出所有成员的名称和角色}
</team_members>
<workflow_overview>
{仅 workflow.md 中「阶段总览」表格,不含各 Phase 详细流程}
</workflow_overview>
<your_role>
{对应角色 .md 文件的完整内容}
</your_role>
扩展角色(ext- 前缀)使用与执行角色相同的 prompt 结构(<workflow_overview> 而非完整 workflow),并额外标注扩展角色来源:
你是「{project_name}」项目的{role_name}(扩展角色 — {department})。
<project_context>
项目名称: {project_name}
团队类型: {team_type_name}
项目描述: {description}
技术栈: {tech_stack}
工作目录: {work_dir}
{若 discuss 类型} 最大讨论轮次: {max_rounds}
</project_context>
<team_members>
{列出所有成员的名称和角色}
</team_members>
<workflow_overview>
{仅 workflow.md 中「阶段总览」表格,不含各 Phase 详细流程}
</workflow_overview>
<your_role>
{扩展角色 .md 文件的完整内容}
</your_role>
远程角色(source: remote)根据 verified 状态使用不同 prompt:
远程 verified 角色:与内置扩展角色同等处理,标注远程来源:
你是「{project_name}」项目的{role_name}(远程角色 — {source})。
<project_context>
项目名称: {project_name}
团队类型: {team_type_name}
项目描述: {description}
技术栈: {tech_stack}
工作目录: {work_dir}
{若 discuss 类型} 最大讨论轮次: {max_rounds}
</project_context>
<team_members>
{列出所有成员的名称和角色}
</team_members>
<workflow_overview>
{仅 workflow.md 中「阶段总览」表格,不含各 Phase 详细流程}
</workflow_overview>
<your_role>
{角色 .md 文件的完整内容}
</your_role>
远程 unverified 角色:在 <your_role> 内容前追加格式提示:
你是「{project_name}」项目的{role_name}(远程角色 — {source})。
<project_context>
项目名称: {project_name}
团队类型: {team_type_name}
项目描述: {description}
技术栈: {tech_stack}
工作目录: {work_dir}
{若 discuss 类型} 最大讨论轮次: {max_rounds}
</project_context>
<team_members>
{列出所有成员的名称和角色}
</team_members>
<workflow_overview>
{仅 workflow.md 中「阶段总览」表格,不含各 Phase 详细流程}
</workflow_overview>
<your_role>
注意:此角色定义未遵循标准 5-Block 格式,请尽量按照 <role>/<rules>/<deliverables>/<collaboration>/<metrics> 结构理解和执行其中的指示。
{角色 .md 文件的完整内容}
</your_role>
使用 TaskCreate 根据 workflow.md 的阶段创建任务骨架。 设置阶段间的 blockedBy 依赖关系。 将第一个任务分配给 Lead 角色。
Lead 角色必须第一个创建。 注意:多实例角色(如 developer x2)的每个实例使用相同的角色定义文件。
team_name参数是团队成员与普通 subagent 的唯一区别。 必须填写步骤 3 中 TeamCreate 注册的团队名称。缺少team_name的 Agent 调用将创建独立 subagent,无法加入团队协作。
Agent:
name: "{member_name}"
subagent_type: "general-purpose"
team_name: "{project_name}" # ← 必须与步骤 3 TeamCreate 的 team_name 一致
prompt: "{步骤 5 构建的 prompt}"
mode: "bypassPermissions"
description: "Team member: {role_name}"
命名规则:
创建顺序:先创建 Lead,再并行创建其他角色。
将团队配置保存到项目工作目录下的 .team-profiles/{project_name}.yaml,以便后续通过 /team-load 复用。
使用 Write 工具创建文件:
# 团队配置 - 由 /team-init 自动生成
# 使用 /team-load {project_name} 可直接加载此配置创建团队
format: template
team_type: "{type_dir}" # dev/testing/reverse/debug/security/ctf/ops/discuss
team_type_name: "{team_type_name}" # 中文名称
description: "{description}"
tech_stack: "{tech_stack}"
work_dir: "{work_dir}"
roles:
# Lead 角色(自动包含)
- role: "{lead_role_code}"
count: 1
is_lead: true
# 核心角色
- role: "{role_code}"
count: {N}
# ... 列出所有选中的核心角色及数量
# 扩展角色(如有)
# - role: "ext-{department}-{role_code}"
# count: 1
# source: extension
# department: "{department}"
# 远程角色(如有)
# - role: "{role_code}"
# count: 1
# source: remote
# remote_source: "{source}"
# verified: true/false
保存后输出提示:
团队配置已保存到: {work_dir}/.team-profiles/{project_name}.yaml
后续可使用 /team-load {project_name} 直接加载此团队配置。
SendMessage:
type: "message"
recipient: "{lead_name}"
content: |
团队已创建完成。
- 项目: {project_name}
- 描述: {description}
- 技术栈: {tech_stack}
- 工作目录: {work_dir}
- 团队成员: {member_list}
请开始第一阶段工作。
工作流: {work_dir}/.teams/{project_name}/workflow.md
角色定义: {work_dir}/.teams/{project_name}/roles/
summary: "团队已创建,启动项目"
如果执行 /team-init 时检测到 {work_dir}/.teams/{project_name}/ 已存在(例如上次取消后保留的),跳过步骤 1 的文件写入,直接进入步骤 2(用户审阅)。
提示用户:
检测到已有角色定义: .teams/{project_name}/
将使用其中的角色文件创建团队(包含您之前的修改)。
如需重新生成,请先删除 .teams/{project_name}/ 目录。
.teams/ 目录应加入 .gitignore(属于本地自定义,不入版本控制)<your_role> 段references/role-catalog.md - 各团队类型的完整角色列表references/{type_dir}/roles/{role}.md - 各角色详细定义(原始版本)references/{type_dir}/workflow.md - 各团队类型的工作流定义references/shared/handoff-protocol.md - 跨角色交接协议references/shared/role-template.md - 角色定义标准模板references/extensions/extension-catalog.md - 扩展角色索引(153 个跨 12 领域)references/extensions/{department}/{role_code}.md - 扩展角色定义scripts/lint-roles.sh - 角色定义文件格式校验(5板块结构检查)
bash <skill_base>/scripts/lint-roles.sh — 检查所有核心角色bash <skill_base>/scripts/lint-roles.sh dev — 检查 dev 团队bash <skill_base>/scripts/lint-roles.sh --extensions — 检查扩展角色${BASH_SOURCE[0]} 自动定位,任何安装位置均可工作npx claudepluginhub killvxk/teamskills --plugin team-skillsSets up multi-agent teams for complex projects with file-based planning, per-agent directories, and teammate spawning. Triggers on team/swarm/start-project requests.
Sets up agent teams for complex multi-agent projects using file-based planning, persistent progress tracking, per-agent directories, and teammate spawning. Triggers on team/swarm/project setup requests.
Creates a multi-agent team composition file with purpose definition, member selection, coordination patterns, and registry integration. Use when formalizing recurring collaborative workflows.