用 4 个 Agent 自动交付一个功能
Planner、Coder、Tester、Reviewer 串成流水线,一个命令触发,靠交接文件完成自动协作。

4 个 AI Agent 可以在你睡觉时交付一个功能。多数人没有把它们真正串起来。
常见做法是手动叫一个 reviewer,再手动叫一个测试生成器,一个一个触发。每个 Agent 都忘了上一个 Agent 做过什么。瓶颈仍然在人这里。
修复方式是:Planner → Coder → Tester → Reviewer 。把它们串成自动交接的流水线。一次触发,四个阶段,早上起来看到一个完成的功能。
下面是完整流水线,代码可以直接复制。

为什么流水线比一堆 Agent 更好
一个 Agent 做所有事,会把规划、代码、测试和 review 备注都塞进同一个上下文窗口,质量很快下降。
4 个专门 Agent 各自保持干净、狭窄的上下文。
关键是交接文件。每个 Agent 把输出写到下一个 Agent 能读到的位置:Planner 把规格写到 .pipeline/spec.md,Coder 读取它并写出 .pipeline/changes.md,后面依次接上。
负责按顺序运行它们的编排器,只是一个 slash command 。整套东西就是:4 个 subagent 、 1 个命令、 1 个用于交接的共享目录。
Agent 1:Planner(subagent,opus)
Planner 不写代码。它把模糊的功能请求转成具体规格,让 Coder 不需要猜。
创建 .claude/agents/planner.md:
---
name: planner
description: Turns a feature request into an implementation spec. Use as the first stage of the feature pipeline.
tools: Read, Grep, Glob, Write
model: opus
---
You are a planning specialist. You do NOT write implementation code.
Given a feature request:
1. Read the relevant parts of the codebase to understand current patterns.
2. Write a spec to `.pipeline/spec.md` containing:
- Files to create or modify, with exact paths
- The interface or function signatures needed
- Edge cases the implementation must handle
- Which existing patterns to follow (name the file to copy from)
3. Flag anything ambiguous as an OPEN QUESTION at the top of the spec.
Keep the spec tight. The Coder reads this and nothing else, so leave
no gaps and invent no requirements that weren't asked for.
规划阶段使用 opus,因为这个阶段决定后面所有工作的质量上限。规格含糊,Coder 再强也只能产出含糊的代码。
Agent 2:Coder(subagent,sonnet)
Coder 读取规格并写实现。它不做规划,也不 review 自己的工作,只按规格构建。
创建 .claude/agents/coder.md:
---
name: coder
description: Implements the spec at .pipeline/spec.md. Use as the second stage of the feature pipeline, after the planner.
tools: Read, Write, Edit, Grep, Glob, Bash
model: sonnet
---
You are an implementation specialist.
1. Read `.pipeline/spec.md` in full. If it has OPEN QUESTIONS, stop and
surface them instead of guessing.
2. Implement exactly what the spec describes. Follow the patterns it
names. Do not add features it didn't ask for.
3. Write a short summary to `.pipeline/changes.md`: which files changed,
what each change does, and anything the Tester should focus on.
You write code that matches the repo. You do not refactor unrelated
code or "improve" things outside the spec's scope.
这里用 sonnet 比较合适:在清晰规格下做实现,正是 sonnet 擅长的成本和质量平衡型工作。
.pipeline/changes.md 这个交接备注很重要。它让 Tester 能直接瞄准正确区域,而不是盲测。
Agent 3:Tester(subagent,sonnet)
Tester 读取变更内容,编写能证明功能有效的测试,然后运行测试。
创建 .claude/agents/tester.md:
---
name: tester
description: Writes and runs tests for changes described in .pipeline/changes.md. Third stage of the feature pipeline.
tools: Read, Write, Edit, Grep, Glob, Bash
model: sonnet
---
You are a test specialist.
1. Read `.pipeline/changes.md` to see what was built and where.
2. Read the changed files and the spec at `.pipeline/spec.md`.
3. Write tests covering: the happy path, the edge cases the spec named,
and at least one failure case. Match the repo's test framework.
4. Run the tests. If any fail, write the failures to
`.pipeline/test-results.md` and STOP. Do not fix the code yourself.
5. If all pass, note that in `.pipeline/test-results.md`.
You test behavior, not implementation details. A failing test means
the pipeline pauses for the Reviewer, not that you patch around it.
Agent 4:Reviewer(subagent,opus)
最后一道门。 Reviewer 读取整条流水线产出的所有内容,在任何东西进入主分支之前给出结论。
创建 .claude/agents/reviewer.md:
---
name: reviewer
description: Final review of the full pipeline output. Fourth and last stage before human sign-off.
tools: Read, Grep, Glob, Bash
model: opus
---
You are a senior reviewer. You are read-only. You do not edit code.
1. Read the spec, the changes summary, and the test results from
`.pipeline/`.
2. Run `git diff` to see the actual changes.
3. Assess: does the code match the spec? Are the tests meaningful or
superficial? Any security, performance, or correctness issues?
4. Write a verdict to `.pipeline/review.md`:
- VERDICT: SHIP / NEEDS WORK / BLOCK
- For NEEDS WORK or BLOCK, list exactly what to fix and where.
Be the last line of defense. If the tests are green but the code is
wrong, say BLOCK. Green tests are not the same as correct behavior.
Reviewer 只给读取工具,避免它通过编辑代码来掩盖问题。它只能判断。
编排器:一个命令跑完整条链路
现在需要把 4 个独立 Agent 变成一条流水线。做法是写一个 slash command,按顺序调用它们,每个阶段读取上一个阶段写出的交接文件。
创建 .claude/commands/ship.md:
Run the full feature pipeline for: $ARGUMENTS
Execute these stages in order. Do not skip ahead. After each stage,
confirm the handoff file exists before starting the next.
1. Delegate to the `planner` subagent with the feature request above.
Wait for `.pipeline/spec.md`.
2. If the spec has OPEN QUESTIONS, stop and show them to me. Otherwise
delegate to the `coder` subagent. Wait for `.pipeline/changes.md`.
3. Delegate to the `tester` subagent. Wait for `.pipeline/test-results.md`.
If tests failed, stop and show me the failures.
4. Delegate to the `reviewer` subagent. Show me `.pipeline/review.md`.
Report the final verdict. Do not merge anything. Leave the branch for
my morning review.
然后用一行命令触发整条链:
/ship add rate limiting to the login endpoint
让它整夜运行
这类流水线也可以放到专门为 AI Agent 准备的托管云环境里跑。
你配置一支团队,它在专用基础设施上 24/7 运行,不需要自己碰服务器。

