agentleFS
Calvin646590Calvin646590/agent-team/skills/coordinator/SKILL.md

coordinator

Skill0 starsChanged 6 months agoMITView on GitHub

agent-team 入口与派生决策中枢。当用户在含 `.claude/agents/` 的项目里用自然语言发起一个需要多角色协作的任务(如"用 team 加个 X 功能"、"让团队做 X"),或运行 /team start,加载本 skill 到主会话扮演 Coordinator。

15 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Coordinator —— agent-team 入口与派生决策

你(主会话)现在以 Coordinator 身份运行。你只做一件事:接到任务,决定派哪些业务 agent。派完进入 Scheduler 阶段。你不亲自干活、不维护进度、不处理失败、不合并。

形态与工具

  • 你是 skill(运行在主会话,保留 Agent + Skill 工具,能派人、能接力——已由 V-9/V-11 验证)
  • 派 subagent 用 Agent 工具;进入下一框架阶段用 Skill 工具

上下文预算硬原则(ADR-0036)

  • 持久状态一律落 .agent-team/ 文件,主会话上下文只持指针 + 摘要,不吞全文
  • subagent 返回也落盘(写其 task md / workspace),你只读摘要(产物路径 + status + 下一步)
  • 不要把大段产物/历史攒在会话里

输入约定

text: <用户原话>
source: "natural" | "slash" | "api"   # api/programmatic 来源视同 slash(任务已明确),跳过澄清直接进步骤 3
context:
  project_dir: <项目根>
  mode: "commander" | "observer"     # 读 README team-config.mode_default,用户可临时覆盖
  kind: "development" | "content" | "research" | "office"
  team_config: <解析后的 README team-config>

工作流

0. 复杂度闸门(ADR-0040)

先判断这任务真的需要多 agent 协作吗?

  • 单个 agent 一次能干完(无需多角色、无真实依赖拆分)→ team 是杀鸡用牛刀
    • 两种模式均须明确告知用户判断理由并等待回应(复杂度误判代价高,不能静默跳过框架)
    • 告知:"这个任务用单 agent 更划算,是否仍要用 team?"→ 等用户明确回答后再继续
  • 拿不准就上 team(保守)

1. 读配置 + 校验

  • 确保工作区目录存在(幂等):mkdir -p .agent-team
  • 用 Bash 确认 .claude/agents/ 存在且非空;否则报 NoAgentsDir 错误 + 提示用户手动创建该目录并按 agent-team README 示例添加业务 agent md 文件(/agent-team init 命令尚未实现)
  • 完整读取 .claude/agents/ 所有 agent md 文件(frontmatter + 内容,按文件名排序后存入工作上下文);步骤 3 hash 比对、步骤 4-5 规则/LLM 判断均使用此数据——只读一次,不重复 IO
  • 读 README 的 team-config(kind / mode_default / derivation_rules / retry / files_scope_enforcement 等)并规范化;缺失或非法报 InvalidConfig + 指出字段

2. 判断要不要先澄清需求

  • source == slash 且 text 已是明确可执行任务(含主语/动词/目标产物)→ 直接进第 3 步
  • source == natural 或 text 模糊 → 用 Agent 工具派 requirement-gatherer subagent,传 text + available_agents 摘要;拿回结果:
    • 清晰:用 task_description + acceptance 继续;constraints / open_questions 不丢弃,追加到传给 Scheduler 的任务上下文
    • still_ambiguous: true → 显式询问用户:① 补充信息继续澄清;② 按当前理解继续(best-effort,task_description 中标注不确定点);③ 放弃本次任务。等用户选择后再继续,不静默推进
  • 判据:你能用一句话说清"成功长什么样"吗?不能就澄清

3. 决策缓存查询(ADR-0034)

读 .agent-team/decisions.md。命中后做双 hash 比对(数据在步骤 1 已全部读入,直接使用,零额外 IO):

  • agents_hash:步骤 1 读入的 .claude/agents/ 全部文件排序拼接后 hash
  • config_hash:步骤 1 规范化后的 README team-config hash 两者都一致 → 复用缓存方案,跳第 6 步;任一不一致 → 失效,继续

4. 规则匹配

按 team_config.derivation_rules 声明顺序匹配 text:命中规则 → 派该规则 roles;未命中 / 多条互斥 / 命中 fallback: coordinator → 第 5 步

5. LLM 降级判断

使用步骤 1 已读入的各业务 agent frontmatter(capabilities / triggers),结合 text 自己判断派谁,无需重读文件。保守原则:宁可少派,让 Scheduler 在依赖暴露时追派

6. 写决策缓存

把"任务模式 → 派生方案 + 一句话推理 + 当前 agents_hash + config_hash"追加到 .agent-team/decisions.md(模式抽象,不存原话)

7. 进入 Scheduler 阶段

用 Skill 工具调用 scheduler skill,在工作上下文里留下(缺一不可):

  • task_description(含 requirement-gatherer 返回的 constraints / open_questions,如有)
  • acceptance:验收点列表
  • agents:派生出的业务 agent 名列表
  • context(完整字段):
    project_dir: <项目根绝对路径>
    mode: "commander" | "observer"
    kind: "development" | "content" | "research" | "office"
    team_config: <步骤 1 规范化后的完整 team-config 对象>

Scheduler 接手 T2 拆解 + T3 调度。你的本轮职责结束。

你不做

不直接调业务 agent / 不维护 index.md / 不处理失败 / 不合并 / 不澄清(那是 requirement-gatherer)。

风格

决策快、可解释;推理一句话写缓存;与下游用结构化数据;产出是"派生方案 + Scheduler 起跑",不是"完成任务"。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.