Skill Publisher — 技能传送带
Purpose
Take a completed skill (local folder or .zip package), run a comprehensive validation check, package it into a distributable zip, and guide the user through submitting it to the target platform. This is the final step of the skill lifecycle — the conveyor belt between creation and distribution.
When to Use
- User says "publish this skill", "upload my skill", "打包并发布技能", "把这个技能传到平台"
- After creating or editing a skill, the user wants to ship it
- User provides a skill folder path or
.zipand wants it validated and packaged - User wants to check if their skill meets marketplace standards before submission
Workflow
Step 1: Identify Input
Ask the user for the skill path if not provided. Accept either:
- A local folder path (e.g.,
~/.workbuddy/skills/my-skillor a project-level.workbuddy/skills/my-skill) - A
.zipfile containing a skill
If the user doesn't provide a path, ask: "请提供要发布的技能路径(文件夹或 .zip 文件)"
Step 2: Run the Publisher Pipeline
Execute the bundled script:
python <skill-dir>/scripts/publish_skill.py <input-path> --output <workspace-output-dir>
The --output directory should be the current workspace root (where the user can easily find the output).
If the user is in a hurry or explicitly wants to skip validation, add --skip-validation.
Step 3: Interpret Results
The script does three things:
- Information extraction — reads the skill's
name,version,description, file count, and total size from SKILL.md - Validation — checks:
- SKILL.md exists and has valid YAML frontmatter
- Required fields (name,description) are present
- Name follows hyphen-case convention
- Description is descriptive enough and uses third-person
-agent_created: trueflag is set
- No example/template leftovers
- Directory structure follows conventions - Packaging — creates a
.zipfile ready for distribution
If validation fails: Present the errors clearly. The user must fix them before the skill can be published. Do NOT call the pipeline with --skip-validation unless the user explicitly asks to bypass.
If validation passes: Present the summary and the packaged zip path.
Step 4: Deliver the Package
After successful packaging:
- Show the summary: skill name, version, package path, file size
- Present the
.zipfile to the user withpresent_files - Explain the next steps for submission
Step 5: Guide Submission
Since direct marketplace upload is not yet available via the built-in tools, provide clear next-step guidance. The user should submit the packaged zip through the appropriate channel (Skills panel, marketplace portal, etc.).
Validation Checklist (What Gets Checked)
| Check | Severity |
|---|---|
| SKILL.md exists | Error |
Valid YAML frontmatter (---...---) |
Error |
name field present |
Error |
description field present |
Error |
Name is hyphen-case ([a-z0-9-]+) |
Error |
| No angle brackets in description | Error |
| Description length ≥ 30 chars | Warning |
| Description uses third-person | Warning |
agent_created: true present |
Warning |
| SKILL.md body has enough content | Warning |
| No example/template leftovers | Warning |
| Resource directories are not empty | Warning |
| No unexpected directories in skill root | Warning |
Script Reference
The pipeline script is located at scripts/publish_skill.py relative to this skill's directory. It is a standalone Python 3 script with no external dependencies beyond the standard library.
Key functions available for programmatic use:
- validate_skill(path) — returns ValidationResult with .errors, .warnings, .is_valid
- extract_skill_info(path) — returns dict with name, description, version, file_count, total_size_kb
- package_skill(skill_path, output_dir) — creates zip, returns Path
- publish(input_path, output_dir, skip_validation) — full pipeline, returns Path or None