Loop directory

246 published loops. Copy one, swap in your repo, run it.

Presale questions loop

Loop/loop

Turn the pre-purchase questions people ask in DMs, comments, and emails into a reusable, deduplicated answer bank.

prompt
→ Claude
/loop cadence: weekly. From my pasted/exported pre-sale questions [SOURCE], cluster recurring pre-purchase questions and objections. Append (question cluster, frequency, best current answer) to state-file presale-bank.md. Each round, write or improve ONE canonical answer for the most-asked unanswered question. Write to the bank file only; send nothing to any customer. Stop after one answer; log and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketinglow riskclaude-code

Expectation-gap audit

Loop/loop

Start from 'I thought it did X' support tickets and walk back to the exact page sentence that over-promised.

prompt
→ Claude
/loop cadence: weekly. Using the Zendesk MCP (read), pull tickets expressing a mismatch between expectation and reality ('I thought it...', 'the site said...'). Append (ticket theme, misread feature, suspected source page) to state-file expectation-gaps.md. Each round, trace the single most common gap back to the exact page sentence and draft a clarifying rewrite — draft only, edit nothing live. Stop after one; log errors and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketinglow riskclaude-code

Ad-creative fatigue drafting loop

Loop/loop

Draft the next batch of ad creative before your current set fatigues — nothing launches without you.

prompt
→ Claude
/loop cadence: every [N] days. Using the Meta Marketing API (read), watch frequency, CTR decay, and CPA drift on active creatives. Append fatigue signals to state-file ad-fatigue.md. When a creative crosses [THRESHOLD], draft the next creative variant batch (hooks, angles, copy) — draft only, launch nothing, touch no budget. Stop after drafting one batch; log API errors and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketingmedium riskclaude-code

X content-idea miner

Loop/loop

Watch a curated list on X each morning, rank what's actually working, and draft your take in your own voice ready to review.

prompt
→ Claude
/loop cadence: daily (morning). Using twitterapi.io to read my curated X list [LIST ID] and Typefully to hold drafts, rank the last 24h of posts by engagement-per-follower. Append top themes to state-file x-ideas.md. Each round, draft ONE post in MY voice [VOICE NOTES] on the strongest theme as a Typefully draft — never publish. Stop after one draft; log API errors and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketingmedium riskclaude-code

Content-brief backlog loop

Loop/loop

Keep your content pipeline stocked with fully-specified briefs mined from your own search traffic, so writers never start from a blank page.

prompt
→ Claude
/loop cadence: weekly. Using the Search Console MCP, mine my own impressions/clicks for queries with demand but weak coverage. Append candidate topics (query, intent, current page, gap) to state-file brief-backlog.md. Each round, expand the single highest-opportunity topic into ONE fully-specified brief (angle, outline, target terms, internal links). Draft only. Stop after one brief; log GSC errors and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketinglow riskclaude-code

Competitor-content watch loop

Loop/loop

Read competitors' newly published articles and the keywords they target, then plan your moves against the gaps they leave open.

prompt
→ Claude
/loop cadence: weekly. Using DataForSEO MCP for keyword/SERP data and a Firecrawl monitor on competitor blogs [LIST], detect new competitor articles and the terms they target. Append (competitor, URL, target terms, gap vs our coverage) to state-file competitor-content.md. Each round, draft ONE counter-move brief against the largest open gap. Read + draft only; publish nothing. Stop after one brief; log source errors and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketinglow riskclaude-code

Share-of-model brand watch

Loop/loop

Every week, ask the AI engines the same 'best [category]' questions your buyers ask, log where your brand ranks, and track the trend over time instead of guessing.

prompt
→ Claude
/loop cadence: weekly. Using the Perplexity API, run my fixed list of 'best [category]' / buyer-intent queries [PASTE QUERIES]. Append each result (query, my rank/mention, competitors named, date) to state-file share-of-model.md as a time series. Each round, draft ONE action for the query where I dropped the most. Never message anyone or change any page. Stop after logging the week; if a query errors, log the failure and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketinglow riskclaude-code

Programmatic-page quality gate

Loop/loop

Catch thin or duplicate template-generated pages and flag them for a human before Google penalizes the set.

