← 返回
未分类 中文

Claude Code ↔ OpenClaw Skill Sync

This skill should be used when the user wants to sync, synchronize, or compare skills between Claude Code and OpenClaw. Use it for requests like "sync my ski...
此技能用于在 Claude Code 与 OpenClaw 之间同步或比对技能,适用于“sync my …”之类的请求。
rushingai
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 330
下载
💾 0
安装
1
版本
#latest

概述

Claude Code ↔ OpenClaw Skill Sync

Goal

Scan skill directories for both Claude Code and OpenClaw, compare their contents,

and perform a bidirectional sync — asking the user for confirmation before making

any changes, and asking the user to resolve conflicts when the same skill exists

in both tools with different content.

Both sides store full SKILL.md content. There are no wrapper stubs.

Steps

1. Scan Claude Code Skills

List all immediate subdirectories (one level deep, not recursive) under ~/.claude/skills/ that contain a SKILL.md file.

Record the name (directory name) and read the full content of each SKILL.md.

2. Scan OpenClaw Skills

List all immediate subdirectories (one level deep, not recursive) under ~/.openclaw/workspace/skills/ that contain a SKILL.md file.

Record the name (directory name) and read the full content of each SKILL.md.

3. Compare and Categorize

Build four categories by matching skill names across both 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 sync — exists in both, 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 both, but content differs after the normalization above.

4. Present the Report

Output a summary before taking any action:

## Skill Sync Report

### In Sync ✅
{count} skills are already in sync.
{list skill names, one per line}

### Claude Code Only — missing from OpenClaw (A)
- {skill-name}

### OpenClaw Only — missing from Claude Code (B)
- {skill-name}

### Conflicts — same name, different content (D)
- {skill-name}

If all skills are in sync, output "✅ All skills are in sync. Nothing to do." and stop.

5. Handle Category A — Copy to OpenClaw

For each skill in category A, ask the user:

> "{skill-name}" exists in Claude Code but is missing from OpenClaw.

> Copy it to OpenClaw? [y/n/all/skip-all]

  • y → copy this skill
  • n → skip this skill
  • all → copy all remaining category A skills without asking again
  • skip-all → skip all remaining category A skills (applies to this category only — you will still be prompted for categories B and D)

To copy a Claude Code skill to OpenClaw:

  1. Read the version field from the SKILL.md frontmatter. If absent, use 1.0.0.
  2. Create directory ~/.openclaw/workspace/skills/{name}/
  3. Write the full SKILL.md content to ~/.openclaw/workspace/skills/{name}/SKILL.md as-is.
  4. Write ~/.openclaw/workspace/skills/{name}/_meta.json:
{
  "slug": "{name}",
  "version": "{version}"
}

6. Handle Category B — Copy to Claude Code

For each skill in category B, ask the user:

> "{skill-name}" exists in OpenClaw but is missing from Claude Code.

> Copy it to Claude Code? [y/n/all/skip-all]

  • y → copy this skill
  • n → skip
  • all → copy all remaining category B skills without asking
  • skip-all → skip all remaining category B skills (applies to this category only — you will still be prompted for category D)

To copy an OpenClaw skill to Claude Code:

  1. Create directory ~/.claude/skills/{name}/
  2. Write the full SKILL.md content to ~/.claude/skills/{name}/SKILL.md as-is.

Do not copy _meta.json — it is OpenClaw-specific.

7. Handle Category D — Resolve Conflicts

For each conflict, show the user:

Conflict: {skill-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 both as-is

Apply the user's choice:

  • Choice 1 → overwrite ~/.openclaw/workspace/skills/{name}/SKILL.md with the Claude Code content.

Update ~/.openclaw/workspace/skills/{name}/_meta.json version to match the frontmatter of the winning file. If _meta.json does not exist, create it.

  • Choice 2 → overwrite ~/.claude/skills/{name}/SKILL.md with the OpenClaw content.

No changes to _meta.json — it is OpenClaw-specific and remains as-is.

  • Choice 3 → do nothing for this skill.

8. Summary

After all actions are complete, output:

## Sync 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 output token values, API keys, or credentials that may appear in skill files.
  • Always use ~/.claude/ and ~/.openclaw/ path notation. Never expand ~ to an absolute path.
  • If a version field is absent from a SKILL.md frontmatter, use 1.0.0 as the default.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 13:18 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,523 📥 580,939
ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,171 📥 943,485
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 871 📥 349,519