Skill: zhaobudaoyuema/skill-self-evolution-enhancer (version 1.0.0)

--- name: skill-self-evolution-enhancer description: "Enables any skill to gain self-evolution capabilities. Use when: (1) User asks to add self-evolution to a skill, (2) User wants a skill to learn from feedback and errors, (3) Scaling self-improvement to multiple skills with per-skill evolution logic. Outputs domain-specific .learnings/, EVOLUTION.md, and Review-Apply-Report workflow." metadata: --- # Skill Self-Evolution Enhancer This skill enables **other skills** to gain self-evolution capabilities similar to self-improving-agent. A skill that originally has no self-evolution will, after enhancement, have: logging, learning from user feedback, promotion to rules, and a Review→Apply→Report loop—all tailored to its domain. ## Quick Reference | Step | Action | |------|--------| | User requests evolution for skill X | Read target skill's SKILL.md | | Deep analysis | Identify capabilities, scenarios, evolution directions | | Extract domain | Name, use cases, triggers, areas, promotion targets | | Generate .learnings/ | Domain-specific LEARNINGS.md, ERRORS.md, FEATURE_REQUESTS.md | | Generate EVOLUTION.md | Triggers, Review-Apply-Report, OpenClaw feedback rules | | Language | Match target skill's user language (infer from SKILL.md) | ## When to Use - User says: "给 skill X 加上自进化能力" / "Add self-evolution to skill X" - Scaling self-improvement across many skills (each with its own evolution direction) - Target skill is non-coding (e.g., 洗稿能手, 电脑加速) and needs domain-specific triggers ## Workflow ### Step 1: Read Target Skill ``` Read(target_skill_path/SKILL.md) ``` Obtain path from user or infer (e.g., `skills/xxx`, `~/.cursor/skills/xxx`). ### Step 2: Deep Capability & Scenario Analysis **Before generating** any config, analyze the target skill deeply: **Capabilities** (what the skill does): - Primary outputs and workflows - Secondary or edge capabilities - Dependencies (tools, APIs, formats) **Scenarios** (when and how it is used): - User personas - Typical tasks (e.g., 科普改写 vs 汇报改写) - Input/output patterns **Evolution directions** (what can improve): - User feedback patterns (e.g., "改得不通顺" → style) - Failure modes (e.g., "优化无效" → strategy) - Recurring corrections → domain-specific rules **Use cases** → infer from description, Quick Reference, examples ### Step 3: Extract Domain Config When reading the target skill, extract: | Field | Where to Find | Example | |-------|---------------|---------| | **Domain name** | `name` in frontmatter, title | 洗稿能手, 电脑加速 | | **Use cases / scenarios** | Description, Quick Reference, examples | 科普、汇报、直播 | | **Learning triggers** | User feedback phrases in examples | "改得不通顺", "不像口播", "风格不对" | | **Error triggers** | Failure modes | "优化无效", "某些电脑不适用", "报错" | | **Areas** | Output types, workflow stages | 文案/口播/短视频脚本, 或 系统优化/卡顿/报错 | | **Promotion targets** | Skill-specific rules | `{skill}-专属进化规则.md`, `{skill}-最佳实践.md` | **Language**: Infer from SKILL.md content (Chinese vs English). Generate all output files in that language. Use [assets/DOMAIN-CONFIG-TEMPLATE.md](assets/DOMAIN-CONFIG-TEMPLATE.md) to structure the extracted data. ### Step 4: Generate .learnings/ Create inside target skill directory: `target_skill_path/.learnings/` **Structure** (same as self-improving-agent): - `.learnings/LEARNINGS.md` - `.learnings/ERRORS.md` - `.learnings/FEATURE_REQUESTS.md` Use templates from `assets/`; parameterize with domain areas, categories, promotion targets. Write in the target skill's language. ### Step 5: Generate EVOLUTION.md Create `target_skill_path/EVOLUTION.md` using [assets/EVOLUTION-RULES-TEMPLATE.md](assets/EVOLUTION-RULES-TEMPLATE.md). **Must include**: - Quick Reference: domain triggers → actions - **Review→Apply→Report** loop (see below) - Detection triggers (when to log) - Promotion decision tree - Area tags - Domain-specific activation conditions (for hooks) - Experience invalidation / update rules (when user corrects again) ### Step 6: Optional – Activator Script If target skill has `scripts/`, add `scripts/activator.sh` with domain-specific reminder text. Adapt from self-improving-agent; replace generic prompts with domain triggers. ## Review → Apply → Report Loop The enhanced skill must **use** learnings, not only log them. Include this in EVOLUTION.md or the enhanced skill's instructions: ### Before Task - Load relevant entries from `.learnings/LEARNINGS.md` (and ERRORS.md if applicable) - Filter by area, tags, or keywords - Note which entries apply to the current task ### During Task - Apply learnings when relevant - Optionally annotate output: "本次参考了 [LRN-xxx]: ..." (or equivalent in target language) ### After Task - Summarize for user: which learnings were used, what evolution result, what improvement - Let OpenClaw decide: per-use mention vs end-of-task summary **Example** (Chinese): "本次改写了口播稿，参考了经验 [LRN-20250115-001]（科普场景应避免过于书面），相比之前更口语化。" **Example** (English): "Used learning [LRN-20250115-001] (avoid formal tone for科普) in this rewrite; output is more conversational than before." ## User Preference vs Domain Best Practice | Type | Storage | Example | |------|---------|---------| | **User preference** | MEMORY.md (user-level) | "This user prefers shorter sentences" | | **Domain best practice** | `.learnings/LEARNINGS.md` | "科普场景应避免过于书面" | Evolution is driven by **user feedback**; log and promote based on user corrections and recurring patterns. ## OpenClaw Active Feedback Add to the enhanced skill or SOUL.md/AGENTS.md: - When using experience from `.learnings/`, briefly tell the user - At end of task, optionally summarize: evolution used, improvements - Let OpenClaw decide when to surface (per-use vs summary) See [references/openclaw-feedback.md](references/openclaw-feedback.md) for SOUL.md and AGENTS.md snippets. ## Experience Invalidation & Update When user corrects again after a learning was applied: - Add `Contradicted-By: LRN-YYYYMMDD-XXX` to the original entry - Mark `Last-Valid` or `Status: superseded` if the learning is no longer valid - Increment `Recurrence-Count` if the pattern recurs but the fix is different Include in LEARNINGS template: `Recurrence-Count`, `Last-Valid`, `Contradicted-By`. ## Domain Extraction Framework ### Trigger Extraction **Learning triggers** (user feedback → log to LEARNINGS.md): - Look for: "用户说", "when user says", example dialogs - Infer: common corrections, style mismatches, scene-specific preferences - Add generic fallbacks: "不对", "不是这样", "改一下" **Error triggers** (failures → log to ERRORS.md): - Look for: "失败", "报错", "不适用", "when X fails" - Infer: environment-specific failures, edge cases - Add generic fallbacks: "操作失败", "未达到预期" ### Area Mapping Define 3–6 areas that partition the skill's scope. Use domain-specific areas, not coding areas. ### Promotion Target Naming - `{skill-name}-专属进化规则.md` — evolution rules, style preferences - `{skill-name}-最佳实践.md` — best practices - `{skill-name}-安全规范.md` — safety constraints (e.g., 电脑加速) Use kebab-case for skill name in filenames. ## Logging Format (Reuse from Self-Improving-Agent) ID format: `LRN-YYYYMMDD-XXX`, `ERR-YYYYMMDD-XXX`, `FEAT-YYYYMMDD-XXX` Statuses: `pending` | `in_progress` | `resolved` | `wont_fix` | `promoted` | `promoted_to_skill` For full entry formats, see the self-improving-agent skill's Logging Format section. ## References - [assets/DOMAIN-CONFIG-TEMPLATE.md](assets/DOMAIN-CONFIG-TEMPLATE.md) — Schema for domain config - [assets/EVOLUTION-RULES-TEMPLATE.md](assets/EVOLUTION-RULES-TEMPLATE.md) — EVOLUTION.md template - [references/domain-examples.md](references/domain-examples.md) — 洗稿能手, 电脑加速 examples - [references/openclaw-feedback.md](references/openclaw-feedback.md) — SOUL.md, AGENTS.md snippets for active feedback - [scripts/generate-evolution.sh](scripts/generate-evolution.sh) — Optional scaffold generator ## Source - Based on: self-improving-agent 3.0.1 - Purpose: Enable any skill to gain self-evolution capabilities similar to self-improving-agent

