lets-loop
Skill8 starsChanged 16 days agoApache-2.0View on GitHub
Loop Engineering 循环调度框架:以循环设计模式、四层工程治理和自主改进机制编排持续型 Agent 任务。适用于设计自动化触发、多 Agent 制衡、预算控制的循环系统;单次长任务的澄清与连续执行协议见 long-term-task。
In this repository32 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ast-grep-blockSkill
- code-deconstructSkill
- code-detect-dupSkill
- code-detect-problemSkill
- code-part-modificationSkill
- code-refactorSkill
- code-reviewSkill
- cpp-checkSkill
- cpp-clang-tidySkill
- cpp-tscancodeSkill
- full-analysisSkill
- gdb-heap-analysisSkill
- java-asprofSkill
- java-check-pmdSkill
- java-check-spotbugsSkill
- java-coverageSkill
- java-envSkill
- java-g2mSkill
- jmh-benchSkill
- long-term-taskSkill
- md2pdfSkill
- merge-agents-mdSkill
- qualitative-assessmentSkill
- requirement-collectSkill
- rust-clippySkill
- rust-flamegraphSkill
- shell-checkSkill
- sql-extractSkill
- sync-dev-specSkill
- sync-repo-docsSkill
- vbox-test-envSkill
The file
Files
Let's Loop - Loop Engineering 循环调度框架
本文件中的
templates/...均指本技能目录下的templates/子目录。
企业Agent落地的第四层工程进化:从提示词工程到循环工程,构建部署后每天都变得更好的系统
核心洞察:AI工程范式已从单次提示词演进到持续循环调度——生成→评估→学习→改进→直到输出真正足够好。
四层工程进化论
| 层级 | 名称 | 核心 | 关键技术 | 局限性 |
| L1 | Prompt Engineering | 说清楚任务 | CoT、Few-shot、结构化模板 | 信息孤岛、无记忆、人肉触发 |
| L2 | Context Engineering | 提供背景信息 | RAG、MCP协议、Message History | 模型手不受控、错误不自愈 |
| L3 | Harness Engineering | 验证正确性 | AGENTS.md、Sensors、Enforcement | 依赖人触发收尾、无跨session记忆 |
| L4 | Loop Engineering | 持续迭代改进 | Automations、Worktrees、Skills、Sub-agents、State | — |
嵌套关系:L4 ⊃ L3 ⊃ L2 ⊃ L1
Loop 六要素
| 要素 | 作用 | 示例 |
| Automations | 自动化心跳 | --cron "0 9 * * *" / --trigger "git_push" |
| Worktrees | 工作树隔离 | concurrency: 3, isolation: git_worktree |
| Skills | 技能编码 | 将历史错误提炼为可复用规则 |
| Plugins/Connectors | 插件连接器 | Jira、Slack等MCP集成 |
| Sub-agents | 子Agent制衡 | Maker-Checker分离 |
| State | 外部状态存储 | 迭代计数、错误/成功记忆、模式库 |
适用边界:框架设计 vs 任务执行
lets-loop 只回答"循环系统如何设计",不负责"一个任务如何从头做到尾"。后者由 long-term-task 承载,两者互补而非替代,不得互相顶替。
| 场景 | 使用技能 | 原因 |
| 设计自动化心跳、多 Agent 制衡、预算与状态存储 | lets-loop | 提供 L1-L4 模型、循环模式与配置模板 |
| 执行一次跨多步骤的分析、重构或迁移任务 | long-term-task | 提供澄清、计划确认、连续执行与完成总结协议 |
| 两者同时需要 | 先由 long-term-task 立项,再用本框架设计外循环 | 执行协议保证单次任务跑完,框架保证跨任务持续改进 |
long-term-task 在执行期可择用的本框架模式:模式 4(Reflexion,失败后分析假设并存储教训)、模式 7(计划→执行→重新规划)。模式 11(元循环)属于跨任务优化,需在多次长任务运行后由本框架评估,不在单次执行中启用。
循环设计模式
以下为常用模式,按类别编号;项目可按实际需要扩展,新增模式须说明触发条件、终止条件与成本上限。
类别1:质量改进
| # | 模式 | 要点 |
| 1 | 生成→批判→重写 | generator→critic→generator,until score≥85 |
| 2 | 打分并重试 | max_retries:5, quality_threshold:80, 按criteria评估 |
| 3 | 多批判者 | 多角色critic,consensus_required: 2/3 |
类别2:记忆
| # | 模式 | 要点 |
| 4 | Reflexion | 失败→分析假设→存储教训→重试,最重要的自我改进 |
| 5 | 错误库 | 错误驱动知识库,任务前precheck |
| 6 | 成功模式 | quality>90且time<threshold时捕获 |
类别3:规划
| # | 模式 | 要点 |
| 7 | 计划→执行→重新规划 | adaptive, observe→replan if unexpected |
| 8 | 动态工作流 | decision_points条件分支 |
类别4:探索
| # | 模式 | 要点 |
| 9 | 分支探索 | parallel_branches:3, select_best_by加权评分 |
类别5:系统优化
| # | 模式 | 要点 |
| 10 | 提示词优化 | evolutionary策略,mutation变体 |
| 11 | 工作流优化(元循环) | 监控latency/cost/quality/success_rate触发优化 |
企业级Loop模板
本文件中的
templates/指本技能目录下的templates/子目录。
code-review-loop.yaml— 代码审查自动化Looptech-debt-loop.yaml— 技术债务管理Looprisk-and-budget.yaml— 风险管理和成本控制industry-adaptation.yaml— 行业适配(金融/软件/客服)diagnostic-flow.yaml— 诊断框架:问题在哪一层
采纳路径
| 阶段 | 目标 | 命令 |
| 1: 夯实L1+L2 | 验证AI能做这件事 | --level L2 --scenarios "code-review,doc-generation" --goal "85%_accuracy" |
| 2: 建设L3 | Agent可被信任独立完成 | --level L3 --harness "agents.md,linter,test_gates" --goal "semi_autonomous" |
| 3: 试点L4 | 验证无人值守可行性和ROI | --level L4 --pilot "daily_ci_triage" --budget "50k_tokens" --supervision "high" |
| 4: 规模化L4 | 扩展到多场景 | --level L4 --scale "3_scenarios" --automation "full" --budget "500k_tokens" |
核心原则:Build the Loop, Stay the Engineer
两个人可以搭建完全相同的Loop,得到完全相反的结果。一个人用它加速自己深刻理解的工作,另一个人用它逃避理解工作本身。
- 工程师:用Loop处理理解深刻的重复性工作,保持code walkthroughs,审查重大决策,把Loop当放大器
- 逃避者:用Loop处理不理解的新领域,停止审查输出,盲目信任决策,把Loop当外包团队
愿景:lets-loop 让Agent从"单次执行工具"进化为"持续改进系统",从"需要人推动"进化为"自己发现工作",从"概率性正确"进化为"可验证可靠"。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

