← 返回 Skills 市场
shenghoo123-png

自我提升助手

作者 shenghoo123-png · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
85
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install kay-self-improving
功能描述
A universal self-improving agent that learns from ALL skill experiences. Uses multi-memory architecture (semantic + episodic + working) to continuously evolv...
使用说明 (SKILL.md)

Self-Improving Agent

"An AI agent that learns from every interaction, accumulating patterns and insights to continuously improve its own capabilities." — Based on 2025 lifelong learning research

Overview

This is a universal self-improvement system that learns from ALL skill experiences, not just PRDs. It implements a complete feedback loop with:

  • Multi-Memory Architecture: Semantic + Episodic + Working memory
  • Self-Correction: Detects and fixes skill guidance errors
  • Self-Validation: Periodically verifies skill accuracy
  • Hooks Integration: Auto-triggers on skill events (before_start, after_complete, on_error)
  • Evolution Markers: Traceable changes with source attribution

Research-Based Design

Based on 2025 research:

Research Key Insight Application
SimpleMem Efficient lifelong memory Pattern accumulation system
Multi-Memory Survey Semantic + Episodic memory World knowledge + experiences
Lifelong Learning Continuous task stream learning Learn from every skill use
Evo-Memory Test-time lifelong learning Real-time adaptation

The Self-Improvement Loop

┌─────────────────────────────────────────────────────────────────┐
│                    UNIVERSAL SELF-IMPROVEMENT                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│   Skill Event → Extract Experience → Abstract Pattern → Update  │
│        │                  │                │         │          │
│        ▼                  ▼                ▼         ▼          │
│   ┌─────────────────────────────────────────────────────┐       │
│   │              MULTI-MEMORY SYSTEM                      │       │
│   ├─────────────────────────────────────────────────────┤       │
│   │  Semantic Memory   │  Episodic Memory  │ Working Memory │  │
│   │  (Patterns/Rules)  │  (Experiences)    │  (Current)     │  │
│   │  memory/semantic/  │  memory/episodic/ │  memory/working/│  │
│   └─────────────────────────────────────────────────────┘       │
│                                                                 │
│   ┌─────────────────────────────────────────────────────┐       │
│   │              FEEDBACK LOOP                            │       │
│   │  User Feedback → Confidence Update → Pattern Adapt   │       │
│   └─────────────────────────────────────────────────────┘       │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

When This Activates

Automatic Triggers (via hooks)

Event Trigger Action
before_start Any skill starts Log session start
after_complete Any skill completes Extract patterns, update skills
on_error Bash returns non-zero exit Capture error context, trigger self-correction

Manual Triggers

  • User says "自我进化", "self-improve", "从经验中学习"
  • User says "分析今天的经验", "总结教训"
  • User asks to improve a specific skill

Evolution Priority Matrix

Trigger evolution when new reusable knowledge appears:

Trigger Target Skill Priority Action
New PRD pattern discovered prd-planner High Add to quality checklist
Architecture tradeoff clarified architecting-solutions High Add to decision patterns
API design rule learned api-designer High Update template
Debugging fix discovered debugger High Add to anti-patterns
Review checklist gap code-reviewer High Add checklist item
Perf/security insight performance-engineer, security-auditor High Add to patterns
UI/UX spec issue prd-planner, architecting-solutions High Add visual spec requirements
React/state pattern debugger, refactoring-specialist Medium Add to patterns
Test strategy improvement test-automator, qa-expert Medium Update approach
CI/deploy fix deployment-engineer Medium Add to troubleshooting

Multi-Memory Architecture

1. Semantic Memory (memory/semantic-patterns.json)

Stores abstract patterns and rules reusable across contexts:

{
  "patterns": {
    "pattern_id": {
      "id": "pat-2025-01-11-001",
      "name": "Pattern Name",
      "source": "user_feedback|implementation_review|retrospective",
      "confidence": 0.95,
      "applications": 5,
      "created": "2025-01-11",
      "category": "prd_structure|react_patterns|async_patterns|...",
      "pattern": "One-line summary",
      "problem": "What problem does this solve?",
      "solution": { ... },
      "quality_rules": [ ... ],
      "target_skills": [ ... ]
    }
  }
}

2. Episodic Memory (memory/episodic/)

Stores specific experiences and what happened:

memory/episodic/
├── 2025/
│   ├── 2025-01-11-prd-creation.json
│   ├── 2025-01-11-debug-session.json
│   └── 2025-01-12-refactoring.json
{
  "id": "ep-2025-01-11-001",
  "timestamp": "2025-01-11T10:30:00Z",
  "skill": "debugger",
  "situation": "User reported data not refreshing after form submission",
  "root_cause": "Empty callback in onRefresh prop",
  "solution": "Implement actual refresh logic in callback",
  "lesson": "Always verify callbacks are not empty functions",
  "related_pattern": "callback_verification",
  "user_feedback": {
    "rating": 8,
    "comments": "This was exactly the issue"
  }
}

