diff --git a/manifest.json b/manifest.json index c1c65f9..57434e0 100644 --- a/manifest.json +++ b/manifest.json @@ -31,8 +31,8 @@ "stats": { "totalAgents": 12, "totalTeams": 3, - "totalSkills": 164, - "lastUpdated": "2026-12-02" + "totalSkills": 165, + "lastUpdated": "2026-12-03" }, "features": [ "curated-index", diff --git a/skills/migrate-from-openclaw/SKILL.md b/skills/migrate-from-openclaw/SKILL.md new file mode 100644 index 0000000..4b2184d --- /dev/null +++ b/skills/migrate-from-openclaw/SKILL.md @@ -0,0 +1,164 @@ +--- +license: "MIT" +name: migrate-from-openclaw +description: >- + 把本机 OpenClaw 数据目录(~/.openclaw/)中的智能体与技能迁移到 DesireCore:按固定映射(SOUL.md→persona.md、AGENTS.md→principles.md、USER.md/MEMORY.md→memory/、workspace skills→智能体私有技能)经 ManageAgent 创建智能体并复制技能,迁移后逐项核对。Use when 用户要求从 OpenClaw 导入、迁移或搬家智能体与技能(migrate / import from OpenClaw)。需要本机已有 OpenClaw 数据目录;不安装、不运行 OpenClaw。 +version: 1.0.0 +compatibility: "Requires an existing local OpenClaw data directory (~/.openclaw); this Skill only reads it and does not install, license or operate OpenClaw. Uses DesireCore ManageAgent, file tools and FileDigest; reading outside the DesireCore data directory follows the current approval mode." +type: meta +risk_level: medium +status: enabled +disable-model-invocation: true +tags: + - agent + - migration + - import + - openclaw +metadata: + author: desirecore + updated_at: '2026-12-03' + i18n: + default_locale: en-US + source_locale: zh-CN + locales: + - zh-CN + - en-US + zh-CN: + name: 从 OpenClaw 迁移 + short_desc: 把本机 OpenClaw 的智能体与技能迁移到 DesireCore + description: >- + 把本机 OpenClaw 数据目录(~/.openclaw/)中的智能体与技能迁移到 DesireCore:按固定映射(SOUL.md→persona.md、AGENTS.md→principles.md、USER.md/MEMORY.md→memory/、workspace skills→智能体私有技能)经 ManageAgent 创建智能体并复制技能,迁移后逐项核对。Use when 用户要求从 OpenClaw 导入、迁移或搬家智能体与技能(migrate / import from OpenClaw)。需要本机已有 OpenClaw 数据目录;不安装、不运行 OpenClaw。 + body: ./SKILL.zh-CN.md + source_hash: sha256:1afa5bf5e6016987 + translated_by: human + en-US: + name: Migrate from OpenClaw + short_desc: Move local OpenClaw agents and skills into DesireCore + description: >- + Migrate agents and skills from the local OpenClaw data directory (~/.openclaw/) into DesireCore using a fixed mapping (SOUL.md→persona.md, AGENTS.md→principles.md, USER.md/MEMORY.md→memory/, workspace skills→agent-private skills): create agents with ManageAgent, copy skills, then verify every item. Use when the user asks to import or migrate agents or skills from OpenClaw. Requires an existing local OpenClaw data directory; does not install or run OpenClaw. + body: ./SKILL.md + source_hash: sha256:1afa5bf5e6016987 + translated_by: human +market: + icon: >- + + category: productivity + maintainer: + name: DesireCore Official + verified: true + compatible_agents: [] + channel: latest + required_client_version: 10.0.180 +--- + +# migrate-from-openclaw Skill + +## L0: One-line summary + +Migrate the agents and skills in the local OpenClaw data directory (`~/.openclaw/`) into DesireCore: read the source, create agents with a fixed mapping, copy skills, then verify every item. + +## L1: Overview + +This Skill is operating knowledge only: how to read the source directory, where each file goes, how to handle name conflicts, and how to verify the result. Always create agents with `ManageAgent(action="create")`, and read or copy files with the file tools available in the current session. The platform handles permissions and approvals for every step according to the current approval mode; never try to bypass them or switch to HTTP endpoints. + +Migration is a **copy**: never modify or delete anything under `~/.openclaw/`, and never overwrite existing DesireCore agents or skills. + +Prerequisite: an existing OpenClaw data directory on this machine. This Skill does not install or run OpenClaw and does not contact any OpenClaw network service. If the directory is missing, tell the user and stop. + +## L2: Detailed specification + +### 1. Locate the source + +- Source root: `.openclaw/` in the user's home directory (`~/.openclaw/` on macOS/Linux, `%USERPROFILE%\.openclaw\` on Windows). It lies outside the DesireCore data directory, so reading it may show an approval card or require authorizing the directory with `ManageWorkDirs(action="add")` first. Follow the prompt; do not retry with a different path. +- Configuration file: `.openclaw/openclaw.json`. Structure (only these fields are used): + +```json +{ + "agents": { + "defaults": { "workspace": "~/.openclaw/workspace" }, + "list": [ + { "id": "main" }, + { "id": "writer", "name": "Writer", "workspace": "~/.openclaw/workspace-writer" } + ] + } +} +``` + +- Global skills directory: `.openclaw/skills//SKILL.md`. Subdirectories without `SKILL.md` are not skills; skip them. +- Missing source root: tell the user "No OpenClaw data directory was found" and stop without creating anything. Missing or invalid `openclaw.json`: report 0 agents with the reason and still scan skills. + +### 2. Parse each agent + +For every entry in `agents.list[]`: + +| Item | Rule | +| --- | --- | +| Workspace | `workspace` → otherwise `agents.defaults.workspace` → if neither exists the entry cannot be migrated. A leading `~` or `~/` means the user's home directory; `~otheruser/...` is not expanded and is treated as missing | +| Display name | The value on the `- **Name:** ` line of the workspace `IDENTITY.md` → entry `name` → entry `id` | +| Emoji | The value on the `- **Emoji:** ` line of `IDENTITY.md`; empty if absent | +| Description | The first non-empty line of `SOUL.md`, trimmed, at most 200 characters; empty if there is no `SOUL.md` | + +Example of the two `IDENTITY.md` lines: + +```markdown +- **Name:** Night Owl +- **Emoji:** 🦉 +``` + +If the workspace directory does not exist, record the agent as "cannot migrate: workspace not found " and continue with the others. + +### 3. File mapping + +| OpenClaw (inside the workspace) | DesireCore (inside the new agent directory) | Method | +| --- | --- | --- | +| `IDENTITY.md` | `name` (and optional `avatar.char`) in `agent.json` | Parsed and passed as `ManageAgent` parameters | +| First line of `SOUL.md` | `description` in `agent.json` | `ManageAgent` `description` | +| `SOUL.md` | `persona.md` | Full text, unchanged, as the `ManageAgent` `persona` string | +| `AGENTS.md` | `principles.md` | Full text, unchanged, as the `ManageAgent` `principles` string | +| `USER.md` | `memory/USER.md` | Byte-for-byte copy after creation | +| `MEMORY.md` | `memory/MEMORY.md` | Byte-for-byte copy after creation | +| `skills/` (whole directory) | `skills/` (the agent's private skills) | Whole-directory copy after creation | + +- Skip a target when its source file does not exist; never invent content. When `SOUL.md` or `AGENTS.md` is missing, omit the `persona` / `principles` parameter so the platform generates its default template, and mention it in the receipt. +- Pass `persona` / `principles` as Markdown strings whose content is **exactly** the source file: do not rewrite, summarize, translate, or add an L0/L1/L2 structure. +- Global skill `.openclaw/skills//` → DesireCore global skills directory `/skills//`, copied as a whole directory (including scripts and resources). +- **Global skills only**: when the `SKILL.md` frontmatter has no version (neither top-level `version` nor `metadata.version`), add `1.0.0`: write `metadata.version` if the frontmatter has a `metadata` object, otherwise a top-level `version`. Change nothing else. Agent-private skills are copied as they are, with no version added. + +Determine the DesireCore data directory from the current environment (for example from the agent directory returned by `ManageAgent(action="get")`); do not assume it is `~/.desirecore`. + +### 4. Name conflicts + +- **Agents**: do not pass `id`. `ManageAgent` derives the directory ID from the name and appends `-2`, `-3` when it is taken; use the ID in the result. The display name stays the OpenClaw name. +- **Global skills**: the target directory name defaults to the source directory name; if it exists, try `-openclaw`, `-openclaw-2`, `-openclaw-3`, … until one is free. Never overwrite or merge an existing directory. + +### 5. Procedure + +1. **Scan**: read `openclaw.json`, each workspace's `IDENTITY.md` / `SOUL.md`, and list the global skills directory. +2. **Preview and confirm**: show a table of migratable agents (name, emoji, description, which mapped files the workspace has, number of private skills) and global skills (name, description, target directory name, whether renamed). Use `ManageAgent(action="list")` and a listing of the global skills directory to detect and mark conflicts. Let the user choose what to migrate; create nothing before the user has chosen explicitly. +3. **Create agents** (one at a time): + +``` +ManageAgent({ + "action": "create", + "name": "", + "description": "", + "persona": "", + "principles": "", + "avatarGeneration": { "enabled": false } +}) +``` + + - `avatarGeneration.enabled:false` keeps parity with the source (OpenClaw has no image avatar); drop it only when the user explicitly asks for a generated avatar. + - When there is an emoji you may add `"config": { "avatar": { "char": "" } }`; if the parameter is rejected, retry without it and say so in the receipt. + - Record the returned agent ID. If one agent fails, record the reason and continue with the next. +4. **Copy memory and private skills**: copy `USER.md` and `MEMORY.md` into the new agent's `memory/`, and copy the workspace `skills/` directory as a whole into the new agent's `skills/`. Prefer a whole-directory shell copy (macOS/Linux: `cp -R `; Windows PowerShell: `Copy-Item -Recurse -LiteralPath -Destination `); without a shell, copy file by file with Read + Write. If a target file already exists, stop and ask; never overwrite. Leave copied private skills unchanged (no version added). +5. **Copy global skills**: pick the target directory name per section 4, copy the whole directory, then add the version per section 3. +6. **Verify**: for every copied or written file, compare the source and target SHA-256 with `FileDigest` (except a `SKILL.md` that received a version; read it instead and confirm the version is the only addition), and use `ManageAgent(action="get")` to confirm each new agent exists with the right name and description. On any mismatch, name the file; never claim success. +7. **Receipt**: list each item's result in a table (migrated / renamed to … / skipped with reason / failed with reason) together with where it was written, and remind the user that the new agents are ready to chat and that the original OpenClaw directory is untouched; whether to clean it up is the user's decision. + +### 6. Boundaries + +- Only read `~/.openclaw/`; never write, move, or delete anything in it. +- Migrate only the files in the mapping above. Do not copy other workspace files (for example `HEARTBEAT.md`, `TOOLS.md`, session logs, credential or token files); if the user asks for them, explain where each would go and confirm item by item. If a file looks like a credential, only mention that it exists; do not read it. +- Do not create or change MCP servers, tool permissions, model providers, or credentials; the user configures those separately in the interface. +- Always create agents with `ManageAgent`; never use curl / HTTP endpoints, and never create an agent directory or `agent.json` by hand. diff --git a/skills/migrate-from-openclaw/SKILL.zh-CN.md b/skills/migrate-from-openclaw/SKILL.zh-CN.md new file mode 100644 index 0000000..1e953a8 --- /dev/null +++ b/skills/migrate-from-openclaw/SKILL.zh-CN.md @@ -0,0 +1,113 @@ + + +# migrate-from-openclaw 技能 + +## L0:一句话摘要 + +把本机 OpenClaw 数据目录(`~/.openclaw/`)里的智能体与技能迁移到 DesireCore:读取来源、按固定映射创建智能体、复制技能,最后逐项核对。 + +## L1:概述 + +本技能只是操作知识:来源目录怎么读、文件映射到哪里、重名怎么处理、迁移后怎么核对。创建智能体一律经 `ManageAgent(action="create")`,读取与复制文件使用当前会话可用的文件工具;每一步的权限与审批由平台按当前审批模式处理,不要尝试绕过或改用 HTTP 接口。 + +迁移是**复制**:不修改、不删除 `~/.openclaw/` 下的任何文件;已存在的 DesireCore 智能体与技能也不覆盖。 + +前提:本机已有 OpenClaw 的数据目录。本技能不安装、不运行 OpenClaw,也不访问它的网络服务;目录不存在时如实告知用户并结束。 + +## L2:详细规范 + +### 1. 定位来源 + +- 来源根目录:用户主目录下的 `.openclaw/`(macOS/Linux 为 `~/.openclaw/`,Windows 为 `%USERPROFILE%\.openclaw\`)。它在 DesireCore 数据目录之外,读取时平台可能弹出审批卡或要求先用 `ManageWorkDirs(action="add")` 授权该目录;按提示处理,不要换路径重试。 +- 配置文件:`.openclaw/openclaw.json`。结构(只用到这些字段): + +```json +{ + "agents": { + "defaults": { "workspace": "~/.openclaw/workspace" }, + "list": [ + { "id": "main" }, + { "id": "writer", "name": "Writer", "workspace": "~/.openclaw/workspace-writer" } + ] + } +} +``` + +- 全局技能目录:`.openclaw/skills/<目录名>/SKILL.md`。没有 `SKILL.md` 的子目录不是技能,跳过。 +- 根目录不存在:告诉用户「未检测到 OpenClaw 数据目录」并结束,不要创建任何东西。`openclaw.json` 缺失或不是合法 JSON:智能体部分记为 0 个并说明原因,技能部分照常扫描。 + +### 2. 解析每个智能体 + +对 `agents.list[]` 的每一项: + +| 要素 | 规则 | +| --- | --- | +| 工作区 | `workspace` → 缺省用 `agents.defaults.workspace` → 都没有则该项不可迁移。开头的 `~` 或 `~/` 指用户主目录;`~其他用户/...` 不展开,按不存在处理 | +| 显示名称 | 工作区 `IDENTITY.md` 中 `- **Name:** <值>` 一行的值 → 配置项 `name` → 配置项 `id` | +| 表情 | `IDENTITY.md` 中 `- **Emoji:** <值>` 一行的值;没有则为空 | +| 描述 | `SOUL.md` 第一个非空行,去掉首尾空白,最多 200 个字符;没有 `SOUL.md` 则为空 | + +`IDENTITY.md` 两行的格式示例: + +```markdown +- **Name:** 赛博牛马 +- **Emoji:** 🐂 +``` + +工作区目录不存在时,该智能体记为「无法迁移:工作区不存在 <路径>」,不影响其他项。 + +### 3. 文件映射 + +| OpenClaw(工作区内) | DesireCore(新智能体目录内) | 方式 | +| --- | --- | --- | +| `IDENTITY.md` | `agent.json` 的 `name`(及可选 `avatar.char`) | 解析后作为 `ManageAgent` 参数 | +| `SOUL.md` 第一行 | `agent.json` 的 `description` | `ManageAgent` 的 `description` | +| `SOUL.md` | `persona.md` | 全文原样作为 `ManageAgent` 的 `persona` 字符串 | +| `AGENTS.md` | `principles.md` | 全文原样作为 `ManageAgent` 的 `principles` 字符串 | +| `USER.md` | `memory/USER.md` | 创建后逐字节复制 | +| `MEMORY.md` | `memory/MEMORY.md` | 创建后逐字节复制 | +| `skills/`(整个目录) | `skills/`(该智能体私有技能) | 创建后整目录复制 | + +- 源文件不存在就跳过对应目标,不要编造内容。`SOUL.md` 或 `AGENTS.md` 不存在时省略 `persona` / `principles` 参数,由平台生成默认模板,并在回执里说明。 +- `persona` / `principles` 传 Markdown 字符串,内容与源文件**完全一致**:不改写、不总结、不翻译、不补 L0/L1/L2 结构。 +- 全局技能 `.openclaw/skills/<目录名>/` → DesireCore 全局技能目录 `/skills/<目标目录名>/`,整目录复制(含脚本与资源)。 +- 只对**全局技能**:`SKILL.md` frontmatter 没有版本号(顶层 `version` 和 `metadata.version` 都没有)时补 `1.0.0`:frontmatter 有 `metadata` 对象就写成 `metadata.version`,否则写顶层 `version`。其他内容不改。智能体私有技能原样复制,不补版本号。 + +DesireCore 数据目录的位置以当前环境为准(例如通过 `ManageAgent(action="get")` 返回的智能体目录推断),不要假设一定是 `~/.desirecore`。 + +### 4. 重名处理 + +- **智能体**:不要传 `id`。`ManageAgent` 会从名称生成目录 ID,已被占用时自动加 `-2`、`-3` 后缀;以返回结果中的 ID 为准。显示名称保持 OpenClaw 中的名称。 +- **全局技能**:目标目录名默认与来源目录名相同;已存在时依次改用 `<名>-openclaw`、`<名>-openclaw-2`、`<名>-openclaw-3`……直到不存在。绝不覆盖或合并已有目录。 + +### 5. 执行流程 + +1. **扫描**:读取 `openclaw.json`、各工作区的 `IDENTITY.md` / `SOUL.md`,列出全局技能目录。 +2. **预览并确认**:用表格列出可迁移的智能体(名称、表情、描述、工作区里有哪些映射文件、私有技能数量)和全局技能(名称、描述、目标目录名、是否改名)。用 `ManageAgent(action="list")` 与列出全局技能目录判断重名,并标出。让用户选择要迁移的项目;用户没有明确选择前不要创建任何东西。 +3. **创建智能体**(逐个): + +``` +ManageAgent({ + "action": "create", + "name": "<显示名称>", + "description": "<描述>", + "persona": "", + "principles": "", + "avatarGeneration": { "enabled": false } +}) +``` + + - `avatarGeneration.enabled:false` 保持与来源一致(OpenClaw 没有图片头像);用户明确要求生成头像时再去掉。 + - 有表情时可加 `"config": { "avatar": { "char": "<表情>" } }`;参数被拒就去掉重试,并在回执说明未设置。 + - 记录返回的智能体 ID。某个智能体失败时记录原因,继续处理下一个。 +4. **复制记忆与私有技能**:把 `USER.md`、`MEMORY.md` 复制到新智能体目录的 `memory/`,把工作区 `skills/` 整目录复制到新智能体目录的 `skills/`。优先用 Shell 整目录复制(macOS/Linux:`cp -R <源> <目标>`;Windows PowerShell:`Copy-Item -Recurse -LiteralPath <源> -Destination <目标>`),没有 Shell 时用 Read + Write 逐个文件复制。目标已存在同名文件时停下询问,不覆盖。私有技能复制后不做任何修改(不补版本号)。 +5. **复制全局技能**:按第 4 节确定目标目录名后整目录复制,再按第 3 节补版本号。 +6. **核对**:对每个复制或写入的文件,用 `FileDigest` 比较来源与目标的 SHA-256(补过版本号的 `SKILL.md` 除外,改为读取确认只多了版本号),并用 `ManageAgent(action="get")` 确认每个新智能体存在且名称、描述正确。不一致时说明是哪个文件,不要假装成功。 +7. **回执**:用表格列出每个项目的结果(已迁移 / 已改名为… / 跳过及原因 / 失败及原因)和产出位置,提醒用户:新智能体可以直接对话;OpenClaw 原目录未改动,确认无误后由用户自行决定是否清理。 + +### 6. 边界 + +- 只读 `~/.openclaw/`,绝不写入、移动或删除其中的文件。 +- 只迁移上述映射中的文件。工作区里的其他文件(例如 `HEARTBEAT.md`、`TOOLS.md`、会话记录、凭据或令牌文件)不复制;用户另外要求时逐项说明去向并单独确认。发现疑似凭据的文件时只提示存在,不读取内容。 +- 不新建或修改 MCP 服务、工具权限、模型提供方或凭据;这些需要用户在界面中另行配置。 +- 一律经 `ManageAgent` 创建智能体,不用 curl / HTTP 接口,也不手工创建智能体目录或 `agent.json`。 diff --git a/skills/migrate-from-openclaw/catalog-metadata.v1.json b/skills/migrate-from-openclaw/catalog-metadata.v1.json new file mode 100644 index 0000000..683beb1 --- /dev/null +++ b/skills/migrate-from-openclaw/catalog-metadata.v1.json @@ -0,0 +1,75 @@ +{ + "$schema": "../../schemas/catalog-metadata.v1.schema.json", + "schemaVersion": 1, + "identity": { + "kind": "skill", + "id": "migrate-from-openclaw" + }, + "presentation": { + "defaultLocale": "en-US", + "i18n": { + "zh-CN": { + "name": "从 OpenClaw 迁移", + "summary": "把本机 OpenClaw 的智能体与技能迁移到 DesireCore", + "description": "把本机 OpenClaw 数据目录(~/.openclaw/)中的智能体与技能迁移到 DesireCore:按固定映射(SOUL.md→persona.md、AGENTS.md→principles.md、USER.md/MEMORY.md→memory/、workspace skills→智能体私有技能)经 ManageAgent 创建智能体并复制技能,迁移后逐项核对。Use when 用户要求从 OpenClaw 导入、迁移或搬家智能体与技能(migrate / import from OpenClaw)。需要本机已有 OpenClaw 数据目录;不安装、不运行 OpenClaw。" + }, + "en-US": { + "name": "Migrate from OpenClaw", + "summary": "Move local OpenClaw agents and skills into DesireCore", + "description": "Migrate agents and skills from the local OpenClaw data directory (~/.openclaw/) into DesireCore using a fixed mapping (SOUL.md→persona.md, AGENTS.md→principles.md, USER.md/MEMORY.md→memory/, workspace skills→agent-private skills): create agents with ManageAgent, copy skills, then verify every item. Use when the user asks to import or migrate agents or skills from OpenClaw. Requires an existing local OpenClaw data directory; does not install or run OpenClaw." + } + }, + "category": "productivity", + "tags": [ + "agent", + "migration", + "import", + "openclaw" + ] + }, + "release": { + "state": "known", + "version": "1.0.0", + "versionScheme": "semver" + }, + "timestamps": { + "catalogUpdatedAt": { + "state": "known", + "value": "2026-12-03", + "precision": "day" + }, + "releasePublishedAt": { + "state": "unknown" + }, + "reviewedAt": { + "state": "unknown" + }, + "upstreamObservedAt": { + "state": "unknown" + } + }, + "provenance": {}, + "governance": { + "stewardship": "official", + "availability": "installable", + "license": { + "state": "known", + "value": "MIT" + }, + "redistribution": "verify-package-terms", + "listingMaintainer": { + "name": "DesireCore Official", + "verified": true + } + }, + "compatibility": { + "platforms": { + "state": "unknown" + }, + "requiredClientVersion": "10.0.180" + }, + "spec": { + "kind": "skill", + "riskLevel": "medium" + } +}