每日备份 2026-06-10 12:57:13

This commit is contained in:
root-backup committed 2026-06-10 12:57:14 +08:00
1 parent fda2ccb8c2
commit 3d2e638c6a
244 files changed
+58890 -3

No files matched your search

@@ -0,0 +1,7 @@
{
"version": 1,
"registry": "https://clawhub.ai",
"slug": "skill-self-evolution-enhancer",
"installedVersion": "1.0.0",
"installedAt": 1773868802966
}
@@ -0,0 +1,213 @@
# Errors
Error logs and failure patterns for **skill-self-evolution-enhancer**.
**Categories**: timeout | context_overhead | missing_data | workflow_error
**Statuses**: pending | in_progress | resolved | wont_fix | promoted
## Status Definitions
| Status | Meaning |
|--------|---------|
| `pending` | Not yet addressed |
| `in_progress` | Actively being worked on |
| `resolved` | Issue fixed or workaround found |
| `wont_fix` | Decided not to address |
| `promoted` | Elevated to evolution rules |
## Error Entry Format
```markdown
## [ERR-YYYYMMDD-XXX] category
**Logged**: ISO-8601 timestamp
**Priority**: low | medium | high | critical
**Status**: pending
**Area**: 领域
### Summary
One-line description
### Details
Full context
### Root Cause
Likely cause if known
### Workaround
What was tried or could be tried
### Metadata
- Source: error_log | user_report | test
- Tags: tag1, tag2
- Recurrence-Count: 1
---
```
## [ERR-20260326-001] cron_timeout_context_overhead
**Logged**: 2026-03-26T04:14:00Z
**Priority**: high
**Status**: resolved
**Area**: cron任务调度
### Summary
cron agentTurn timeout设置120s但实际超时,原因是session上下文大(205k)导致agent处理慢
### Details
- 脚本 `evolution-report.sh` 本身执行仅需 4秒
- 但 cron agentTurn 报告超时 120028ms(连续3次)
- session 状态显示: `unknown/205k (?%)` 说明上下文很大
- 日志分析显示脚本实际在 4s 内完成
### Root Cause
timeoutSeconds 设置的是 cron job 的硬性超时,但 OpenClaw agent 处理大上下文时初始化+推理本身就耗时很长,与实际脚本执行时间无关
### Workaround
将 `timeoutSeconds` 从 120 降到 60(脚本只需4s,60s足够让agent初始化完成)
已对 `dbd84977`(GitHub进化猎手)和 `b0afa4db`(日志清理)应用修复
### Metadata
- Source: heartbeat_analysis
- Tags: cron, timeout, context-size, self-healing
- Recurrence-Count: 3
- See Also: HEARTBEAT.md
---
## [ERR-20260326-002] resource_guard_cpu_parsing_bug
**Logged**: 2026-03-26T09:25:00Z
**Priority**: high
**Status**: resolved
**Area**: 资源监控
### Summary
资源守卫脚本CPU解析bug:int($2)对"4.5"返回0,显示95%而非5%
### Details
- `top -bn1 | grep "Cpu(s)"` 输出: `4.5 us, 0.0 sy, 0.0 ni, 95.5 id`
- 脚本用 `awk '{print int($2)}'` 取字段2,得到 `4.5`,但 `int("4.5")` 在awk中返回 0
- 导致 CPU 显示为 idle 字段值(95%),实际是空闲95%,使用仅5%
### Root Cause
awk int()函数对含小数点的字符串处理有误,且脚本逻辑不对:应该用 idle 计算使用率,而非直接取us字段
### Workaround
修改为 `cpu_usage=$(top -bn1 | grep "Cpu(s)" | awk '{print int($8)}')` 然后 `cpu_usage=$((100 - cpu_usage))`
### Metadata
- Source: heartbeat_false_alarm
- Tags: monitoring, awk, parsing
- Recurrence-Count: 1
- File: /home/yh6788/.openclaw/scripts/resource-guard.sh
---
## [ERR-20260326-002] camoufox_browse_headless_crash
**Logged**: 2026-03-26T14:01:00Z
**Priority**: high
**Status**: resolved
**Area**: 浏览器自动化
### Summary
camoufox browse.py 硬编码 headless=False,在服务器上会卡住等待用户输入
### Details
- 原脚本最后有 input("Press Enter to close..."),headless模式下无法交互
- 原脚本没有 headless 参数选项
- camoufox 安装在 ~/.local/lib/python3.13/site-packages/,不在 venv 里
### Root Cause
脚本设计假设在有GUI环境运行,未考虑服务器无头模式
### Workaround
修复后的 browse.py:
1. 添加 --headless 参数
2. 无DISPLAY时自动启用headless
3. headless模式下跳过等待用户输入
4. 添加 USER_SITE 路径到 sys.path
### Metadata
- Source: self_discovery
- Tags: camoufox, headless, server
- Recurrence-Count: 1
- See Also: camoufox/scripts/browse.py
---
## [ERR-20260327-001] log_cleaner_timeout
**Logged**: 2026-03-27T18:35:00Z
**Priority**: high
**Status**: resolved
**Area**: cron任务调度
### Summary
日志清理脚本本身只需1.3秒,但cron timeout 60秒仍超时
### Root Cause
同GitHub进化猎手问题:agent初始化(含session加载、context初始化)耗时远超脚本执行时间
### Workaround
将timeout从60s降到30s,脚本仅需1.3s,30s足够agent初始化完成
### Metadata
- Source: heartbeat_check
- Tags: cron, timeout, agent-initialization
- Recurrence-Count: 2
- See Also: ERR-20260326-001
---
## [ERR-20260327-001] cron_timeout_agent_context_overhead_v2
**Logged**: 2026-03-27T03:05:00Z
**Priority**: high
**Status**: resolved
**Area**: cron任务调度
### Summary
降低cron timeout反而导致更多超时:agent加载205k上下文需要60-120s
### Details
- 脚本本身执行只需 1.2 秒
- 但 agent 加载 205k 上下文需要 60-120s
- 60s timeout: 持续超时
- 180s timeout: 足够agent初始化完成
### Root Cause
OpenClaw agentTurn timeout 指的是 agent 整个执行周期,不是脚本执行时间。agent 需要时间初始化大上下文 session。
### Workaround
对于简单脚本任务,timeout 应设置为 120-300s,保证 agent 有足够时间初始化后再执行脚本
### Metadata
- Source: heartbeat_analysis
- Tags: cron, timeout, context-size, agent-overhead
- Recurrence-Count: 2
- See Also: ERR-20260326-001
---
## 2026-03-27 日志清理超时问题
**问题**: log-cleaner.sh 连续2次 timeout(cron 设置 60s)
**根因**: 逐文件循环 `stat` + 条件判断,大目录极慢
**解决方案**: 改用 `find -mtime +N -print -delete` 批量操作,timeout 提升至 120s
**进化**: 脚本已优化,cron 已更新
## 日志清理脚本超时问题 (2026-03-27)
**问题**: 日志清理cron任务连续2次超时(timeout)
**根因**: 脚本扫描目录包含node_modules等大目录,导致1.5GB数据遍历超时
**解决方案**:
- 排除目录:node_modules、.cache、.npm、.pnpm-store、.git
- 聚焦日志目录:workspace/sleep-learning、logs、token-monitor/logs
- 不再扫描整个workspace和openclaw根目录
**验证**: 修复后执行耗时0秒,正常完成
@@ -0,0 +1,163 @@
# Learnings
Corrections, insights, and best practices for **skill-self-evolution-enhancer**.
**Categories**: correction | insight | knowledge_gap | best_practice
**Statuses**: pending | in_progress | resolved | wont_fix | promoted
## [LRN-20260326-001] insight
**Logged**: 2026-03-26T04:14:00Z
**Priority**: high
**Status**: resolved
**Area**: 自进化冷启动
### Summary
learnings文件初始为空时,需要从heartbeat/cron日志/执行输出中主动提取进化素材
### Details
skill自进化需要真实错误数据驱动,但冷启动时.learnings/是空白模板
解决方案:从系统日志(cron状态、资源使用)、执行输出(stderr/stdout)、用户反馈中主动提取
### Suggested Action
在HEARTBEAT.md中增加"每次心跳检查时提取一条可进化的错误/改进项"规则
### Metadata
- Source: heartbeat_automation_session
- Tags: cold-start, self-evolution, data-driven
- Recurrence-Count: 1
---
## [LRN-20260327-001] insight
**Logged**: 2026-03-27T08:04:00Z
**Priority**: medium
**Status**: resolved
**Area**: GitHub进化猎手-克隆超时
### Summary
GitHub进化猎手在心跳/cron环境中克隆大型仓库容易超时,需要优化分析策略
### Details
心跳/cron环境网络受限,克隆⭐49306的deer-flow和⭐20811的agentscope均超时失败
解决方案:改用web_fetch读取README+API分析结构,不依赖git clone
### Suggested Action
修改github-intel.sh,增加"克隆前先web_fetch README预览"逻辑,对⭐>20000项目改用API+README分析
### Metadata
- Source: github-intel-cron-20260327
- Tags: network-timeout, github-analysis, optimization
- Recurrence-Count: 1
---
## [LRN-20260327-002] insight
**Logged**: 2026-03-27T08:04:00Z
**Priority**: high
**Status**: in_progress
**Area**: 重大突破性项目发现
### Summary
本期发现2个⭐>20000的突破性项目,需要深度研究
### Details
发现两个突破性项目:
1. **bytedance/deer-flow** (⭐49306) - SuperAgent框架,集成sandbox/memories/tools/skill/subagents/message gateway
2. **agentscope-ai/agentscope** (⭐20811) - "Build and run agents you can see, understand and trust"
这两个项目代表了当前Agent架构的最新方向,值得深入研究代码结构
### Suggested Action
下次有充足时间时,手动克隆这两个项目分析代码结构
### Metadata
- Source: github-intel-cron-20260327
- Tags: breakthrough-project, deer-flow, agentscope, agent-framework
- Recurrence-Count: 1
---
## [LRN-20260327-004] best_practice
**Logged**: 2026-03-27T12:04:00Z
**Priority**: high
**Status**: resolved
**Area**: GitHub进化猎手-本期深度分析
### Summary
本期分析3个高价值项目:last30days-skill、superpowers、dexter
### Details
从 **mvanhorn/last30days-skill** (⭐11702) 学到:
1. **Open Claw原生适配**: 明确说明"Designed for Open Claw and similar always-on AI environments",提供open variant
2. **Watchlist + briefings模式**: SQLite持久化研究数据,支持自然语言查询历史,支持定时cron触发
3. **多信号并行 + 质量排序**: 10个平台并行搜索,双向文本相似度 + 参与度速度归一化
4. **Comparative Mode**: "X vs Y"模式并行3次研究 + 并排对比
从 **obra/superpowers** (⭐117412) 学到:
1. **Subagent驱动开发**: dispatching-parallel-agents + 两阶段review (spec compliance → code quality)
2. **Skills自动触发**: agent在执行任务前自动检查相关skills,无需手动调用
3. **brainstorming skill**: Socratic设计澄清,在写代码前先确认真正需求
4. **git-worktrees隔离**: 每个任务在独立branch的worktree执行,避免污染主分支
5. **skills库生态**: 测试/调试/协作/元技能分类,writing-skills指导创建新skill
从 **virattt/dexter** (⭐19354) 学到:
1. **自验证循环**: 执行任务后检查结果,迭代直到confidence足够
2. **Scratchpad调试日志**: 每个query生成JSONL文件,记录tool调用和LLM推理过程
3. **Task Planning自动分解**: 复杂query自动拆解为结构化研究步骤
4. **Loop Detection**: 内置循环检测和step limits防止无限执行
5. **WhatsApp Gateway**: 通过WhatsApp与agent交互
### Suggested Action
1. 考虑为OpenClaw skills增加watchlist/briefings持久化模式
2. 引入superpowers的"执行前先brainstorm"流程
3. 学习dexter的scratchpad日志机制用于调试
4. last30days-skill的"对比模式"可作为GitHub进化的分析模板
### Metadata
- Source: github-intel-cron-20260327-deep-analysis-2
- Tags: last30days-skill, superpowers, dexter, agent-framework
- Recurrence-Count: 1
---
## [LRN-20260327-003] best_practice
**Logged**: 2026-03-27T08:29:00Z
**Priority**: high
**Status**: resolved
**Area**: GitHub进化猎手-多源情报融合设计模式
### Summary
oh-my-claudecode的团队协作模式揭示了multi-agent编排的最佳实践
### Details
从oh-my-claudecode (⭐13148)学到:
1. **Team Pipeline架构**: team-plan → team-prd → team-exec → team-verify → team-fix 循环
2. **Deep Interview技能**: Socratic追问 + 数学模糊度门控 (ambiguity ≤ 20%才允许执行)
3. **tmux CLI Workers**: 真实终端窗口作为worker,支持多agent并行
4. **AGENTS.md规范**: 用guidance_schema_contract定义角色契约,operating_principles + delegation_rules
从last30days-skill (⭐11242)学到:
1. **多信号质量排序**: 8个平台并行搜索,双向文本相似度 + 参与度速度归一化 + 跨平台收敛检测
2. **Polymarket预测市场集成**: 用真钱 bets 作为信号源,比Reddit更可靠
3. **Per-project .env配置**: 项目级环境变量隔离
4. **自动归档**: 每次运行保存到 ~/Documents/ 构建个人研究库
从agentscope (⭐20827)学到:
1. **"可观测的Agent"理念**: Build and run agents you can see, understand and trust
2. **A2A协议支持**: Agent间标准通信协议
3. **VNC-powered GUI沙箱**: 运行时可视化调试
4. **OTel生产部署**: K8s + Docker内置支持
### Suggested Action
将team pipeline分阶段架构引入OpenClaw skill编排;考虑增加"模糊度门控"机制在执行危险操作前要求用户确认
### Metadata
- Source: github-intel-cron-20260327-deep-analysis
- Tags: multi-agent, orchestration, team-pipeline, skill-design
- Recurrence-Count: 1
@@ -0,0 +1,52 @@
# 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
@@ -0,0 +1,52 @@
# 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 类似的自进化能力
@@ -0,0 +1,202 @@
---
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
@@ -0,0 +1,6 @@
{
"ownerId": "kn73p6rbsz7t6kfxtv1h84v84h82h6z6",
"slug": "skill-self-evolution-enhancer",
"version": "1.0.0",
"publishedAt": 1773303234062
}
@@ -0,0 +1,66 @@
# 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)
@@ -0,0 +1,50 @@
# 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
---
@@ -0,0 +1,100 @@
# [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
@@ -0,0 +1,45 @@
# 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
---
@@ -0,0 +1,62 @@
# 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"
---
@@ -0,0 +1,134 @@
# 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.
@@ -0,0 +1,58 @@
# 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
```
@@ -0,0 +1,155 @@
#!/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)"