3. Working Memory (memory/working/)

Stores current session context:

memory/working/
├── current_session.json   # Active session data
├── last_error.json        # Error context for self-correction
└── session_end.json       # Session end marker

Self-Improvement Process

Phase 1: Experience Extraction

After any skill completes, extract:

What happened:
  skill_used: {which skill}
  task: {what was being done}
  outcome: {success|partial|failure}

Key Insights:
  what_went_well: [what worked]
  what_went_wrong: [what didn't work]
  root_cause: {underlying issue if applicable}

User Feedback:
  rating: {1-10 if provided}
  comments: {specific feedback}

Phase 2: Pattern Abstraction

Convert experiences to reusable patterns:

Concrete Experience Abstract Pattern Target Skill
"User forgot to save PRD notes" "Always persist thinking to files" prd-planner
"Code review missed SQL injection" "Add security checklist item" code-reviewer
"Callback was empty, didn't work" "Verify callback implementations" debugger
"Net APY position ambiguous" "UI specs need exact relative positions" prd-planner

Abstraction Rules:

If experience_repeats 3+ times:
  pattern_level: critical
  action: Add to skill's "Critical Mistakes" section

If solution_was_effective:
  pattern_level: best_practice
  action: Add to skill's "Best Practices" section

If user_rating >= 7:
  pattern_level: strength
  action: Reinforce this approach

If user_rating \x3C= 4:
  pattern_level: weakness
  action: Add to "What to Avoid" section

Phase 3: Skill Updates

Update the appropriate skill files with evolution markers:

\x3C!-- Evolution: 2025-01-12 | source: ep-2025-01-12-001 | skill: debugger -->

## Pattern Added (2025-01-12)

**Pattern**: Always verify callbacks are not empty functions

**Source**: Episode ep-2025-01-12-001

**Confidence**: 0.95

### Updated Checklist
- [ ] Verify all callbacks have implementations
- [ ] Test callback execution paths

Correction Markers (when fixing wrong guidance):

\x3C!-- Correction: 2025-01-12 | was: "Use callback chain" | reason: caused stale refresh -->

## Corrected Guidance

Use direct state monitoring instead of callback chains:
```typescript
// ✅ Do: Direct state monitoring
const prevPendingCount = usePrevious(pendingCount);

### Phase 4: Memory Consolidation

1. **Update semantic memory** (`memory/semantic-patterns.json`)
2. **Store episodic memory** (`memory/episodic/YYYY-MM-DD-{skill}.json`)
3. **Update pattern confidence** based on applications/feedback
4. **Prune outdated patterns** (low confidence, no recent applications)

## Self-Correction (on_error hook)

Triggered when:
- Bash command returns non-zero exit code
- Tests fail after following skill guidance
- User reports the guidance produced incorrect results

**Process:**

```markdown
## Self-Correction Workflow

1. Detect Error
   - Capture error context from working/last_error.json
   - Identify which skill guidance was followed

2. Verify Root Cause
   - Was the skill guidance incorrect?
   - Was the guidance misinterpreted?
   - Was the guidance incomplete?

3. Apply Correction
   - Update skill file with corrected guidance
   - Add correction marker with reason
   - Update related patterns in semantic memory

4. Validate Fix
   - Test the corrected guidance
   - Ask user to verify

Example:

\x3C!-- Correction: 2025-01-12 | was: "useMemo for claimable ids" | reason: stale data at click time -->

## Self-Correction: Click-Time Computation

**Issue**: Using useMemo for claimable IDs caused stale data
**Fix**: Compute at click time for always-fresh data
**Pattern**: click_time_vs_open_time_computation

Self-Validation

Use the validation template in references/appendix.md when reviewing updates.

Hooks Integration

Wiring Hooks in Claude Code Settings

Add to Claude Code settings (~/.claude/settings.json):

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash|Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/pre-tool.sh \"$TOOL_NAME\" \"$TOOL_INPUT\""
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/post-bash.sh \"$TOOL_OUTPUT\" \"$EXIT_CODE\""
          }
        ]
      }
    ],
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "bash ${SKILLS_DIR}/self-improving-agent/hooks/session-end.sh"
          }
        ]
      }
    ]
  }
}

Replace ${SKILLS_DIR} with your actual skills path.

Additional References

See references/appendix.md for memory structure, workflow diagrams, metrics, feedback templates, and research links.

Best Practices

DO

  • ✅ Learn from EVERY skill interaction
  • ✅ Extract patterns at the right abstraction level
  • ✅ Update multiple related skills
  • ✅ Track confidence and apply counts
  • ✅ Ask for user feedback on improvements
  • ✅ Use evolution/correction markers for traceability
  • ✅ Validate guidance before applying broadly

