skill-publish
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill 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
工作流程
- Identify the skill to publish
- Optionally review first with skill-review
- Collect publishing metadata through dialogue
- Generate the repository structure with
publish.py - Optionally initialize git and create GitHub repo
- 确定要发布的Skill
- (可选)先使用skill-review进行审核
- 通过对话收集发布元数据
- 使用生成仓库结构
publish.py - (可选)初始化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 is available (check if exists), suggest running validation first:
skill-review{SKILL_DIR}/../skill-review/scripts/validate.pybash
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可用(检查是否存在),建议先运行验证:
skill-review{SKILL_DIR}/../skill-review/scripts/validate.pybash
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:
-
GitHub owner/org — Default: try to infer fromor
git config user.name. Ask user to confirm or change.gh api user -q .login -
Repository name — Default:(e.g.,
<skill-name>-skill). Suggest the convention but let user override.cors-audit-skill -
Version — Default:. Use semver.
1.0.0 -
License — Default: MIT. Options: MIT, Apache-2.0, GPL-3.0.
-
Output directory — Where to create the repo. Default: parent directory of the skill.
通过AskUserQuestion收集以下信息:
-
GitHub owner/org — 默认值:尝试从或
git config user.name推断。请用户确认或修改。gh api user -q .login -
Repository name — 默认值:(例如
<skill-name>-skill)。建议遵循此命名规范,但允许用户自定义。cors-audit-skill -
Version — 默认值:。采用semver版本规范。
1.0.0 -
License — 默认值:MIT。可选选项:MIT、Apache-2.0、GPL-3.0。
-
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 is the directory containing this SKILL.md file.
{SKILL_DIR}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.md文件的目录。
{SKILL_DIR}脚本会向标准输出打印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 . --pushOption 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
└── .gitignoreDistribution Guide Reference
分发指南参考
For details about skills.sh registry, versioning strategy, and publishing conventions, read .
references/distribution_guide.md如需了解skills.sh注册表、版本策略及发布规范的详细信息,请查阅。
references/distribution_guide.md