智能体
dev.to ·
@Kix Panganiban
用 AI 写代码容易,交付经过测试的代码才是难点
作者介绍其开源项目 agent-doctrine:让多个 Agent 按 scout、gate、plan、implement、review、consolidate、verify、ship 的固定流程协作,主 Agent 负责规划与分派,并在修改前依据 TENETS.md 回答十五个带证据的问题(最小正确改动、影响范围、如何在真实数据上验证等),答不上来就不允许写代码。文章为团队自述经验,未给出量化效果数据。
AI推荐理由 作者开源了 agent-doctrine,给出 scout→gate→plan→implement→review→consolidate→verify→ship 的 Agent 编码流程,并用 TENETS.md 的十五问作为编辑前门禁,属于可复用的工程实践。局限是文章为作者自述,未提供基准测试或合并成功率等量化证据,效果仍需验证。
72
正文
Getting an agent to write code is solved. Getting it to write the right code, prove it works, and hand you a PR you'd actually merge is not.
For the last year we've been iterating on a set of prompts, role definitions and skills at sisig.ai to close that gap. We just open-sourced it as agent-doctrine.
The loop
Every agent on the machine follows the same steps:
scout → gate → plan → implement → review → consolidate → verify → ship
The agent you talk to is the lead. It plans and delegates, and it only hand-writes code if you tell it to.
The gate
This is the part that changed things the most for us. Before any edit, the lead answers fifteen questions from TENETS.md in the transcript, with evidence. Some examples:
what's the smallest correct change?
what's the blast radius?
how will you prove it on real data?
If the agent can't answer, it isn't ready to code.
The team
scout: reads the codebase before planning
implementer: one per split, each in its own worktree
simplifier: cuts the plan down (rigorous mode)
adv_review: tries to break the plan and every diff
Handoffs are files with a fixed shape (HANDOFFS.md), so a spec written in Claude Code can be picked up by Codex or Cursor.
Fast vs rigorous
Fast keeps the gate and a review per diff. Rigorous adds plan simplification, adversarial plan review, and your approval before code. The lead asks which one at the start.
The prose rules
We also wanted agent output that doesn't read like slop. Replies, specs, PR bodies and commit messages follow simplified technical English: active voice, 8-20 words per sentence, answer first, no "leverage" or "delve", no em dashes.
Try it
Needs Git and Bun. Back up your agent config first, because it rewrites global instructions.
git clone https://github.com/sisig-ai/agent-doctrine.git
cd agent-doctrine
bun install --frozen-lockfile
export CLAUDE_MD_DIR="$PWD"
./sync.sh apply-snapshot
Enter fullscreen mode
Exit fullscreen mode
Then hand your agent a spec and answer "fast or rigorous?".
It's MIT and opinionated on purpose. Fork it and rewrite TASTE.md to fit how you work.