Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

Loop Engineering

Explore the Showcase

GitHub stars loop-audit dogfood loop-audit npm loop-init npm loop-cost npm loop-sync npm loop-context npm MIT Pages

Loop Engineering logo

Stop prompting. Design the loop. Get a score.

Loop Engineering — design the system that prompts your agents

npx @cobusgreyling/loop-init .

loop-init scaffolds skills, state, and budget files, then prints your Loop Ready score and first loop command. Swap --tool for claude, codex, or opencode.

Loop Ready score climbs from 10 to 100 in 15 seconds

Loop engineering replaces you as the person who prompts the agent — you design the system that does it instead.

New here? Quickstart (5 min) · Interactive picker

For developers using Grok, Claude Code, Codex, Cursor, and other AI coding agents.

→ Interactive showcase + pattern picker · Essay · Addy Osmani

Contents

Quick Links

Start hereDescription
Quickstart (5 min)Scaffold → cost check → audit → first loop — start here if you just landed
Loop Engineering essayThe concept, primitives, and Grok mapping — read for the why
Pattern PickerWhich loop to run first — start here if unsure
Primitives MatrixCross-tool loop primitive mapping — bookmark this
Loop Design ChecklistShip readiness rubric
Patterns7 production patterns + interactive picker
StartersClone-and-run kits (Grok, Claude Code, Codex, Opencode)
Opencode examplesCLI-first loops: cron/systemd + opencode run, skills, worktrees
loop-auditLoop Readiness Score CLI (v1.5 + constraints scoring) — npx @cobusgreyling/loop-audit . --suggest · --badge for README
loop-initScaffold starters + budget/run-log + constraints (v1.2) — npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok
loop-costToken spend estimator — npx @cobusgreyling/loop-cost
loop-syncDrift detection between STATE.md and LOOP.mdnpx @cobusgreyling/loop-sync .
loop-contextStateful memory manager + circuit breaker for long runs — npx @cobusgreyling/loop-context --check --ledger run.json
loop-mcp-serverMCP runtime lookup for patterns, skills, state — node tools/mcp-server/dist/index.js (repo v1; npm pending)
Goal EngineeringCompanion: loops discover, goals finish — /goal + stack cookbook (npx @cobusgreyling/goal doctor .)
StoriesReal wins and honest failures
Contributor quickstartHelp wanted: 9 scoped good first issues — comment I'll take this to get assigned
Community updatev1.5.0 release — loop-sync, constraints, MCP server
Add your projectPinned: Loop Ready badge + adopters list

Why This Matters

Peter Steinberger:

“You shouldn’t be prompting coding agents anymore. You should be designing loops that prompt your agents.”

Boris Cherny (Head of Claude Code at Anthropic):

“I don’t prompt Claude anymore. I have loops running that prompt Claude and figuring out what to do. My job is to write loops.”

The leverage point has moved from crafting individual prompts to designing the control systems that orchestrate agents over time.

The Five Building Blocks + Memory

PrimitiveJob in the Loop
Automations / SchedulingDiscovery + triage on a cadence
WorktreesSafe parallel execution
SkillsPersistent project knowledge
Plugins & ConnectorsReach into your real tools (MCP)
Sub-agentsMaker / checker split
+ Memory / StateDurable spine outside any conversation

Full detail: docs/primitives.md · Cross-tool matrix: docs/primitives-matrix.md

Visual Overview

The Five Building Blocks + Memory — Loop Engineering

Anatomy of a Loop

Animated loop flow — schedule, triage, state, worktree, implement, verify, MCP, human gate

Mermaid diagram (copy-friendly)
flowchart LR
    A[Schedule / Automation] --> B[Triage Skill]
    B --> C[Read + Write STATE / Memory]
    C --> D[Isolated Worktree]
    D --> E[Implementer Sub-agent]
    E --> F[Verifier Sub-agent<br/>tests + gates]
    F --> G[MCP / Git / Tickets]
    G --> H{Human Gate?}
    H -->|safe / allowlisted| I[Commit / PR / Action]
    H -->|risky / ambiguous| J[Escalate to human<br/>with full context]
    I --> A
    J --> A

