Skill from Memory
Transform your work into reusable skills. Extract workflows, solutions, and patterns from conversation history or memory files, package them as skills, and publish to GitHub and ClawHub.
Overview
This skill automates the complete workflow:
- 1. Extract - Parse conversation history or memory for reusable patterns
- Design - Structure as a proper skill with SKILL.md and resources
- Create - Generate skill files and scripts
- Publish - Push to GitHub and publish to ClawHub
Quick Start
Create Skill from Recent Conversation
CODEBLOCK0
Create Skill from Memory File
CODEBLOCK1
Full Auto-Create and Publish
CODEBLOCK2
Workflow Steps
Step 1: Extract Requirements
Identify from conversation/memory:
- - Task Pattern: What workflow was solved?
- Inputs/Outputs: What goes in, what comes out?
- Scripts/Tools: What code was written?
- Key Decisions: What choices were made?
Step 2: Design Skill Structure
Decide resource types:
- -
scripts/ - For reusable code - INLINECODE1 - For documentation
- INLINECODE2 - For templates/files
Step 3: Create Skill Files
Generate:
- -
SKILL.md with frontmatter and instructions - Scripts in INLINECODE4
- Any reference files
Step 4: Publish
Push to GitHub and publish to ClawHub:
CODEBLOCK3
Scripts Reference
extract-from-history.sh
Parse conversation JSONL for skill content.
CODEBLOCK4
extract-from-memory.sh
Parse memory markdown files.
CODEBLOCK5
create-skill.sh
Generate skill structure from extracted content.
CODEBLOCK6
publish.sh
Complete publish workflow.
CODEBLOCK7
Example: Converting a Task to Skill
Original Task (from conversation)
User: "帮我设置每天自动备份OpenClaw配置"
→ Agent creates backup scripts + cron setup
Skill Creation Process
- 1. Extract:
CODEBLOCK8
- 2. Design:
- Type: Workflow skill
- Scripts: backup.sh, setup-cron.sh, cleanup.sh
- No assets needed
- 3. Create:
CODEBLOCK9
- 4. Publish:
CODEBLOCK10
Best Practices
What Makes a Good Skill
✅ Do:
- - Single, well-defined purpose
- Reusable across contexts
- Includes working scripts
- Clear usage examples
- Progressive disclosure design
❌ Don't:
- - Too broad or vague
- Hardcoded personal paths
- Missing error handling
- Undocumented assumptions
Extracting from Memory
Look for these patterns:
- - "帮我写一个脚本..."
- "设置定时任务..."
- "以后每次都要..."
- "这个流程可以复用..."
GitHub Integration
Required setup:
CODEBLOCK11
Versioning
Follow semantic versioning:
- -
1.0.0 - Initial release - INLINECODE6 - Bug fix
- INLINECODE7 - New feature
- INLINECODE8 - Breaking change
Troubleshooting
Extraction finds nothing
- - Check session file path
- Verify date range with INLINECODE9
- Try broader pattern matching
GitHub push fails
- - Verify SSH key is added to GitHub
- Check repo exists and you have access
- Ensure git config user.name/email set
ClawHub publish fails
- - Run
clawhub login first - Check skill validation passes
- Verify slug is unique
Skill doesn't work when used
- - Test scripts manually first
- Check for hardcoded paths
- Verify all dependencies listed
- Run with
--examples flag when creating
Related Skills
- - skill-creator - Low-level skill creation utilities
- cron-backup - Example output skill (backup automation)
- clawhub - ClawHub CLI operations
记忆技能化
将你的工作转化为可复用的技能。从对话历史或记忆文件中提取工作流程、解决方案和模式,将其打包为技能,并发布到GitHub和ClawHub。
概述
该技能自动化完整的工作流程:
- 1. 提取 - 解析对话历史或记忆,寻找可复用的模式
- 设计 - 使用SKILL.md和资源文件构建规范的技能结构
- 创建 - 生成技能文件和脚本
- 发布 - 推送到GitHub并发布到ClawHub
快速开始
从最近对话创建技能
bash
分析最近对话并创建技能草稿
./scripts/extract-from-history.sh /path/to/session.jsonl ./my-new-skill
或指定时间范围
./scripts/extract-from-history.sh /path/to/session.jsonl ./my-new-skill --since 2026-02-03 --pattern backup
从记忆文件创建技能
bash
从记忆markdown文件提取
./scripts/extract-from-memory.sh /path/to/memory/2026-02-04.md ./my-new-skill
全自动创建并发布
bash
一条命令:提取、创建并发布
./scripts/create-and-publish.sh \
--source /path/to/session.jsonl \
--skill-name my-automation \
--github-repo user/my-skills \
--clawhub-slug my-automation
工作流程步骤
第一步:提取需求
从对话/记忆中识别:
- - 任务模式:解决了什么工作流程?
- 输入/输出:输入什么,输出什么?
- 脚本/工具:编写了哪些代码?
- 关键决策:做出了哪些选择?
第二步:设计技能结构
决定资源类型:
- - scripts/ - 可复用代码
- references/ - 文档资料
- assets/ - 模板/文件
第三步:创建技能文件
生成:
- - 包含前置信息和说明的SKILL.md
- scripts/中的脚本
- 任何参考文件
第四步:发布
推送到GitHub并发布到ClawHub:
bash
./scripts/publish.sh ./my-skill \
--github user/repo \
--clawhub-slug my-skill \
--version 1.0.0
脚本参考
extract-from-history.sh
解析对话JSONL以提取技能内容。
bash
./scripts/extract-from-history.sh [选项]
选项:
--since DATE 仅提取DATE之后的内容
--pattern REGEX 过滤匹配正则表达式的消息
--tools-only 仅提取工具使用模式
extract-from-memory.sh
解析记忆markdown文件。
bash
./scripts/extract-from-memory.sh
create-skill.sh
从提取的内容生成技能结构。
bash
./scripts/create-skill.sh
选项:
--description ... 技能描述
--type workflow 技能类型(workflow|tool|reference)
publish.sh
完整的发布工作流程。
bash
./scripts/publish.sh [选项]
选项:
--github REPO GitHub仓库(owner/repo)
--clawhub-slug ClawHub标识符
--version VER 版本标签
--skip-github 跳过GitHub推送
--skip-clawhub 跳过ClawHub发布
示例:将任务转换为技能
原始任务(来自对话)
用户:帮我设置每天自动备份OpenClaw配置
→ 智能体创建备份脚本 + cron设置
技能创建过程
- 1. 提取:
bash
./scripts/extract-from-history.sh \
~/.openclaw/agents/main/sessions/latest.jsonl \
./extracted-backup
- 2. 设计:
- 类型:工作流技能
- 脚本:backup.sh, setup-cron.sh, cleanup.sh
- 无需资源文件
- 3. 创建:
bash
./scripts/create-skill.sh ./extracted-backup cron-backup \
--description 使用cron自动备份调度 \
--type workflow
- 4. 发布:
bash
./scripts/publish.sh ./cron-backup \
--github zfanmy/openclaw-skills \
--clawhub-slug cron-backup \
--version 1.0.0
最佳实践
优秀技能的特征
✅ 应该做:
- - 单一、明确的目的
- 跨上下文可复用
- 包含可运行的脚本
- 清晰的使用示例
- 渐进式信息展示设计
❌ 避免:
- - 过于宽泛或模糊
- 硬编码的个人路径
- 缺少错误处理
- 未记录的假设条件
从记忆中提取
寻找这些模式:
- - 帮我写一个脚本...
- 设置定时任务...
- 以后每次都要...
- 这个流程可以复用...
GitHub集成
必要设置:
bash
配置git
git config --global user.name 你的名字
git config --global user.email your@email.com
为GitHub设置SSH密钥
ssh-keygen -t ed25519 -C your@email.com
将~/.ssh/id_ed25519.pub添加到GitHub设置 → SSH密钥
登录ClawHub
clawhub login
版本管理
遵循语义化版本:
- - 1.0.0 - 初始版本
- 1.0.1 - 错误修复
- 1.1.0 - 新功能
- 2.0.0 - 破坏性变更
故障排除
提取不到内容
- - 检查会话文件路径
- 使用--since验证日期范围
- 尝试更宽泛的模式匹配
GitHub推送失败
- - 验证SSH密钥已添加到GitHub
- 检查仓库存在且有访问权限
- 确保已设置git config user.name/email
ClawHub发布失败
- - 先运行clawhub login
- 检查技能验证是否通过
- 验证标识符是否唯一
技能使用时无效
- - 先手动测试脚本
- 检查硬编码路径
- 验证所有依赖项已列出
- 创建时使用--examples标志
相关技能
- - skill-creator - 底层技能创建工具
- cron-backup - 示例输出技能(备份自动化)
- clawhub - ClawHub CLI操作