Novera-AI-agent

AI 编程四智能体流水线 —— 一套可直接复制使用的多智能体开发提示词。
核心主张:不审过程,只卡终局。 人不再逐行看代码,人只做两件事——
把需求写成机器能验证的规格,然后信任一套焊死的自动化质量关卡。
这条流水线怎么转
模糊需求 → Specifier(需求规格官) → Coder(编码官) → Refactorer(重构官) → Architect(架构守门官) → 自动合并
唯一需要人看的环节 只管让测试变绿 只改结构不改行为 唯一有一票否决权
| Agent |
角色 |
干什么 |
不干什么 |
| Agent 1 Specifier |
需求规格官 |
把模糊需求编译成 Gherkin 验收标准 + 边界条件 + DoD |
不写一行实现代码 |
| Agent 2 Coder |
编码官 |
让验收测试和单元测试全部变绿,最小实现 |
不过度设计、不顺手加需求 |
| Agent 3 Refactorer |
重构官 |
只改结构不改行为,并用变异测试验证"测试是不是真的有效" |
不借重构之名改业务逻辑 |
| Agent 4 Architect |
架构守门官 |
逐项核对硬指标出 PASS/FAIL,不合格带具体原因打回上游 |
不重写代码,只裁决 |
任何一环失败都不卡在人手里,而是带着具体数值和原因自动路由回对应的上游 Agent。
"钢铁笼子"质量关卡
人不读代码,但机器把每一道关卡焊死。示例阈值(按项目风险等级自行调整):
| 关卡 |
示例阈值 |
工具(按生态选一套) |
| 验收测试 |
100% 通过 |
Cucumber / Behave / SpecFlow |
| 单元测试 |
100% 通过 |
pytest / Jest·Vitest / go test / JUnit |
| 测试覆盖率 |
行覆盖 ≥85%,分支覆盖 ≥75% |
coverage.py / Istanbul·nyc / JaCoCo |
| 变异测试得分 |
≥80% |
mutmut / Stryker / PIT |
| 圈复杂度 |
单函数 ≤10 |
radon / ESLint complexity / lizard |
| 代码重复率 |
≤3% |
jscpd / PMD CPD |
| 依赖方向 |
0 违规 |
dependency-cruiser / import-linter |
| Lint |
0 error |
ruff / ESLint / golangci-lint |
| 安全扫描 |
0 高危/严重项 |
semgrep / bandit / npm audit |
每一项都是二元判据:过了就是过了,没过 Architect 无权放行。
失败路由表(谁挂了打回给谁)
| 失败类型 |
打回给 |
| 验收测试不过 / 行为不符预期 |
Coder |
| 复杂度 / 重复率 / 变异得分不达标 |
Refactorer |
| 安全扫描高危项 |
Coder(实现漏洞)或 Refactorer(结构性暴露面) |
| 依赖方向违规 |
Refactorer |
| 出现"规格异议报告" |
Specifier |
| 全部关卡通过 |
无需打回,自动合并,人只 review 验收标准 diff |
怎么用
- 打开
prompts/four-agent-pipeline.md。
- 把第三节四个 Agent 的系统提示词分别配置给你的四个智能体实例
(可以是同一个模型的四个会话,也可以是不同模型)。
- 把第四节"钢铁笼子"清单里的工具接入你的 CI,阈值按项目风险等级调整。
- 丢给 Specifier 一句自然语言需求,之后人只看两样东西:
规格确认时的验收标准,和每次合并时的验收标准 diff。
仓库结构
Novera-AI-agent/
├── README.md # 本文件
├── prompts/
│ └── four-agent-pipeline.md # 四智能体完整提示词文档(核心交付物)
├── LICENSE # MIT
└── .gitignore
License
MIT — 可自由复制、修改、商用,保留版权声明即可。
English Summary
Novera-AI-agent is a four-agent AI coding pipeline prompt set. Instead of reviewing
AI-written code line by line, you review only the acceptance spec — automated quality
gates ("the steel cage") do the rest, and failures are routed back upstream with
measured values and reasons.
- Specifier compiles vague requirements into Gherkin acceptance criteria
(Given/When/Then), edge cases, and a Definition of Done. The only output a human reviews.
- Coder writes the minimal implementation that turns every acceptance and unit test
green — no over-engineering, no scope creep.
- Refactorer improves structure without changing behavior, and uses mutation testing
to prove the test suite actually catches defects (no "fake green" suites).
- Architect is the only role with veto power: it checks hard metrics — coverage,
cyclomatic complexity, duplication, mutation score, dependency direction, security
scan — emits PASS/FAIL per gate, and routes failures back to the right upstream agent.
Full prompts: prompts/four-agent-pipeline.md.
Works with any multi-agent LLM orchestration setup — Claude Code subagents, CrewAI,
MetaGPT-style pipelines, or four separate chat sessions with the same model.