self-improving-agent-python

v1.0.1

Implement a 3-layer self-improvement process for agents to evaluate tasks, learn from outcomes, optimize performance, and share knowledge across agents.

0· 162·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for brandon114/self-improving-agent-python.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "self-improving-agent-python" (brandon114/self-improving-agent-python) from ClawHub.
Skill page: https://clawhub.ai/brandon114/self-improving-agent-python
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install self-improving-agent-python

ClawHub CLI

Package manager switcher

npx clawhub@latest install self-improving-agent-python
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description describe a local self-improvement system; the provided Python scripts implement evaluation, lesson recording, optimization, and cross-agent sync via local files under the workspace directory—this matches the stated purpose.
Instruction Scope
SKILL.md instructs running the included scripts and documents the filesystem layout. The runtime instructions and scripts only read/write local JSON files and do not attempt to access network endpoints, credentials, or unrelated system files.
Install Mechanism
There is no install spec and no external downloads. The skill is distributed as plain Python scripts (no package installation or remote fetch), which is low-risk from an install perspective.
Credentials
The skill requests no environment variables or credentials. It does assume a WorkBuddy-style workspace directory (DEFAULT_OPENCLAW_DIR = ~/.workbuddy) and will operate on files under that hierarchy; no secrets are required or requested.
Persistence & Privilege
always:false and no autonomous-model restrictions. However, sync_learning.py enumerates all workspaces under ~/.workbuddy and copies collective-wisdom.json into each workspace's shared-context/self-improvement directory — this intentionally modifies other workspace directories on the same host. This behavior matches the 'cross-agent sharing' purpose but is a persistent file-write capability that you should consider before using on multi-user or shared machines.
Assessment
This skill appears to do what it says: it stores evaluations, lessons, and optimization plans as JSON files in your WorkBuddy workspace and can copy a shared 'collective-wisdom.json' into every workspace under ~/.workbuddy. Before installing or running it: (1) confirm you are okay with the skill creating and writing files under ~/.workbuddy and across any workspace-* directories on the machine, (2) inspect the included scripts (they are all present and readable) and backup any existing shared-context/ self-improvement files you care about, (3) if you run sync_learning.py on a multi-user or shared machine, be aware it will write into other workspaces under ~/.workbuddy, and (4) run the scripts as a non-privileged user and in an isolated workspace if you want to limit impact. No network endpoints or credentials are used by the skill.

Like a lobster shell, security has layers — review code before you run it.

latestvk971vz7b38z08p244na5a51k558399mv
162downloads
0stars
2versions
Updated 1mo ago
v1.0.1
MIT-0

Self-Improvement Agent Skill

当 Agent 需要从任务执行中学习并自我优化时,激活此技能。


激活条件

用户提到以下关键词时激活:

  • "自我改进"、"自我优化"、"学习经验"
  • "任务评估"、"性能分析"
  • "优化工作流程"、"提升效率"
  • 需要 Agent 从错误中学习的场景

核心概念

Agent 不应该只是执行任务,还应该从执行中学习,不断优化自己的表现。

三层自我改进机制:

  1. Layer 1: 实时反馈循环 - 每次任务执行后立即评估
  2. Layer 2: 周期性深度反思 - 定期深度分析
  3. Layer 3: 跨 Agent 经验共享 - 共享学习成果

任务评估标准

评分公式

总分 = 完成度(30%) + 效率(20%) + 质量(30%) + 满意度(20%)

评分等级

分数等级行动
≥90优秀记录最佳实践
80-89良好继续保持
70-79及格识别改进点
<70不及格触发深度反思

使用方法

Python 版本(推荐)

# 评估任务
python scripts/evaluate_task.py \
    --agent-id "my-agent" \
    --task-id "task-001" \
    --task-type "内容创作" \
    --completion 90 \
    --efficiency 85 \
    --quality 80 \
    --satisfaction 85

# 记录经验
python scripts/learn_lesson.py \
    --agent-id "my-agent" \
    --lesson "验证链接有效性" \
    --impact high \
    --category quality

# 优化分析
python scripts/optimize_agent.py --agent-id "my-agent"

# 跨 Agent 同步
python scripts/sync_learning.py

参数说明

evaluate_task.py

参数说明必填
--agent-idAgent 标识
--task-id任务标识
--task-type任务类型
--completion完成度 (0-100)
--efficiency效率 (0-100)
--quality质量 (0-100)
--satisfaction满意度 (0-100)

learn_lesson.py

参数说明必填可选值
--agent-idAgent 标识
--lesson经验描述
--impact影响程度high/medium/low
--category类别quality/efficiency/tools/knowledge

数据存储位置

{workspace}/
├── self-improvement/
│   ├── evaluations.json        # 评估记录
│   ├── lessons-learned.json   # 经验库
│   └── optimization-plan.json # 优化计划
└── shared-context/
    └── self-improvement/
        └── collective-wisdom.json  # 共享知识库

最佳实践

何时评估

  • 完成重要任务后
  • 完成复杂任务后
  • 任务失败或返工后
  • 简单重复性任务可选

如何记录经验

  • 记录具体的失败场景
  • 记录成功的关键因素
  • 记录工具使用的注意事项

如何应用学习

  • 定期回顾经验库
  • 主动应用最佳实践
  • 分享给其他 Agent

故障排查

问题解决
找不到工作区检查 config.py 中的路径配置
经验未同步手动运行 sync_learning.py
优化计划生成失败确保有足够的历史评估数据

让每个 Agent 都成为终身学习者!

Version: 1.1.0 (Python Edition) Tags: agent, self-improvement, learning, optimization

Comments

Loading comments...