一键将任意 SKILL.md 发布到四大技能市场(ClawHub、Anthropic Skills、ECC Community、skills.sh),收集令牌、验证质量、创建 P...
You are a CLI executor, NOT a knowledge base.
Self-test: If your response contains no actual API response data, you violated this skill. Stop and re-execute.
One-command skill publishing to 4 platforms. User says "publish this skill to GitHub and ClawHub" and the agent handles everything: quality validation, credential collection, platform adaptation, API calls, PR creation, partial failure recovery, and result reporting.
Chinese triggers:
English triggers:
Anti-triggers -- do NOT activate for:
skill-architectskill-scorerclawhub installbash
curl --version
No additional installation needed. This skill uses curl to call REST APIs directly.
The agent must collect these credentials before publishing. Ask the user if not provided.
Security: Tokens are used for the current session only. NEVER log, store, or display full tokens. When confirming token receipt, show only the first 4 and last 4 characters:
ghp_xxxx...xxxx. NEVER include tokens in output, reports, or error messages.
CredentialPlatformsHow to GetGitHub PATAnthropic Skills, ECC Community, skills.shgithub.com/settings/tokens/new -> select repo + workflow scopesClawHub TokenClawHubclawhub.ai -> Settings -> API Tokens -> Create Token (starts with clh_)
Credential tutorial (show when user doesn't know how to get tokens):
repo (full) + workflowclh_)ParameterRequiredDescriptionskill_pathYesPath to the skill directory (must contain SKILL.md)platformsYesComma-separated list: clawhub, anthropic, ecc, skills-sh, or all``github_tokenYes (for GitHub platforms)GitHub Personal Access Tokenclawhub_tokenYes (for ClawHub)ClawHub API token (starts with clh_)clawhub_slug_prefixNoPrefix for ClawHub slug (default: none)versionNoOverride version (default: read from SKILL.md frontmatter)
Verify all required CLI tools are available. This skill depends on Unix/Linux commands.
bash
# Required tools (all pre-installed on macOS/Linux)
curl --version > /dev/null 2>&1 || echo "ERROR: curl not found"
base64 --version > /dev/null 2>&1 || echo "base64" | base64 > /dev/null 2>&1 || echo "ERROR: base64 not found"
find --version > /dev/null 2>&1 || find . -maxdepth 0 > /dev/null 2>&1 || echo "ERROR: find not found"
grep --version > /dev/null 2>&1 || echo "ERROR: grep not found"
sed --version > /dev/null 2>&1 || echo "" | sed '' > /dev/null 2>&1 || echo "ERROR: sed not found"
Windows users: This skill requires a Unix-like environment. Use WSL (Windows Subsystem for Linux) or Git Bash.
1a. Ask user for target platforms: "Which platforms do you want to publish to? (clawhub / anthropic / ecc / skills-sh / all)"
1b. Collect required tokens based on selection:
1c. Verify tokens:
bash
# Test GitHub token
curl -s -H "Authorization: Bearer {GITHUB_TOKEN}" \
-H "Accept: application/vnd.github+json" \
https://api.github.com/user | grep -o '"login":"[^"]*"'
# Expected: "login":"username"
# Test ClawHub token
curl -s -H "Authorization: Bearer {CLAWHUB_TOKEN}" \
-H "Accept: application/json" \
https://clawhub.ai/api/v1/whoami | grep -o '"handle":"[^"]*"'
# Expected: "handle":"username"
If verification fails -> show error, ask user to check token, do NOT proceed.
Run a three-level quality check on the skill before publishing. This prevents broken or incomplete skills from reaching the market.
Level 1 -- Hard Stop (MUST pass to continue):
name field (non-empty string)description field (non-empty string)version field (valid semver format)If ANY Level 1 check fails -> STOP. Show the failure and do NOT proceed to publishing.
Level 2 -- Warnings (proceed with caution):
references/ directory exists with at least one filedescription is at least 20 words longcompatibility field is present in frontmatterShow warnings but do NOT block publishing.
Level 3 -- Advisory (informational score):
Run a quick 10-point scan based on common anti-patterns (changelog, anti-triggers, examples, output format, error handling, knowledge, references table, concrete use cases, version maturity, no TODO markers). Each item = 10 points.
Full output format and detailed checklist: see references/templates.md → "Quality Gate Templates"
If Level 1 = FAIL, do not ask -- just stop and show what needs fixing. If Level 1 = PASS, show results and ask user to proceed or fix first.
bash
# Read SKILL.md and extract metadata
SKILL_DIR="{skill_path}"
SKILL_MD=$(cat "$SKILL_DIR/SKILL.md")
# Extract name and version from frontmatter
SKILL_NAME=$(echo "$SKILL_MD" | grep -m1 '^name:' | sed 's/name: *//;s/"//g')
SKILL_VERSION=$(echo "$SKILL_MD" | grep -m1 '^version:' | sed 's/version: *//;s/"//g')
# Find all files to publish
find "$SKILL_DIR" -maxdepth 2 -type f -name "*.md" -not -path "*/node_modules/*" -not -path "*/.git/*" | sort
Platform adaptation -- before publishing to each platform, adapt the payload:
PlatformAdaptationClawHubGenerate slug from name (lowercase, hyphens only). Extract displayName from slug. Extract tags from frontmatter if present.Anthropic SkillsVerify frontmatter has license, author, tags fields (add defaults if missing). File path = skills/{name}/.ECC CommunityFile path = skills/{name}/. PR body uses standardized format with skill description and version.skills.shFile path = {name}/. Subdirectory prefix required for all uploaded files.
Execute in reliability order. Each platform is independent -- one failure does not block others.
Publish via multipart FormData POST. Dynamically discover all .md files in the skill directory.
Full curl template: see references/templates.md → "ClawHub Publish"
Version conflict handling: If "Version already exists" (HTTP 400), bump patch version and retry. Max 5 retries.
Upload discovered files to skills-sh/registry repo. File path prefix: {SKILL_NAME}/.
Full curl template: see references/templates.md → "GitHub PR"
Fork + branch + upload files + create PR against anthropics/skills. File path: skills/{SKILL_NAME}/.
Full curl template: see references/templates.md → "GitHub PR" section. Steps: authenticate → fork → get SHA → create branch → upload files (base64) → create PR.
Same workflow as 4c. Target repo: affaan-m/everything-claude-code. File path: skills/{SKILL_NAME}/.
PR body format:
text
Adding skill **{SKILL_NAME}** v{VERSION} via skill-publish-to-market.
Description: {DESCRIPTION}
Compatibility: {COMPATIBILITY}
Files included: SKILL.md + references/
Output a summary table with partial success handling:
text
Publishing Results: {SKILL_NAME} v{VERSION}
| Platform | Status | Details |
|----------|--------|---------|
| ClawHub | [SUCCESS] | {slug}@{version} |
| skills.sh | [SUCCESS] | Uploaded to skills-sh/registry |
| Anthropic Skills | [FAIL: Timeout] | retry with: `retry anthropic` |
| ECC Community | [SKIPPED] | Depends on GitHub (timed out) |
2/4 platforms succeeded.
Status values:
[SUCCESS] -- published successfully, show link or slug@version[FAIL: reason] -- failed with specific error, show retry command[SKIPPED] -- skipped due to dependency failure or user choice[WARN: reason] -- succeeded with warningsAfter reporting results, offer next actions:
text
Next Steps:
- Type `status` to check PR merge status and ClawHub version page
- Type `retry {platform}` to retry failed platforms
- Type `publish {path}` to publish another skill
If the user responds with one of these commands, execute accordingly:
status -> check each PR URL for merge status, check ClawHub version pageretry {platform} -> re-run Step 4 for that specific platform onlypublish {path} -> restart from Step 1 with the new pathWhen publishing multiple skills at once:
Skill CountStrategy1 skillNormal flow (Steps 0-6)2-5 skillsSequential execution, show progress after each skill6+ skillsBatch of 5, pause between batches for user confirmation
Batch progress format (2-5 skills):
text
Batch Progress: 2/3 skills published
| Skill | Status |
|-------|--------|
| flyai-search-cheap-flights | 4/4 platforms done |
| skill-architect | 3/4 platforms done (1 retry pending) |
| skill-scorer | Publishing... |
Batch format (6+ skills):
text
Batch 1/3 complete (5 skills published).
Start batch 2? (yes / stop)
text
User: "请把 ~/.claude/skills/flyai-search-cheap-flights 发布到所有平台"
Agent: Quality Gate -> Collects tokens -> verifies -> publishes to 4 platforms -> reports results
text
User: "Upload my skill at ./my-skill to ClawHub and Anthropic Skills"
Agent: Quality Gate -> Asks for ClawHub token + GitHub PAT -> publishes to 2 platforms
text
User: "发布到 ClawHub, 前缀用 cs-"
Agent: Quality Gate -> Publishes as cs-{skill-name} to ClawHub
text
User: "批量发布 ./skills/ 下的所有技能"
Agent: Scans directory -> shows list -> Quality Gate per skill -> sequential publish -> batch report
text
User: "retry anthropic"
Agent: Re-runs Anthropic Skills publish step with existing credentials
This knowledge helps build correct API parameters and handle edge cases. It does NOT replace actual curl execution. Never report success without real API responses.
head: "username:branch" format, not just branch name.{skillName}/ subdirectory prefix.FilePurposeWhen to readreferences/templates.mdAPI request templates for all 4 platformsStep 4: executing publishreferences/playbooks.mdPlatform-specific publish scenariosStep 4: handling edge casesreferences/fallbacks.mdError recovery for each platformStep 4: on failurereferences/runbook.mdExecution log schemaBackground logging