This reference repo now runs its own validate-patterns + audit workflows on every push/PR (see .github/workflows/). We also added LOOP.md describing the loops that will maintain it.

Patterns

Seven production loop patterns with cadence and token cost

PatternCadenceStarterWeek 1Token cost
Daily Triage1d–2hminimal-loopL1 reportLow
PR Babysitter5–15mpr-babysitterL1 watchHigh
CI Sweeper5–15mci-sweeperL2 cautiousVery high
Dependency Sweeper6h–1ddependency-sweeperL2 patch-onlyMedium
Changelog Drafter1d or tagchangelog-drafterL1 draftLow
Post-Merge Cleanup1d–6hpost-merge-cleanupL1 off-peakLow
Issue Triage2h–1dissue-triageL1 propose-onlyLow

Not sure which to pick? Try the interactive picker or pattern-picker.

Machine-readable index: patterns/registry.yaml (7 patterns)

Getting Started (5 minutes)

# 1. Scaffold + get your Loop Ready score (printed automatically)
npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok

# 2. Estimate token spend for your cadence
npx @cobusgreyling/loop-cost --pattern daily-triage --level L1

# 3. Re-audit after improvements
npx @cobusgreyling/loop-audit . --suggest

# Optional: paste Loop Ready badge into your README
npx @cobusgreyling/loop-audit . --badge

# 4. See scores climb: empty → L1 → L2
bash scripts/before-after-demo.sh

# 5. Start report-only (Grok example)
/loop 1d Run loop-triage. Update STATE.md. No auto-fix in week one.

All three CLIs publish to npm from tagged releases — see docs/RELEASE.md. No clone required.

Develop from source (monorepo contributors):

cd tools/loop-init && npm ci && npm test && node dist/cli.js /path/to/project --pattern daily-triage --tool grok
cd tools/loop-audit && npm ci && npm test && node dist/cli.js /path/to/project --suggest
cd tools/loop-cost && npm ci && npm test && node dist/cli.js --pattern ci-sweeper --cadence 15m

Phased rollout: L1 report → L2 assisted fixes → L3 unattended — see loop-design-checklist.

Examples by Tool

Operating & Safety

Caveats

Loop engineering amplifies judgment — both good and bad.

  • Token costs can explode with sub-agents and long-running loops.
  • Verification is still on you. Unattended loops make unattended mistakes.
  • Comprehension debt grows faster unless you read what the loop ships.
  • Two people can run the same loop and get opposite results. The loop doesn't know. You do.

Addy Osmani:

“Build the loop. But build it like someone who intends to stay the engineer, not just the person who presses go.”

Help wanted

First PR? Start with the contributor quickstart — ~10 min to ~1 hr tasks with same-day review on stories and adopters.

Pick oneIssue
~10 min#120 — Add your project to adopters
~20 min#121 — QUICKSTART loop-init --tool values
~1 hr#118 / #119failure stories welcome

Comment "I'll take this" on any good first issue for assignment.

Contributing

Share production patterns, tool mappings, and failure stories. See CONTRIBUTING.md (contribution ladder + good first issue backlog), adopters, and GitHub Discussions.

Sources

License

MIT


Practical, tool-aware reference for loop engineering, patterns you can clone, checklists you can ship against, and stories that include what broke.

Essay · Showcase · Cobus Greyling

Star History Chart

关于 About

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.
agentic-aiai-agentsai-codinganthropicautomationclaudeclaude-codecodexcoding-agentsdevops-automationdevtoolsgithub-actionsgrokllmloop-engineeringmcpprompt-engineering

语言 Languages

JavaScript55.5%
TypeScript35.6%
Shell5.7%
Python3.2%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
123
Total Commits
峰值: 57次/周
Less
More

核心贡献者 Contributors