From legal-skills
Syncs locally developed skills to ClawHub. Supports batch/individual sync, .gitignore filtering, allowlist control, version tracking, and dry-run validation. Use when publishing new or updated skills from a local skill directory.
How this skill is triggered — by the user, by Claude, or both
Slash command
/legal-skills:clawhub-syncThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
将本地开发的 Skills 批量同步到 ClawHub 平台。支持读取 `.gitignore` 智能忽略敏感文件和临时文件。
将本地开发的 Skills 批量同步到 ClawHub 平台。支持读取 .gitignore 智能忽略敏感文件和临时文件。
ClawHub 平台强制使用 MIT-0 许可证(无需署名,允许商业使用)。
- MIT 许可证的 skill 可以同步
- CC-BY-NC 等限制性许可证与 MIT-0 冲突,不应同步
SKILL.md frontmatter 需包含必要字段:
---
name: skill-name
description: 技能描述
version: "1.0.0" # 推荐但不强制
homepage: https://github.com/cat-xierluo/legal-skills # 自动设置
---
clawhub login
执行 dry-run 检查配置是否正确,不实际发布:
clawhub sync --dry-run
同步单个技能:
clawhub sync skills/<skill-name>
同步所有技能:
clawhub sync --all
注意:
--all会受skills/clawhub-sync/config/sync-allowlist.yaml约束。如果存在白名单文件,只同步其中列出的 skill。
交互式选择同步:
用户可以指定要同步的技能列表,我会逐个执行同步命令。
当需要同步指定的 skill(而非全部)时,使用此工作流。
检查登录状态
clawhub whoami
检查白名单
skills/clawhub-sync/config/sync-allowlist.yaml# 注释)检查许可证
license 字段比较两个版本号:
| 来源 | 位置 | 格式 |
|---|---|---|
| 新版本 | skills/<skill-name>/SKILL.md frontmatter 的 version | "1.2.0" |
| 已记录版本 | skills/clawhub-sync/config/sync-records.yaml 中的 version | "1.1.0" |
版本比较逻辑(语义化版本):
new_version > recorded_version → 需要同步
new_version == recorded_version → 跳过(无变化)
new_version < recorded_version → 警告(版本回退?)
recorded_version 为 null → 需要同步(首次发布)
步骤 1:准备发布目录
bash skills/clawhub-sync/scripts/prepare-publish.sh skills/<skill-name>
步骤 2:执行发布(使用 publish 命令)
clawhub publish /tmp/clawhub-publish-<skill-name> \
--slug <skill-name> \
--name "<Display Name>" \
--version "<新版本号>" \
--changelog "<变更说明>"
⚠️ 必须指定 --slug 和 --name
- 临时目录名可能包含前缀(如
clawhub-publish-),导致发布时 slug 不正确--slug <skill-name>确保使用正确的 skill 标识符--name "<Display Name>"确保在 ClawHub 上显示正确的名称
为什么用
publish而不是sync?
clawhub sync会扫描所有目录的 skills,可能遇到 slug 冲突clawhub publish <path>只发布指定路径的单个 skill,更精确
步骤 3:更新同步记录
更新 skills/clawhub-sync/config/sync-records.yaml:
<skill-name>:
version: "<新版本号>"
last_sync: "<ISO 8601 时间>"
git_hash: "<当前 commit hash>"
status: synced
changelog_summary: "<变更说明>"
url: "https://clawhub.ai/skills/<skill-name>"
publish_id: "<从命令输出获取>"
# 1. 检查白名单
grep "git-batch-commit:" skills/clawhub-sync/config/sync-allowlist.yaml
# 输出:git-batch-commit: # MIT
# 2. 比较版本
# SKILL.md: version: "1.2.0"
# sync-records.yaml: version: "1.1.0"
# 结论:1.2.0 > 1.1.0,需要同步
# 3. 准备发布
bash skills/clawhub-sync/scripts/prepare-publish.sh skills/git-batch-commit
# 4. 执行发布(使用 publish 命令)
clawhub publish /tmp/clawhub-publish-git-batch-commit \
--version "1.2.0" \
--changelog "添加 ClawHub 同步工作流"
# 5. 更新记录
# 编辑 sync-records.yaml,更新 git-batch-commit 条目
status: failedchangelog_summaryCHANGELOG.md 第一行提取版本号## [x.y.z] - YYYY-MM-DDv 前缀(v1.0.0 → 1.0.0)| 字段 | 处理方式 |
|---|---|
homepage | 自动设置为 GitHub 仓库地址 |
version | 从 CHANGELOG.md 提取(如 SKILL.md 中未指定) |
配置文件: skills/clawhub-sync/config/sync-allowlist.yaml(skill 自包含)
优先级:白名单 > 默认忽略规则
skills/clawhub-sync/config/sync-allowlist.yaml 存在:只同步文件中列出的 skillskills/clawhub-sync/config/sync-allowlist.yaml 不存在:使用默认忽略规则(忽略 test/、private-skills/、node_modules/)配置格式:
# legal-qa-extractor: # 带 # 表示不发布
legal-qa-extractor: # 无 # 表示发布
litigation-analysis:
配置文件: skills/clawhub-sync/sync-allowlist.yaml(skill 自包含)
发布时会自动应用 .gitignore 过滤规则,确保敏感文件和临时文件不会被上传。
双重过滤机制:
.gitignore.gitignore,会额外应用默认排除(始终生效):
.git/ - Git 目录node_modules/ - Node.js 依赖__pycache__/ - Python 缓存.DS_Store - macOS 系统文件每次同步前,会自动:
/tmp/clawhub-publish-<skill-name> 创建临时目录如需手动检查将要发布的文件:
# 准备发布目录(不实际发布)
bash skills/clawhub-sync/scripts/prepare-publish.sh skills/trademark-assistant
# 检查临时目录内容
ls -la /tmp/clawhub-publish-trademark-assistant/
.gitignore 包含所有敏感文件模式prepare-publish.sh 检查将要发布的文件.env.example 代替 .env 文件.env - 环境变量(使用 .env.example 作为模板)config.yaml - 配置文件(使用 config.example.yaml 作为模板)*.db, *.sqlite - 数据库文件logs/ - 日志目录downloads/, output/ - 输出目录如果发现已发布的技能包含敏感信息:
clawnet publish 更新 ClawHub 上的技能重要提醒:
检查 CHANGELOG.md 格式:
## [1.0.0] - 2026-03-21
### 新增
- 新功能描述
clawhub sync --dry-run 检查配置clawhub whoami每次同步后,会更新 config/sync-records.yaml 记录文件,便于溯源和增量同步。
| 字段 | 说明 |
|---|---|
version | 同步时的版本号 |
last_sync | 最后同步时间 (ISO 8601) |
git_hash | 同步时的 commit hash |
status | synced / pending / failed |
changelog_summary | 变更摘要 |
url | ClawHub 发布地址 |
publish_id | ClawHub 内部 ID |
trademark-assistant:
version: "1.5.0"
last_sync: "2026-03-24T16:42:00+08:00"
git_hash: "f5f0726"
status: synced
changelog_summary: "新增商标说明撰写、图形商标分析、商品清单生成"
url: "https://clawhub.ai/skills/trademark-assistant"
publish_id: "k97fmhvcnrh1tn2msya98nbxxd83gspe"
status: pending 或版本更新的 skillgit_hash 追溯发布时的代码状态url 直接访问 ClawHub 上的 skill 页面npx claudepluginhub cat-xierluo/legal-skills --plugin transcription-correctorConverts a personal agent skill into a distributable open-source package with PII audit, generalization, license check, and packaging workflow.
Packages Claude Code skills for distribution via GitHub, Claude.ai uploads, or team deployment. Generates install scripts, READMEs, .skill zips, and .gitignore files.
Generates OpenClaw SKILL.md files for skills or slash commands. Interviews for new skill requirements or ports existing Claude Code skills with frontmatter translation and tool mapping.