recursive-self-improvement

递归自我改进系统,能够自动检测错误并修复,或持续优化和重构。包含修复模式和优化模式,支持并发执行、自动化测试、性能监控、智能调度、自适应学习、错误预测和异常恢复。用于需要持续自我优化的系统。

7 stars

Best use case

recursive-self-improvement is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

递归自我改进系统,能够自动检测错误并修复,或持续优化和重构。包含修复模式和优化模式,支持并发执行、自动化测试、性能监控、智能调度、自适应学习、错误预测和异常恢复。用于需要持续自我优化的系统。

Teams using recursive-self-improvement should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/recursive-self-improvement/SKILL.md --create-dirs "https://raw.githubusercontent.com/Demerzels-lab/elsamultiskillagent/main/public/skills/erichy777/recursive-self-improvement/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/recursive-self-improvement/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How recursive-self-improvement Compares

Feature / Agentrecursive-self-improvementStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

递归自我改进系统,能够自动检测错误并修复,或持续优化和重构。包含修复模式和优化模式,支持并发执行、自动化测试、性能监控、智能调度、自适应学习、错误预测和异常恢复。用于需要持续自我优化的系统。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 递归自我改进系统

## 核心模式

系统有两种基本工作模式,根据系统状态自动切换:

### 1. 修复模式 (REPAIRING)
**触发条件:** 检测到错误或异常

**工作流程:**
1. 错误识别(类型/位置/影响)
2. 根因分析
3. 修复方案设计
4. 代码/逻辑变更
5. 单元测试
6. 集成测试
7. 验证通过?→ 是则标记已修复,否则回到步骤1

**系统状态:** REPAIRING → REPAIRED → STABLE

### 2. 优化模式 (OPTIMIZING)
**触发条件:** 系统稳定运行,无错误超过 N 轮

**工作流程:**
1. 性能指标收集
2. 代码复杂度分析
3. 重构方案设计
4. 迁移计划
5. 分步实施
6. 回归测试
7. 指标对比
8. 是否有提升?→ 是则标记已优化,否则保留原样

**系统状态:** OPTIMIZING → OPTIMIZED → STABLE

## 状态标记

- `INITIAL`: 初始状态
- `REPAIRING`: 修复模式中
- `OPTIMIZING`: 优化模式中
- `STABLE`: 稳定运行
- `ERROR`: 检测到错误
- `OPTIMIZED`: 已优化完成

## 并发执行引擎

系统支持多任务并发执行:

```
任务池 → 智能调度 → 并发执行 → 结果收集
```

**调度策略:**
- 基于任务复杂度
- 考虑历史成功率
- 预测执行时间
- 动态调整并发数

**默认配置:**
- 并发工作池大小:4
- 超时时间:5秒
- 重试次数:3

## 自动化测试框架

系统内置测试框架:

**测试类型:**
- 单元测试:验证单个功能
- 集成测试:验证模块间交互
- 性能测试:验证性能指标

**测试覆盖率:**
- 目标覆盖率:80%+
- 关键路径覆盖率:100%

## 性能监控仪表盘

实时监控以下指标:

**系统状态:**
- 当前版本
- 运行轮次
- 系统模块

**性能指标:**
- 并发任务数
- 平均执行时间
- 吞吐量(任务/分钟)
- CPU 使用率
- 内存使用率

## 智能任务调度器

基于历史数据和预测的智能调度:

**优先级计算:**
1. 任务复杂度评估
2. 历史成功率分析
3. 最近性能趋势
4. 截止时间紧迫性

**调度策略:**
- 高优先级任务优先执行
- 同优先级任务 FIFO
- 动态调整资源分配

## 自适应学习引擎

从执行中学习,持续优化:

**学习内容:**
- 任务执行成功率
- 性能瓶颈识别
- 模式识别

**预测能力:**
- 任务成功率预测
- 性能趋势预测
- 资源需求预测

## 错误预测系统

提前识别潜在错误:

**预测维度:**
- 任务类型模式
- 资源使用模式
- 时间分布模式

**预测阈值:**
- 低置信度:60%
- 中置信度:80%
- 高置信度:90%

## 异常恢复系统

