autonomous-loops
Loop patterns for autonomous agent work including sequential pipelines, watch loops, infinite agentic loops, PR loops, de-sloppify, and RFC-driven DAGs.
Best use case
autonomous-loops is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Loop patterns for autonomous agent work including sequential pipelines, watch loops, infinite agentic loops, PR loops, de-sloppify, and RFC-driven DAGs.
Teams using autonomous-loops should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/autonomous-loops/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How autonomous-loops Compares
| Feature / Agent | autonomous-loops | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Loop patterns for autonomous agent work including sequential pipelines, watch loops, infinite agentic loops, PR loops, de-sloppify, and RFC-driven DAGs.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Autonomous Loops — Agent Loop Patterns
6 patterns for autonomous agent work. Each has specific use cases, stop conditions, and safety requirements.
## Pattern 1: Sequential Pipeline
Chain agents where each output feeds the next.
```bash
# Generate → Review → Fix
claude -p "implement feature X" | claude -p "review this code for bugs" | claude -p "fix the issues found"
```
**Use when**: Linear workflow with clear stages.
**Stop condition**: Pipeline completes or any stage fails.
## Pattern 2: Watch Loop
File watcher triggers agent on changes.
```bash
# Watch for changes, run agent on each
fswatch -o src/ | while read; do
claude -p "run tests and fix any failures in src/"
done
```
**Use when**: Continuous feedback during development.
**Stop condition**: Manual interrupt or error threshold.
## Pattern 3: Infinite Agentic Loop
Agent runs continuously with explicit stop conditions.
```bash
while true; do
result=$(claude -p "check for issues in the codebase and fix one. Reply DONE if none found.")
if echo "$result" | grep -q "DONE"; then break; fi
((count++))
if [ $count -ge 20 ]; then echo "Max iterations reached"; break; fi
done
```
**Use when**: Iterative improvement until convergence.
**Stop conditions** (MUST have at least one):
- Task completion signal ("DONE")
- Max iteration count
- Time budget exceeded
- Cost budget exceeded
## Pattern 4: Continuous PR Loop
Monitor repository for PRs, review, and optionally merge.
```bash
while true; do
prs=$(gh pr list --state open --json number,title)
for pr in $(echo "$prs" | jq -r '.[].number'); do
claude -p "review PR #$pr: $(gh pr diff $pr). Approve if good, request changes if not."
done
sleep 300 # Check every 5 minutes
done
```
**Use when**: Automated code review pipeline.
**Stop condition**: Manual interrupt, shift end, or error threshold.
## Pattern 5: De-Sloppify Pattern
Iterative quality improvement — each pass tightens one aspect.
```bash
# Pass 1: Type safety
claude -p "add strict TypeScript types to all functions in src/"
# Pass 2: Error handling
claude -p "add proper error handling to all async functions in src/"
# Pass 3: Tests
claude -p "add unit tests for all untested functions in src/"
# Pass 4: Docs
claude -p "add JSDoc to all exported functions in src/"
```
**Use when**: Incrementally improving existing codebase quality.
**Stop condition**: All quality passes complete, or quality threshold met.
## Pattern 6: RFC-Driven DAG
Spec first, then parallel implementation, then merge.
```
Phase 1: claude -p "write an RFC for feature X"
Phase 2: (parallel)
claude -p "implement module A per RFC" &
claude -p "implement module B per RFC" &
claude -p "implement module C per RFC" &
wait
Phase 3: claude -p "integrate modules A, B, C and run tests"
```
**Use when**: Large features that can be decomposed into independent modules.
**Stop condition**: Integration tests pass.
## Decision Matrix
| Pattern | Complexity | Cost Risk | Best For |
|---------|-----------|-----------|----------|
| Sequential Pipeline | Low | Low | Linear workflows |
| Watch Loop | Low | Medium | Dev feedback |
| Infinite Agentic | Medium | **High** | Convergence tasks |
| Continuous PR | Medium | Medium | CI/CD automation |
| De-Sloppify | Low | Medium | Quality uplift |
| RFC-Driven DAG | High | Medium | Large features |
## Anti-Patterns
1. **No stop condition**: Infinite loop without exit → cost explosion
2. **Unbounded retries**: Retrying the same failing operation → burns tokens
3. **No cost tracking**: Running overnight without budget limits
4. **No isolation**: Agent modifying production without sandbox
5. **Silent failures**: Loop swallows errors and continues
6. **No rollback**: Agent makes changes with no way to revert
## Safety Requirements
Every autonomous loop MUST have:
- **Budget limit**: Max tokens, max cost, or max iterations
- **Rollback mechanism**: Git branch, backup, or dry-run mode
- **Isolation**: Run against branch/staging, never production directly
- **Logging**: Record every action for post-run audit
- **Alert threshold**: Notify on repeated failures or unexpected behavior
- **Kill switch**: Easy way to stop the loop immediately
## UltraThink Integration
- Use `cost-aware-pipeline` skill for model routing within loops (Sonnet for coding passes, Opus for review)
- Use `subagent-driven-development` for the RFC-DAG pattern's parallel phase
- Log loop outcomes to memory system for Tekiō adaptation
- Use VFS for cheap file scanning within watch loops (avoid full reads per iteration)Related Skills
ultrathink
UltraThink Workflow OS — 4-layer skill mesh with persistent memory and privacy hooks for complex engineering tasks. Routes prompts through intent detection to activate the right domain skills automatically.
ultrathink_review
Multi-pass code review powered by UltraThink's quality gate — checks correctness, security (OWASP), performance, readability, and project conventions in a single structured pass.
ultrathink_memory
Persistent memory system for UltraThink — search, save, and recall project context, decisions, and patterns across sessions using Postgres-backed fuzzy search with synonym expansion.
ui-design
Comprehensive UI design system: 230+ font pairings, 48 themes, 65 design systems, 23 design languages, 30 UX laws, 14 color systems, Swiss grid, Gestalt principles, Pencil.dev workflow. Inherits ui-ux-pro-max (99 UX rules) + impeccable-frontend-design (anti-AI-slop). Triggers on any design, UI, layout, typography, color, theme, or styling task.
Zod
> TypeScript-first schema validation with static type inference.
webinar-registration-page
Build a webinar or live event registration page as a self-contained HTML file with countdown timer, speaker bio, agenda, and registration form. Triggers on: "build a webinar registration page", "create a webinar sign-up page", "event registration landing page", "live training registration page", "workshop sign-up page", "create a webinar page", "build an event page", "free webinar landing page", "live demo registration page", "online event page", "create a registration page for my webinar", "build a training event page".
webhooks
Webhook design patterns — delivery, retry with exponential backoff, HMAC signature verification, payload validation, idempotency keys
web-workers
Offload heavy computation from the main thread using Web Workers, SharedWorkers, and Comlink — structured messaging, transferable objects, and off-main-thread architecture patterns
web-vitals
Core Web Vitals monitoring (LCP, FID, CLS, INP, TTFB), measurement with web-vitals library, reporting to analytics, and optimization strategies for Next.js
web-components
Native Web Components, custom elements API, Shadow DOM, HTML templates, slots, lifecycle callbacks, and framework-agnostic design patterns
wasm
WebAssembly integration — Rust to WASM with wasm-pack/wasm-bindgen, WASI, browser usage, server-side WASM, and performance considerations
vue
Vue 3 Composition API, Nuxt patterns, reactivity system, component architecture, and production development practices