Milestone-driven engineering loop with binary gates.
里程碑驱动的工程闭环系统,用二值 Gate 消除"差不多完成了"。
Large coding tasks drift when one conversation tries to research, design, implement, and test at the same time. Loop Engineering fixes this with:
复杂编程任务在一个对话里同时做设计、实现、测试,必然跑偏。Loop Engineering 用以下方式解决:
- 4 Core Workstations — Orchestrator, Architect, Implementer, Test Evaluator
- Binary Gates — Every check is 1 or 0. No "mostly done"
- Milestone Contract — Define what "done" means before you start
- Reject & Return — Fail = return to same role, not advance with tech debt
4个核心工位,1/0 二值验收,先定义完成标准再开工,不通过就打回。
Orchestrator defines Milestone Contract
→ Architect designs (boundaries, interfaces, risks)
→ Orchestrator gate check (1/0)
→ Implementer codes (changed files, verification, tests)
→ Orchestrator gate check (1/0)
→ Test Evaluator validates (SOP, pass/fail/not_run)
→ Orchestrator gate check (1/0)
→ Milestone complete ✅
Any gate failure → reject back to that role with specific reason.
任何 gate 失败 → 打回该角色并附具体原因。
| Workstation | Role | Does | Does NOT |
|---|---|---|---|
| Orchestrator | 流程控制 + 验收 | Create contract, gate check, reject/advance | Judge design quality or code correctness |
| Architect | 技术设计 | Boundaries, interfaces, data flow, risks, trade-offs | Write code |
| Implementer | 代码实现 | Code changes, verification commands, test results | Design architecture |
| Test Evaluator | 独立验证 | SOP evaluation of entire milestone, pass/fail/not_run | Only check changed files |
Not every milestone needs all 8 roles. Start with 4 core, add as needed:
不是每个 milestone 都需要 8 个角色。先用 4 个核心,按需加:
| Extension | When to Add |
|---|---|
| Researcher | New domain, unfamiliar tech stack |
| Product PRD | User-facing features, scope ambiguity |
| Code Context | Large codebase, complex dependencies |
| Reviewer | High-risk changes, audit requirements |
- Binary completion —
role_completion_statusis 1 or 0. Never "partial" or "with residual risk" - Evidence required — Claims without evidence = status 0
- No scope creep —
must_not_claimlist prevents roles from claiming unrelated work - Orchestrator doesn't think for roles — Checks format, evidence, alignment. Not design quality
- Two rejects = escalate to human — Prevents infinite loops
- Copy
contracts/milestone-contract-template.md, fill in your milestone - Use
workstations/{role}/assignment-template.mdto assign work - Roles complete using
workstations/{role}/completion-template.md - Orchestrator validates using
workstations/orchestrator/gate-template.md - Gate pass → next role. Gate fail → reject with reason
Loop Engineering is platform-agnostic. It works with:
- OpenClaw —
sessions_spawnper role, orchestrator in main session - Codex — One conversation per role, copy-paste handoff
- Claude Code — Separate sessions per role
- Any AI coding assistant — Templates are plain markdown
See docs/integration/ for platform-specific guides.
loop-engineering/
├── contracts/ # Milestone contract template
│ └── milestone-contract-template.md
├── workstations/ # 4 core workstations
│ ├── orchestrator/
│ ├── architect/
│ ├── implementer/
│ └── test-evaluator/
├── extensions/ # Optional workstations
│ ├── researcher/
│ ├── product-prd/
│ ├── code-context/
│ └── reviewer/
├── examples/ # Example milestones
└── docs/ # Guides & integrations
If a role's output doesn't let the next role guess one step less, or doesn't help the Orchestrator judge milestone completion more accurately, that output is not qualified.
如果一个角色的产出不能让下一个角色少猜一步,或者不能让 Orchestrator 更准确判断 milestone 是否完成,这个产出就不合格。
Built by Deepleaper — AI Agent infrastructure for business decisions.