ExpertPack Export
Part of the ExpertPack framework — a structured, portable knowledge format for AI agents.
Export an OpenClaw instance into a composite ExpertPack — an agent pack (subtype: agent) as the voice, plus person/product/process packs as knowledge constituents.
Learn more: expertpack.ai · GitHub · Schema docs
Prerequisites
- - Read
references/schemas-summary.md for the EP schema rules this export must follow. - The export writes to a target directory (default:
{workspace}/export/). It does NOT modify the agent's live workspace files.
Export Flow
1. Scan
Run scripts/scan.py to inventory the workspace. It outputs a JSON manifest of discovered files, their categories, and proposed pack assignments.
CODEBLOCK0
Review the scan output. It proposes:
- - Which files map to which pack type (agent, person, product, process)
- Which knowledge domains were detected
- Confidence scores for ambiguous classifications
2. Propose
Present the proposed composite to the user:
- - List each proposed pack with type, slug, and key content sources
- Flag ambiguous classifications for user decision
- Note any gaps (e.g., "No process packs detected — skip or create stubs?")
Wait for user confirmation before proceeding.
3. Distill
Run scripts/distill.py for each proposed pack. It reads source files, extracts knowledge, deduplicates, and writes EP-compliant output.
CODEBLOCK1
Repeat for each pack. The script:
- - Reads source files listed in the scan manifest
- Extracts and classifies knowledge assertions
- Deduplicates (prefers newest for conflicts)
- Writes structured .md files with proper headers and frontmatter
- Writes manifest.yaml per pack
- Strips secrets (API keys, tokens, passwords) automatically
4. Compose
Run scripts/compose.py to generate the composite manifest and overview.
CODEBLOCK2
5. Validate
Run scripts/validate.py to check the export against schema rules.
CODEBLOCK3
It checks:
- - All required files exist per schema
- manifest.yaml fields are valid
- No secrets leaked (scans for API key patterns)
- File sizes within guidelines
- Cross-references resolve
6. Review & Ship
Present the validation report and a summary of what was exported. The user decides whether to commit/push or adjust.
Important Rules
- - Never include secrets. The scan and distill scripts strip known patterns, but always review
operational/tools.md and operational/infrastructure.md manually. - Distill, don't copy. Raw journal entries and session states should be compressed into structured knowledge. The export should be 10-20% the volume of raw state.
- Respect privacy. Flag personal information about the user for access tier review. Default user-specific content to
private access. - Preserve provenance. Each distilled file should note its source files in frontmatter.
- Don't modify the live workspace. All output goes to the export directory.
ExpertPack 导出
属于 ExpertPack 框架的一部分——一种为AI智能体设计的结构化、可移植知识格式。
将OpenClaw实例导出为复合型ExpertPack:一个智能体包(子类型:agent)作为主声音,加上个人/产品/流程包作为知识组成部分。
了解更多: expertpack.ai · GitHub · Schema文档
前置条件
- - 阅读 references/schemas-summary.md 了解本次导出必须遵循的EP schema规则。
- 导出内容写入目标目录(默认:{workspace}/export/)。不会修改智能体当前的工作区文件。
导出流程
1. 扫描
运行 scripts/scan.py 对工作区进行盘点。输出一个JSON清单,包含发现的文件、分类及建议的包分配。
bash
python3 {skill_dir}/scripts/scan.py --workspace /root/.openclaw/workspace --output /tmp/ep-scan.json
查看扫描输出。它会建议:
- - 哪些文件映射到哪种包类型(agent、person、product、process)
- 检测到的知识领域
- 模糊分类的置信度评分
2. 提议
向用户展示提议的复合结构:
- - 列出每个提议的包,包括类型、slug和关键内容来源
- 标记模糊分类供用户决策
- 指出任何缺口(例如:未检测到流程包——跳过还是创建存根?)
等待用户确认后再继续。
3. 提炼
为每个提议的包运行 scripts/distill.py。它读取源文件、提取知识、去重,并写入符合EP规范的输出。
bash
python3 {skill_dir}/scripts/distill.py \
--scan /tmp/ep-scan.json \
--pack agent:easybot \
--output /root/.openclaw/workspace/export/packs/easybot/
对每个包重复执行。该脚本:
- - 读取扫描清单中列出的源文件
- 提取并分类知识断言
- 去重(冲突时优先采用最新内容)
- 写入带有正确标题和前置元数据的结构化.md文件
- 为每个包写入manifest.yaml
- 自动清除机密信息(API密钥、令牌、密码)
4. 组合
运行 scripts/compose.py 生成复合清单和概览。
bash
python3 {skill_dir}/scripts/compose.py \
--scan /tmp/ep-scan.json \
--export-dir /root/.openclaw/workspace/export/
5. 验证
运行 scripts/validate.py 检查导出内容是否符合schema规则。
bash
python3 {skill_dir}/scripts/validate.py --export-dir /root/.openclaw/workspace/export/
它检查:
- - 所有必需文件是否按schema存在
- manifest.yaml字段是否有效
- 无机密泄露(扫描API密钥模式)
- 文件大小在指导范围内
- 交叉引用是否可解析
6. 审查与交付
展示验证报告和导出内容的摘要。用户决定是提交/推送还是进行调整。
重要规则
- - 绝不包含机密信息。 扫描和提炼脚本会清除已知模式,但始终手动检查 operational/tools.md 和 operational/infrastructure.md。
- 提炼而非复制。 原始日志条目和会话状态应压缩为结构化知识。导出内容体积应为原始状态的10-20%。
- 尊重隐私。 标记用户的个人信息以供访问层级审查。默认将用户特定内容设为 private 访问权限。
- 保留来源信息。 每个提炼文件应在前置元数据中注明其源文件。
- 不修改实时工作区。 所有输出均写入导出目录。