add-skill

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Add 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:
  1. Parse the URL to extract repository owner, name, and skill path
  2. Fetch the skill using the bundled script:
    bash
    python3 <this-skill-path>/scripts/fetch_skill.py "<github-url>" "<workspace-path>"
  3. Verify that SKILL.md exists in the destination
  4. Inform the user the skill is now available
当用户请求从GitHub URL添加Skill时:
  1. 解析URL以提取仓库所有者、名称和Skill路径
  2. 获取Skill:使用捆绑的脚本:
    bash
    python3 <this-skill-path>/scripts/fetch_skill.py "<github-url>" "<workspace-path>"
  3. 验证目标目录中是否存在SKILL.md文件
  4. 通知用户Skill现已可用

URL Formats Supported

支持的URL格式

  • https://github.com/owner/repo/tree/main/path/to/skill
  • https://github.com/owner/repo/skill-name
  • github.com/owner/repo/skill-name
  • owner/repo/skill-name
    (shorthand)
  • https://github.com/owner/repo/tree/main/path/to/skill
  • https://github.com/owner/repo/skill-name
  • github.com/owner/repo/skill-name
  • owner/repo/skill-name
    (简写格式)

Example

示例

User:
/add-skill https://github.com/OpenHands/skills/tree/main/skills/codereview
bash
undefined
用户:
/add-skill https://github.com/OpenHands/skills/tree/main/skills/codereview
bash
undefined

Run 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
    .agents/skills/
    directory if it doesn't exist
  • Uses
    GITHUB_TOKEN
    for authentication (required for private repos)
  • Warns before overwriting existing skills with the same name
  • 如果.agents/skills/目录不存在则自动创建
  • 使用
    GITHUB_TOKEN
    进行身份验证(私有仓库需要)
  • 在覆盖同名现有Skill前会发出警告