MCP.so
登录

Loops

可复用的提示词和分步工作流,让编码智能体自主推进任务直到完成。

测试

测试manual

Build Until Green

Run the production build, fix compile and bundling errors, and loop until the build succeeds.

CursorClaude Code
测试manual

Coverage Until Threshold

Add focused tests until coverage meets your threshold (e.g. 80%), without changing production behavior unnecessarily.

Claude Code
测试manual

Format Until Clean

Run the formatter, fix any remaining style issues, and loop until the codebase formats cleanly with no diffs.

Cursor
测试manual

Flaky Test Triage

Run failing tests repeatedly, classify each failure as flaky or real, and fix only confirmed regressions.

Claude CodeCursor
测试event

Pre-Commit Guard

Hook that runs tests before git commit commands to block commits when the suite is red.

Cursor
测试manual

Autoloop TDD

Test-first loop: write a failing test, implement the minimum code to pass, refactor, and repeat.

Claude Code
测试manual

Independent Verifier Pass

When implementation claims done, a separate verifier pass runs build, lint, and tests with no access to the implementer's rationale.

Claude Code
测试event

Post-Merge Regression Guard

Hook that runs smoke tests after git merge or rebase to catch integration regressions immediately.

Cursor
测试manual

Lint and Typecheck Fix

Run lint and typecheck, fix reported issues, and loop until the codebase is clean.

Cursor
测试event

Post-Edit Test Guard

Hook-based loop that runs related tests after file edits to catch regressions early.

Cursor
测试manual

Test Until Green

Run your test suite, fix the smallest root cause on failure, and repeat until every test passes.

CursorClaude Code
测试manual

Visual Regression Until Match

Run Playwright or Percy visual snapshots on UI changes; fix unintended diffs until baselines match intentionally.

Cursor
测试manual

E2E Until Green

Run end-to-end tests, fix UI and integration failures, and loop until the E2E suite passes.

Cursor

常见问题

关于 AI 编码 Agent 可复用 Loops 的常见问题

1

循环(loop)到底是什么?

循环是面向 AI 编码智能体的一种可复用工作流,由四部分构成:目标、用于客观验证进度的检查命令、退出条件,以及最大迭代次数上限。把启动提示词粘贴给你的智能体,它就会自主推进任务,每一轮都重新运行检查命令,直到满足退出条件为止。

2

这和写一句普通提示词有什么区别?

普通提示词是一轮对话里的一条指令;循环则是围绕多轮重复的一整套系统——它告诉智能体如何验证自己的产出、什么时候该停止,这样它就能持续推进,而不需要你在每次尝试后重新手动下达指令。这种做法就是 Loop Engineering(循环工程)。

3

这些循环支持哪些编码智能体?

本页大多数循环都不绑定特定智能体——启动提示词是纯文本,可以直接粘贴给 Claude Code、Cursor、Codex 或其他任意编码智能体使用。每条循环的详情页都列出了它专门构建并测试过的智能体。

4

什么时候适合使用 AI Agent Loop?

当任务需要多轮修改并且有客观验收方式时,适合使用 Loop,例如修复测试、处理 CI 失败、代码审查、部署验证和批量重构。一次性问答或没有明确完成标准的任务通常不需要循环。

5

如何为循环设计检查命令和退出条件?

优先选择稳定、可重复且返回明确退出码的检查命令,例如测试、类型检查、Lint 或部署健康检查。退出条件应描述可验证的完成状态,并设置最大迭代次数,避免 AI Agent 无限重试。

6

运行 AI 编码循环安全吗?

循环会重复执行提示词和命令,因此应限制文件、网络、密钥与部署权限,在隔离分支或沙盒中运行高风险任务,并保留最大迭代次数和人工复核步骤。不要让循环在未审查的情况下执行破坏性命令。