ClawSkills logoClawSkills

Publisher

让你的技能易于理解且不容忽视。

介绍

# publisher

**面向 Clawdbot 技能的专业文档与发布工具**

一键生成针对采用优化的 README,并发布至 GitHub + ClawdHub。

---

## ⚠️ Requirements

- bash - `jq`(用于 JSON 解析) - `gh` CLI(GitHub 操作) - `clawdhub` CLI(发布) - git

---

## 📋 What It Does

自动化完整的发布工作流:

### Documentation Generation 1. 读取您的 SKILL.md 以了解技能的功能 2. 使用经过验证的模式生成 3 个单行描述选项 3. 遵循 GitHub 最佳实践创建 README: - 开篇即提出问题/解决方案 - 倒金字塔结构 - 使用 Emoji 标题以提高可扫读性 - 突出显示结果 - 文本高亮占比低于 15% 4. 使用选定的描述更新 SKILL.md frontmatter

### Publishing 5. 创建 GitHub 仓库(如果不存在) 6. 推送代码至 GitHub 7. 以自动检测的版本号发布至 ClawdHub

---

## 🚀 Installation

```bash clawdhub install skill-publisher ```

---

## 💡 Usage

```bash cd ~/clawd/skills/your-skill skill-publisher ```

该脚本将: 1. 显示 3 个单行描述选项(选择或自行编写) 2. 生成 README 预览 3. 请求批准 4. 发布至 GitHub + ClawdHub

---

## 🎯 One-Liner Generation Patterns

该工具使用三种经过验证的模式生成选项:

### Pattern A: Continuous Benefit ``` Keep [thing] [desired state] [timeframe] ``` 示例:“Keep your Claude access token fresh 24/7”

### Pattern B: Elimination ``` [Do thing] without [pain point] ``` 示例:“Build cross-device tools without hardcoding paths”

### Pattern C: Automation ``` Automatically [action] [thing] [when] ``` 示例:“Automatically refresh tokens before they expire”

---

## 📚 README Structure Generated

遵循 GitHub 文档最佳实践框架:

### Essential Sections (above the fold) - 标题 + 副标题 - **The problem:**(1 句话) - **This tool:**(1 句话) - 📋 Requirements - ⚡ What It Does(结果优先,然后是特性) - 🚀 Installation - 🔧 How It Works(结果优先,然后是过程)

### Optional Sections (collapsible) - 配置选项 - 故障排除 - 面向开发者 - 实现细节

---

## 🔧 How It Works

### Phase 1: Analysis - 读取 SKILL.md frontmatter(如果存在) - 提取关键信息:名称、描述、Requirements - 解析脚本以获取依赖项

### Phase 2: One-Liner Generation 分析您的 SKILL.md 描述并生成 3 个选项: - 模式 A:持续受益格式 - 模式 B:痛点消除格式 - 模式 C:自动化格式

向您展示全部 3 个选项,供您选择或自定义编写。

### Phase 3: README Generation 使用 `~/clawd/templates/README-template.md` 中的模板: - 填入标题、问题、解决方案 - 从 SKILL.md 提取 Requirements - 根据描述生成“What It Does” - 创建安装步骤 - 使用示例构建“How It Works”

### Phase 4: Publishing 1. 检查 `gh` CLI(如果缺失则引导设置) 2. 读取 VERSION 文件以获取版本号 3. 创建 GitHub 仓库(使用 `gh repo create`) 4. 提交并推送所有文件 5. 使用 `clawdhub publish` 发布至 ClawdHub

---

## 📁 File Structure Expected

``` your-skill/ ├── SKILL.md # Required: skill description ├── VERSION # Required: version number (e.g., "1.0.0") ├── scripts/ # Optional: your scripts │ └── main.sh ├── README.md # Generated by this tool └── .gitignore # Optional ```

---

## ⚙️ Configuration

无需配置。该工具自动从以下位置检测所有内容: - `SKILL.md`(名称、描述、Requirements) - `VERSION`(版本号) - `scripts/`(代码示例、依赖项)

---

## 🐛 Troubleshooting

### "gh: command not found"

安装 GitHub CLI: ```bash brew install gh gh auth login ```

### "SKILL.md not found"

创建一个最小的 SKILL.md: ```markdown --- name: your-skill description: Brief description of what it does ---

# your-skill

More details about your skill here. ```

### "VERSION file not found"

创建一个 VERSION 文件: ```bash echo "1.0.0" > VERSION ```

---

## 📖 References

- GitHub 文档最佳实践:https://docs.github.com/en/contributing/writing-for-github-docs/best-practices-for-github-docs - README 模板:`~/clawd/templates/README-template.md` - 单行公式:参见上面的“One-Liner Generation Patterns”部分

---

## License

MIT

更多产品