skill-publish

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill Publish

Skill 发布

Package a agent skill into a complete, distributable GitHub repository. Generates all the surrounding files (README, LICENSE, plugin.json, marketplace.json) and optionally creates the GitHub repo.
将Agent Skill打包为可分发的完整GitHub仓库。自动生成所需的全部配套文件(README、LICENSE、plugin.json、marketplace.json),还可选择性创建GitHub仓库。

How It Works

工作流程

  1. Identify the skill to publish
  2. Optionally review first with skill-review
  3. Collect publishing metadata through dialogue
  4. Generate the repository structure with
    publish.py
  5. Optionally initialize git and create GitHub repo
  1. 确定要发布的Skill
  2. (可选)先使用skill-review进行审核
  3. 通过对话收集发布元数据
  4. 使用
    publish.py
    生成仓库结构
  5. (可选)初始化Git并创建GitHub仓库

Dialogue Flow

对话流程

Step 1: Identify the Skill

步骤1:确定Skill

Ask the user for the skill directory path. Auto-detect if the current working directory contains a SKILL.md. Accept absolute or relative paths.
询问用户Skill的目录路径。如果当前工作目录包含SKILL.md文件则自动检测。支持绝对路径或相对路径。

Step 2: Pre-Publish Validation

步骤2:发布前验证

If the
skill-review
skill is available (check if
{SKILL_DIR}/../skill-review/scripts/validate.py
exists), suggest running validation first:
bash
python3 {SKILL_DIR}/../skill-review/scripts/validate.py run --path <skill-path>
If there are failures, recommend fixing them before proceeding. Warnings are acceptable.
If skill-review is not available, do a quick manual check: verify SKILL.md exists and has valid frontmatter with name and description.
skill-review
Skill可用(检查
{SKILL_DIR}/../skill-review/scripts/validate.py
是否存在),建议先运行验证:
bash
python3 {SKILL_DIR}/../skill-review/scripts/validate.py run --path <skill-path>
若验证失败,建议修复后再继续。警告信息可忽略。
若skill-review不可用,则进行快速手动检查:确认SKILL.md存在且包含有效的名称和描述前置内容。

Step 3: Collect Metadata

步骤3:收集元数据

Use AskUserQuestion to gather:
  1. GitHub owner/org — Default: try to infer from
    git config user.name
    or
    gh api user -q .login
    . Ask user to confirm or change.
  2. Repository name — Default:
    <skill-name>-skill
    (e.g.,
    cors-audit-skill
    ). Suggest the convention but let user override.
  3. Version — Default:
    1.0.0
    . Use semver.
  4. License — Default: MIT. Options: MIT, Apache-2.0, GPL-3.0.
  5. Output directory — Where to create the repo. Default: parent directory of the skill.
通过AskUserQuestion收集以下信息:
  1. GitHub owner/org — 默认值:尝试从
    git config user.name
    gh api user -q .login
    推断。请用户确认或修改。
  2. Repository name — 默认值:
    <skill-name>-skill
    (例如
    cors-audit-skill
    )。建议遵循此命名规范,但允许用户自定义。
  3. Version — 默认值:
    1.0.0
    。采用semver版本规范。
  4. License — 默认值:MIT。可选选项:MIT、Apache-2.0、GPL-3.0。
  5. Output directory — 仓库创建的目标目录。默认值:Skill所在目录的父目录。

Step 4: Generate Repository

步骤4:生成仓库

bash
python3 {SKILL_DIR}/scripts/publish.py generate \
    --skill-path <path> \
    --owner <owner> \
    --repo <repo-name> \
    --version <version> \
    [--license mit|apache2|gpl3] \
    [--output <dir>] \
    [--force]
Where
{SKILL_DIR}
is the directory containing this SKILL.md file.
The script outputs JSON to stdout:
json
{
  "status": "ok",
  "output_dir": "/path/to/output",
  "repo": "owner/repo-name",
  "created": [".claude-plugin/plugin.json", "README.md", "LICENSE", ...],
  "hint": "Repository files generated. Next: git init or gh repo create."
}
bash
python3 {SKILL_DIR}/scripts/publish.py generate \
    --skill-path <path> \
    --owner <owner> \
    --repo <repo-name> \
    --version <version> \
    [--license mit|apache2|gpl3] \
    [--output <dir>] \
    [--force]
其中
{SKILL_DIR}
是包含本SKILL.md文件的目录。
脚本会向标准输出打印JSON内容:
json
{
  "status": "ok",
  "output_dir": "/path/to/output",
  "repo": "owner/repo-name",
  "created": [".claude-plugin/plugin.json", "README.md", "LICENSE", ...],
  "hint": "Repository files generated. Next: git init or gh repo create."
}

Step 5: Post-Generation

步骤5:生成后操作

Present what was generated, then ask the user what to do next:
Option A: Initialize git repo
bash
cd <output-dir>
git init
git add .
git commit -m "Initial commit"
Option B: Create GitHub repo and push
bash
cd <output-dir>
git init
git add .
git commit -m "Initial commit"
gh repo create <owner>/<repo> --public --source . --push
Option C: Done — User will handle git themselves.
After creation, remind the user:
  • Edit README.md and README.zh.md to polish auto-generated content
  • Register on skills.sh if they want public discoverability
  • Test installation:
    npx skills add ./ -g -y
展示已生成的内容,然后询问用户下一步操作:
选项A:初始化Git仓库
bash
cd <output-dir>
git init
git add .
git commit -m "Initial commit"
选项B:创建GitHub仓库并推送
bash
cd <output-dir>
git init
git add .
git commit -m "Initial commit"
gh repo create <owner>/<repo> --public --source . --push
选项C:完成 — 用户自行处理Git相关操作。
生成完成后,提醒用户:
  • 编辑README.md和README.zh.md以完善自动生成的内容
  • 若希望公开可发现性,请在skills.sh上注册
  • 测试安装:
    npx skills add ./ -g -y

Generated Repository Structure

生成的仓库结构

<repo-name>/
├── .claude-plugin/
│   ├── plugin.json
│   └── marketplace.json
├── skills/
│   └── <skill-name>/        # Copied from source
│       ├── SKILL.md
│       ├── scripts/
│       └── references/
├── README.md
├── README.zh.md
├── LICENSE
└── .gitignore
<repo-name>/
├── .claude-plugin/
│   ├── plugin.json
│   └── marketplace.json
├── skills/
│   └── <skill-name>/        # Copied from source
│       ├── SKILL.md
│       ├── scripts/
│       └── references/
├── README.md
├── README.zh.md
├── LICENSE
└── .gitignore

Distribution Guide Reference

分发指南参考

For details about skills.sh registry, versioning strategy, and publishing conventions, read
references/distribution_guide.md
.
如需了解skills.sh注册表、版本策略及发布规范的详细信息,请查阅
references/distribution_guide.md