Repo Dev Tools

cobusgreyling/loop-engineering

Pattern library and CLI for loop engineering: design systems that discover work, hand it to AI coding agents, verify results and persist state.

  • 11.8k GitHub stars
  • TypeScript
  • ⚖️ MIT
  • 🎯 Intermediate

Last verified: repo last pushed

npx @cobusgreyling/loop cost --pattern daily-triage --level L1
cobusgreyling/loop-engineering preview image

What it is

Loop Engineering is a pattern library for operating AI agents around a codebase, with starters and a unified CLI (npx @cobusgreyling/loop) offering init, doctor, status, audit and cost. You design a system that discovers work, hands it to agents, verifies results and persists state, instead of typing each prompt yourself. It is not a "rewrite the module" button.

Who it's for

  • Developers who want to run AI coding agents on a recurring schedule to keep a repo healthy (issues, CI, deps)
  • Teams who want to manage PRs, changelogs or cleanup with agent loops
  • Users of Claude Code, Grok, Codex, OpenClaw, Opencode or GitHub Actions

Requirements

Requirements

  • Node/npx to run @cobusgreyling/loop (implied by the npx commands)
  • One of the supported tools: claude (default), grok, codex or opencode

Setup

  1. Initialize a daily-triage loop and run doctor

    Scaffold the daily-triage pattern for the Claude tool, then check the setup. --tool defaults to claude; swap for grok, codex, or opencode. Week one is report-only.

    bash
    npx @cobusgreyling/loop init . --pattern daily-triage --tool claude
    npx @cobusgreyling/loop doctor .
  2. Estimate loop cost

    Check the cost of a pattern at a given level before running it.

    bash
    npx @cobusgreyling/loop cost --pattern daily-triage --level L1

Examples

Scaffold a daily triage loop

bash
bash
npx @cobusgreyling/loop init . --pattern daily-triage --tool claude

What it does: Initializes the daily-triage pattern in the current directory for Claude. Other tools can be substituted via --tool.

Validate the setup

bash
bash
npx @cobusgreyling/loop doctor .

What it does: Runs the doctor command on the project after init.

Check pattern cost at L1

bash
bash
npx @cobusgreyling/loop cost --pattern daily-triage --level L1

What it does: Shows the cost estimate for the daily-triage pattern at the L1 report-only level.

Pros & cons

Pros

  • Pro:Eight documented patterns with cadence, week-one level and cost ratings (e.g. Daily Triage, PR Babysitter, CI Sweeper)
  • Pro:Staged rollout from L1 report to L2 assisted to L3 unattended, with week one report-only
  • Pro:Unified CLI covers init, doctor, status, audit and cost
  • Pro:Examples for multiple tools and docs on failure modes, anti-patterns and safety

Cons

  • Con:Token costs can explode; some patterns are rated High or Very high cost (PR Babysitter, CI Sweeper)
  • Con:Unattended loops make unattended mistakes, so output needs to be reviewed
  • Con:Not a one-click refactor tool; it is a pattern library for operating agents

Images