Skip to content

Her-shey/fastloops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loops - AI-Powered Development Automation Loops Collection

A curated collection of AI-powered development loops for automating software development tasks.


What is a Loop?

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.

Core Concepts of Loops

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

Loop vs Traditional Instructions

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

When to Use Loops?

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

Common Scenarios

✅ 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

How to Use Loops?

Method 1: Use on Loops! Website

Visit https://loops.elorm.xyz/loops to browse, search, and install the Loops you need.

Method 2: Use in Claude Code / Cursor

/loop <loop-name>

For example:

/loop test-until-green
/loop fix-ci-until-green
/loop pr-self-review

Method 3: Local Use

Paste Loop instructions into your preferred AI programming assistant and follow its check commands.


Loop Categories Overview

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

Complete Loop List

Testing

1. test-until-green

Goal: All tests pass

npm test

Run tests, fix the smallest root cause, repeat until all tests pass.

# Usage
/loop test-until-green

2. e2e-until-green

Goal: E2E test suite passes

npm run test:e2e

Run E2E tests, fix the first failing spec, repeat until all pass.

# Usage
/loop e2e-until-green

3. flaky-test-triage

Goal: 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-triage

4. visual-regression-until-match

Goal: Visual regression tests pass with intentional UI changes only

npx playwright test --grep @visual

Run visual tests, fix unintended UI diffs; update baselines only for deliberate design changes.

# Usage
/loop visual-regression-until-match

5. coverage-until-threshold

Goal: Coverage meets target threshold (default 80%) with all tests passing

npm test -- --coverage

Run coverage, add focused tests for biggest uncovered gaps, repeat until threshold is met.

# Usage
/loop coverage-until-threshold

6. staging-smoke-test

Goal: Staging smoke checklist passes

npm run smoke:staging

Run staging smoke checklist, fix the first failing item, repeat until passing.

# Usage
/loop staging-smoke-test

7. post-edit-test-guard

Goal: 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-guard

CI/CD

8. ship-pr-until-green

Goal: PR is open with all CI checks passing

gh pr checks

Implement change, test locally, push, open PR, fix CI until all pass.

# Usage
/loop ship-pr-until-green

9. fix-ci-until-green

Goal: 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-green

10. ci-failure-watcher

Goal: Latest CI run on current branch is green

gh run list --branch $(git branch --show-current) --limit 1

Check CI status, if failed read logs, fix root cause, verify locally, push if needed.

# Usage
/loop ci-failure-watcher

11. build-until-green

Goal: Production build succeeds

npm run build

Run build, if it fails fix the first error, repeat until green.

# Usage
/loop build-until-green

12. pre-commit-guard

Goal: Block git commits when tests are failing

npm test

Before any git commit, run tests, fix failures before committing.

# Usage
/loop pre-commit-guard

13. pr-self-review

Goal: Three clean self-review passes on the current diff

git diff main...HEAD

Review the diff like a senior reviewer, fix findings, then re-review.

# Usage
/loop pr-self-review

14. pr-babysitter

Goal: 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-babysitter

15. pr-watch-loop

Goal: Keep codex-watch PRs healthy and unblocked

gh pr list --label codex-watch --json number,title,state,statusCheckRollup

List codex-watch PRs, check CI and reviews, report or fix trivial blockers.

# Usage
/loop pr-watch-loop

16. spec-first-ship

Goal: Every requirement in spec.md is implemented and checked off

npm test

Read spec.md, implement the first unchecked item, verify it, mark [x], stop this iteration.

# Usage
/loop spec-first-ship

Code Quality

17. lint-typecheck-fix

Goal: Lint and typecheck are clean

npm run lint && npx tsc --noEmit

Run lint and typecheck, fix reported issues with minimal diffs, repeat.

# Usage
/loop lint-typecheck-fix

18. format-until-clean

Goal: Formatter runs cleanly with no remaining diff

npm run format

Run formatter, fix any issues it cannot auto-fix, repeat.

# Usage
/loop format-until-clean

19. de-sloppify-pass

Goal: Recent changes are clean, minimal, and convention-aligned

npm run lint && npm test

Review diff for debug code, dead branches, naming issues, fix with minimal diffs.

# Usage
/loop de-sloppify-pass

20. knip-until-clean

Goal: Knip reports no unused code or dependencies

npx knip

Run knip, remove dead exports and unused deps with minimal diffs, verify tests still pass.

# Usage
/loop knip-until-clean

API/Specs

21. api-contract-until-match

Goal: API implementation matches the published contract

npm run test:contract

Run contract tests, fix each schema/response mismatch with minimal diffs, re-run.

# Usage
/loop api-contract-until-match

