关于 skill-downloader
用于从 GitHub、压缩包、直接 URL 或本地目录下载并安装 Claude Code 技能的工具。它会验证技能文件及其元数据,并支持自动识别来源类型。
主要功能
- 01支持多种技能来源
- 02自动识别来源类型
- 03验证 SKILL.md 与 YAML 元数据
- 04检测恶意内容模式
适用场景
- 01从 GitHub 安装指定技能
- 02从压缩包导入技能
- 03检查技能包有效性
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ nicepkg/ ai-workflow --skill skill-downloader安装后在 Claude Code 中输入/skill-downloader确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
scripts/download_from_archive.pydownload_from_github.pydownload_skill.py详细介绍
技能下载器
从多个来源下载并安装 Claude Code 技能。
支持的来源
| 来源类型 | 示例 |
|---|---|
| GitHub 仓库 | https://github.com/user/repo、github.com/user/repo |
| 压缩归档文件 | .zip、.tar.gz、.tgz、.skill(重命名后的 zip) |
| 直接 URL | 指向归档文件或技能文件夹的 URL |
用法
从 GitHub 下载
python scripts/download_from_github.py <repo-url> <skill-path> --output <target-dir>
示例:
# Official Anthropic skills
python scripts/download_from_github.py https://github.com/anthropics/skills skills/docx --output ./.claude/skills/
# Community skills (root level)
python scripts/download_from_github.py https://github.com/gked2121/claude-skills social-repurposer --output ./.claude/skills/
# Nested skill path
python scripts/download_from_github.py https://github.com/MadAppGang/claude-code skills/content-brief --output ./.claude/skills/
从归档文件下载
python scripts/download_from_archive.py <url-or-path> --output <target-dir>
示例:
# From URL
python scripts/download_from_archive.py https://example.com/skills/my-skill.zip --output ./.claude/skills/
# From local file
python scripts/download_from_archive.py ./downloads/my-skill.tar.gz --output ./.claude/skills/
# .skill files (renamed zip)
python scripts/download_from_archive.py https://skillhub.club/download/awesome-skill.skill --output ./.claude/skills/
统一下载命令
python scripts/download_skill.py <source> --output <target-dir>
自动检测来源类型:
- GitHub URL → 使用 git 稀疏检出
- 归档文件 URL/路径 → 下载并解压
- 目录路径 → 直接复制
示例:
# Auto-detect GitHub
python scripts/download_skill.py https://github.com/anthropics/skills/tree/main/skills/docx --output ./.claude/skills/
# Auto-detect archive
python scripts/download_skill.py https://example.com/my-skill.zip --output ./.claude/skills/
验证
所有下载方式都会验证:
- 技能文件夹包含
SKILL.md SKILL.md包含有效的 YAML frontmatter,且具有name和description- 未检测到恶意内容模式
输出结构
下载的技能会放置在:
<output-dir>/
└── <skill-name>/
├── SKILL.md # Required
├── scripts/ # Optional
└── ...
错误处理
| 错误 | 原因 | 解决方案 |
|---|---|---|
| 技能已存在 | 目标目录已存在 | 使用 --force 覆盖 |
| 未找到 SKILL.md | 技能包无效 | 确认来源中包含 SKILL.md |
| 归档文件无效 | 文件损坏或格式不受支持 | 检查文件完整性 |
| 网络错误 | 下载失败 | 重试或检查 URL |
与 Workflow Creator 集成
与 workflow-creator 搭配使用时,将技能下载到工作流的 .claude/skills/ 目录:
# Create workflow first
python /path/to/workflow-creator/scripts/create_workflow.py my-workflow --path ./workflows
# Then download skills
python scripts/download_skill.py https://github.com/anthropics/skills/tree/main/skills/docx --output ./workflows/my-workflow/.claude/skills/
技能来源参考
常见的技能仓库:
- Anthropic Official - docx、pdf、pptx
- gked2121/claude-skills - social-repurposer、canvas-design
- ComposioHQ/awesome-claude-skills - 集合
- MadAppGang/claude-code - SEO、内容技能
- daymade/claude-code-skills - twitter-reader、fact-checker
- skillhub.club - 1000 多项技能集合
评论
支持 Markdown