--tool 默认 claude,需显式换成 grok、codex 或 opencode;第一周默认 report-only,不要直接上无人值守;token 成本可能暴涨,需先用 loop cost 估算
loop-engineering
cobusgreylingMIT活跃维护面向 AI 编码代理的循环工程实践模板与 CLI 工具,提供 loop-audit、loop-init、loop-cost 等命令,帮你设计并编排代理的提示与自动化流程。
Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost.
npx @cobusgreyling/loop init . --pattern daily-triage --tool claude
npx @cobusgreyling/loop doctor .README 未说明
用模式库和 CLI 把 AI 编码代理编排成可验证的循环,不再手动逐条写提示词
面向 AI 编码代理的循环工程实践模板与 CLI 工具,提供 loop-audit、loop-init、loop-cost 等命令,帮你设计并编排代理的提示与自动化流程。
核心能力
- 提供 daily-triage、PR Babysitter 等 8 种循环模式模板
- 用 loop init 按模式与工具生成循环脚手架
- 用 loop doctor 检查循环就绪度并给出评分
- 用 loop cost 按模式与 L1/L2/L3 级别估算成本
- 按 L1 报告→L2 辅助→L3 无人值守渐进放权
容易踩的坑
- v1.6.0v1.6.0 — Foundry funnel + loop-gate最新正式版2026-07-20 · 2026-07-20 18:42 UTC
v1.6.0 — Foundry funnel + loop-gate
Three things that matter:
- Design → runtime in one flag —
loop-init --with-foundryscaffolds your loop and a versioned harness stack (.foundry/stack.yaml).loop-audit1.7 scores Harness Runtime. loop-gateis live — mechanical path denylist + auto-merge allowlist fromgate.yaml(npx @cobusgreyling/loop-gate). Wired into starters and MCP.- Longer, safer runs —
loop-contextstagnation detection +loop-worktree --waitqueue; community docs (Devin matrix, architecture diagrams).
Quickstart (copy-paste)
# Scaffold + score (optional Foundry harness) npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok # or: npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok --with-foundry # Readiness + next steps npx @cobusgreyling/loop-audit . --suggest # Gate check (if you use auto-merge / denylist) npx @cobusgreyling/loop-gate check --action auto-merge --paths path/to/fileNew here? Quickstart (5 min) · Interactive showcase · Demo GIF path
Package versions
Package Version Highlights @cobusgreyling/loop-init1.5.0 --with-foundryfunnel@cobusgreyling/loop-audit1.7.0 Harness Runtime signals @cobusgreyling/loop-gate1.0.0 Denylist + auto-merge allowlist @cobusgreyling/loop-context1.3.0 Similarity-based stagnation @cobusgreyling/loop-worktree1.2.0 --waitqueue + deadlock detection@cobusgreyling/loop-mcp-server1.1.0 loop-gate resource + tool @cobusgreyling/loop-cost1.1.0 Token spend estimator @cobusgreyling/loop-sync1.0.0 STATE ↔ LOOP drift Stack
loop-engineering → harness-foundry → outerloop (patterns) (runtime) (governance)Week-one culture unchanged: report-only before auto-fix.
Community
- Show your loop — pin on Discussions (Show and tell)
- Ask anything — pin on Discussions (Q&A)
- Good first issues
- Add adopter
Thanks to everyone who shipped stories, matrix rows, and tooling PRs since v1.5.0 🙏
- Design → runtime in one flag —
- v1.5.0v1.5.0 — Community Tools Drop2026-06-30 · 2026-06-30 08:01 UTC
查看更新说明
v1.5.0 — Community Tools Drop
Seven community PRs merged. Three new tools ship. One command to try everything.
Quickstart (copy-paste)
# Scaffold your first loop (any git repo) npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok # Check token cost before you schedule npx @cobusgreyling/loop-cost --pattern daily-triage --level L1 --cadence 1d # Score readiness + get next steps npx @cobusgreyling/loop-audit . --suggest # Detect drift between STATE.md and LOOP.md npx @cobusgreyling/loop-sync .New here? Quickstart (5 min) · Interactive pattern picker
What's new
New:
loop-syncCLI (npm v1.0.0)Detect configuration drift between
STATE.md,LOOP.md, and skill versions. Run in CI or locally:npx @cobusgreyling/loop-sync . -vContributed via #47 — thanks @community.
New:
loop-constraintsStructured guardrails file + enforcement skill.
loop-initnow scaffoldsloop-constraints.mdand theloop-constraintsskill on every run.loop-auditscores constraints presence (+6 readiness points when file + skill both exist).Contributed via #71.
New:
loop-mcp-server(repo v1)MCP runtime lookup for patterns, skills, and state. Path traversal guards included.
node tools/mcp-server/dist/index.jsContributed via #72. npm publish coming soon.
Updated npm packages
Package Version Highlights @cobusgreyling/loop-audit1.5.0 Constraints scoring + recommendations @cobusgreyling/loop-init1.2.3 Constraints scaffold; serialized asset bundling fix (#80) @cobusgreyling/loop-sync1.0.0 First npm release Docs & discoverability
- QUICKSTART.md — 5-minute path from zero to first loop
- OpenClaw primitives matrix — cron, webhooks, heartbeat mapping
- Dark-theme SVG visuals + README polish
- Star History chart in README
- Post-run critique sections in daily-triage and changelog-drafter starters
Community
This release merges work from 7 community PRs. Read the full story in Discussion #89.
Run a loop? Add yourself to docs/adopters.md or open an Add Adopter issue.
Show & tell: Discussions → Show and tell
Companion — Goal Engineering
Loops discover ongoing work. Goals finish bounded tasks.
Layer Repo Command Discover (cadence) loop-engineering npx @cobusgreyling/loop-init . --pattern daily-triage --tool grokFinish (run-until-done) goal-engineering npx @cobusgreyling/goal init . --pattern fix-bug --tool grokStack cookbook: loop → goal → fleet day rhythm
/goal Read STATE.md top priority. Done when verifier PASS. goal-verifier before completed: true.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Loop Engineering
Stop prompting. Design the loop. Get a score.
npx @cobusgreyling/loop init . --pattern daily-triage --tool claude
npx @cobusgreyling/loop doctor .
--tool defaults to claude if you omit it. Swap for grok, codex, or opencode. Week one is report-only.
You design a system that discovers work, hands it to agents, verifies results, and persists state — instead of typing the next prompt yourself.
New here? Quickstart · Refactor a project · Thin GitHub Action loop (no STATE.md required)
What do you want to do?
This is a pattern library for operating agents around a codebase. It is not a “rewrite the module” button.
| I want to… | Start here |
|---|---|
| Keep the repo healthy (issues, CI, deps) | Quickstart → daily-triage |
| Land and babysit PRs | PR Babysitter |
| Run a loop in GitHub Actions with almost no files | Thin loop |
| Ship a feature or refactor (todos → small PRs) | Refactor / change path |
Full jobs table: docs/jobs.md.
Patterns
| Pattern | Cadence | Week 1 | Cost |
|---|---|---|---|
| Daily Triage | 1d–2h | L1 report | Low |
| Thin loop | event + 1d | L1 snapshot | Very low |
| PR Babysitter | 5–15m | L1 watch | High |
| CI Sweeper | 5–15m | L2 cautious | Very high |
| Dependency Sweeper | 6h–1d | L2 patch-only | Medium |
| Changelog Drafter | 1d or tag | L1 draft | Low |
| Post-Merge Cleanup | 1d–6h | L1 off-peak | Low |
| Issue Triage | 2h–1d | L1 propose-only | Low |
Interactive picker: showcase. Index: patterns/registry.yaml.
Getting started
npx @cobusgreyling/loop init . --pattern daily-triage --tool claude
npx @cobusgreyling/loop doctor .
npx @cobusgreyling/loop cost --pattern daily-triage --level L1
Empty repo → first STATE.md walkthrough: scripts/empty-to-state-demo.sh.
Roll out L1 report → L2 assisted → L3 unattended only after the verifier has been right for a week. See loop-design-checklist.
Loop Ready now weights recent runs harder than files on disk. A 30-day-old STATE.md is not L3.
Examples by tool
Claude Code (including the plugin) · Grok · Codex · OpenClaw · Opencode · GitHub Actions
Operating & safety
Failure modes · Anti-patterns · Safety · Operating loops · Stories (wins and failures)
Loop engineering amplifies judgment. Token costs can explode. Unattended loops make unattended mistakes. Read what the loop ships.
Help wanted
Docs and small PRs: first response within 48 hours.
- Add your project to adopters
- Share a story (failures first-class)
- Live
good first issuelist - Show your loop · Ask anything
See CONTRIBUTING.md.
Unified front door: npx @cobusgreyling/loop (init · doctor · status · audit · cost). Older packages (loop-init, loop-audit, …) stay supported.
Companions exist for later: memory-engineering, harness-foundry, outerloop, fleet-engineering, goal-engineering. Do not add them until a loop has actually run.
Sources
- Cobus Greyling — Loop Engineering
- Addy Osmani — Loop Engineering
- Lulla et al. 2026 — Building Blocks, Adoption, and Impact (this repo is the community reference they reviewed)
- Attribution
License
MIT