A curated collection of AI-powered development loops for automating software development tasks.
Loop is an automated workflow instruction set for AI programming assistants (like Claude Code, Cursor). It enables AI to autonomously complete development tasks through a "execute → check → fix → repeat" closed-loop pattern until a preset goal is achieved.
| Concept | Description |
|---|---|
| Goal | The final state the Loop aims to achieve |
| Check Command | Command to verify if the goal is met |
| Max Iterations | Maximum number of iterations to prevent infinite loops |
| Exit Condition | When to stop (usually when check command returns success) |
| Steps | Specific operations for each iteration |
| Traditional Instruction | Loop |
|---|---|
| "Fix all lint errors" | Run lint → Fix minimal diff → Run again → Repeat until clean |
| "Fix CI" | Check CI status → Read logs → Reproduce locally → Fix → Push → Verify |
| One-time task | Closed-loop automation |
Use Loops when you need:
- Continuous Iteration - Tasks that require repeated check, fix, re-check cycles
- Quality Gates - Keep code, builds, and tests in a healthy state
- Workflow Automation - Reduce repetitive manual operations
- CI/CD Integration - Automatically fix failing CI builds
✅ Run tests until all pass
✅ Fix CI failures and verify
✅ TDD development workflow
✅ Code review and refactoring
✅ Dependency management and security audits
✅ API contract validation
✅ Deployment verification
❌ Simple one-time Q&A
❌ Creative design work
Visit https://loops.elorm.xyz/loops to browse, search, and install the Loops you need.
/loop <loop-name>
For example:
/loop test-until-green
/loop fix-ci-until-green
/loop pr-self-review
Paste Loop instructions into your preferred AI programming assistant and follow its check commands.
| Category | Description | Count |
|---|---|---|
| Testing | Automated testing, quality assurance | 7 |
| CI/CD | Continuous integration and deployment automation | 9 |
| Code Quality | Lint, format, type checking | 4 |
| API/Specs | API contract and spec validation | 2 |
| Dependencies | Dependency upgrades and audits | 4 |
| Security | Security audits and vulnerability fixes | 3 |
| Development Process | Development methodology and workflows | 5 |
| Documentation | Documentation sync and updates | 1 |
| Performance | Performance optimization | 1 |
| Accessibility | Accessibility checks | 1 |
| Pull Request | PR management and collaboration | 2 |
| Maintenance | Routine maintenance tasks | 1 |
Goal: All tests pass
npm testRun tests, fix the smallest root cause, repeat until all tests pass.
# Usage
/loop test-until-greenGoal: E2E test suite passes
npm run test:e2eRun E2E tests, fix the first failing spec, repeat until all pass.
# Usage
/loop e2e-until-greenGoal: Classify failing tests as flaky or real, fix only confirmed regressions
npm test -- --testPathPattern=<failing-suite>Run failing test suite multiple times, classify each failure, fix real ones, document flaky behavior.
# Usage
/loop flaky-test-triageGoal: Visual regression tests pass with intentional UI changes only
npx playwright test --grep @visualRun visual tests, fix unintended UI diffs; update baselines only for deliberate design changes.
# Usage
/loop visual-regression-until-matchGoal: Coverage meets target threshold (default 80%) with all tests passing
npm test -- --coverageRun coverage, add focused tests for biggest uncovered gaps, repeat until threshold is met.
# Usage
/loop coverage-until-thresholdGoal: Staging smoke checklist passes
npm run smoke:stagingRun staging smoke checklist, fix the first failing item, repeat until passing.
# Usage
/loop staging-smoke-testGoal: After each batch of file edits, related tests must pass before continuing
npm test -- --findRelatedTests <edited files>After edits, run related tests. If they fail, fix before making more changes.
# Usage
/loop post-edit-test-guardGoal: PR is open with all CI checks passing
gh pr checksImplement change, test locally, push, open PR, fix CI until all pass.
# Usage
/loop ship-pr-until-greenGoal: Latest CI run on current branch passes
gh run list --branch $(git branch --show-current) --limit 1 --json conclusion -q '.[0].conclusion'Find latest failed CI run, read logs, reproduce locally, fix root cause, push, verify.
# Usage
/loop fix-ci-until-greenGoal: Latest CI run on current branch is green
gh run list --branch $(git branch --show-current) --limit 1Check CI status, if failed read logs, fix root cause, verify locally, push if needed.
# Usage
/loop ci-failure-watcherGoal: Production build succeeds
npm run buildRun build, if it fails fix the first error, repeat until green.
# Usage
/loop build-until-greenGoal: Block git commits when tests are failing
npm testBefore any git commit, run tests, fix failures before committing.
# Usage
/loop pre-commit-guardGoal: Three clean self-review passes on the current diff
git diff main...HEADReview the diff like a senior reviewer, fix findings, then re-review.
# Usage
/loop pr-self-reviewGoal: PRs labeled codex-watch are healthy (CI green, rebased, not stale)
gh pr list --label "codex-watch"List watched PRs, fix CI once, rebase if behind, comment if stale. Escalate repeated failures.
# Usage
/loop pr-babysitterGoal: Keep codex-watch PRs healthy and unblocked
gh pr list --label codex-watch --json number,title,state,statusCheckRollupList codex-watch PRs, check CI and reviews, report or fix trivial blockers.
# Usage
/loop pr-watch-loopGoal: Every requirement in spec.md is implemented and checked off
npm testRead spec.md, implement the first unchecked item, verify it, mark [x], stop this iteration.
# Usage
/loop spec-first-shipGoal: Lint and typecheck are clean
npm run lint && npx tsc --noEmitRun lint and typecheck, fix reported issues with minimal diffs, repeat.
# Usage
/loop lint-typecheck-fixGoal: Formatter runs cleanly with no remaining diff
npm run formatRun formatter, fix any issues it cannot auto-fix, repeat.
# Usage
/loop format-until-cleanGoal: Recent changes are clean, minimal, and convention-aligned
npm run lint && npm testReview diff for debug code, dead branches, naming issues, fix with minimal diffs.
# Usage
/loop de-sloppify-passGoal: Knip reports no unused code or dependencies
npx knipRun knip, remove dead exports and unused deps with minimal diffs, verify tests still pass.
# Usage
/loop knip-until-cleanGoal: API implementation matches the published contract
npm run test:contractRun contract tests, fix each schema/response mismatch with minimal diffs, re-run.
# Usage
/loop api-contract-until-matchGoal: openapi.yaml lints clean and matches implemented routes
npx @redocly/cli lint openapi.yamlLint openapi.yaml, fix spec errors and handler drift until lint passes.
# Usage
/loop openapi-sync-until-validGoal: Critical outdated deps upgraded with green tests
npm outdated && npm test && npm run buildPick one outdated package, upgrade it, fix breakages, commit, stop. One package per iteration.
# Usage
/loop dependency-upgrade-one-by-oneGoal: All database migrations apply cleanly
npx prisma migrate statusRun migrations, fix schema or SQL errors, repeat until status is clean.
# Usage
/loop migration-until-appliedGoal: Deliver weekly dependency audit summary
npm outdated || trueRun npm outdated, categorize updates, propose safe upgrade plan.
# Usage
/loop dependency-audit-weeklyGoal: No high or critical npm audit vulnerabilities
npm audit --audit-level=high && npm testPick one high/critical advisory, apply safest fix, run tests, repeat.
# Usage
/loop npm-audit-fix-loopGoal: Deliver weekly npm audit summary with remediation plan
npm audit --jsonRun npm audit, triage by severity, propose safe remediation steps.
# Usage
/loop security-audit-weeklyGoal: Implement target behavior test-first with green suite
npm testWrite a failing test for the next behavior, implement minimum code to pass, refactor, repeat.
# Usage
/loop autoloop-tddGoal: CHANGELOG.md has accurate [Unreleased] entries
git log -5 --onelineReview recent commits, write Keep-a-Changelog entries for user-visible changes, verify completeness.
# Usage
/loop changelog-sync-after-shipGoal: Prove the root cause with a minimal repro script
node scripts/investigate.mjsWrite a tiny throwaway script that reproduces the issue, run it, iterate on output.
# Usage
/loop investigation-script-loopGoal: Every story in .ralph/prd.json has passes: true
npm test && npm run lint && npm run buildRead .ralph/prd.json and .ralph/progress.md, pick one incomplete story, implement it, run backpressure checks, commit, update prd.json and progress.md, stop this iteration.
# Usage
/loop ralph-story-executorGoal: The failing test or repro passes
npm test -- --testNamePattern=<failing-test>Reproduce the bug. If it fails, append a reflection to .loops/reflexion.md before trying a new fix.
# Usage
/loop reflexion-debug-loopGoal: Documentation matches the current code changes
git diff main...HEAD --name-onlyReview the diff, find stale docs, update them, verify accuracy.
# Usage
/loop docs-sync-after-editsGoal: Client bundle stays under the size-limit budget
npm run build && npm run size-limitBuild and measure bundle size, if over budget lazy-load or trim deps until size-limit passes.
# Usage
/loop bundle-size-budgetGoal: Zero serious accessibility violations on changed UI
npm run test:a11yRun a11y audit on changed routes, fix each violation, prioritize keyboard and screen reader issues.
# Usage
/loop a11y-audit-until-cleanGoal: Branch is rebased on main with no conflicts and tests pass
npm testRebase on main, resolve conflicts one file at a time, run tests, continue.
# Usage
/loop merge-conflict-resolverGoal: Smoke tests pass immediately after every merge or rebase
npm run test:smokeAfter a merge, run smoke tests, fix regressions before continuing other work.
# Usage
/loop post-merge-regression-guardGoal: All post-deploy health and smoke endpoints return success
curl -fsS <your-health-url>Hit health/smoke URLs, if any fail inspect deploy logs, fix or escalate.
# Usage
/loop deploy-verification-loopGoal: Build, lint, and tests pass under independent verification
npm run build && npm run lint && npm testRun build, lint, and tests as a verifier. Trust only command output, not prior claims.
# Usage
/loop independent-verifier-passGoal: Tests and lint pass without repeating prior failure patterns
npm test && npm run lintRead .ralph/guardrails.md, run checks, if a failure repeats add a sign before fixing.
# Usage
/loop guardrails-learning-loopA Loop consists of:
Name
├── Goal - The final state the Loop aims to achieve
├── Check Command - Command to verify if the goal is met
├── Max Iterations - Maximum iterations to prevent infinite loops
├── Exit Condition - When to stop successfully
├── Steps - Specific operations for each iteration
└── Recommended Agents - Suitable AI programming assistants
- Define the Goal - What do you want to automate?
- Design the Check Command - How to verify goal achievement?
- Write the Steps - How should the AI iterate?
- Set Exit Conditions - When to stop?
- Test Your Loop - Verify in real scenarios
### My Custom Loop
**Goal:** Code formatting is clean
**Check Command:**
\`\`\`bash
npm run format && git diff --exit-code
\`\`\`
**Exit Condition:** git diff is empty (no formatting changes needed)
**Steps:**
Step 1: Run the formatter command.
Step 2: Check git diff, if there are changes commit them.
Step 3: Repeat until no changes.
**Recommended Agents:** Claude Code, CursorLicense: MIT Maintainer: Agents Version: 1.0.0