Use cases

Loop categories

Browse copy-ready AI agent loops by the job they help complete.

Closed-loop loops for pull requests, failing checks, CI logs, and green builds.

CImanual trigger Hardened

Ship PR Until Green

Implement a scoped change, open or update a pull request, inspect CI, and continue until all required PR checks pass.

CursorClaude CodeCodex
pull-requestcigithub-actionsverification

Kickoff preview

Take this branch to a green pull request. Implement the requested change, run local verification, open or update the PR, run `gh pr checks`, inspect failures, fix root causes, and repeat until every required check passes or you hit the iteration cap.
Goal: Open or update a pull request and stop only when all required PR checks are green.
Check command: gh pr checks
Exit condition: All required pull request checks are successful and the PR is ready for review or merge.
Max iterations: 10
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not disable required checks, edit loops to skip jobs, or remove tests to make CI green.
- Do not merge the PR unless the user explicitly asked for merge authority.
View
CIscheduled trigger Hardened

CI Failure Watcher

Poll CI status, read failing job logs, and produce the smallest actionable fix plan or patch.

Claude CodeCodexGemini CLIOpenCode
cigithub-actionslogs

Kickoff preview

Monitor the PR checks, inspect failing logs, fix the smallest root cause, push, and continue until CI passes or a real blocker is reported.
Goal: Turn failing CI logs into a verified fix or clear blocker report.
Check command: gh pr checks --watch
Exit condition: The failing CI check is fixed, or a blocker is documented with log evidence.
Max iterations: 6
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not paste secret-bearing logs into public output. Redact tokens and credentials.
View

Agent loops that run tests, isolate failures, fix regressions, and stop only when verification passes.

Testingmanual trigger Hardened

Test Until Green

Run the project test suite, fix root causes, and keep iterating until the selected test command passes.

CursorClaude CodeCodexGemini CLIOpenCode
testsregressionfeedback-gate

Kickoff preview

Run the project tests, inspect failures, fix the smallest root cause, and repeat until the test command passes. Do not weaken the tests or change the check command.
Goal: Make the selected test command pass without weakening coverage.
Check command: pnpm test
Exit condition: The test command exits successfully with no failing tests.
Max iterations: 8
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not delete, skip, or mark tests as todo unless explicitly requested.
View
Testingmanual trigger Hardened

Fix TypeScript Until Clean

Run TypeScript checking, fix typed root causes, and stop only when strict type validation passes.

CursorClaude CodeCodex
typescripttypecheckstrict

Kickoff preview

Run the TypeScript check, group errors by root cause, fix them with strict types, and repeat until the command exits cleanly.
Goal: Make TypeScript validation pass without lowering type safety.
Check command: pnpm tsc --noEmit
Exit condition: TypeScript check exits with code 0.
Max iterations: 8
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not add `any`, `// @ts-ignore`, or disable strict compiler options unless explicitly approved.
View

Self-review and independent verification loops for safer AI-generated code changes.

Reviewmanual trigger Hardened

Independent Verifier Pass

Review an agent-produced change as a skeptical verifier before it is marked done.

CursorClaude CodeCodex
reviewverificationquality

Kickoff preview

Act as an independent verifier. Restate the requirements, inspect the diff, run relevant checks, and return a pass/fail/blocker verdict with evidence.
Goal: Prove the implementation satisfies the request without relying on the implementer’s claim.
Check command: git diff --stat && git diff --check
Exit condition: The verifier can map each requirement to code and verification evidence.
Max iterations: 3
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not rubber-stamp. Find at least one plausible failure mode and check it.
View
Reviewmanual trigger Hardened

PR Self Review

Have the agent review its own pull request for requirement coverage, risky changes, and missing tests.

CursorClaude CodeCodex
pull-requestreviewdiff

Kickoff preview

Review your own PR against the original task, changed files, tests, and risk categories. Fix must-fix issues and report evidence.
Goal: Identify problems in the agent’s own PR before human review.
Check command: git diff --stat main...HEAD && git diff --check main...HEAD
Exit condition: No must-fix review issues remain, or unresolved issues are clearly documented.
Max iterations: 3
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not hide unresolved issues; label them as risks or blockers.
View

Security, dependency, secret scanning, and safe remediation loops for AI coding agents.

Securityevent trigger Hardened

Pre-Commit Guard

Before committing, run diff hygiene, secrets checks, and the closest validation command.

Claude CodeCodexGemini CLIOpenCode
pre-commitsecuritygit

Kickoff preview

Before committing, inspect the staged diff, scan for secrets/debug flags, run relevant validation, and only commit if the guard passes.
Goal: Block commits that contain secrets, debug switches, or unverified broken code.
Check command: git diff --cached --check
Exit condition: Staged diff is clean, no obvious secrets/debug flags are present, and relevant validation passes or is explained.
Max iterations: 3
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not commit secrets, local env files, debug flags, or generated private artifacts.
View
Securitymanual trigger Hardened

Secret Leak Scan Loop

Scan repository changes for leaked credentials, local env files, and unsafe debug output before publishing.

Claude CodeCodexGemini CLIOpenCode
secretsenvsecurity

Kickoff preview

Scan changed and staged files for secrets, local env files, and debug leaks. Remove or redact unsafe values and repeat until clean.
Goal: Prevent secrets and local credentials from leaving the working tree.
Check command: git diff --cached | rg -n "(API_KEY|SECRET|TOKEN|PASSWORD|PRIVATE_KEY|BEGIN RSA|BEGIN OPENSSH)"
Exit condition: No unapproved secrets or local credentials are present in staged or changed files.
Max iterations: 4
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Never print raw secrets in the final answer. Redact values if they appear in output.
View

Deployment, environment, rollback, and Cloudflare/Vercel verification loops.

DevOpsmanual trigger Hardened

Deploy Verification Loop

After deployment, check production URL, health routes, metadata, and key user paths before declaring release success.

Claude CodeCodexGemini CLIOpenCode
deploysmoke-testrelease

Kickoff preview

Verify the deployed URL, critical pages, sitemap, robots, and metadata. Fix or report exact failures before declaring the release successful.
Goal: Confirm the deployed site responds correctly and key pages are usable.
Check command: curl -I $DEPLOY_URL
Exit condition: Critical deployed pages return expected status and visible content/metadata.
Max iterations: 4
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not claim deployment success based only on build success. Verify the deployed URL.
View
DevOpsmanual trigger Hardened

Cloudflare Worker Smoke Test

Verify a Cloudflare Workers deployment, D1 binding, static assets, and route behavior with targeted smoke checks.

Claude CodeCodexGemini CLIOpenCode
cloudflare-workersd1smoke-test

Kickoff preview

Run the Cloudflare build, verify the deployed Worker URL, D1-dependent pages, sitemap, robots, and static assets. Report exact failures.
Goal: Prove the Cloudflare Worker deployment is serving critical routes with correct bindings.
Check command: pnpm cf:build
Exit condition: Cloudflare build and deployed smoke checks pass.
Max iterations: 4
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not expose Cloudflare tokens or account IDs in public output.
View

Google SEO, structured data, sitemap, internal linking, and AdSense-readiness loops.

SEOmanual trigger Hardened

SEO Metadata Audit Loop

Audit title, description, canonical, Open Graph, headings, and indexability for SEO-critical pages.

CursorClaude CodeCodex
seometadatacanonicalssr

Kickoff preview

Audit SEO metadata from server-rendered HTML for the target pages. Verify title, description, canonical, H1, Open Graph, and indexability, then fix and re-check.
Goal: Ensure SEO-critical pages have unique, server-rendered metadata and indexable content.
Check command: curl -sL $URL | head -80
Exit condition: Each target page has unique title, description, canonical, visible H1, and no accidental noindex.
Max iterations: 5
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not rely only on client-rendered metadata for SEO-critical pages. Verify server HTML.
View
SEOmanual trigger Hardened

Programmatic SEO Page QA Loop

Review generated SEO pages for thin content, duplicate metadata, broken internal links, and missing structured data.

CursorClaude CodeCodex
programmatic-seoqualitythin-content

Kickoff preview

Audit a sample of generated SEO pages for uniqueness, helpfulness, metadata, internal links, and schema. Fix template/data issues before publishing at scale.
Goal: Ensure template-generated pages provide distinct value and are safe to index.
Check command: curl -sL $URL
Exit condition: Sampled generated pages have unique metadata, useful body content, and valid internal links.
Max iterations: 5
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not create large numbers of thin pages solely to manipulate search ranking.
View

Documentation sync, README, AGENTS.md, and project context loops.

Docsmanual trigger Hardened

AGENTS.md Improvement Loop

Audit and improve repository agent instructions so future AI sessions follow project conventions and verification rules.

Claude CodeCodexCursor
agents-mdproject-contextinstructions

Kickoff preview

Audit repository agent instructions against actual project files, then improve them with accurate commands, architecture rules, and verification expectations.
Goal: Make repository instructions accurate, actionable, and verification-oriented.
Check command: ls -la && rg -n "build|test|lint|deploy" README.md package.json AGENTS.md CLAUDE.md
Exit condition: Agent instructions state stack, commands, architecture rules, and verification expectations accurately.
Max iterations: 3
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not invent commands, tools, or architecture claims that are not present in the repository.
View
Docsevent trigger Hardened

Docs Sync After Edits

After behavior or API changes, update README, docs, examples, and project instructions to match the code.

CursorClaude CodeCodex
docsreadmechangelog

Kickoff preview

Review code changes for documentation impact, update relevant docs/examples/instructions, and report evidence or why no docs update is needed.
Goal: Keep documentation aligned with code changes.
Check command: git diff --name-only HEAD
Exit condition: Docs are updated for relevant changes or the no-docs-needed decision is justified.
Max iterations: 3
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not update docs with behavior that the code does not actually implement.
View

Database migration, D1 schema, seed, and rollback review loops.

Databasemanual trigger Hardened

Database Migration Review

Review schema and migration changes for destructive operations, D1 compatibility, indexes, and rollback risk.

CursorClaude CodeCodex
databasedrizzled1migration

Kickoff preview

Review database schema and migration changes for D1 compatibility, destructive operations, indexes, and rollback risk. Generate but do not apply production migrations without approval.
Goal: Ensure database changes are safe for development and production migration paths.
Check command: pnpm db:generate
Exit condition: Migration SQL is reviewed and no unexpected destructive operations remain.
Max iterations: 4
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not apply production migrations without human review. Do not run destructive SQL automatically.
View
Databasemanual trigger Hardened

D1 Query Index Audit

Review D1-backed list and detail queries for missing indexes, N+1 patterns, and oversized result sets.

CursorClaude CodeCodex
d1indexesperformance

Kickoff preview

Audit D1-backed public queries for indexes, pagination, N+1 patterns, and SSR safety. Propose or implement targeted fixes.
Goal: Keep public D1 queries indexed, bounded, and SSR-safe.
Check command: rg -n "select(|where(|limit(" src/modules src/routes
Exit condition: Hot list/detail queries have matching indexes and bounded result sizes.
Max iterations: 4
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not add broad unbounded queries to SEO pages. Keep public pages SSR-friendly.
View

Maintenance loops for dependencies, stale content, and recurring quality checks.

Maintenancemanual trigger Hardened

Dependency Upgrade Safety Loop

Upgrade dependencies in small batches, inspect install scripts, and verify build/test behavior after each batch.

Claude CodeCodexGemini CLIOpenCode
dependenciesupgradesupply-chain

Kickoff preview

Upgrade dependencies in small safe batches, review install-time scripts, run build/tests after each batch, and document remaining breaking changes.
Goal: Upgrade dependencies without breaking the app or ignoring supply-chain risk.
Check command: pnpm build
Exit condition: Selected dependency batch is upgraded and validation passes.
Max iterations: 5
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not blindly install packages without reviewing install/postinstall/prepare scripts.
View

Planning loops that turn vague goals into scoped implementation plans and acceptance criteria.

Planningmanual trigger Hardened

Launch Checklist Loop

Run a structured launch review covering build, SEO, policy pages, analytics, sitemap, and deployment verification.

CursorClaude CodeCodex
launchchecklistseodeploy

Kickoff preview

Run a launch readiness checklist: build, deployed critical pages, SEO metadata, sitemap, robots, policy pages, analytics/ads, and final blockers.
Goal: Avoid launching with broken routes, missing policy pages, bad metadata, or unverifiable deployment.
Check command: pnpm build
Exit condition: Build, deployment, SEO basics, policy pages, and critical user paths pass review.
Max iterations: 4
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not mark launch-ready with missing policy pages or broken critical routes.
View
Planningmanual trigger Hardened

Codex Project Context Loop

Build a clear Codex task goal from project files, constraints, done criteria, and stop conditions.

Codex
codexgoalplanning

Kickoff preview

Inspect the project context and write a strict, audit-friendly implementation objective with scope, constraints, done criteria, verification, and stop-if rules.
Goal: Create an audit-friendly agent objective before implementation.
Check command: find . -maxdepth 2 -type f | sort | head -100
Exit condition: The goal is concrete enough for an agent to execute and for a reviewer to audit.
Max iterations: 2
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not write a goal that allows vague completion or unverified claims.
View