path: assets/DOMAIN-CONFIG-TEMPLATE.md
content: # Domain Config for: [skill-name]

Fill this template when extracting domain from a target skill. Use the extracted values to parameterize LEARNINGS.md, ERRORS.md, FEATURE_REQUESTS.md, and EVOLUTION.md.

## Capability & Scenario Analysis (before extraction)

**Capabilities** (what the skill does):
- Primary outputs:
- Secondary/edge capabilities:
- Dependencies:

**Scenarios** (when and how it is used):
- User personas:
- Typical tasks:
- Input/output patterns:

**Evolution directions** (what can improve):
- User feedback patterns:
- Failure modes:
- Recurring corrections → domain rules:

---

## Domain

- **Name**: (human-readable domain name, e.g., 洗稿能手, 电脑加速)
- **Use cases**: (comma-separated scenarios, e.g., 科普、汇报、直播)
- **Areas**: (domain-specific areas for filtering, e.g., 文案 | 口播 | 短视频脚本)
- **Language**: (target language for generated files: zh | en)

## Learning Triggers (user feedback phrases)

Phrases that indicate user correction or style mismatch → log to LEARNINGS.md:

- "phrase1"
- "phrase2"
- "phrase3"

## Error Triggers (failure modes)

Situations that indicate operation failure → log to ERRORS.md:

- failure1
- failure2
- failure3

## Promotion Targets

Files to promote learnings to when they prove broadly applicable:

- **专属进化规则**: [skill-name]-专属进化规则.md
- **最佳实践 / 安全规范**: [skill-name]-最佳实践.md (or [skill-name]-安全规范.md)

## Domain Categories (optional)

If the skill needs categories beyond correction | insight | knowledge_gap | best_practice:

- category1
- category2

## Notes

- Use kebab-case for skill-name in file paths
- Areas should partition the skill's output/workflow scope
- Add 3+ learning triggers and 2+ error triggers for effective capture
- Storage: same as self-improving-agent — `.learnings/` directly (LEARNINGS.md, ERRORS.md, FEATURE_REQUESTS.md)


path: assets/ERRORS-TEMPLATE.md
content: # Errors Log

{DOMAIN_DESCRIPTION}

**Areas**: {DOMAIN_AREAS}
**Statuses**: pending | in_progress | resolved | wont_fix

## Error Entry Format

Append entries in this format:

```markdown
## [ERR-YYYYMMDD-XXX] operation_or_error_type

**Logged**: ISO-8601 timestamp
**Priority**: high
**Status**: pending
**Area**: {DOMAIN_AREAS_EXAMPLE}

### Summary
Brief description of what failed

### Error
```
Actual error message or output
```

### Context
- Operation attempted
- Input or parameters used
- Environment details if relevant

### Suggested Fix
If identifiable, what might resolve this

### Metadata
- Reproducible: yes | no | unknown
- Related Files: path/to/file.ext
- See Also: ERR-YYYYMMDD-XXX (if recurring)

---
```

## Placeholders to Replace

- `{DOMAIN_DESCRIPTION}`: e.g., "Operation failures, exceptions, and unexpected behaviors for [skill-name]."
- `{DOMAIN_AREAS}`: e.g., "文案 | 口播 | 短视频脚本" or "系统优化 | 卡顿 | 报错"
- `{DOMAIN_AREAS_EXAMPLE}`: One example area from the list

---


path: assets/EVOLUTION-RULES-TEMPLATE.md
content: # [Skill Name] Evolution Rules

Domain-specific self-improvement rules for [skill-name]. Log learnings and errors to `.learnings/`; promote proven patterns to the targets below. **Evolution is driven by user feedback.**

## Quick Reference

| Situation | Action |
|-----------|--------|
| {LEARNING_TRIGGER_1} | Log to `.learnings/LEARNINGS.md` with category `correction` or `style_mismatch` |
| {LEARNING_TRIGGER_2} | Log to `.learnings/LEARNINGS.md` |
| {ERROR_TRIGGER_1} | Log to `.learnings/ERRORS.md` |
| {ERROR_TRIGGER_2} | Log to `.learnings/ERRORS.md` |
| User wants missing capability | Log to `.learnings/FEATURE_REQUESTS.md` |
| Pattern proven across 3+ instances | Promote to {PROMOTION_TARGET_1} |
| Safety/correctness rule | Promote to {PROMOTION_TARGET_2} |

## Review → Apply → Report Loop

**Before task**: Load relevant entries from `.learnings/LEARNINGS.md` (and ERRORS.md if applicable). Filter by area, tags, or keywords.

**During task**: Apply learnings when relevant. Optionally annotate: "本次参考了 [LRN-xxx]: ..." (or equivalent in target language).

**After task**: Tell user which learnings were used, what evolution result, what improvement. Decide per-use mention vs end-of-task summary based on context.

## Detection Triggers

### Learning Triggers (→ LEARNINGS.md)

- {LEARNING_TRIGGER_1}
- {LEARNING_TRIGGER_2}
- {LEARNING_TRIGGER_3}
- User provides correction or preference
- Better approach discovered for recurring task

### Error Triggers (→ ERRORS.md)

- {ERROR_TRIGGER_1}
- {ERROR_TRIGGER_2}
- {ERROR_TRIGGER_3}
- Operation fails unexpectedly
- Unexpected output or behavior

## Domain Activation Conditions (for hooks)

When to remind the agent to check learnings:

- {ACTIVATION_CONDITION_1}
- {ACTIVATION_CONDITION_2}

## Promotion Decision Tree

```
Is the learning skill-specific?
├── Yes → Keep in .learnings/
└── No → Is it style/behavior-related?
    ├── Yes → Promote to {PROMOTION_TARGET_1}
    └── No → Is it safety/correctness-related?
        ├── Yes → Promote to {PROMOTION_TARGET_2}
        └── No → Promote to {PROMOTION_TARGET_1}
```

## Experience Invalidation & Update

When user corrects again after a learning was applied:

- Add `Contradicted-By: LRN-YYYYMMDD-XXX` to the original entry
- Mark `Status: superseded` or `Last-Valid: YYYY-MM-DD` if the learning is no longer valid
- Increment `Recurrence-Count` if the pattern recurs but the fix is different

## Area Tags

| Area | Scope |
|------|-------|
| {AREA_1} | {AREA_1_SCOPE} |
| {AREA_2} | {AREA_2_SCOPE} |
| {AREA_3} | {AREA_3_SCOPE} |

## Priority Guidelines

| Priority | When to Use |
|----------|-------------|
| `critical` | Blocks core functionality, safety risk |
| `high` | Significant impact, affects common workflows |
| `medium` | Moderate impact, workaround exists |
| `low` | Minor inconvenience, edge case |

## Promotion Targets

- **{PROMOTION_TARGET_1}**: Evolution rules, style preferences, best practices
- **{PROMOTION_TARGET_2}**: Safety guidelines, correctness rules (if applicable)

## Placeholders to Replace

- `[skill-name]`, `[Skill Name]`: Domain name
- `{LEARNING_TRIGGER_1}`, `{LEARNING_TRIGGER_2}`, `{LEARNING_TRIGGER_3}`: User feedback phrases from domain config
- `{ERROR_TRIGGER_1}`, `{ERROR_TRIGGER_2}`, `{ERROR_TRIGGER_3}`: Failure modes from domain config
- `{ACTIVATION_CONDITION_1}`, `{ACTIVATION_CONDITION_2}`: Domain-specific activation (e.g., "User says 改得不通顺", "Optimization reported无效")
- `{PROMOTION_TARGET_1}`, `{PROMOTION_TARGET_2}`: e.g., `[skill-name]-专属进化规则.md`, `[skill-name]-最佳实践.md`
- `{AREA_1}`, `{AREA_2}`, `{AREA_3}`: Domain areas
- `{AREA_1_SCOPE}`, etc.: Brief scope description for each area


path: assets/FEATURE_REQUESTS-TEMPLATE.md
content: # Feature Requests

{DOMAIN_DESCRIPTION}

**Areas**: {DOMAIN_AREAS}
**Statuses**: pending | in_progress | resolved | wont_fix

## Feature Request Entry Format

Append entries in this format:

```markdown
## [FEAT-YYYYMMDD-XXX] capability_name

**Logged**: ISO-8601 timestamp
**Priority**: medium
**Status**: pending
**Area**: {DOMAIN_AREAS_EXAMPLE}

### Requested Capability
What the user wanted to do

### User Context
Why they needed it, what problem they're solving

### Complexity Estimate
simple | medium | complex

### Suggested Implementation
How this could be built, what it might extend

### Metadata
- Frequency: first_time | recurring
- Related Features: existing_feature_name

---
```

## Placeholders to Replace

- `{DOMAIN_DESCRIPTION}`: e.g., "Capabilities requested by user that don't currently exist for [skill-name]."
- `{DOMAIN_AREAS}`: e.g., "文案 | 口播 | 短视频脚本" or "系统优化 | 卡顿 | 报错"
- `{DOMAIN_AREAS_EXAMPLE}`: One example area from the list

---


path: assets/LEARNINGS-TEMPLATE.md
content: # Learnings

{DOMAIN_DESCRIPTION}

**Categories**: {DOMAIN_CATEGORIES}
**Areas**: {DOMAIN_AREAS}
**Statuses**: pending | in_progress | resolved | wont_fix | promoted | promoted_to_skill | superseded

## Status Definitions

| Status | Meaning |
|--------|---------|
| `pending` | Not yet addressed |
| `in_progress` | Actively being worked on |
| `resolved` | Issue fixed or knowledge integrated |
| `wont_fix` | Decided not to address (reason in Resolution) |
| `promoted` | Elevated to {PROMOTION_TARGETS} |
| `promoted_to_skill` | Extracted as a reusable skill |
| `superseded` | User corrected again; this learning is no longer valid |

## Learning Entry Format

Append entries in this format:

```markdown
## [LRN-YYYYMMDD-XXX] category

**Logged**: ISO-8601 timestamp
**Priority**: low | medium | high | critical
**Status**: pending
**Area**: {DOMAIN_AREAS_EXAMPLE}

### Summary
One-line description of what was learned

### Details
Full context: what happened, what was wrong, what's correct

### Suggested Action
Specific fix or improvement to make

### Metadata
- Source: conversation | error | user_feedback
- Related Files: path/to/file.ext
- Tags: tag1, tag2
- See Also: LRN-YYYYMMDD-XXX (if related to existing entry)
- Recurrence-Count: 1 (optional, bump when pattern recurs)
- Last-Valid: YYYY-MM-DD (optional, when user contradicted)
- Contradicted-By: LRN-YYYYMMDD-XXX (optional, when superseded)

---
```

## Placeholders to Replace

- `{DOMAIN_DESCRIPTION}`: e.g., "Corrections, insights, and style preferences captured for [skill-name]."
- `{DOMAIN_CATEGORIES}`: e.g., "correction | insight | knowledge_gap | best_practice | style_mismatch | scene_adaptation"
- `{DOMAIN_AREAS}`: e.g., "文案 | 口播 | 短视频脚本" or "系统优化 | 卡顿 | 报错"
- `{DOMAIN_AREAS_EXAMPLE}`: One example area from the list
- `{PROMOTION_TARGETS}`: e.g., "[skill-name]-专属进化规则.md, [skill-name]-最佳实践.md"

---


path: README.md
content: # Skill Self-Evolution Enhancer

A Cursor skill that enables **any skill** to gain self-evolution capabilities. Based on self-improving-agent, it equips skills with: logging, learning from user feedback, promotion of experience to rules, and a Review→Apply→Report loop—all tailored to the target skill's domain.

[中文](README.zh.md)

## Features

- **Domain analysis**: Deep analysis of target skill's capabilities, scenarios, and evolution directions
- **Generate .learnings/**: Domain-specific LEARNINGS.md, ERRORS.md, FEATURE_REQUESTS.md
- **Generate EVOLUTION.md**: Triggers, Review-Apply-Report workflow, OpenClaw feedback rules
- **Multi-skill scaling**: Support multiple skills, each with its own evolution logic

## When to Use

- User says: "Add self-evolution to skill X"
- Scaling self-improvement across many skills (each with its own evolution direction)
- Target skill is non-coding (e.g., content rewriting, system optimization) and needs domain-specific triggers

## Quick Start

1. Enable this skill in Cursor
2. Provide the target skill's path (e.g., `skills/xxx`, `~/.cursor/skills/xxx`)
3. Follow the flow: Read target skill → Domain analysis → Generate .learnings/ and EVOLUTION.md

## Structure

```
skill-self-evolution-enhancer/
├── SKILL.md              # Main skill doc
├── assets/               # Templates
│   ├── DOMAIN-CONFIG-TEMPLATE.md
│   ├── EVOLUTION-RULES-TEMPLATE.md
│   ├── LEARNINGS-TEMPLATE.md
│   ├── ERRORS-TEMPLATE.md
│   └── FEATURE_REQUESTS-TEMPLATE.md
├── references/           # Examples
│   ├── domain-examples.md
│   └── openclaw-feedback.md
└── scripts/
    └── generate-evolution.sh   # Optional scaffold generator
```

## References

- [SKILL.md](SKILL.md) — Full workflow and documentation
- [references/domain-examples.md](references/domain-examples.md) — Domain examples (e.g., content rewriting, system optimization)

## Source

- Based on: self-improving-agent 3.0.1
- Purpose: Enable any skill to gain self-evolution capabilities similar to self-improving-agent


path: README.zh.md
content: # Skill Self-Evolution Enhancer

为任意 Cursor Skill 赋予自进化能力的增强技能。基于 self-improving-agent，让原本不具备自进化的技能获得：日志记录、从用户反馈学习、经验提升为规则、以及 Review→Apply→Report 循环——全部按目标技能的领域定制。

[English](README.md)

## 功能

- **领域分析**：深度分析目标技能的能力、场景与进化方向
- **生成 .learnings/**：领域化的 LEARNINGS.md、ERRORS.md、FEATURE_REQUESTS.md
- **生成 EVOLUTION.md**：触发条件、Review-Apply-Report 流程、OpenClaw 反馈规则
- **多技能扩展**：支持为多个技能分别配置各自的进化逻辑

## 使用场景

- 用户说：「给 skill X 加上自进化能力」
- 需要将自改进能力扩展到多个技能（每个技能有独立进化方向）
- 目标技能为非编程类（如洗稿能手、电脑加速），需要领域特定的触发条件

## 快速开始

1. 在 Cursor 中启用本技能
2. 提供目标技能的路径（如 `skills/xxx`、`~/.cursor/skills/xxx`）
3. 按提示完成：读取目标技能 → 领域分析 → 生成 .learnings/ 与 EVOLUTION.md

## 目录结构

```
skill-self-evolution-enhancer/
├── SKILL.md              # 技能主文档
├── assets/               # 模板
│   ├── DOMAIN-CONFIG-TEMPLATE.md
│   ├── EVOLUTION-RULES-TEMPLATE.md
│   ├── LEARNINGS-TEMPLATE.md
│   ├── ERRORS-TEMPLATE.md
│   └── FEATURE_REQUESTS-TEMPLATE.md
├── references/           # 参考示例
│   ├── domain-examples.md
│   └── openclaw-feedback.md
└── scripts/
    └── generate-evolution.sh   # 可选脚手架生成脚本
```

## 参考

- [SKILL.md](SKILL.md) — 完整工作流与说明
- [references/domain-examples.md](references/domain-examples.md) — 洗稿能手、电脑加速等示例

## 来源

- 基于：self-improving-agent 3.0.1
- 用途：让任意技能获得与 self-improving-agent 类似的自进化能力


path: references/domain-examples.md
content: # Domain Examples

Concrete examples for extracting domain config and generating evolution scaffolding. Use these as reference when enhancing skills.

---

## Example 1: 洗稿能手 (Content Rewriting Skill)

**Domain**: 文案 / 口播 / 短视频脚本改写

### Capability & Scenario Analysis

- **Capabilities**: Rewrite text for different formats (文案, 口播, 短视频); adapt style by scene (科普, 汇报, 直播)
- **Scenarios**: User provides source text; requests rewrite for specific format/scene; may correct style
- **Evolution directions**: User feedback on style ("不通顺", "不像口播") → learn scene-specific preferences; recurring corrections → promote to 专属进化规则

### Domain Config

```markdown
## Domain
- Name: 洗稿能手
- Use cases: 科普, 汇报, 直播, 短视频脚本, 口播稿
- Areas: 文案 | 口播 | 短视频脚本 | 科普 | 汇报 | 直播
- Language: zh

## Learning Triggers
- "改得不通顺"
- "不像口播"
- "风格不对"
- "太书面了"
- "读起来不顺"
- "语气不对"

## Error Triggers
- 改写后用户多次要求重改
- 风格与场景不匹配（如科普写成汇报风）
- 口播稿读起来拗口

## Promotion Targets
- 洗稿能手-专属进化规则.md
- 洗稿能手-最佳实践.md
```

### Generated EVOLUTION.md Quick Reference

| Situation | Action |
|-----------|--------|
| 用户说"改得不通顺" | Log to `.learnings/LEARNINGS.md` with category `style_mismatch` |
| 用户说"不像口播" | Log to `.learnings/LEARNINGS.md` with category `scene_adaptation` |
| 用户说"风格不对" | Log to `.learnings/LEARNINGS.md` with category `correction` |
| 改写后多次重改 | Log to `.learnings/ERRORS.md` |
| 风格与场景不匹配 | Log to `.learnings/LEARNINGS.md` with area 科普/汇报/直播 |

### Domain Categories

- correction
- style_mismatch
- scene_adaptation
- best_practice
- knowledge_gap

### Activation Conditions

- User says "改得不通顺", "不像口播", "风格不对"
- User requests rewrite for a specific scene (科普/汇报/直播)

---

## Example 2: 电脑加速 (PC Optimization Skill)

**Domain**: Windows 优化 / 卡慢 / 卡顿

### Capability & Scenario Analysis

- **Capabilities**: System optimization, startup speed, memory release; diagnose slowdowns
- **Scenarios**: User reports slow PC; agent suggests optimizations; some may fail or cause issues
- **Evolution directions**: "优化无效", "某些电脑不适用" → learn environment-specific solutions; safety issues → promote to 安全规范

### Domain Config

```markdown
## Domain
- Name: 电脑加速
- Use cases: 系统优化, 卡顿排查, 启动加速, 内存释放
- Areas: 系统优化 | 卡顿 | 报错 | 兼容性 | 安全
- Language: zh

## Learning Triggers
- "优化无效"
- "某些电脑不适用"
- "这样改有问题"
- "上次的方法不行"

## Error Triggers
- 优化后系统报错
- 某些电脑/系统版本不适用
- 操作导致异常或蓝屏
- 命令执行失败

## Promotion Targets
- 电脑加速-安全规范.md
- 电脑加速-最佳实践.md
```

### Generated EVOLUTION.md Quick Reference

| Situation | Action |
|-----------|--------|
| 用户说"优化无效" | Log to `.learnings/ERRORS.md` with area 系统优化 |
| 用户说"某些电脑不适用" | Log to `.learnings/LEARNINGS.md` with category `knowledge_gap` |
| 优化后报错 | Log to `.learnings/ERRORS.md` with area 报错 |
| 发现安全风险 | Log to `.learnings/LEARNINGS.md`, promote to 电脑加速-安全规范.md |

### Domain Categories

- correction
- knowledge_gap
- best_practice
- safety_constraint

### Activation Conditions

- User reports "优化无效", "报错", "某些电脑不适用"
- After suggesting optimization steps

---

## Extraction Tips

1. **Sparse skills**: If the target skill has little content, infer from the name and description. Add generic triggers like "用户纠正", "操作失败".
2. **Coding skills**: Use areas like frontend | backend | infra if the skill is coding-related; otherwise use domain-specific areas.
3. **Safety-critical domains** (e.g., 电脑加速): Always include a 安全规范 promotion target.
4. **Style domains** (e.g., 洗稿能手): Include style_mismatch, scene_adaptation categories.
5. **Language**: Infer from SKILL.md; generate all output in that language.


path: references/openclaw-feedback.md
content: # OpenClaw Active Feedback Integration

When a skill is enhanced with self-evolution, the agent must **tell the user** when experience was used and what improvement resulted. Add these snippets to SOUL.md or AGENTS.md in the OpenClaw workspace (or to the enhanced skill's EVOLUTION.md) so OpenClaw proactively surfaces evolution feedback.

## SOUL.md Snippet (Behavioral Guidelines)

```markdown
## Self-Evolution Feedback

When using experience from `.learnings/` (LEARNINGS.md, ERRORS.md):

1. **During task**: Optionally mention when a learning was applied: "本次参考了经验 [LRN-xxx]: ..."
2. **After task**: Summarize when relevant: which learnings were used, what evolution result, what improvement
3. **Decide contextually**: Per-use mention vs end-of-task summary — choose based on task length and user need

Do not leave the user in the dark. If evolution was used, surface it at an appropriate moment.
```

## AGENTS.md Snippet (Workflow)

```markdown
## Self-Evolution Workflow

Before using an enhanced skill:
1. Load relevant entries from `.learnings/LEARNINGS.md` (filter by area/tags)
2. Apply learnings during the task
3. After completing the task, evaluate: did we use any learnings?
   - If yes: Tell the user (per-use or summary, decide based on context)
   - Include: which entries, what improvement
```

## EVOLUTION.md Integration

When generating EVOLUTION.md for an enhanced skill, include a section:

```markdown
## OpenClaw Feedback

When this skill uses experience from .learnings/:
- Mention to user: which learning was used, what improvement
- Let OpenClaw decide: per-use mention vs end-of-task summary
- Example: "本次改写了口播稿，参考了 [LRN-xxx]（科普场景应避免过于书面），相比之前更口语化。"
```

## Hook Reminder (Optional)

For domain-specific activation, the activator script can remind:

```bash
# In scripts/activator.sh for the enhanced skill
cat << 'EOF'
<self-evolution-reminder>
After this task, if you used any entries from .learnings/:
- Tell the user which learnings were applied
- Summarize the evolution result and improvement
</self-evolution-reminder>
EOF
```


path: scripts/generate-evolution.sh
content: #!/bin/bash
# Skill Self-Evolution Scaffold Generator
# Creates .learnings/ and template files in a target skill for domain-specific self-improvement.
# Usage: ./generate-evolution.sh <target-skill-path> [--dry-run]
#
# Part of skill-self-evolution-enhancer. The agent should then:
# 1. Read the target skill's SKILL.md
# 2. Perform deep capability & scenario analysis
# 3. Fill DOMAIN-CONFIG-DRAFT.md with extracted domain
# 4. Parameterize and finalize .learnings/ files and EVOLUTION.md
# 5. Add Review→Apply→Report and OpenClaw feedback rules

set -e

# Resolve script directory (skill-self-evolution-enhancer/scripts/)
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ASSETS_DIR="$(cd "$SCRIPT_DIR/../assets" && pwd)"

# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'

usage() {
    cat << EOF
Usage: $(basename "$0") <target-skill-path> [options]

Create self-evolution scaffolding in a target skill. Output structure matches self-improving-agent:
  target-skill/.learnings/LEARNINGS.md, ERRORS.md, FEATURE_REQUESTS.md

Arguments:
  target-skill-path   Path to the skill directory (e.g., ./skills/my-skill, ~/skills/rewrite-master)

Options:
  --dry-run          Show what would be created without creating files
  -h, --help         Show this help message

Examples:
  $(basename "$0") ./skills/rewrite-master
  $(basename "$0") ~/.cursor/skills/pc-optimizer --dry-run

Output:
  - target-skill/.learnings/LEARNINGS.md, ERRORS.md, FEATURE_REQUESTS.md (with placeholders)
  - target-skill/DOMAIN-CONFIG-DRAFT.md (for agent to fill)
  - target-skill/EVOLUTION.md (with placeholders)
EOF
}

log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2; }

# Parse arguments
TARGET_PATH=""
DRY_RUN=false

while [[ $# -gt 0 ]]; do
    case $1 in
        --dry-run)
            DRY_RUN=true
            shift
            ;;
        -h|--help)
            usage
            exit 0
            ;;
        -*)
            log_error "Unknown option: $1"
            usage
            exit 1
            ;;
        *)
            if [ -z "$TARGET_PATH" ]; then
                TARGET_PATH="$1"
            else
                log_error "Unexpected argument: $1"
                usage
                exit 1
            fi
            shift
            ;;
    esac
done

if [ -z "$TARGET_PATH" ]; then
    log_error "Target skill path is required"
    usage
    exit 1
fi

# Resolve to absolute path
TARGET_PATH="$(cd "$TARGET_PATH" 2>/dev/null && pwd)" || {
    log_error "Target path does not exist or is not accessible: $TARGET_PATH"
    exit 1
}

# Validate target has SKILL.md
if [ ! -f "$TARGET_PATH/SKILL.md" ]; then
    log_error "Target skill must have SKILL.md: $TARGET_PATH/SKILL.md"
    exit 1
fi

# Validate assets exist
for f in DOMAIN-CONFIG-TEMPLATE.md LEARNINGS-TEMPLATE.md ERRORS-TEMPLATE.md FEATURE_REQUESTS-TEMPLATE.md EVOLUTION-RULES-TEMPLATE.md; do
    if [ ! -f "$ASSETS_DIR/$f" ]; then
        log_error "Missing asset: $ASSETS_DIR/$f"
        exit 1
    fi
done

# Same structure as self-improving-agent: .learnings/ directly
LEARNINGS_DIR="$TARGET_PATH/.learnings"

if [ "$DRY_RUN" = true ]; then
    log_info "Dry run - would create:"
    echo "  $LEARNINGS_DIR/"
    echo "  $LEARNINGS_DIR/LEARNINGS.md (from LEARNINGS-TEMPLATE.md, placeholders)"
    echo "  $LEARNINGS_DIR/ERRORS.md (from ERRORS-TEMPLATE.md, placeholders)"
    echo "  $LEARNINGS_DIR/FEATURE_REQUESTS.md (from FEATURE_REQUESTS-TEMPLATE.md, placeholders)"
    echo "  $TARGET_PATH/DOMAIN-CONFIG-DRAFT.md (from DOMAIN-CONFIG-TEMPLATE.md)"
    echo "  $TARGET_PATH/EVOLUTION.md (from EVOLUTION-RULES-TEMPLATE.md, placeholders)"
    echo ""
    log_info "Agent should: 1) Read SKILL.md 2) Deep analysis 3) Fill DOMAIN-CONFIG-DRAFT.md 4) Replace placeholders"
    exit 0
fi

# Create .learnings/
log_info "Creating $LEARNINGS_DIR/"
mkdir -p "$LEARNINGS_DIR"

# Copy templates with generic placeholders (agent fills domain-specific values later)
log_info "Creating LEARNINGS.md, ERRORS.md, FEATURE_REQUESTS.md"
cp "$ASSETS_DIR/LEARNINGS-TEMPLATE.md" "$LEARNINGS_DIR/LEARNINGS.md"
cp "$ASSETS_DIR/ERRORS-TEMPLATE.md" "$LEARNINGS_DIR/ERRORS.md"
cp "$ASSETS_DIR/FEATURE_REQUESTS-TEMPLATE.md" "$LEARNINGS_DIR/FEATURE_REQUESTS.md"

# Create DOMAIN-CONFIG-DRAFT.md for agent to fill
SKILL_NAME=$(basename "$TARGET_PATH")
sed "s/\[skill-name\]/$SKILL_NAME/g" "$ASSETS_DIR/DOMAIN-CONFIG-TEMPLATE.md" > "$TARGET_PATH/DOMAIN-CONFIG-DRAFT.md"
log_info "Created DOMAIN-CONFIG-DRAFT.md (agent should fill this)"

# Create EVOLUTION.md with placeholders
cp "$ASSETS_DIR/EVOLUTION-RULES-TEMPLATE.md" "$TARGET_PATH/EVOLUTION.md"
log_info "Created EVOLUTION.md (agent should replace placeholders)"

echo ""
log_info "Scaffold created successfully!"
echo ""
echo "Next steps:"
echo "  1. Read $TARGET_PATH/SKILL.md and perform deep capability & scenario analysis"
echo "  2. Fill $TARGET_PATH/DOMAIN-CONFIG-DRAFT.md with extracted domain config"
echo "  3. Replace placeholders in .learnings/*.md and EVOLUTION.md using the domain config"
echo "  4. Ensure language of generated files matches target skill's user language"
echo "  5. Add Review→Apply→Report and OpenClaw feedback rules (see references/openclaw-feedback.md)"


path: _meta.json
content: slug: skill-self-evolution-enhancer
version: 1.0.0
publishedAt: 1731340800000

Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)