prompt
→ Claude
/loop cadence: weekly. Using the Search Console MCP, pull my programmatic/template page set and check each for thin content, near-duplicate bodies, and impressions-without-clicks. Append flags (URL, issue, evidence) to state-file pseo-quality.md. Each round, draft a fix or consolidation recommendation for the WORST page only — recommend, never edit or deindex. Stop after one recommendation; log GSC errors and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketingmedium riskclaude-code

Answer-engine gap loop

Loop/loop

Each week, find the buyer questions people ask ChatGPT and Perplexity that your site doesn't answer yet, and close exactly one of those gaps.

prompt
→ Claude
/loop cadence: weekly. Using the Exa MCP, search for buyer-intent questions in [MY CATEGORY] that AI answer engines field but my site [DOMAIN] does not rank for or answer. Append findings (question, current answer source, whether we cover it) to state-file answer-engine-gaps.md. Each round, draft ONE page/section outline to close the single biggest gap — draft only, publish nothing. Stop after drafting one gap; if Exa errors, log it and stop. Budget: cap $[X]/run. Hard cap: stop after 1 iteration per run.
marketingmedium riskclaude-code

Run flow until gate or timeout

Loop/goal

Execute a flow step repeatedly until it signals DONE or GATE, or halt after 40 turns to proceed.

prompt
→ Claude
/goal FLOW says DONE or GATE, or stop after 40 turns then /flow-next
planninglow riskclaude-code
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →

Parallel Codex Legion With Integration Judge

Loop/ralph

Split a large mechanical job into 2–5 independent Codex lanes, each isolated in its own worktree with a frozen acceptance bar and binding judge, then block the final merge behind a full integration judge.

prompt
→ Claude
Dispatch a parallel Codex legion for a large mechanical job. Split the work into 2–5 genuinely independent lanes, one lane per piece. First announce a muster table with: - each lane, - the exact files that lane may touch, - the frozen acceptance check for that lane. Do not proceed until I approve the split. Before dispatch, the orchestrator must freeze and record each lane’s acceptance bar. After dispatch, each worker treats `.git` as read-only. Each lane must run in its own git worktree with: - a frozen acceptance bar recorded before code changes, - a strictly disjoint may-touch manifest, - its own sandbox, - read-only `.git` state for the worker. If any lane’s file footprint overlaps another lane, refuse the split and serialize the work instead. When a lane finishes, run a fresh-context judge against that lane’s frozen bar. The judge must return binding PASS or FAIL. Allow at most 2 retries per lane; stop after 2 failed attempts, then escalate loudly. Merge lanes in a fixed order. After merging, require a mandatory integration judge that reruns the full test suite across the combined result. Do not commit or merge unless the integration judge returns PASS. Hard cap: 5 workers. If there are more than 5 pieces, run later waves. Never merge without the integration judge.
automationmedium riskclaude-code

Delegate to Codex with a binding independent judge

Loop/ralph

praetor is a Claude Code plugin that runs a plan → freeze acceptance bar → dispatch → independent fresh-context judge → resolve loop. Claude plans and judges, Codex executes; a FAIL from the judge cannot be overridden, with at most 2 retries before a loud takeover.

prompt
→ Claude
Plan the task and freeze the acceptance criteria in .codex/ACCEPTANCE.md before any work begins. Isolate on a throwaway branch, write a self-contained brief, then dispatch execution to Codex. When Codex finishes, spawn a fresh-context independent judge that runs every check in the frozen bar against the uncommitted working tree and returns a binding PASS or FAIL — a FAIL cannot be overridden. The judge never fixes anything and commits nothing; it touches manifest paths only. Resolve with at most 2 retries; on continued failure, hand back with a loud takeover. Commit only after the judge passes, then clean up and write the ledger. Iron laws: frozen bar before dispatch, binding judge, max 2 retries then loud takeover.
automationmedium riskclaude-code

Run iterative refactor tasks with RALPH

Loop/ralph

Run an agent repeatedly on a single refactoring task, persisting filesystem state between iterations until tests pass.