22. openapi-sync-until-valid

Goal: openapi.yaml lints clean and matches implemented routes

npx @redocly/cli lint openapi.yaml

Lint openapi.yaml, fix spec errors and handler drift until lint passes.

# Usage
/loop openapi-sync-until-valid

Dependencies

23. dependency-upgrade-one-by-one

Goal: Critical outdated deps upgraded with green tests

npm outdated && npm test && npm run build

Pick one outdated package, upgrade it, fix breakages, commit, stop. One package per iteration.

# Usage
/loop dependency-upgrade-one-by-one

24. migration-until-applied

Goal: All database migrations apply cleanly

npx prisma migrate status

Run migrations, fix schema or SQL errors, repeat until status is clean.

# Usage
/loop migration-until-applied

25. dependency-audit-weekly

Goal: Deliver weekly dependency audit summary

npm outdated || true

Run npm outdated, categorize updates, propose safe upgrade plan.

# Usage
/loop dependency-audit-weekly

26. npm-audit-fix-loop

Goal: No high or critical npm audit vulnerabilities

npm audit --audit-level=high && npm test

Pick one high/critical advisory, apply safest fix, run tests, repeat.

# Usage
/loop npm-audit-fix-loop

Security

27. security-audit-weekly

Goal: Deliver weekly npm audit summary with remediation plan

npm audit --json

Run npm audit, triage by severity, propose safe remediation steps.

# Usage
/loop security-audit-weekly

Development Process

28. autoloop-tdd

Goal: Implement target behavior test-first with green suite

npm test

Write a failing test for the next behavior, implement minimum code to pass, refactor, repeat.

# Usage
/loop autoloop-tdd

29. changelog-sync-after-ship

Goal: CHANGELOG.md has accurate [Unreleased] entries

git log -5 --oneline

Review recent commits, write Keep-a-Changelog entries for user-visible changes, verify completeness.

# Usage
/loop changelog-sync-after-ship

30. investigation-script-loop

Goal: Prove the root cause with a minimal repro script

node scripts/investigate.mjs

Write a tiny throwaway script that reproduces the issue, run it, iterate on output.

# Usage
/loop investigation-script-loop

31. ralph-story-executor

Goal: Every story in .ralph/prd.json has passes: true

npm test && npm run lint && npm run build

Read .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-executor

32. reflexion-debug-loop

Goal: 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-loop

Documentation

33. docs-sync-after-edits

Goal: Documentation matches the current code changes

git diff main...HEAD --name-only

Review the diff, find stale docs, update them, verify accuracy.

# Usage
/loop docs-sync-after-edits

Performance

34. bundle-size-budget

Goal: Client bundle stays under the size-limit budget

npm run build && npm run size-limit

Build and measure bundle size, if over budget lazy-load or trim deps until size-limit passes.

# Usage
/loop bundle-size-budget

Accessibility

35. a11y-audit-until-clean

Goal: Zero serious accessibility violations on changed UI

npm run test:a11y

Run a11y audit on changed routes, fix each violation, prioritize keyboard and screen reader issues.

# Usage
/loop a11y-audit-until-clean

Pull Request

36. merge-conflict-resolver

Goal: Branch is rebased on main with no conflicts and tests pass

npm test

Rebase on main, resolve conflicts one file at a time, run tests, continue.

# Usage
/loop merge-conflict-resolver

37. post-merge-regression-guard

Goal: Smoke tests pass immediately after every merge or rebase

npm run test:smoke

After a merge, run smoke tests, fix regressions before continuing other work.

# Usage
/loop post-merge-regression-guard

Deployment

38. deploy-verification-loop

Goal: 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-loop

Maintenance

39. independent-verifier-pass

Goal: Build, lint, and tests pass under independent verification

npm run build && npm run lint && npm test

Run build, lint, and tests as a verifier. Trust only command output, not prior claims.

# Usage
/loop independent-verifier-pass

Hooks

40. guardrails-learning-loop

Goal: Tests and lint pass without repeating prior failure patterns

npm test && npm run lint

Read .ralph/guardrails.md, run checks, if a failure repeats add a sign before fixing.

# Usage
/loop guardrails-learning-loop

How to Create Your Own Loop?

Loop Structure

A 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

Creation Steps

  1. Define the Goal - What do you want to automate?
  2. Design the Check Command - How to verify goal achievement?
  3. Write the Steps - How should the AI iterate?
  4. Set Exit Conditions - When to stop?
  5. Test Your Loop - Verify in real scenarios

Example Loop

### 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, Cursor

License: MIT Maintainer: Agents Version: 1.0.0

About

Fast and one click setup with AI loops — run, check, fix, repeat until done.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages