autoevolve

Auto-evolve iteration engine: An engine that automatically adjusts and iterates strategies, parameters, or processes based on feedback and performance to achieve continuous self-improvement.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "autoevolve" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-0084a9359580631ce3ed9f93d13ed2087d4e8304b9a9ece2fe99e1a5b91e42dc. Verify the upstream source and version against https://skillhub.cn/skills/user_b22a52ba/autoevolve before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Auto-evolve iteration engine: An engine that automatically adjusts and iterates strategies, parameters, or processes based on feedback and performance to achieve continuous self-improvement.

0 Downloads

Introduction source: third_party · user_b22a52ba · 2.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: autoevolve
description: 自进化迭代引擎。通过可量化指标驱动的自主迭代循环,让 AI 持续优化代码、修复 Bug、审查质量、生成文档。核心能力:(1) 持续迭代优化至指标达标(autoevolve),(2)
  将模糊目标转化为可执行配置(plan),(3) 科学方法系统性调试(debug),(4) 迭代修复至零错误(fix),(5) 多视角全面审查(review),(6)
  自动文档与经验沉淀(learn),(7) 多模块串联形成完整流水线(chain)。触发关键词:持续优化、迭代改进、自动优化、帮我优化直到达标、自动迭代、autoevolve、自动修复、debug追踪、代码审查、多视角评审、质量保障流水线、自动生成文档、经验总结、chain串联。
version: 2.0.0
tags:
- ai
- automation
- optimization
slug: autoevolve
displayName: Autoevolve
summary: 自进化迭代引擎

AutoEvolve - 自进化迭代引擎

核心理念:约束 + 可量化指标 + 自主迭代 = 持续复利

快速开始

初始化

import sys, os
sys.path.insert(0, os.path.join(os.getenv("SKILL_PATH"), "autoevolve", "scripts"))
from git_memory import GitMemory, CheckpointManager
from verify_runner import VerifyRunner

# 指定项目路径
PROJECT = "/path/to/project"
gm = GitMemory(PROJECT)
vr = VerifyRunner(PROJECT)

# 首次使用初始化
gm.init()

单次迭代示例

# 1. 保存检查点
gm.save_checkpoint("baseline")

# 2. 执行改动(通过 python_cell_exec 修改代码)

# 3. 提交
gm.commit_experiment("添加缓存层")

# 4. 验证
result = vr.run_verify("python bench.py", r"p95:\s*([\d.]+)ms")
guard = vr.run_guard("pytest --tb=no -q")

# 5. 判定
if vr.should_keep(result) and guard.guard_passed:
    print("KEEP - 指标改善且 Guard 通过")
else:
    gm.rollback()
    print("DISCARD - 回滚")

# 6. 记录
gm.record_iteration({
    "iteration": 1,
    "commit": gm.get_current_state()["last_commit"].split()[0],
    "metric_before": vr._last_metric,
    "metric_after": result.metric_value,
    "delta": result.metric_delta,
    "status": "keep" if vr.should_keep(result) else "discard",
    "description": "添加缓存层",
    "guard_passed": guard.guard_passed
})

六大子模块

模块 1: autoevolve - 核心迭代引擎

触发:用户要求"持续优化 XXX 直到达标"、"自动迭代优化"

执行流程(6 步闭环):

  1. 回顾状态:读取 gm.analyze_experiments() 和 gm.get_iteration_summary()
  2. 选择改动:基于历史数据选择最有希望的原子级改动
  3. 执行+提交:通过 python_cell_exec 修改代码,gm.commit_experiment() 提交
  4. 机械验证:vr.run_full_verify(verify_cmd, metric_pattern, guard_cmd)
  5. 判定回滚:vr.should_keep() 决定保留或 gm.rollback()
  6. 记录循环:gm.record_iteration() + gm.format_progress_report() + 继续循环

输入参数(从用户对话中提取):

Goal:     优化目标(自然语言)
Scope:    影响范围(文件列表)
Metric:   量化指标名
Verify:   验证命令 + 指标提取正则
Guard:    守卫命令(可选)
Mode:     bounded(N) / unbounded
Direction: higher_is_better / lower_is_better

详细规范 → 读取 references/core-loop.md

模块 2: plan - 目标规划向导

触发:用户说"我想优化 XXX 但不知道从哪开始"

5 步引导:

  1. 目标捕获(对话引导用户明确目标)
  2. 范围定义(扫描项目结构,确认修改范围)
  3. 指标量化(提供开箱即用的模板,详见 references/metric-templates.md)
  4. 方向确认(展示完整配置预览)
  5. 验证测试(dry-run 确认可行性)

输出:完整的优化配置参数,可直接启动 autoevolve 循环。

详细规范 → 读取 references/plan-guide.md

模块 3: debug - 科学调试

触发:用户说"帮我找出 XXX 的 Bug"或"XXX 有问题"

7 种调查技术(按适用场景选择):

  1. 二分查找 - 能确定正常/异常边界时
  2. 差异调试 - 存在正常/异常两个版本时(gm.get_diff())
  3. 最小复现 - 任何 Bug(在沙箱中构建最小用例)
  4. 追踪执行 - 逻辑复杂时(插入日志点)
  5. 模式搜索 - 常见 Bug 类型(正则搜索代码模式)
  6. 逆向推导 - 已知错误结果不知原因时
  7. 橡皮鸭法 - 其他方法无效时(自然语言复述逻辑)

流程:收集症状 → 侦察 → 假设 → 实验 → 分类 → 记录 → 重复

关键原则:被证伪的假设同样有价值。

输出:.autoevolve/results/debug.json

详细规范 → 读取 references/debug-methodology.md

模块 4: fix - 迭代修复

触发:用户说"修复 XXX 的所有错误"或"让测试全部通过"

流程:

  1. 自动检测错误类型(语法/运行时/逻辑/测试失败)
  2. 按优先级排序(阻塞性 > 严重 > 一般)
  3. 一次修一个 → gm.commit_experiment(desc, "fix") → 验证
  4. 验证通过 + Guard 通过 → 保留
  5. 失败 → gm.rollback()
  6. 错误数归零 → 自动停止

经典组合:先用 debug 定位 Bug → 再用 fix 系统修复

验证方式:

result = vr.run_verify("pytest --tb=no -q 2>&1", r"(\d+) failed")
# 指标为失败数,越低越好
if result.metric_value == 0:
    # 全部修复,停止循环

模块 5: review - 多视角审查

触发:用户说"帮我全面审查 XXX"或"给 XXX 做个代码评审"

5 个视角: | 视角 | 关注点 | |---|---| | 架构师 | 模块划分、职责分离、扩展性 | | 安全分析师 | 输入校验、认证授权、数据加密 | | 性能工程师 | 算法复杂度、N+1 查询、缓存策略 | | 可靠性工程师 | 错误处理、超时、重试、资源清理 | | 批判者 | 最坏情况、边界条件、并发问题 |

严重程度分级:P0(安全/崩溃) > P1(功能/性能) > P2(质量) > P3(风格)

输出:.autoevolve/results/review.json

详细规范 → 读取 references/review-guide.md

模块 6: learn - 知识沉淀

触发:用户说"帮我生成文档"或"总结优化经验"

4 种模式: | 模式 | 用途 | 场景 | |---|---|---| | init | 从零生成完整文档 | 项目无文档时 | | update | 基于变更增量更新 | 代码有改动时 | | check | 文档健康检查 | 定期维护时 | | digest | 迭代经验总结 | 迭代周期结束时 |

输出:docs/ 目录下的 Markdown 文档

详细规范 → 读取 references/learn-guide.md

Chain 串联机制

将多个模块串联成完整工作流:

Chain 模式 组合 适用场景
质量保障 plan → review → debug → fix → learn 上线前全面质量提升
持续优化 plan → autoevolve → learn 有明确指标的持续优化
Bug 修复 debug → fix → autoevolve 系统修复已知 Bug
审查改进 review → autoevolve 基于审查建议改进
快速启动 plan → autoevolve 快速优化任务

上下文传递:前一模块输出到 .autoevolve/results/{module}.json,后一模块读取该文件作为输入。