prompt
→ Claude
#!/usr/bin/env python3 """ RALPH Loop Runner for RefactorBench. Runs iterative agent retry loops with filesystem-based memory on a SINGLE task at a time. RALPH pattern: - Agent runs, does work, exits - Work persists on the filesystem (working directory retains all changes) - Fresh agent starts, reads progress.json from the working directory, continues - Repeats until tests pass or max iterations Usage: python3 ralph runner.py --repo django refactor --task add-log-parameter-get-resolver python3 ralph runner.py --repo django refactor --task add-log-parameter-get-resolver --chains 2 --iterations 3 python3 ralph runner.py --repo django refactor --task add-log-parameter-get-resolver --verbose """ import argparse import asyncio import json import os import re import shutil import sys import time from dataclasses import dataclass from datetime import datetime from pathlib import Path from refactor agent import get task info, run test, setup workdir from notebook import ( FileSnapshot, NotebookWriter, parse stream json, compute solution diff, compute diff stats, ) import ralph prompt builder BENCH ROOT = Path( file ).parent / ".refactorbench" # --------------
automationmedium riskclaude-code

Ship stories with Ralph

Loop/ralph

Ralph executes one story per iteration, reading PRD state and committing work until the backlog clears.

prompt
→ Claude
# Ralph ![Ralph](ralph.webp) Ralph is a minimal, file‑based agent loop for autonomous coding. Each iteration starts fresh, reads the same on‑disk state, and commits work for one story at a time. ## How it works Ralph treats files and git as memory, not the model context: - PRD (JSON) defines stories, gates, and status - Loop executes one story per iteration - State persists in .ralph/ ![Ralph architecture](diagram.svg) ## Global CLI (recommended) Install and run Ralph from anywhere: bash npm i -g @iannuttall/ralph ralph prd # launches an interactive prompt ralph build 1 # one Ralph run ### Template hierarchy Ralph will look for templates in this order: 1. .agents/ralph/ in the current project (if present) 2. Bundled defaults shipped with this repo State and logs always go to .ralph/ in the project. ### Install templates into a project (optional overrides) bash ralph install This creates .agents/ralph/ in the current repo so you can customize prompts and loop behavior. During install, you’ll be asked if you want to add the required skills. ### Install required skills (optional) bash ralph install --skills You’ll be prom Cap the run at 25 iterations; leave remaining work for the next session.
automationmedium riskclaude-code

Ship PRD stories via dual-agent loop

Loop/ralph

Ralph runs a generator and evaluator in tandem until all user stories pass acceptance criteria and browser tests.

prompt
→ Claude
# Ralph Harness — Agent Instructions ## Overview Ralph Harness is an autonomous AI agent loop that runs AI coding tools (Amp or Claude Code) repeatedly until all PRD items are complete. Each iteration is a fresh instance with clean context. Ralph supports two modes: | Mode | Architecture | When to use | |------|-------------|-------------| | simple | Single agent (self-implement, self-check) | Quick tasks, backend-only stories, well-defined small changes | | harness | Generator + Evaluator (dual-agent with contract) | UI-heavy features, complex stories, when quality is critical | ## Architecture: Harness Mode ralph.sh orchestrator │ ├── Planner (prd.json) │ Defines user stories, acceptance criteria, dependencies │ ├── Generator (generator-prompt.md) │ Drafts sprint contracts → Implements stories → Fixes based on feedback │ └── Evaluator (evaluator-prompt.md) Reviews contracts → Signs/locks → Tests in browser → Scores → Writes feedback ### Per-Story Flow 1. Contract Negotiation : Generator drafts contract.json → Evaluator reviews → Back-and-forth until Evaluator signs → Contract locked (immutable) 2. Build : Generator reads Hard cap: stop after 30 iterations even if PRD items remain.
automationhigh riskclaude-code

Burn down critical security findings

Loop/looplooprepo

Run your static analyzer on the security ruleset, fix one high-severity finding at a time, re-verify, and loop until zero remain or 10 turns pass.

prompt
→ Claude
/loop run the repo's static analyzer (semgrep, CodeQL, or whatever is already configured) with the security ruleset; take ONE finding — highest severity first — and fix it minimally, then re-run the analyzer to verify the finding is gone and run the test suite. Never suppress or downgrade a rule to make a finding disappear; anything that needs a design change gets flagged for human review instead. Continue until the analyzer reports zero findings at high severity — stop after 10 turns and propose the fixes as one PR.
securitymedium riskclaude-code

Triage untriaged issues to zero

Loop/looplooprepo

Pick the oldest untriaged issue, validate it against the current build, then label it, close if obsolete, or document repro steps—one per turn until the queue empties or 12 iterations pass.

prompt
→ Claude
/loop pick the single oldest untriaged issue in the tracker; reproduce or validate it against the current build, then either label it (area, priority, effort), close it with a polite explanation if it is obsolete, or write the missing repro steps. One issue per iteration, never close anything that still reproduces, and propose bulk closes for maintainer review instead of executing them. Continue until the untriaged queue hits zero — stop after 12 turns and report the triaged/closed/escalated counts.
maintenancelow riskclaude-code

