/ai-team-os:os-workflowfrom ai-team-os
Guides using Claude Code built-in Workflows within an AI Team OS: standard templates for writing outputs back to OS, plus review-tier (L0/L1/L2) and model-tier discipline for dispatching sub-agents.
Ships in ai-team-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
调用 Workflow 后,每个内部 agent 会被 hook 自动注册成一个 OS 团队(workflow-<wf_id>,
一次 workflow = 一个团队)。追踪是自动的,但工作内容不会自己入库——下面两件事必须你做。
调用 Workflow 前用 task_create 把这次工作方向登记上墙并置 running(§2 的回写指令要把它的 id
插进每个 agent 的 prompt,事后补建来不及),完成后 task_update 置 completed 并填 result。
把下面这段粘进你写的 workflow 脚本里每个 agent() 的 prompt 末尾(已验证 workflow
agent 能调 OS 的 MCP 工具 + HTTP API,非沙盒):
【回写 OS(收尾必做)】
1. ToolSearch 加载:select:mcp__ai-team-os__task_memo_add,mcp__ai-team-os__report_save
2. 完成本职工作后:
- task_memo_add(task_id="<总任务id>", content="<这步干了啥+关键结论>", memo_type="progress")
- 重要产出再 report_save(...) 落库,并把 report_id 写进 memo
3. 你在项目目录运行,MCP 自动带项目头,无需关心端口/项目 id。
在脚本里把 <总任务id> 用第 1 步 task_create 拿到的 id 通过 prompt 字符串插值传进去。
// Leader 先 task_create 拿到 taskId(OS MCP),再写 workflow:
const WRITEBACK = `\n【回写 OS(收尾必做)】\n1. ToolSearch: select:mcp__ai-team-os__task_memo_add\n2. 完成后 task_memo_add(task_id="${taskId}", content="...", memo_type="progress")\n3. 项目目录运行,MCP 自动带项目头。`
const r = await agent('你的实际任务……' + WRITEBACK, { schema, label })
不传 model 即继承主会话模型,所以每个 agent() 都显式写 model(层级别名如 'opus'、'fable',浮动到最新,不写死型号)。选哪一档按使用者自己的派工策略(写在项目 CLAUDE.md 或用户规则里),本技能不预设档位。
model: 'fable' 调用须配一条 // fable 理由: … 行注释;Agent 工具派工则在 prompt 首行写 [fable 理由: …]。S6 派工门禁(PreToolUse 机检):缺省 model 直接拦,fable 无理由拦。// 每个 stage 显式写 model;用 fable 的那处配一条理由注释
const found = await parallel(ITEMS.map(x => () =>
agent(findPrompt(x) + WRITEBACK, { model: 'opus', schema: FINDINGS })))
// fable 理由: <这一步为什么要用这一档>
const verdict = await agent(judgePrompt(found) + WRITEBACK,
{ model: 'fable', effort: 'xhigh', schema: VERDICT })
注:effort 与档位同按使用者自己的派工策略设(agent() 的 effort?: 'low'|'medium'|'high'|'xhigh'|'max',省略即继承会话档位),S6 不校验 effort。模型档位则是硬约束:S6 对缺省 model、fable 无理由一律 exit(2) 拦下(见上一条)。
实证(0905 单日):133 个 agent 产出 274 万 token 却读了 2.02 亿缓存(74:1)——钱花在重复读同一批全文上,不是花在干活上。
总原则:限制的是「把任何问题都按最复杂方式做完」,不是把复杂问题做简单;审查强度按风险定,不按预算定——L2 该全文对抗就全文,省的是重复读、多余的镜头与反驳者、多余的轮次。分级在前,模式在后:ultracode 常开≠事事开 workflow(用户习惯常开;它的字面定义「每个实质任务都开 workflow」照做就是给每件事按最贵的价做),L0/L1 直接做,只有 L2 才开;开了也按下面七条控人数与读量。
// 分级示例:L2 全文对抗 = 一个审稿人 + 每条发现一个反驳者,被反驳才二审
const findings = await agent(reviewPrompt(SECTIONS), { model: 'opus', schema: FINDINGS }) // 定位到章节
const verified = await parallel(findings.map(f => () =>
agent(refutePrompt(f), { model: 'opus', schema: VERDICT })
.then(async v => v.refuted
? { ...f, votes: [v, await agent(refutePrompt(f), { model: 'opus', schema: VERDICT })] } // 被反驳才二审;此处档位按你的派工策略
: { ...f, votes: [v] })))
给 agent 配 schema 时,prompt 里必须写显式体量硬约束(每字段字符上限、条目数上限、"宁可精炼不可超限")——只靠 schema 的 maxLength 拦不住:agent 超限会陷入 StructuredOutput 重试循环,耗尽重试上限(5)后整路阵亡返回 null。
maxLength 给出安全余量;长文本产出改让 agent 直接 Write 文件,结构化输出只返摘要与路径。(prompt, opts) 不动,走缓存零成本重放。api_port.txt 为准(aiteam paths 可查数据目录;默认 8000,被占用时 autostart 会换端口)。What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub cronusl-1141/ai-company --plugin ai-team-os5 skills in this plugin
/meeting-facilitate用 meeting_* 工具跑一场多 Agent 会议:创建 → 亲自 spawn 参与者 → 推进轮次 → 签到 → conclude 并把决策上墙。仅当已决定以「开会」形式产出一个需上墙的决策时使用;典型场景是减法类提案:回退既有设计决策、砍工具删表、削弱或删除自动检查——这类结论必须留痕。加法(新增检查、加严判据、新增工具)不需要开会,写清理由直接做。用户只是让你评审代码、复盘、比较方案时不要触发——那是直接做,或派一个审查 agent。/meeting-participate你被派来参加 AI Team OS 会议(派你的 prompt 里带 meeting_id),且要在 Round 2 及之后发言时用:怎么拿到自己的 agent_id、怎么引用前人发言、round_number 怎么填。Round 1 的材料、发言规则与调用样例已经写在派你的 prompt 里,不必读本技能。/os-channelCC 与 Codex(或两个各自独立运行的 CC 会话)之间用 OS 信道留言、查未读、被新消息唤醒。触发:要跨 harness 把结论交给对端、给对端留言或清未读、用户问"能不能让 Claude 和 Codex 互相沟通"。不适用于派子 agent 或 workflow 内部协作——那是 Agent 与 SendMessage,信道对同会话的子 agent 没有意义。/os-release发布 AI Team OS 新版本的完整清单——预检与本机安装验收(含远程测试机全量)、版本七处锁步、中英双语 CHANGELOG、双份 dist 构建、私有术语扫描、commit、tag(说明即 Release 标题)、双仓推送、核对 workflow 自动建的 GitHub Release 条目与 latest 徽章、事后核对(含公开仓 CI 结论,红了出补丁)。当准备发版、补建漏掉的 Release 条目、或核对已发版本的线上状态时使用。Other plugins' skills for the same job