智能错误处理和恢复:

**内置策略:**
- `TIMEOUT`: 重试 + 指数退避
- `MEMORY_ERROR`: 并行化处理
- `CONCURRENCY_LIMIT`: 动态调整并发数

**恢复流程:**
1. 错误检测
2. 策略匹配
3. 执行恢复
4. 验证结果

## 运行记录格式

每次运行记录使用标准格式:

```json
{
  "timestamp": "2026-02-05T21:55:00Z",
  "mode": "REPAIRING | OPTIMIZING | STABLE",
  "action": "fix | refactor | validate | monitor",
  "previous_state": "状态名称",
  "current_state": "状态名称",
  "details": "详细描述",
  "results": {
    "key1": true/false,
    "key2": "value"
  }
}
```

## 版本管理

系统自动管理版本:

**版本格式:** vN.M

**升级规则:**
- v1.0: 基础框架
- v2.0: 添加并发、测试、监控
- v3.0: 添加智能调度、学习引擎、错误预测
- v4.0: 添加恢复系统、完整生态

**升级条件:**
- 完成 N 轮优化
- 累计改进 10+ 项
- 持续稳定运行 24 小时

## 使用建议

**何时使用:**
- 需要持续改进的复杂系统
- 有明确性能指标的项目
- 需要自动化测试和验证的流程
- 多模块并行处理的任务

**最佳实践:**
1. 初始化时定义明确的性能基线
2. 每次优化后进行回归测试
3. 定期检查错误预测和建议
4. 保留优化历史用于分析

## 配置参数

可在配置文件中调整:

```json
{
  "optimization": {
    "min_stable_rounds": 3,
    "max_concurrent_tasks": 8,
    "timeout_seconds": 5
  },
  "testing": {
    "target_coverage": 80,
    "critical_coverage": 100
  },
  "monitoring": {
    "metrics_interval": 60,
    "alert_thresholds": {
      "cpu": 80,
      "memory": 90
    }
  }
}
```

## 资源

- [工作流程](references/workflows.md) - 详细工作流程和模式识别
- [使用示例](references/examples.md) - 运行记录格式和示例

Related Skills

self-love-confidence

7
from Demerzels-lab/elsamultiskillagent

Build self-love and confidence with affirmations, wins logging, and inner critic management

agent-selfie

7
from Demerzels-lab/elsamultiskillagent

AI agent self-portrait generator. Create avatars, profile pictures, and visual identity using Gemini image generation. Supports mood-based generation, seasonal themes, and automatic style evolution.

self-reflection

7
from Demerzels-lab/elsamultiskillagent

Continuous self-improvement through structured reflection and memory

self-taught-ml-career-path

7
from Demerzels-lab/elsamultiskillagent

Discussion about self-taught machine learning career paths and success stories. Use when exploring alternative education paths, self-study strategies, or career development in ML without formal PhD training.

d-examples-of-self-taught-people-who-made-signific-96d5680b

7
from Demerzels-lab/elsamultiskillagent

Most high profile work income across seems to be from people with PhDs, either in academia or industry. There's also a hiring bias towards formal degrees.

asked-chatgpt-to-turn-me-and-itself-into-animals-t-aedd4d88

7
from Demerzels-lab/elsamultiskillagent

cute 😇.

recursive-generosity-protocol

7
from Demerzels-lab/elsamultiskillagent

Public reference + implementation playbook for Delta9-WP-003 Recursive Generosity ("Anthem of the Unbounded Well").

self-improvement

7
from Demerzels-lab/elsamultiskillagent

Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks.

agent-self-reflection

7
from Demerzels-lab/elsamultiskillagent

Periodic self-reflection on recent sessions.

self-integration

7
from Demerzels-lab/elsamultiskillagent

Connect to any external app and perform actions on it.

agent-self-governance

7
from Demerzels-lab/elsamultiskillagent

Self-governance protocol for autonomous agents: WAL (Write-Ahead Log), VBR (Verify Before Reporting), ADL.

self-evolve

7
from Demerzels-lab/elsamultiskillagent

Autonomous self-evolution skill: grants the agent full authority to modify its own configuration, skills, prompts.