状态管理:.autoevolve/chain-state.json 记录进度,支持断点续跑。

详细模式 → 读取 references/chain-patterns.md

八条铁律

  1. 循环直到完成:bounded 模式 N 次后总结,unbounded 模式直到达标或用户中断
  2. 写前必读:修改前必须读 gm.get_history() + gm.analyze_experiments()
  3. 一次一改:每次迭代只修改一个逻辑点
  4. 只信机械验证:指标必须数值化,拒绝主观判断
  5. 自动回滚:验证失败立即 gm.rollback(),不留烂摊子
  6. 简洁优先:效果相同时保留代码更少的版本
  7. Git 即记忆:所有实验用前缀提交,每次迭代前读历史
  8. 遇瓶颈想更深:重读代码、合并方案、尝试激进变化

核心脚本 API

GitMemory(scripts/git_memory.py)

gm = GitMemory(repo_path)
gm.init()                                    # 初始化
gm.commit_experiment(desc, category)          # 提交实验
gm.rollback()                                # 回滚到上一提交
gm.get_history(limit=20)                     # 查询实验历史
gm.analyze_experiments()                     # 分析成功/失败模式
gm.get_current_state()                       # 获取工作区状态
gm.save_checkpoint(label)                    # 保存检查点
gm.restore_checkpoint(tag)                   # 恢复检查点
gm.record_iteration(entry)                   # 记录迭代结果
gm.get_iteration_summary()                   # 迭代摘要
gm.format_progress_report()                  # 格式化进度报告

VerifyRunner(scripts/verify_runner.py)

vr = VerifyRunner(work_dir)
vr.run_verify(cmd, pattern)                  # 执行验证 + 提取指标
vr.run_guard(cmd)                            # 执行 Guard 检查
vr.run_full_verify(verify_cmd, pattern, guard_cmd)  # 综合验证
vr.should_keep(result, higher_is_better)     # 判断是否保留
vr.reset_metric()                            # 重置指标记录
vr.extract_metric(output, pattern)           # 通用指标提取
vr.extract_metric_json(output, key)          # JSON 指标提取

CheckpointManager(scripts/checkpoint.py)

cm = CheckpointManager(project_path)
cm.save(label, paths)                        # 保存快照
cm.restore(checkpoint_id)                    # 恢复快照
cm.list_checkpoints()                        # 列出检查点
cm.cleanup(keep_last=5)                      # 清理旧检查点

参考文档索引

文档 内容 何时读取
references/core-loop.md 6 步闭环详细规范 执行 autoevolve 循环时
references/plan-guide.md 目标规划向导 5 步流程 执行 plan 时
references/debug-methodology.md 7 种调试技术和假设管理 执行 debug 时
references/review-guide.md 5 视角审查规范和报告格式 执行 review 时
references/learn-guide.md 文档生成 4 种模式 执行 learn 时
references/chain-patterns.md Chain 串联模式和状态管理 执行 chain 时
references/metric-templates.md 可量化指标模板库 plan 阶段需要量化指标时

Current listing version

2.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 提供完整的 AI 自主迭代优化闭环,解决代码持续优化、Bug 修复、质量审查等核心痛点
  • 六大子模块覆盖开发全生命周期,具备高实用价值和广泛适用性
Trigger Precision95/100

Highlights

  • 触发关键词覆盖全面,包含 14 个精准触发词,边界清晰
Structure and Standards90/100

Areas to improve

  • description内容截断 Reported severity: Minor

    frontmatter 中 description 字段在第 13 行被换行截断,但 skill_body 内部有完整描述

    Recommendation: 建议将完整 description 内容放在 frontmatter 中,避免截断

Highlights

  • 文档结构完整,包含快速开始、模块说明、API 文档和参考索引
  • 每个模块均有清晰的触发条件、执行流程和输入输出说明
Execution Reliability93/100

Highlights

  • 工具来源明确,参数定义清晰,验证流程闭环
  • 具备自动回滚机制和 Guard 检查,确保执行安全
Evidence Verifiability (mean of the first four)93/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.