feat: add ClawHub/OpenClaw publishing support

This commit is contained in:
Jim Liu 宝玉 2026-03-08 19:22:13 -05:00
parent 2e68aa64a4
commit a37c80e142
4 changed files with 66 additions and 0 deletions

3
.gitignore vendored
View File

@ -161,3 +161,6 @@ posts/
*.ipr
.claude/skills/baoyu-skill-evolution
# ClawHub local state (current and legacy directory names from the official CLI)
.clawhub/
.clawdhub/

View File

@ -17,6 +17,27 @@ Skills shared by Baoyu for improving daily work efficiency with Claude Code.
npx skills add jimliu/baoyu-skills
```
### Publish to ClawHub / OpenClaw
This repository now supports publishing each `skills/baoyu-*` directory as an individual ClawHub skill.
```bash
# Preview what would be published
./scripts/sync-clawhub.sh --dry-run
# Publish all changed skills from ./skills
./scripts/sync-clawhub.sh --all
```
ClawHub installs skills individually, not as one marketplace bundle. After publishing, users can install specific skills such as:
```bash
clawhub install baoyu-image-gen
clawhub install baoyu-markdown-to-html
```
Publishing to ClawHub releases the published skill under `MIT-0`, per ClawHub's registry rules.
### Register as Plugin Marketplace
Run the following command in Claude Code:

View File

@ -17,6 +17,27 @@
npx skills add jimliu/baoyu-skills
```
### 发布到 ClawHub / OpenClaw
现在这个仓库支持把每个 `skills/baoyu-*` 目录作为独立 ClawHub skill 发布。
```bash
# 预览将要发布的变更
./scripts/sync-clawhub.sh --dry-run
# 发布 ./skills 下所有已变更的 skill
./scripts/sync-clawhub.sh --all
```
ClawHub 按“单个 skill”安装不是把整个 marketplace 一次性装进去。发布后,用户可以按需安装:
```bash
clawhub install baoyu-image-gen
clawhub install baoyu-markdown-to-html
```
根据 ClawHub 的 registry 规则,发布到 ClawHub 的 skill 会以 `MIT-0` 许可分发。
### 注册插件市场
在 Claude Code 中运行:

21
scripts/sync-clawhub.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SKILLS_DIR="${ROOT_DIR}/skills"
if command -v clawhub >/dev/null 2>&1; then
CLAWHUB_CMD=(clawhub)
elif command -v npx >/dev/null 2>&1; then
CLAWHUB_CMD=(npx -y clawhub)
else
echo "Error: neither clawhub nor npx is available."
echo "See https://docs.openclaw.ai/zh-CN/tools/clawhub"
exit 1
fi
if [ "$#" -eq 0 ]; then
set -- --all
fi
exec "${CLAWHUB_CMD[@]}" sync --root "${SKILLS_DIR}" "$@"