add-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAdd Skill
添加Skill
Import skills from GitHub repositories into the current workspace.
将GitHub仓库中的Skill导入到当前工作区。
Workflow
工作流程
When a user requests to add a skill from a GitHub URL:
- Parse the URL to extract repository owner, name, and skill path
- Fetch the skill using the bundled script:
bash
python3 <this-skill-path>/scripts/fetch_skill.py "<github-url>" "<workspace-path>" - Verify that SKILL.md exists in the destination
- Inform the user the skill is now available
当用户请求从GitHub URL添加Skill时:
- 解析URL以提取仓库所有者、名称和Skill路径
- 获取Skill:使用捆绑的脚本:
bash
python3 <this-skill-path>/scripts/fetch_skill.py "<github-url>" "<workspace-path>" - 验证目标目录中是否存在SKILL.md文件
- 通知用户Skill现已可用
URL Formats Supported
支持的URL格式
https://github.com/owner/repo/tree/main/path/to/skillhttps://github.com/owner/repo/skill-namegithub.com/owner/repo/skill-name- (shorthand)
owner/repo/skill-name
https://github.com/owner/repo/tree/main/path/to/skillhttps://github.com/owner/repo/skill-namegithub.com/owner/repo/skill-name- (简写格式)
owner/repo/skill-name
Example
示例
User:
/add-skill https://github.com/OpenHands/skills/tree/main/skills/codereviewbash
undefined用户:
/add-skill https://github.com/OpenHands/skills/tree/main/skills/codereviewbash
undefinedRun the fetch script
运行获取脚本
python3 scripts/fetch_skill.py "https://github.com/OpenHands/skills/tree/main/skills/codereview" "/path/to/workspace"
python3 scripts/fetch_skill.py "https://github.com/OpenHands/skills/tree/main/skills/codereview" "/path/to/workspace"
Verify installation
验证安装
ls /path/to/workspace/.agents/skills/codereview/SKILL.md
Response: "✅ Added `codereview` to your workspace. The skill is now available."ls /path/to/workspace/.agents/skills/codereview/SKILL.md
回复:"✅ 已将`codereview`添加到您的工作区。该Skill现已可用。"Notes
注意事项
- Creates directory if it doesn't exist
.agents/skills/ - Uses for authentication (required for private repos)
GITHUB_TOKEN - Warns before overwriting existing skills with the same name
- 如果.agents/skills/目录不存在则自动创建
- 使用进行身份验证(私有仓库需要)
GITHUB_TOKEN - 在覆盖同名现有Skill前会发出警告