Draft weekly release notes

Loop/schedulelooprepo

Every Friday at 2pm, draft release notes from merged PRs into releases/DRAFT.md and verify all links resolve.

prompt
→ Claude
/schedule every Friday at 2pm, draft release notes from the PRs merged since the last draft: group changes into features, fixes, and docs, write one plain-English line per change with the PR link, and save to releases/DRAFT.md. Draft only — a human edits and publishes; never post or send anywhere. Verify every PR link resolves and every merged PR since the last run is covered before saving. Stop after 1 pass per run.
automationlow riskclaude-code

Index every foreign key

Loop/goallooprepo

Query the catalog for unindexed foreign keys, create a migration per missing index, and verify each with a full test run until all FKs are covered or 6 turns complete.

prompt
→ Claude
/goal every foreign key in the schema has a covering index — query the catalog (pg_catalog or information_schema) to list FKs with no matching index, add one migration per missing index, and re-run the catalog check until it returns zero rows. After each index, apply the migration on a scratch database and run the full test suite to verify nothing regresses; stop after 6 turns. Only add indexes — never change constraints or table definitions — and propose the final migration set as a PR for review.
databasehigh riskclaude-code

Catch schema drift nightly

Loop/schedulelooprepo

Every night at 3am, dump the production schema and diff it against migrations, filing issues for any drift found.

prompt
→ Claude
/schedule every night at 3am, dump the live database schema (`pg_dump --schema-only`) and diff it against the schema produced by applying all committed migrations to a fresh scratch database. Verify the scratch build reports `migrate status` clean before comparing. Any drift — columns, indexes, or constraints present in prod but missing from migrations, or vice versa — gets an issue filed with the exact diff attached and a proposed corrective migration for human review. Read-only against production; never modify the live schema. Stop after 1 pass per run.
databaselow riskclaude-code
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →

Fix slow queries, ship index PR

Loop/looplooprepo

Pull the slowest PostgreSQL statement, optimize its query plan with an index or rewrite, verify the improvement, and repeat until all captured queries run under 100ms or hit eight iterations.

prompt
→ Claude
/loop pull the 10 slowest statements from pg_stat_statements, take the single worst one, and EXPLAIN ANALYZE it. Fix only that query this iteration — add the missing index, rewrite the predicate, or batch the N+1 — then re-run EXPLAIN ANALYZE to verify the plan improved and run the test suite to prove behavior is unchanged. Only touch indexes and query shape, never application behavior. Continue until every statement in the captured set runs under its 100ms budget — stop after 8 turns, then propose the accumulated index changes as a single PR for review and report any remaining offenders.
performancemedium riskclaude-code

Execute SkillFoundry agent pipeline

Loop/ralph

Run all PRD-driven agents across database, backend, and frontend layers until the full development lifecycle completes.

prompt
→ Claude
# SkillFoundry Framework — Agent Instructions for OpenAI Codex Version 5.22.1 | Hexa-Platform: Claude Code · Cursor · Copilot · Codex · Gemini · Grok Build | 107 Skills | 20 MCP Tool Agents --- ## What This Is SkillFoundry (Agents & Skills) is a production-ready AI development framework with 60 specialized agents covering the full software development lifecycle. This file provides always-on context for OpenAI Codex CLI. ## Philosophy - Cold-blooded logic over flattery — Honest, structured, production-ready evaluations only - ONLY REAL LOGIC — No placeholders, TODOs, mocks, or stubs. Every feature works end-to-end - Three-Layer Completeness — Every feature verified across DATABASE → BACKEND → FRONTEND - PRD-First Development — Non-trivial features start with a Product Requirements Document - Implement Test Iterate — Every feature tested before considered done ## How to Use Skills Each SkillFoundry agent is available as a Codex Skill in .agents/skills/ . Invoke explicitly or let Codex auto-select based on your prompt. Explicit invocation: $go # Execute all PRDs from genesis/ $coder

Ship audit-grade verification gates

Loop/ralph

Pick the single highest-priority task from fix plan.md, implement it with green tests and small diffs, then stop—rinse and repeat.