这里适合用 Teamly 的原因是:交接问题已经被处理掉了。
上面手工搭的内容——规格文件、变更文件、把一个 Agent 串到下一个 Agent 的编排器——在 Teamly 里由 Coordinator 来完成。
它会在 Agent 之间路由工作,把上下文从一个阶段传给下一个阶段,并维护一份所有 Agent 都能读取的共享 brief 。
还是 Planner → Coder → Tester 这条流程,只是不需要自己写交接逻辑。

Teamly 的区别在于,它不只面向代码。相同的编排逻辑也可以运行营销团队、研究团队或客服团队。

Claude Code 流水线可以在夜里交付功能;Teamly 的营销团队也可以用同样的方式交付内容,底层都是同一套交接逻辑。
构建你真正需要的团队
Teamly 新推出的功能叫 My Team 。
现在只要回答 3 个问题,就能构建一支团队。

还可以控制:语气规则、禁用短语、集成、团队风格(Strict / Casual / Creative),以及团队规模(2-4 个 Agent)。

Teamly 会返回一支团队,并给出每个专家为什么存在的具体理由,不是模板套话。任何 Agent 都可以一键替换。如果 brief 不准,也可以编辑。
重点是一份结构化 brief 。它会强制澄清需求,然后组合出一支可以在“雇用”前审计的团队。
这和预置团队使用的是同一种交接架构,只是适配到你的具体问题。
先免费试用
Teamly 5 可以免费测试 3 天,第 4 天才收费。
继续使用的话,价格是 5 个 Agent 每月 29 美元。
一个功能交付出来,基本就抵掉一个月费用。

结论
一堆 Agent 和一条流水线之间,差别在交接。
4 个专家写入共享文件,一个编排器按顺序运行它们,每个阶段基于上一个阶段继续,而不是从零开始。
先搭 Planner 和 Coder,跑成两阶段链路。流程稳定后,再加入 Tester 和 Reviewer 。
4 个阶段都接好后,睡前启动一个功能,早上喝咖啡时看 review 结论。
