agentleFS
jggomezjggomez/expert-ai-developer-skills/skills/loop-engineering/SKILL.md

loop-engineering

Skill28 starsChanged 3 months agoApache-2.0View on GitHub

Implements self-correcting agent execution loops, multi-agent parallel workflows, workspace isolation (Git Worktrees), and automated cron-based Pull Request auditing. Use this skill when asked to orchestrate parallel workers or construct review loops.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use agentic-engineering.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • InfopibeSkill

    agentic-engineering

    Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Trivial isolated fixes: Avoid worktree provisioning overhead.

    line 20
  2. Distinctive:

    Run the worktree provisioning script to create one isolated git worktree and branch per task:

    line 27
  3. Distinctive:

    Run automated PR/branch auditors to scan feature and bugfix branches:

    line 39
  4. Distinctive:

    If quality gates fail, the manager or worker agent checks out the branch, reads the error traceback, applies targeted fixes, and pushes …

    line 46
  5. Very specific:

    Claude Code: Run run_parallel_agents.py to create worktrees, then dispatch subagents into each worktree path.

    line 65

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Loop Engineering Skill

Overview

This skill designs and executes multi-agent workflows, isolated parallel worker topologies, and self-correcting development loops. It acts as a Loop Engineering and Multi-Agent Orchestrator, enabling manager agents to coordinate multiple worker agents operating concurrently in dedicated git worktrees, protected by automated review crons and quality verification gates.

When to Use

Trigger Scenarios

  • Orchestrating multi-agent parallel execution across disjoint modules or features.
  • Provisioning isolated git worktrees to prevent mutational file conflicts among concurrent agents.
  • Setting up automated periodic review crons to audit open pull requests and branches.
  • Establishing self-correcting execution loops that detect build/test failures and automatically remediate code.

When NOT to Use

  • Single-agent sequential development tasks: Standard execution suffices.
  • Trivial isolated fixes: Avoid worktree provisioning overhead.
  • Pure git commit message validation: Route to commit-expert.
  • Stand-alone manual code reviews: Route to pull-request-expert.

Process

Phase 1: Task Decomposition & Worktree Provisioning

  1. Identify independent, disjoint tasks with zero shared mutational state.
  2. Run the worktree provisioning script to create one isolated git worktree and branch per task:
    python3 ./skills/loop-engineering/scripts/run_parallel_agents.py --tasks "task1:path1" "task2:path2"
    The script creates the worktree directories and outputs ready-to-use prompts for each subagent.

Phase 2: Parallel Subagent Dispatching

  1. Launch concurrent subagents via host-native subagent tools (invoke_subagent on Antigravity, Task on Claude Code).
  2. Assign each subagent to its dedicated worktree directory and branch.
  3. Subagents execute implementation and local testing autonomously within their isolated directories.

Phase 3: Continuous Review Crons & Quality Gates

  1. Run automated PR/branch auditors to scan feature and bugfix branches:
    python3 ./skills/loop-engineering/scripts/pr_cron_reviewer.py
  2. The auditor runs static analyzers, test runners, and secret scanners against git diffs, appending actionable comments to the review log.

Phase 4: Self-Correction Loop

  1. If quality gates fail, the manager or worker agent checks out the branch, reads the error traceback, applies targeted fixes, and pushes updates.
  2. Re-trigger the review cron until 100% of quality checks pass.

Usage

Commands & Automation Scripts

# Provision isolated worktrees and generate subagent prompts
python3 ./skills/loop-engineering/scripts/run_parallel_agents.py

# Execute automated PR and branch diff quality review cron
python3 ./skills/loop-engineering/scripts/pr_cron_reviewer.py

Example Prompts

  • "Provision isolated worktrees for these 3 independent API routes and dispatch parallel subagents."
  • "Run the PR review cron to inspect all active feature branches for quality gate compliance."
  • "Orchestrate a self-correcting development loop for this refactoring until all tests pass."

Host Execution Instructions

  • Claude Code: Run run_parallel_agents.py to create worktrees, then dispatch subagents into each worktree path.
  • Antigravity: Launch subagents with Workspace='branch' or Workspace='share' and monitor execution reactively.

Red Flags

  • Spawning parallel subagents in the same directory without worktree isolation (causing race conditions and file collisions).
  • Bypassing the self-correction loop when quality gates fail.
  • Allowing subagents to commit directly to production branches without PR review.
  • Running parallel subagents on heavily coupled tasks with shared mutable state.

Verification

  • Worktrees provisioned cleanly with isolated branches:
    python3 ./skills/loop-engineering/scripts/run_parallel_agents.py
  • Subagents execute and commit changes to their respective branches without collision.
  • PR cron reviewer passes with zero gate failures:
    python3 ./skills/loop-engineering/scripts/pr_cron_reviewer.py
  • Self-correction loop successfully resolves any test or lint failures before merge.

References

  • Loop Engineering & Multi-Agent Orchestration Reference

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.