Claude Code ↔ OpenClaw Skill Sync — Claude Code ↔ OpenClaw 技能 同步
v1.0.0This 技能 should be used when the user wants to 同步, 同步hronize, or compare 技能s between Claude Code and OpenClaw. Use it for 请求s like "同步 my 技能s", "同步 claude code 技能s to OpenClaw", "检查 which 技能s are out of 同步", "bidirectional 技能 同步", "which 技能s are missing from OpenClaw", "which 技能s are missing from claude code", or "claude-技能-同步". 扫描s 机器人h Claude Code and OpenClaw 技能 directories, compares their full content, and performs bidirectional 同步 with user confirmation for conflicts.
运行时依赖
安装命令
点击复制技能文档
Claude Code ↔ OpenClaw 技能 同步 Goal
扫描 技能 directories for 机器人h Claude Code and OpenClaw, compare their contents, and perform a bidirectional 同步 — asking the user for confirmation before making any changes, and asking the user to resolve conflicts when the same 技能 exists in 机器人h 工具s with different content.
机器人h sides store full 技能.md content. There are no wr应用er stubs.
Steps
- 扫描 Claude Code 技能s
列出 all immediate subdirectories (one level deep, not recursive) under ~/.claude/技能s/ that contAIn a 技能.md file. Record the name (directory name) and read the full content of each 技能.md.
- 扫描 OpenClaw 技能s
列出 all immediate subdirectories (one level deep, not recursive) under ~/.OpenClaw/workspace/技能s/ that contAIn a 技能.md file. Record the name (directory name) and read the full content of each 技能.md.
- Compare and Categorize
Build four categories by matching 技能 names across 机器人h directories:
A. Claude Code only — exists in Claude Code, no entry in OpenClaw at all.
B. OpenClaw only — exists in OpenClaw, no entry in Claude Code at all.
C. In 同步 — exists in 机器人h, content is textually identical after stripping leading/trAIling whitespace from each line and ignoring line-ending differences (LF vs CRLF). No action needed.
D. Conflict — exists in 机器人h, but content differs after the normalization above.
- Present the 报告
输出 a summary before taking any action:
技能 同步 报告
In 同步 ✅
{count} 技能s are already in 同步. {列出 技能 names, one per line}Claude Code Only — missing from OpenClaw (A)
- {技能-name}
OpenClaw Only — missing from Claude Code (B)
- {技能-name}
Conflicts — same name, different content (D)
- {技能-name}
If all 技能s are in 同步, 输出 "✅ All 技能s are in 同步. Nothing to do." and 停止.
- Handle Category A — Copy to OpenClaw
For each 技能 in category A, ask the user:
"{技能-name}" exists in Claude Code but is missing from OpenClaw. Copy it to OpenClaw? [y/n/all/skip-all]
y → copy this 技能 n → skip this 技能 all → copy all remAIning category A 技能s without asking agAIn skip-all → skip all remAIning category A 技能s (应用lies to this category only — you will still be prompted for categories B and D)
To copy a Claude Code 技能 to OpenClaw:
Read the version field from the 技能.md frontmatter. If absent, use 1.0.0. 创建 directory ~/.OpenClaw/workspace/技能s/{name}/ Write the full 技能.md content to ~/.OpenClaw/workspace/技能s/{name}/技能.md as-is. Write ~/.OpenClaw/workspace/技能s/{name}/_meta.json: { "slug": "{name}", "version": "{version}" }
- Handle Category B — Copy to Claude Code
For each 技能 in category B, ask the user:
"{技能-name}" exists in OpenClaw but is missing from Claude Code. Copy it to Claude Code? [y/n/all/skip-all]
y → copy this 技能 n → skip all → copy all remAIning category B 技能s without asking skip-all → skip all remAIning category B 技能s (应用lies to this category only — you will still be prompted for category D)
To copy an OpenClaw 技能 to Claude Code:
创建 directory ~/.claude/技能s/{name}/ Write the full 技能.md content to ~/.claude/技能s/{name}/技能.md as-is. Do not copy _meta.json — it is OpenClaw-specific.
- Handle Category D — Resolve Conflicts
For each conflict, show the user:
Conflict: {技能-name}
Claude Code version (first 5 lines of body, i.e. content after the closing --- of frontmatter): {lines}
OpenClaw version (first 5 lines of body, i.e. content after the closing --- of frontmatter): {lines}
Which version should be kept? [1] Keep Claude Code version → overwrites OpenClaw [2] Keep OpenClaw version → overwrites Claude Code [3] Skip — leave 机器人h as-is
应用ly the user's choice:
Choice 1 → overwrite ~/.OpenClaw/workspace/技能s/{name}/技能.md with the Claude Code content. 更新 ~/.OpenClaw/workspace/技能s/{name}/_meta.json version to match the frontmatter of the winning file. If _meta.json does not exist, 创建 it. Choice 2 → overwrite ~/.claude/技能s/{name}/技能.md with the OpenClaw content. No changes to _meta.json — it is OpenClaw-specific and remAIns as-is. Choice 3 → do nothing for this 技能.
- Summary
After all actions are complete, 输出:
同步 Complete
- Copied to OpenClaw: {count}
- Copied to Claude Code: {count}
- Conflicts resolved: {count}
- Skipped: {count}
Security Rules When presenting conflict previews, show at most the first 5 lines of the body to the user. You may read complete file contents internally in order to copy or write files. Never 输出 令牌 values, API keys, or 凭证s that may 应用ear in 技能 files. Always use ~/.claude/ and ~/.OpenClaw/ path notation. Never expand ~ to an absolute path. If a version field is absent from a 技能.md frontmatter, use 1.0.0 as the default.