prompt
→ Claude
# CLAUDE.md — Project Constitution Claude Code reads this file automatically at the start of every run. In a Ralph loop each iteration is a FRESH context, so this file is the only memory that survives. Treat every rule here as non-negotiable. ## What we are building An audit-grade verification gate : an inline API an AI agent calls before it commits a high-stakes output. It returns a verdict AND a signed, tamper- evident audit receipt that a compliance officer can hand to a regulator. The receipt — not the detection — is the product. Full spec: specs/verification-gate.md . ## The Ten Golden Rules (violating any is a failed iteration) 1. One task per loop. Read fix plan.md , pick the single highest-priority unchecked [ ] item, do ONLY that. Do not batch. 2. Tests are law. Never mark a task done unless the full test suite is green. Run it; do not assume. 3. Never weaken a test to pass it. Deleting, skipping, or loosening an assertion to get green is a critical failure. If a test is genuinely wrong, record why in the progress log and stop. 4. Small diffs. If your change touches more than ~3 files or ~150 lines, you have taken too much Cap the run at 25 iterations; leave remaining work for the next session.
planninghigh riskclaude-code

Polish page against design brief

Loop/ralph

Read the design brief, apply one focused improvement to the current implementation, re-check against all requirements until the brief is fully met.

prompt
→ Claude
/ralph-loop "Read the brief at /redesign/briefs/clients-brief.md. Compare the current implementation to the brief's requirements (every section of the brief, including Recipe Context and Implementation Notes). Apply one focused improvement. Re-check against the brief. If all brief requirements are met, output <promise PAGE-POLISH-COMPLETE</promise ." --max-iterations 8 --completion-promise "PAGE-POLISH-COMPLETE
designmedium riskclaude-code

Ship a PR through CI and reviews

Loop/loop

Draft a PR, run CI, collect reviews, merge, and release—repeat every 30 minutes until land criteria are met.

prompt
→ Claude
/loop 30m /flow-next:land # ship loop: draft PR → CI green → reviews converged → merged → released Cap the run at 15 passes.
cihigh riskclaude-codecodex

Ship specs through code review

Loop/loop

Run spec-driven workflow loop every 10 minutes: plan work, collect reviews, execute tasks, open pull requests.

prompt
→ Claude
/loop 10m /flow-next:pilot # build loop: ready spec → plan → reviews → work → draft PR Cap the run at 15 passes.
cimedium riskclaude-codecodex

Re-run PR review on schedule

Loop/schedule

Re-invoke a specific PR review skill every 20 minutes until the review completes or you stop it.

prompt
→ Claude
/loop 20m /review-pr 1234 , to re-run that skill each iteration. {/ min-version: 2.1.196 /}As of v2.1.196, a scheduled fire only runs skills that Claude is [allowed to invoke on its own](/en/skills#control-who-invokes-a-skill). The following reach Claude as plain text instead of executing

Verify foundations refactor baseline

Loop/goal

Record baseline documentation and contract specifications when pure validation refactoring completes with zero public API impact.

prompt
→ Claude
/goal records docs/reports/ baselines/2026-06-02-foundations-after.md + specs/047-foundations-programme-closeout/contracts/after-baseline.md ; no public product .fsi /surface/package/runtime impact; Principle IV (Elmish/MVU) is not applicable (pure validation refactor, IO confined to the existing read-file wrapper); required real evidence = prose-size accounting, the rewording-passes / drift-fails red→green, the enumerated contract-token set, and the restated-goal record Cap the run at 20 turns.
refactoringlow riskclaude-code

Get lint and E2E tests passing

Loop/goal

Execute work from PLAN.md until npm run lint and npm run test:e2e pass, scoping changes per AGENTS.md.

prompt
→ Claude
/goal Implement the work described in PLAN.md. Stop only when npm run lint and npm run test:e2e pass. Follow AGENTS.md, keep changes scoped, and report verification evidence Stop after 25 turns even if the goal is not reached.
cimedium riskcodex

Implement spec until tests pass

Loop/goal

Build the feature from docs/spec.md and iterate until your test suite passes completely.

prompt
→ Claude
/goal Implement the feature described in docs/spec.md and keep going until tests pass
testingmedium riskclaude-code
Sponsored · ConnectMyEmail

Loops that read your inbox.

Email is the missing tool in your harness. ConnectMyEmail gives Claude Code and Codex a clean MCP into Gmail, Outlook, iCloud and IMAP — triage, drafts, follow-ups, on a loop.

connectmyemail.com →