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.

v1.6.0发布于 2026-07-20 18:42 UTC11,743star +26 / 7 天1,581fork同步于 2026-11-10 05:28 UTC

怎么上手

由 README 提炼,执行前请确认
npx @cobusgreyling/loop init . --pattern daily-triage --tool claude
npx @cobusgreyling/loop doctor .
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 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 无人值守渐进放权

容易踩的坑

--tool 默认 claude,需显式换成 grok、codex 或 opencode;第一周默认 report-only,不要直接上无人值守;token 成本可能暴涨,需先用 loop cost 估算

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

2 个版本v1.6.0
  1. 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:

    1. Design → runtime in one flag — loop-init --with-foundry scaffolds your loop and a versioned harness stack (.foundry/stack.yaml). loop-audit 1.7 scores Harness Runtime.
    2. loop-gate is live — mechanical path denylist + auto-merge allowlist from gate.yaml (npx @cobusgreyling/loop-gate). Wired into starters and MCP.
    3. Longer, safer runs — loop-context stagnation detection + loop-worktree --wait queue; 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/file
    

    New here? Quickstart (5 min) · Interactive showcase · Demo GIF path

    Package versions

    PackageVersionHighlights
    @cobusgreyling/loop-init1.5.0--with-foundry funnel
    @cobusgreyling/loop-audit1.7.0Harness Runtime signals
    @cobusgreyling/loop-gate1.0.0Denylist + auto-merge allowlist
    @cobusgreyling/loop-context1.3.0Similarity-based stagnation
    @cobusgreyling/loop-worktree1.2.0--wait queue + deadlock detection
    @cobusgreyling/loop-mcp-server1.1.0loop-gate resource + tool
    @cobusgreyling/loop-cost1.1.0Token spend estimator
    @cobusgreyling/loop-sync1.0.0STATE ↔ LOOP drift

    Stack

    loop-engineering  →  harness-foundry  →  outerloop
       (patterns)         (runtime)          (governance)
    

    Week-one culture unchanged: report-only before auto-fix.

    Community

    Thanks to everyone who shipped stories, matrix rows, and tooling PRs since v1.5.0 🙏

  2. 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-sync CLI (npm v1.0.0)

    Detect configuration drift between STATE.md, LOOP.md, and skill versions. Run in CI or locally:

    npx @cobusgreyling/loop-sync . -v
    

    Contributed via #47 — thanks @community.

    New: loop-constraints

    Structured guardrails file + enforcement skill. loop-init now scaffolds loop-constraints.md and the loop-constraints skill on every run. loop-audit scores 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.js
    

    Contributed via #72. npm publish coming soon.

    Updated npm packages

    PackageVersionHighlights
    @cobusgreyling/loop-audit1.5.0Constraints scoring + recommendations
    @cobusgreyling/loop-init1.2.3Constraints scaffold; serialized asset bundling fix (#80)
    @cobusgreyling/loop-sync1.0.0First 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.

    LayerRepoCommand
    Discover (cadence)loop-engineeringnpx @cobusgreyling/loop-init . --pattern daily-triage --tool grok
    Finish (run-until-done)goal-engineeringnpx @cobusgreyling/goal init . --pattern fix-bug --tool grok

    Stack cookbook: loop → goal → fleet day rhythm

    /goal Read STATE.md top priority. Done when verifier PASS. goal-verifier before completed: true.
    

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    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 PRsPR Babysitter
    Run a loop in GitHub Actions with almost no filesThin loop
    Ship a feature or refactor (todos → small PRs)Refactor / change path

    Full jobs table: docs/jobs.md.

    Patterns

    PatternCadenceWeek 1Cost
    Daily Triage1d–2hL1 reportLow
    Thin loopevent + 1dL1 snapshotVery low
    PR Babysitter5–15mL1 watchHigh
    CI Sweeper5–15mL2 cautiousVery high
    Dependency Sweeper6h–1dL2 patch-onlyMedium
    Changelog Drafter1d or tagL1 draftLow
    Post-Merge Cleanup1d–6hL1 off-peakLow
    Issue Triage2h–1dL1 propose-onlyLow

    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.

    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

    License

    MIT