autonomous-loops
Skill10 starsChanged 3 months agoMITView on GitHub
Use when choosing how to run Claude Code autonomously on this project — from a single sequential pipeline to multi-agent DAG orchestration. A reference catalog of loop patterns anchored to this repo's real tooling (resolve-issue, code-review-github, process-code-review, merge-github-pr, /loop), with composer build / composer skill-check as the quality gate between iterations.
We split this skill into the rules it gives an agent
11 rules. 0 are common, 7 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Every loop needs an explicit stop condition (max iterations, no open work, or a documented blocker).
- Distinctive: line 16
Stop on blockers, never force through them: merge conflict, failing CI, unresolved Critical/Moderate findings, or a gate failure ends the …
- Distinctive: line 18
Do not expose sensitive/internal details in user-facing loop reports.
- Very specific: line 30
No reliable automated gate exists for the work (nothing for composer build / tests to verify).
- Distinctive: line 37
Use when the task is a single focused change with a known sequence (implement → clean up → verify → commit).
- Distinctive: line 54
Use when you want a recurring task without authoring a runner: poll PR status, re-run a check, keep an eye on a long job.
- Distinctive: line 65
Use when one tracker issue should be taken from open to merged without a human between steps.
- Very specific: line 78
Use when a labelled backlog (default Resolve_by_AI) should be worked down over a session.
- Very specific: line 91
Stop conditions: MAX_RUNS reached, no eligible issue, or a blocker surfaced by the chain.
- Distinctive: line 96
Use when one feature is large enough to split into several units that can progress at once, and only then.
- Very specific: line 127
Every iteration that advanced or merged passed composer build and composer skill-check.
“Common” is measured: kept by at least 6 in 10 of the 15 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.
Files
This is a reference skill. It does not run a loop itself — it helps you pick the right autonomous-loop architecture for a task and wire it to this project's existing skills, gates, and CLI tooling. Patterns are ordered simplest → most complex. Use the lightest one that fits.
Constraints
- Apply
@rules/git/general.mdc— never push tomain, one logical change per commit, English commit messages, worktree/branch per work unit. - Apply
@rules/code-review/general.mdcto every review stage in a loop — reviewers are read-only and must not be the same context that wrote the code. composer buildandcomposer skill-checkare non-negotiable gates between iterations. An iteration that does not pass them is not "done" and must not advance the loop or merge.- Every loop needs an explicit stop condition (max iterations, no open work, or a documented blocker). Never run unbounded.
- Stop on blockers, never force through them: merge conflict, failing CI, unresolved Critical/Moderate findings, or a gate failure ends the loop with a report.
- Parallel multi-unit patterns (e.g. the DAG below) are an explicit opt-in: only when the user chooses parallel orchestration does each work unit run in its own git worktree so units cannot corrupt each other's tree. A single sequential loop never creates a worktree on its own — it works in the current tree per
@rules/git/general.mdcWorktrees / Workspaces. - Do not expose sensitive/internal details in user-facing loop reports.
Use when
- Deciding whether a task should run autonomously at all, and with which architecture.
- Setting up a scripted or scheduled pipeline that chains this project's skills without a human between steps.
- Running multiple independent work units in parallel and coordinating their merges.
- You need context to survive across otherwise-independent iterations.
When NOT to run autonomously
- The requirements are vague or the acceptance criteria are missing — autonomy multiplies hallucination. Resolve scope with a human first (see
prepare-issue-context). - The change touches auth, payments, migrations on production data, or anything irreversible.
- One focused edit a human could do faster than wiring a loop.
- No reliable automated gate exists for the work (nothing for
composer build/ tests to verify).
Patterns
1. Sequential pipeline
Lowest complexity. Break the work into ordered, non-interactive steps; each step runs in a fresh context and builds on the filesystem state of the previous one. Order matters and steps exit on first failure.
Use when the task is a single focused change with a known sequence (implement → clean up → verify → commit).
set -e
# branch per work unit per @rules/git/general.mdc — never on main
git switch -c feat/<scope>-<slug>
claude -p "Implement <scope> per <spec>. TDD: failing test first."
claude -p "Review the diff. Remove redundant type/framework tests and over-defensive checks. Keep business-logic tests."
composer build && composer skill-check # gate: must pass before commit
claude -p "Create one conventional commit for the staged changes per @rules/git/general.mdc."Tip: prefer a separate cleanup step over negative instructions ("don't over-test") inside the implement step — two focused agents beat one constrained one.
2. Built-in /loop
Low complexity, no script. Use the built-in /loop to re-run a prompt or slash command on an interval (or self-paced). Good for polling and short repeating chores where each pass is independent.
Use when you want a recurring task without authoring a runner: poll PR status, re-run a check, keep an eye on a long job.
/loop 5m run `composer skill-check` and report only new failuresStill bounded in practice: stop it when there is no open work or a blocker appears.
3. Single-issue end-to-end chain
Medium complexity. This is the project's existing autonomous unit: pick one issue and drive it resolve → review → process-feedback → merge, stopping at any blocker. Run the four skills in order; no single entry point wraps them.
Use when one tracker issue should be taken from open to merged without a human between steps.
Pick the oldest open issue (for example gh issue list --label Resolve_by_AI --state open --search "sort:created-asc" --limit 1), then run:
@skills/resolve-issue/SKILL.md— branch, implement, local code-review + security-review loop, pre-push gates, PR.@skills/code-review-github/SKILL.md— review the PR, post findings.@skills/process-code-review/SKILL.md— drive findings to Critical+Moderate == 0.@skills/merge-github-pr/SKILL.md— merge only if mergeable, CI green, approved.
The chain processes exactly one issue and stops on the first blocker — never wrap it in a second loop that "retries" past a blocker.
4. Continuous multi-issue loop
Medium complexity. Run the single-issue chain repeatedly across a backlog, with a shared notes file bridging context between otherwise-independent passes and a hard stop limit.
Use when a labelled backlog (default Resolve_by_AI) should be worked down over a session.
set -e
MAX_RUNS=5; NOTES=.loop/SHARED_NOTES.md # context bridge across iterations
for i in $(seq 1 "$MAX_RUNS"); do
gh issue list --label Resolve_by_AI --state open --limit 1 | grep -q . || break # stop: no work
claude -p "Read $NOTES for prior-pass context. Take the oldest open issue labelled \
Resolve_by_AI through the single-issue chain (pattern 3). Append outcome, decisions, and follow-ups to $NOTES. \
Stop and report if the chain hit any blocker."
doneStop conditions: MAX_RUNS reached, no eligible issue, or a blocker surfaced by the chain. The notes file is what lets pass N learn from pass N-1 despite the fresh context — keep it short and factual.
5. Parallel units with merge coordination
Highest complexity. Decompose a large spec into independent work units, give each its own git worktree, run each through a complexity-tiered pipeline, and land them through a merge queue that rebases and re-runs gates per unit.
Use when one feature is large enough to split into several units that can progress at once, and only then.
Per work unit: { id, deps, acceptance, tier }. Pipeline depth scales with tier:
- trivial → implement →
composer build/skill-check. - small → implement → gates →
code-review. - medium → analyze (
analyze-problem) → implement → gates →code-review+ assignment check → fix. - large → all of the above → security-review → final review.
Model routing: run implementation on a lighter model, run the review/decomposition stages on a heavier model — the reviewer must be a separate context from the author per @rules/code-review/general.mdc.
for each layer of the dependency DAG (deps satisfied):
for each unit in layer (parallel):
worktree = git worktree add ../wt-<unit.id> -b feat/<unit.id>
run tier pipeline in worktree
merge queue (sequential when worktrees overlap files):
rebase unit branch onto main → composer build && composer skill-check → merge
on conflict / gate failure → evict unit with full context, re-enter next passNon-overlapping units can land speculatively in parallel; overlapping units land sequentially with rebase. An evicted unit re-enters the next pass carrying its conflict/failure context — never force its merge.
Quality gates
- Between every iteration and before any merge:
composer buildthencomposer skill-check. Both must pass; a failure ends the iteration, not advances it. - Review stages stay read-only (
@rules/code-review/general.mdc); the reviewing context must differ from the implementing context. - The single-issue chain's own gates (
resolve-issuelocal review loop,code-review-github,process-code-reviewconvergence,merge-github-prpre-checks) are authoritative — a loop wrapping them must never bypass or retry past them. - Tier the gates to complexity: trivial units need only build+tests; large units add security and final review. Do not under-gate risky units.
Done when
- The right pattern was chosen for the task's complexity, and a lighter pattern was not adequate.
- The loop has an explicit, reached stop condition (max iterations, empty backlog, or a documented blocker).
- Every iteration that advanced or merged passed
composer buildandcomposer skill-check. - Each work unit ran in its own branch/worktree and was committed per
@rules/git/general.mdc. - Any blocker was reported and left for a human, never forced through.
- A final report lists per-unit outcomes (merged / stopped + reason) and the PR URLs.
Other versions18 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 18
- loulanyue/awesome-claude-notes★ 272same name
- Resgrid/Core★ 229same name
- Fmarzochi/EGC★ 61same name
- gongyijie85/dsh-ecc★ 8same name
- TsinHzl/claude-code-config★ 2same name
- get-proofpilot/claude-skills-catalog★ 1same name
- junimnjw/everything-claude-code★ 1same name
- Ronnasayd/aipp★ 1same name
- SamuelNDCE/claude-super-skill-library★ 1same name
- TironFox/everything-claude-code★ 1same name
8 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository62 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- analyze-problemSkill
- api-reviewSkill
- article-writingSkill
- assignment-compliance-checkSkill
- automation-audit-opsSkill
- benchmark-optimization-loopSkill
- benchmarkSkill
- blueprintSkill
- class-refactoringSkill
- cleanup-local-branchesSkill
- codebase-simplification-auditSkill
- code-review-bugsnagSkill
- code-review-githubSkill
- code-review-jiraSkill
- code-reviewSkill
- composer-updateSkill
- create-issues-from-textSkill
- create-issueSkill
- create-missing-tests-in-prSkill
- create-testSkill
- design-systemSkill
- docker-patternsSkill
- e2e-testingSkill
- frontend-a11ySkill
- frontend-design-directionSkill
- frontend-patternsSkill
- frontend-slidesSkill
- git-workflowSkill
- laravel-authorization-reviewSkill
- laravel-securitySkill
- laravel-telescopeSkill
- latency-critical-systemsSkill
- merge-github-prSkill
- mysql-patternsSkill
- mysql-problem-solverSkill
- penetration-testerSkill
- postgres-patternsSkill
- prepare-issue-contextSkill
- process-code-reviewSkill
- product-capabilitySkill
- production-auditSkill
- pr-staged-merge-planSkill
- pr-summarySkill
- record-project-memorySkill
- redis-patternsSkill
- refactor-entry-point-to-actionSkill
- refresh-claude-mdSkill
- resolve-issueSkill
- rewrite-tests-pestSkill
- security-bounty-hunterSkill
- security-reviewSkill
- security-threat-analysisSkill
- seoSkill
- skill-creatorSkill
- slack-messagingSkill
- smartest-project-additionSkill
- test-driven-developmentSkill
- tester-cookbookSkill
- test-like-humanSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