DON'T

  • ❌ Over-generalize from single experiences
  • ❌ Update skills without confidence tracking
  • ❌ Ignore negative feedback
  • ❌ Make changes that break existing functionality
  • ❌ Create contradictory patterns
  • ❌ Update skills without understanding context

Quick Start

After any skill completes, this agent automatically:

  1. Analyzes what happened
  2. Extracts patterns and insights
  3. Updates relevant skill files
  4. Logs to memory for future reference
  5. Reports summary to user

References

安全使用建议
This skill tries to act as a universal, automatic 'self-improver' that collects outputs from other skills and can propose code changes. The red flags are: (1) it promises auto hooks but OpenClaw doesn't support the claimed hook integration; (2) it says it will create PRs but does not declare the Git/GitHub credentials needed; and (3) it grants broad read/write/bash access and uses open‑ended language about learning from 'ALL skills' without boundaries. Before installing: (a) ask the author to explain how hooks/auto-triggering will work on OpenClaw and to explicitly list any credentials or remote endpoints required; (b) require explicit declaration of any Git tokens or repository URLs (and prefer manual PR creation rather than automatic pushes); (c) review the memory files and hooks scripts (they are small here) and confirm there are no network exfiltration endpoints; (d) if you proceed, run the skill in a constrained sandbox or give it only the minimal file-tree access necessary and do not provide repository credentials until you trust the behavior. If you cannot get clear answers about PR automation and data boundaries, treat this as untrusted and avoid giving it write/network credentials.
功能分析
Type: OpenClaw Skill Name: kay-self-improving Version: 0.1.0 The skill bundle implements a 'self-improving' framework that instructs the AI agent to autonomously modify its own skill files and memory based on session experiences (SKILL.md). It includes a hooks system designed to execute shell scripts (hooks/pre-tool.sh, hooks/post-bash.sh) on every tool invocation. While the provided scripts are currently limited to logging and the stored patterns (memory/semantic-patterns.json) reflect legitimate engineering practices, the core architecture of self-modification and broad hook execution represents a high-risk capability that could be leveraged for persistent prompt injection or unauthorized codebase changes.
能力评估
Purpose & Capability
The skill claims to 'learn from ALL skill experiences' and to auto-trigger via hooks and create PRs, but the registry metadata declares no required credentials or config for repository access or system hooks. It expects platform hook integration (Claude-style) that OpenClaw doesn't currently support — the OPENCLAW_HOOKS.md even notes this mismatch. Asking to update other skills/repos (create-pr) normally requires Git credentials (GITHUB_TOKEN, SSH key) which are not declared.
Instruction Scope
SKILL.md and included docs describe extracting patterns from 'Any Skill Completes' and storing episodes/semantic memory. Allowed tools include Read, Write, Edit, Bash, Grep, Glob — powerful capabilities that could read/write many files. The instructions are open‑ended about learning from 'ALL skills' and do not clearly limit which files/outputs may be read or stored, giving the agent broad discretion to collect session/tool outputs and repository contents.
Install Mechanism
No install spec; this is instruction‑plus-data and a few small hook scripts. There are no downloads or external installers. The included shell hooks only log inputs/outputs to stderr; nothing is fetched from remote URLs or written by an installer.
Credentials
The skill intends to create PRs and update other skills but declares no credentials (no GitHub/Git token, no repo URL, no user identity). That is disproportionate: repository operations require credentials and network access which should have been declared. Additionally, because it collects tool outputs, it could capture sensitive outputs from other skills without specifying safeguards.
Persistence & Privilege
always:false so it is not force-included, and disable-model-invocation is false (normal). However, the skill's design to auto-run hooks (if platform supported) plus broad file/tool access increases its potential blast radius. The skill doesn't request to modify other skills' configs explicitly, but its stated behavior (automatic updates to skills, create-pr) implies persistent influence over the codebase if granted write access.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install kay-self-improving
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /kay-self-improving 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
- Introduces a universal self-improving agent that continuously learns from all skill interactions using a multi-memory architecture (semantic, episodic, working). - Implements hooks-based automation to log sessions, trigger self-correction, and propose improvements after skill completion or errors. - Captures experiences, abstracts patterns, and updates reusable knowledge for skill evolution. - Provides structured memory storage for lessons (patterns), specific experiences, and active session context. - Supports both automatic and manual self-improvement triggers for broad adaptability.
元数据
Slug kay-self-improving
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

自我提升助手 是什么?

A universal self-improving agent that learns from ALL skill experiences. Uses multi-memory architecture (semantic + episodic + working) to continuously evolv... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 85 次。

如何安装 自我提升助手?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install kay-self-improving」即可一键安装,无需额外配置。

自我提升助手 是免费的吗?

是的,自我提升助手 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

自我提升助手 支持哪些平台?

自我提升助手 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 自我提升助手?

由 shenghoo123-png(@shenghoo123-png)开发并维护,当前版本 v0.1.0。

💬 留言讨论